@azure/communication-react 1.13.0-alpha-202402060012 → 1.13.0-alpha-202402070012

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/dist/communication-react.d.ts +69 -10
  2. package/dist/dist-cjs/communication-react/index.js +414 -272
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  6. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +2 -1
  7. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  8. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
  9. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +6 -4
  10. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  11. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.d.ts +7 -7
  12. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +1 -1
  13. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
  14. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +4 -4
  15. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js.map +1 -1
  16. package/dist/dist-esm/react-components/src/theming/icons.js +3 -1
  17. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  18. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +1 -1
  19. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  20. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +5 -0
  21. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  22. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -1
  23. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +2 -2
  24. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  25. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +3 -2
  26. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  27. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.d.ts +3 -0
  28. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +12 -4
  29. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  30. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.d.ts +3 -0
  31. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +15 -3
  32. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  33. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.d.ts +73 -0
  34. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.js +41 -0
  35. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.js.map +1 -0
  36. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +1 -1
  37. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  38. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +1 -0
  39. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  40. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +46 -23
  41. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  42. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/spotlightUtils.d.ts +9 -0
  43. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/spotlightUtils.js +81 -0
  44. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/spotlightUtils.js.map +1 -0
  45. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +2 -1
  46. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +2 -2
  47. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  48. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +3 -2
  49. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  50. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +2 -1
  51. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +1 -1
  52. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  53. package/dist/dist-esm/react-composites/src/composites/common/icons.js +3 -1
  54. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  55. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +14 -0
  56. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MediaGallery.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/components/MediaGallery.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAiB,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACnE,mDAAmD,CAAC,wCAAwC;AAC5F,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,YAAY,EAGZ,SAAS,EAGV,4CAAmC;AAEpC,mDAAmD,CAAC,wCAAwC;AAC5F,OAAO,EAAE,kBAAkB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,QAAQ;QACd,wCAAwC;QACxC,KAAK,CAAC,qBAAqB;QAC3B,mBAAmB;QACnB,cAAc;QACd,0BAA0B;QAC1B,mDAAmD;QACnD,uBAAuB;QACvB,wCAAwC;QACxC,QAAQ;QACR,wCAAwC;QACxC,WAAW;QACX,mDAAmD;QACnD,oBAAoB;QACpB,kDAAkD;QAClD,KAAK,CAAC,oBAAoB;QAC1B,yBAAyB;QACzB,2CAA2C;QAC3C,iBAAiB;QACjB,4CAA4C;QAC5C,eAAe;KAChB,CAAC,CAAC;IAEH,OAAO,CACL,6BAAyD,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,2BAA2B;QAC5G,oBAAC,SAAS,IAAC,kBAAkB,EAAE,eAAe,EAAE,QAAQ,EAAE,QAAQ,GAAI;QACrE,oBAAoB,CACjB,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAkB,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAErF,MAAM,8BAA8B,GAAG;AACrC,gDAAgD,CAAC,gBAAyB,EACtD,EAAE;IACtB,gDAAgD;IAChD,OAAO,gBAAgB,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC;IACtE,OAAO,oBAAoB,CAAC;AAC9B,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { CSSProperties, useCallback, useMemo } from 'react';\n/* @conditional-compile-remove(vertical-gallery) */ /* @conditional-compile-remove(rooms) */\nimport { useRef } from 'react';\nimport {\n VideoGallery,\n VideoStreamOptions,\n CustomAvatarOptions,\n Announcer,\n VideoTileContextualMenuProps,\n VideoTileDrawerMenuProps\n} from '@internal/react-components';\nimport { VideoGalleryLayout } from '@internal/react-components';\n/* @conditional-compile-remove(vertical-gallery) */ /* @conditional-compile-remove(rooms) */\nimport { _useContainerWidth, _useContainerHeight } from '@internal/react-components';\nimport { usePropsFor } from '../hooks/usePropsFor';\nimport { AvatarPersona, AvatarPersonaDataCallback } from '../../common/AvatarPersona';\nimport { mergeStyles, Stack } from '@fluentui/react';\nimport { useHandlers } from '../hooks/useHandlers';\nimport { useSelector } from '../hooks/useSelector';\nimport { localVideoCameraCycleButtonSelector } from '../selectors/LocalVideoTileSelector';\nimport { LocalVideoCameraCycleButton } from '@internal/react-components';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { useParticipantChangedAnnouncement } from '../utils/MediaGalleryUtils';\nimport { RemoteVideoTileMenuOptions } from '../CallComposite';\n/* @conditional-compile-remove(click-to-call) */ /* @conditional-compile-remove(rooms) */ /* @conditional-compile-remove(vertical-gallery) */\nimport { LocalVideoTileOptions } from '../CallComposite';\n/* @conditional-compile-remove(rooms) */\nimport { useAdapter } from '../adapter/CallAdapterProvider';\n\nconst VideoGalleryStyles = {\n root: {\n height: '100%',\n minHeight: '10rem', // space affordance to ensure media gallery is never collapsed\n minWidth: '6rem'\n }\n};\n\nconst localVideoViewOptions = {\n scalingMode: 'Crop',\n isMirrored: true\n} as VideoStreamOptions;\n\nconst remoteVideoViewOptions = {\n scalingMode: 'Crop'\n} as VideoStreamOptions;\n\n/**\n * @private\n */\nexport interface MediaGalleryProps {\n isVideoStreamOn?: boolean;\n isMicrophoneChecked?: boolean;\n onStartLocalVideo: () => Promise<void>;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n isMobile?: boolean;\n drawerMenuHostId?: string;\n remoteVideoTileMenuOptions?: RemoteVideoTileMenuOptions;\n /* @conditional-compile-remove(click-to-call) */ /* @conditional-compile-remove(rooms) */ /* @conditional-compile-remove(vertical-gallery) */\n localVideoTileOptions?: boolean | LocalVideoTileOptions;\n /* @conditional-compile-remove(gallery-layouts) */\n userSetOverflowGalleryPosition?: 'Responsive' | 'horizontalTop';\n /* @conditional-compile-remove(gallery-layouts) */\n userSetGalleryLayout: VideoGalleryLayout;\n}\n\n/**\n * @private\n */\nexport const MediaGallery = (props: MediaGalleryProps): JSX.Element => {\n const videoGalleryProps = usePropsFor(VideoGallery);\n const cameraSwitcherCameras = useSelector(localVideoCameraCycleButtonSelector);\n const cameraSwitcherCallback = useHandlers(LocalVideoCameraCycleButton);\n const announcerString = useParticipantChangedAnnouncement();\n\n /* @conditional-compile-remove(rooms) */\n const adapter = useAdapter();\n /* @conditional-compile-remove(rooms) */\n const userRole = adapter.getState().call?.role;\n /* @conditional-compile-remove(rooms) */\n const isRoomsCall = adapter.getState().isRoomsCall;\n\n /* @conditional-compile-remove(vertical-gallery) */ /* @conditional-compile-remove(rooms) */\n const containerRef = useRef<HTMLDivElement>(null);\n /* @conditional-compile-remove(vertical-gallery) */ /* @conditional-compile-remove(rooms) */\n const containerWidth = _useContainerWidth(containerRef);\n /* @conditional-compile-remove(vertical-gallery) */ /* @conditional-compile-remove(rooms) */\n const containerHeight = _useContainerHeight(containerRef);\n /* @conditional-compile-remove(click-to-call) */ /* @conditional-compile-remove(rooms) */ /* @conditional-compile-remove(vertical-gallery) */\n const containerAspectRatio = containerWidth && containerHeight ? containerWidth / containerHeight : 0;\n /* @conditional-compile-remove(reaction) */\n const reactionResources = adapter.getState().reactions;\n\n const layoutBasedOnTilePosition: VideoGalleryLayout = localVideoTileLayoutTrampoline(\n /* @conditional-compile-remove(click-to-call) */ (props.localVideoTileOptions as LocalVideoTileOptions)?.position\n );\n\n const cameraSwitcherProps = useMemo(() => {\n return {\n ...cameraSwitcherCallback,\n ...cameraSwitcherCameras\n };\n }, [cameraSwitcherCallback, cameraSwitcherCameras]);\n\n const onRenderAvatar = useCallback(\n (userId?: string, options?: CustomAvatarOptions) => {\n return (\n <Stack className={mergeStyles({ position: 'absolute', height: '100%', width: '100%' })}>\n <Stack styles={{ root: { margin: 'auto', maxHeight: '100%' } }}>\n {options?.coinSize && (\n <AvatarPersona userId={userId} {...options} dataProvider={props.onFetchAvatarPersonaData} />\n )}\n </Stack>\n </Stack>\n );\n },\n [props.onFetchAvatarPersonaData]\n );\n\n const remoteVideoTileMenuOptions: false | VideoTileContextualMenuProps | VideoTileDrawerMenuProps = useMemo(() => {\n return props.remoteVideoTileMenuOptions?.isHidden\n ? false\n : props.isMobile\n ? { kind: 'drawer', hostId: props.drawerMenuHostId }\n : { kind: 'contextual' };\n }, [props.remoteVideoTileMenuOptions?.isHidden, props.isMobile, props.drawerMenuHostId]);\n\n /* @conditional-compile-remove(vertical-gallery) */\n const overflowGalleryPosition = useMemo(() => {\n /* @conditional-compile-remove(gallery-layouts) */\n if (props.userSetOverflowGalleryPosition === 'horizontalTop') {\n return props.userSetOverflowGalleryPosition;\n }\n return containerWidth && containerHeight && containerWidth / containerHeight >= 16 / 9\n ? 'verticalRight'\n : 'horizontalBottom';\n }, [\n /* @conditional-compile-remove(gallery-layouts) */ props.userSetOverflowGalleryPosition,\n containerWidth,\n containerHeight\n ]);\n\n /* @conditional-compile-remove(spotlight) */\n const ableToSpotlight = adapter.getState().call?.capabilitiesFeature?.capabilities.spotlightParticipant.isPresent;\n\n const VideoGalleryMemoized = useMemo(() => {\n const layoutBasedOnUserSelection = (): VideoGalleryLayout => {\n /* @conditional-compile-remove(gallery-layouts) */\n return props.localVideoTileOptions ? layoutBasedOnTilePosition : props.userSetGalleryLayout;\n return layoutBasedOnTilePosition;\n };\n\n return (\n <VideoGallery\n {...videoGalleryProps}\n localVideoViewOptions={localVideoViewOptions}\n remoteVideoViewOptions={remoteVideoViewOptions}\n styles={VideoGalleryStyles}\n layout={layoutBasedOnUserSelection()}\n showCameraSwitcherInLocalPreview={props.isMobile}\n localVideoCameraCycleButtonProps={cameraSwitcherProps}\n onRenderAvatar={onRenderAvatar}\n remoteVideoTileMenu={remoteVideoTileMenuOptions}\n /* @conditional-compile-remove(vertical-gallery) */\n overflowGalleryPosition={overflowGalleryPosition}\n /* @conditional-compile-remove(rooms) */\n localVideoTileSize={\n props.localVideoTileOptions === false || userRole === 'Consumer' || (isRoomsCall && userRole === 'Unknown')\n ? 'hidden'\n : props.isMobile && containerAspectRatio < 1\n ? '9:16'\n : '16:9'\n }\n /* @conditional-compile-remove(reaction) */\n reactionResources={reactionResources}\n /* @conditional-compile-remove(spotlight) */\n onStartSpotlight={ableToSpotlight ? videoGalleryProps.onStartSpotlight : undefined}\n /* @conditional-compile-remove(spotlight) */\n onStopSpotlight={ableToSpotlight ? videoGalleryProps.onStopSpotlight : undefined}\n />\n );\n }, [\n videoGalleryProps,\n props.isMobile,\n /* @conditional-compile-remove(rooms) */\n props.localVideoTileOptions,\n cameraSwitcherProps,\n onRenderAvatar,\n remoteVideoTileMenuOptions,\n /* @conditional-compile-remove(vertical-gallery) */\n overflowGalleryPosition,\n /* @conditional-compile-remove(rooms) */\n userRole,\n /* @conditional-compile-remove(rooms) */\n isRoomsCall,\n /* @conditional-compile-remove(vertical-gallery) */\n containerAspectRatio,\n /* @conditional-compile-remove(gallery-layouts) */\n props.userSetGalleryLayout,\n layoutBasedOnTilePosition,\n /* @conditional-compile-remove(reaction) */\n reactionResources,\n /* @conditional-compile-remove(spotlight) */\n ableToSpotlight\n ]);\n\n return (\n <div /* @conditional-compile-remove(vertical-gallery) */ ref={containerRef} style={mediaGalleryContainerStyles}>\n <Announcer announcementString={announcerString} ariaLive={'polite'} />\n {VideoGalleryMemoized}\n </div>\n );\n};\n\nconst mediaGalleryContainerStyles: CSSProperties = { width: '100%', height: '100%' };\n\nconst localVideoTileLayoutTrampoline = (\n /* @conditional-compile-remove(click-to-call) */ localTileOptions?: string\n): VideoGalleryLayout => {\n /* @conditional-compile-remove(click-to-call) */\n return localTileOptions === 'grid' ? 'default' : 'floatingLocalVideo';\n return 'floatingLocalVideo';\n};\n"]}
1
+ {"version":3,"file":"MediaGallery.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/components/MediaGallery.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAiB,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACnE,mDAAmD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,CAAC,gBAAyB,EACtD,EAAE;IACtB,gDAAgD;IAChD,OAAO,gBAAgB,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,oBAAoB,CAAC;IACtE,OAAO,oBAAoB,CAAC;AAC9B,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { CSSProperties, useCallback, useMemo } from 'react';\n/* @conditional-compile-remove(vertical-gallery) */ /* @conditional-compile-remove(rooms) */\nimport { useRef } from 'react';\nimport {\n VideoGallery,\n VideoStreamOptions,\n CustomAvatarOptions,\n Announcer,\n VideoTileContextualMenuProps,\n VideoTileDrawerMenuProps\n} from '@internal/react-components';\nimport { VideoGalleryLayout } from '@internal/react-components';\n/* @conditional-compile-remove(vertical-gallery) */ /* @conditional-compile-remove(rooms) */\nimport { _useContainerWidth, _useContainerHeight } from '@internal/react-components';\nimport { usePropsFor } from '../hooks/usePropsFor';\nimport { AvatarPersona, AvatarPersonaDataCallback } from '../../common/AvatarPersona';\nimport { mergeStyles, Stack } from '@fluentui/react';\nimport { useHandlers } from '../hooks/useHandlers';\nimport { useSelector } from '../hooks/useSelector';\nimport { localVideoCameraCycleButtonSelector } from '../selectors/LocalVideoTileSelector';\nimport { LocalVideoCameraCycleButton } from '@internal/react-components';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { useParticipantChangedAnnouncement } from '../utils/MediaGalleryUtils';\nimport { RemoteVideoTileMenuOptions } from '../CallComposite';\n/* @conditional-compile-remove(click-to-call) */ /* @conditional-compile-remove(rooms) */ /* @conditional-compile-remove(vertical-gallery) */\nimport { LocalVideoTileOptions } from '../CallComposite';\n/* @conditional-compile-remove(rooms) */\nimport { useAdapter } from '../adapter/CallAdapterProvider';\n/* @conditional-compile-remove(spotlight) */\nimport { PromptProps } from './Prompt';\n/* @conditional-compile-remove(spotlight) */\nimport { useSpotlightCallbacksWithPrompt } from '../utils/spotlightUtils';\n\nconst VideoGalleryStyles = {\n root: {\n height: '100%',\n minHeight: '10rem', // space affordance to ensure media gallery is never collapsed\n minWidth: '6rem'\n }\n};\n\nconst localVideoViewOptions = {\n scalingMode: 'Crop',\n isMirrored: true\n} as VideoStreamOptions;\n\nconst remoteVideoViewOptions = {\n scalingMode: 'Crop'\n} as VideoStreamOptions;\n\n/**\n * @private\n */\nexport interface MediaGalleryProps {\n isVideoStreamOn?: boolean;\n isMicrophoneChecked?: boolean;\n onStartLocalVideo: () => Promise<void>;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n isMobile?: boolean;\n drawerMenuHostId?: string;\n remoteVideoTileMenuOptions?: RemoteVideoTileMenuOptions;\n /* @conditional-compile-remove(click-to-call) */ /* @conditional-compile-remove(rooms) */ /* @conditional-compile-remove(vertical-gallery) */\n localVideoTileOptions?: boolean | LocalVideoTileOptions;\n /* @conditional-compile-remove(gallery-layouts) */\n userSetOverflowGalleryPosition?: 'Responsive' | 'horizontalTop';\n /* @conditional-compile-remove(gallery-layouts) */\n userSetGalleryLayout: VideoGalleryLayout;\n /* @conditional-compile-remove(spotlight) */\n setIsPromptOpen: (isOpen: boolean) => void;\n /* @conditional-compile-remove(spotlight) */\n setPromptProps: (props: PromptProps) => void;\n}\n\n/**\n * @private\n */\nexport const MediaGallery = (props: MediaGalleryProps): JSX.Element => {\n /* @conditional-compile-remove(spotlight) */\n const { setIsPromptOpen, setPromptProps } = props;\n\n const videoGalleryProps = usePropsFor(VideoGallery);\n const cameraSwitcherCameras = useSelector(localVideoCameraCycleButtonSelector);\n const cameraSwitcherCallback = useHandlers(LocalVideoCameraCycleButton);\n const announcerString = useParticipantChangedAnnouncement();\n\n /* @conditional-compile-remove(rooms) */\n const adapter = useAdapter();\n /* @conditional-compile-remove(rooms) */\n const userRole = adapter.getState().call?.role;\n /* @conditional-compile-remove(rooms) */\n const isRoomsCall = adapter.getState().isRoomsCall;\n\n /* @conditional-compile-remove(vertical-gallery) */ /* @conditional-compile-remove(rooms) */\n const containerRef = useRef<HTMLDivElement>(null);\n /* @conditional-compile-remove(vertical-gallery) */ /* @conditional-compile-remove(rooms) */\n const containerWidth = _useContainerWidth(containerRef);\n /* @conditional-compile-remove(vertical-gallery) */ /* @conditional-compile-remove(rooms) */\n const containerHeight = _useContainerHeight(containerRef);\n /* @conditional-compile-remove(click-to-call) */ /* @conditional-compile-remove(rooms) */ /* @conditional-compile-remove(vertical-gallery) */\n const containerAspectRatio = containerWidth && containerHeight ? containerWidth / containerHeight : 0;\n /* @conditional-compile-remove(reaction) */\n const reactionResources = adapter.getState().reactions;\n\n const layoutBasedOnTilePosition: VideoGalleryLayout = localVideoTileLayoutTrampoline(\n /* @conditional-compile-remove(click-to-call) */ (props.localVideoTileOptions as LocalVideoTileOptions)?.position\n );\n\n const cameraSwitcherProps = useMemo(() => {\n return {\n ...cameraSwitcherCallback,\n ...cameraSwitcherCameras\n };\n }, [cameraSwitcherCallback, cameraSwitcherCameras]);\n\n const onRenderAvatar = useCallback(\n (userId?: string, options?: CustomAvatarOptions) => {\n return (\n <Stack className={mergeStyles({ position: 'absolute', height: '100%', width: '100%' })}>\n <Stack styles={{ root: { margin: 'auto', maxHeight: '100%' } }}>\n {options?.coinSize && (\n <AvatarPersona userId={userId} {...options} dataProvider={props.onFetchAvatarPersonaData} />\n )}\n </Stack>\n </Stack>\n );\n },\n [props.onFetchAvatarPersonaData]\n );\n\n const remoteVideoTileMenuOptions: false | VideoTileContextualMenuProps | VideoTileDrawerMenuProps = useMemo(() => {\n return props.remoteVideoTileMenuOptions?.isHidden\n ? false\n : props.isMobile\n ? { kind: 'drawer', hostId: props.drawerMenuHostId }\n : { kind: 'contextual' };\n }, [props.remoteVideoTileMenuOptions?.isHidden, props.isMobile, props.drawerMenuHostId]);\n\n /* @conditional-compile-remove(vertical-gallery) */\n const overflowGalleryPosition = useMemo(() => {\n /* @conditional-compile-remove(gallery-layouts) */\n if (props.userSetOverflowGalleryPosition === 'horizontalTop') {\n return props.userSetOverflowGalleryPosition;\n }\n return containerWidth && containerHeight && containerWidth / containerHeight >= 16 / 9\n ? 'verticalRight'\n : 'horizontalBottom';\n }, [\n /* @conditional-compile-remove(gallery-layouts) */ props.userSetOverflowGalleryPosition,\n containerWidth,\n containerHeight\n ]);\n\n /* @conditional-compile-remove(spotlight) */\n const { onStartSpotlight, onStopSpotlight } = videoGalleryProps;\n\n /* @conditional-compile-remove(spotlight) */\n const { onStartSpotlightWithPrompt, onStopSpotlightWithPrompt } = useSpotlightCallbacksWithPrompt(\n onStartSpotlight,\n onStopSpotlight,\n setIsPromptOpen,\n setPromptProps\n );\n\n /* @conditional-compile-remove(spotlight) */\n const ableToSpotlight = adapter.getState().call?.capabilitiesFeature?.capabilities.spotlightParticipant.isPresent;\n\n const VideoGalleryMemoized = useMemo(() => {\n const layoutBasedOnUserSelection = (): VideoGalleryLayout => {\n /* @conditional-compile-remove(gallery-layouts) */\n return props.localVideoTileOptions ? layoutBasedOnTilePosition : props.userSetGalleryLayout;\n return layoutBasedOnTilePosition;\n };\n\n return (\n <VideoGallery\n {...videoGalleryProps}\n localVideoViewOptions={localVideoViewOptions}\n remoteVideoViewOptions={remoteVideoViewOptions}\n styles={VideoGalleryStyles}\n layout={layoutBasedOnUserSelection()}\n showCameraSwitcherInLocalPreview={props.isMobile}\n localVideoCameraCycleButtonProps={cameraSwitcherProps}\n onRenderAvatar={onRenderAvatar}\n remoteVideoTileMenu={remoteVideoTileMenuOptions}\n /* @conditional-compile-remove(vertical-gallery) */\n overflowGalleryPosition={overflowGalleryPosition}\n /* @conditional-compile-remove(rooms) */\n localVideoTileSize={\n props.localVideoTileOptions === false || userRole === 'Consumer' || (isRoomsCall && userRole === 'Unknown')\n ? 'hidden'\n : props.isMobile && containerAspectRatio < 1\n ? '9:16'\n : '16:9'\n }\n /* @conditional-compile-remove(reaction) */\n reactionResources={reactionResources}\n /* @conditional-compile-remove(spotlight) */\n onStartSpotlight={ableToSpotlight ? onStartSpotlightWithPrompt : undefined}\n /* @conditional-compile-remove(spotlight) */\n onStopSpotlight={ableToSpotlight ? onStopSpotlightWithPrompt : undefined}\n />\n );\n }, [\n videoGalleryProps,\n props.isMobile,\n /* @conditional-compile-remove(rooms) */\n props.localVideoTileOptions,\n cameraSwitcherProps,\n onRenderAvatar,\n remoteVideoTileMenuOptions,\n /* @conditional-compile-remove(vertical-gallery) */\n overflowGalleryPosition,\n /* @conditional-compile-remove(rooms) */\n userRole,\n /* @conditional-compile-remove(rooms) */\n isRoomsCall,\n /* @conditional-compile-remove(vertical-gallery) */\n containerAspectRatio,\n /* @conditional-compile-remove(gallery-layouts) */\n props.userSetGalleryLayout,\n layoutBasedOnTilePosition,\n /* @conditional-compile-remove(reaction) */\n reactionResources,\n /* @conditional-compile-remove(spotlight) */\n ableToSpotlight,\n /* @conditional-compile-remove(spotlight) */\n onStartSpotlightWithPrompt,\n /* @conditional-compile-remove(spotlight) */\n onStopSpotlightWithPrompt\n ]);\n\n return (\n <div /* @conditional-compile-remove(vertical-gallery) */ ref={containerRef} style={mediaGalleryContainerStyles}>\n <Announcer announcementString={announcerString} ariaLive={'polite'} />\n {VideoGalleryMemoized}\n </div>\n );\n};\n\nconst mediaGalleryContainerStyles: CSSProperties = { width: '100%', height: '100%' };\n\nconst localVideoTileLayoutTrampoline = (\n /* @conditional-compile-remove(click-to-call) */ localTileOptions?: string\n): VideoGalleryLayout => {\n /* @conditional-compile-remove(click-to-call) */\n return localTileOptions === 'grid' ? 'default' : 'floatingLocalVideo';\n return 'floatingLocalVideo';\n};\n"]}
@@ -0,0 +1,73 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * @private
4
+ */
5
+ export interface PromptProps {
6
+ isOpen?: boolean;
7
+ onDismiss?: () => void;
8
+ heading?: string;
9
+ text?: string;
10
+ confirmButtonLabel?: string;
11
+ cancelButtonLabel?: string;
12
+ onConfirm?: () => void;
13
+ onCancel?: () => void;
14
+ }
15
+ /**
16
+ * @private
17
+ */
18
+ export declare const Prompt: (props: PromptProps) => JSX.Element;
19
+ /**
20
+ * Strings used in prompt related to spotlight
21
+ * @beta
22
+ */
23
+ export interface SpotlightPromptStrings {
24
+ /**
25
+ * Heading for prompt when starting spotlight on participant
26
+ */
27
+ startSpotlightHeading: string;
28
+ /**
29
+ * Text for prompt when starting spotlight on participant
30
+ */
31
+ startSpotlightText: string;
32
+ /**
33
+ * Label for button to confirm starting spotlight on local user in prompt
34
+ */
35
+ startSpotlightOnSelfText: string;
36
+ /**
37
+ * Label for button to confirm starting spotlight on participant in prompt
38
+ */
39
+ startSpotlightConfirmButtonLabel: string;
40
+ /**
41
+ * Label for button to cancel starting spotlight on participant in prompt
42
+ */
43
+ startSpotlightCancelButtonLabel: string;
44
+ /**
45
+ * Heading for prompt when stopping spotlight on participant
46
+ */
47
+ stopSpotlightHeading: string;
48
+ /**
49
+ * Heading for prompt when stopping spotlight on local user
50
+ */
51
+ stopSpotlightOnSelfHeading: string;
52
+ /**
53
+ * Text for prompt when stopping spotlight on participant
54
+ */
55
+ stopSpotlightText: string;
56
+ /**
57
+ * Text for prompt when stopping spotlight on local user
58
+ */
59
+ stopSpotlightOnSelfText: string;
60
+ /**
61
+ * Label for button to confirm stopping spotlight on participant in prompt
62
+ */
63
+ stopSpotlightConfirmButtonLabel: string;
64
+ /**
65
+ * Label for button to confirm stopping spotlight on local user in prompt
66
+ */
67
+ stopSpotlightOnSelfConfirmButtonLabel: string;
68
+ /**
69
+ * Label for button to cancel stopping spotlight on participant in prompt
70
+ */
71
+ stopSpotlightCancelButtonLabel: string;
72
+ }
73
+ //# sourceMappingURL=Prompt.d.ts.map
@@ -0,0 +1,41 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ /* @conditional-compile-remove(spotlight) */
4
+ import { DefaultButton, IconButton, Modal, PrimaryButton, Stack, Text, mergeStyles } from '@fluentui/react';
5
+ /* @conditional-compile-remove(spotlight) */
6
+ import { useTheme } from "../../../../../react-components/src";
7
+ /* @conditional-compile-remove(spotlight) */
8
+ import React from 'react';
9
+ /* @conditional-compile-remove(spotlight) */
10
+ /**
11
+ * @private
12
+ */
13
+ export const Prompt = (props) => {
14
+ const theme = useTheme();
15
+ return (React.createElement(Modal, { styles: modalStyles, isOpen: props.isOpen, onDismiss: props.onDismiss, isBlocking: false },
16
+ React.createElement(Stack, { className: mergeStyles({ position: 'relative' }) },
17
+ React.createElement(Text, { className: mergeStyles({ fontWeight: 600, fontSize: '1.25rem' }) }, props.heading),
18
+ React.createElement(IconButton, { styles: iconButtonStyles(theme), iconProps: { iconName: 'Cancel' }, onClick: props.onCancel })),
19
+ React.createElement(Stack, { verticalAlign: "center", className: mergeStyles({ minHeight: '6rem' }) },
20
+ React.createElement(Text, { className: mergeStyles({ fontSize: '0.875rem' }) }, props.text)),
21
+ React.createElement(Stack, { horizontal: true, reversed: true, tokens: { childrenGap: '0.5rem' } },
22
+ React.createElement(DefaultButton, { styles: buttonTextStyles, text: props.cancelButtonLabel, onClick: props.onCancel }),
23
+ React.createElement(PrimaryButton, { styles: buttonTextStyles, text: props.confirmButtonLabel, onClick: props.onConfirm }))));
24
+ };
25
+ /* @conditional-compile-remove(spotlight) */
26
+ const iconButtonStyles = (theme) => ({
27
+ root: {
28
+ position: 'absolute',
29
+ top: 0,
30
+ right: 0,
31
+ color: theme.palette.neutralPrimary
32
+ },
33
+ rootHovered: {
34
+ color: theme.palette.neutralDark
35
+ }
36
+ });
37
+ /* @conditional-compile-remove(spotlight) */
38
+ const modalStyles = { main: { padding: '1.5rem ', maxWidth: '30rem' } };
39
+ /* @conditional-compile-remove(spotlight) */
40
+ const buttonTextStyles = { label: { fontSize: '0.875rem' } };
41
+ //# sourceMappingURL=Prompt.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Prompt.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/components/Prompt.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,4CAA4C;AAC5C,OAAO,EACL,aAAa,EAEb,UAAU,EACV,K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AAgB,EAAE,IAAI,EAAE,KAAK,CAAC,iBAAiB,EAAE,OAAO,EAAE,KAAK,CAAC,QAAQ,GAAI;YACnG,oBAAC,aAAa,IAAC,MAAM,EAAE,gBAAgB,EAAE,IAAI,EAAE,KAAK,CAAC,kBAAkB,EAAE,OAAO,EAAE,KAAK,CAAC,SAAS,GAAI,CAC/F,CACF,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,4CAA4C;AAC5C,MAAM,gBAAgB,GAAG,CAAC,KAAY,EAAiB,EAAE,CAAC,CAAC;IACzD,IAAI,EAAE;QACJ,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,KAAK,EAAE,CAAC;QACR,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,cAAc;KACpC;IACD,WAAW,EAAE;QACX,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,WAAW;KACjC;CACF,CAAC,CAAC;AAEH,4CAA4C;AAC5C,MAAM,WAAW,GAAG,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,CAAC;AAExE,4CAA4C;AAC5C,MAAM,gBAAgB,GAAkB,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(spotlight) */\nimport {\n DefaultButton,\n IButtonStyles,\n IconButton,\n Modal,\n PrimaryButton,\n Stack,\n Text,\n Theme,\n mergeStyles\n} from '@fluentui/react';\n/* @conditional-compile-remove(spotlight) */\nimport { useTheme } from '@internal/react-components';\n/* @conditional-compile-remove(spotlight) */\nimport React from 'react';\n\n/* @conditional-compile-remove(spotlight) */\n/**\n * @private\n */\nexport interface PromptProps {\n isOpen?: boolean;\n onDismiss?: () => void;\n heading?: string;\n text?: string;\n confirmButtonLabel?: string;\n cancelButtonLabel?: string;\n onConfirm?: () => void;\n onCancel?: () => void;\n}\n\n/* @conditional-compile-remove(spotlight) */\n/**\n * @private\n */\nexport const Prompt = (props: PromptProps): JSX.Element => {\n const theme = useTheme();\n\n return (\n <Modal styles={modalStyles} isOpen={props.isOpen} onDismiss={props.onDismiss} isBlocking={false}>\n <Stack className={mergeStyles({ position: 'relative' })}>\n <Text className={mergeStyles({ fontWeight: 600, fontSize: '1.25rem' })}>{props.heading}</Text>\n <IconButton styles={iconButtonStyles(theme)} iconProps={{ iconName: 'Cancel' }} onClick={props.onCancel} />\n </Stack>\n <Stack verticalAlign=\"center\" className={mergeStyles({ minHeight: '6rem' })}>\n <Text className={mergeStyles({ fontSize: '0.875rem' })}>{props.text}</Text>\n </Stack>\n <Stack horizontal reversed tokens={{ childrenGap: '0.5rem' }}>\n <DefaultButton styles={buttonTextStyles} text={props.cancelButtonLabel} onClick={props.onCancel} />\n <PrimaryButton styles={buttonTextStyles} text={props.confirmButtonLabel} onClick={props.onConfirm} />\n </Stack>\n </Modal>\n );\n};\n\n/* @conditional-compile-remove(spotlight) */\nconst iconButtonStyles = (theme: Theme): IButtonStyles => ({\n root: {\n position: 'absolute',\n top: 0,\n right: 0,\n color: theme.palette.neutralPrimary\n },\n rootHovered: {\n color: theme.palette.neutralDark\n }\n});\n\n/* @conditional-compile-remove(spotlight) */\nconst modalStyles = { main: { padding: '1.5rem ', maxWidth: '30rem' } };\n\n/* @conditional-compile-remove(spotlight) */\nconst buttonTextStyles: IButtonStyles = { label: { fontSize: '0.875rem' } };\n\n/* @conditional-compile-remove(spotlight) */\n/**\n * Strings used in prompt related to spotlight\n * @beta\n */\nexport interface SpotlightPromptStrings {\n /**\n * Heading for prompt when starting spotlight on participant\n */\n startSpotlightHeading: string;\n /**\n * Text for prompt when starting spotlight on participant\n */\n startSpotlightText: string;\n /**\n * Label for button to confirm starting spotlight on local user in prompt\n */\n startSpotlightOnSelfText: string;\n /**\n * Label for button to confirm starting spotlight on participant in prompt\n */\n startSpotlightConfirmButtonLabel: string;\n /**\n * Label for button to cancel starting spotlight on participant in prompt\n */\n startSpotlightCancelButtonLabel: string;\n /**\n * Heading for prompt when stopping spotlight on participant\n */\n stopSpotlightHeading: string;\n /**\n * Heading for prompt when stopping spotlight on local user\n */\n stopSpotlightOnSelfHeading: string;\n /**\n * Text for prompt when stopping spotlight on participant\n */\n stopSpotlightText: string;\n /**\n * Text for prompt when stopping spotlight on local user\n */\n stopSpotlightOnSelfText: string;\n /**\n * Label for button to confirm stopping spotlight on participant in prompt\n */\n stopSpotlightConfirmButtonLabel: string;\n /**\n * Label for button to confirm stopping spotlight on local user in prompt\n */\n stopSpotlightOnSelfConfirmButtonLabel: string;\n /**\n * Label for button to cancel stopping spotlight on participant in prompt\n */\n stopSpotlightCancelButtonLabel: string;\n}\n"]}
@@ -41,7 +41,7 @@ const createCompositeHandlers = memoizeOne((adapter) => ({
41
41
  onAddParticipant: (participant, options) => __awaiter(void 0, void 0, void 0, function* () {
42
42
  return yield adapter.addParticipant(participant, options);
43
43
  }),
44
- /* @conditional-compile-remove(PSTN-calls) */
44
+ /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(dtmf-dialer) */
45
45
  onSendDtmfTone: (dtmfTone) => __awaiter(void 0, void 0, void 0, function* () {
46
46
  yield adapter.sendDtmfTone(dtmfTone);
47
47
  }),
@@ -1 +1 @@
1
- {"version":3,"file":"useHandlers.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/hooks/useHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAGlC,OAAO,EAAoB,6BAA6B,EAAE,yCAAgC;AAE1F,OAAO,UAAU,MAAM,aAAa,CAAC;AAIrC,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAUtC;;GAEG;AACH,+HAA+H;AAC/H,MAAM,CAAC,MAAM,WAAW,GAAG;AACzB,6DAA6D;AAC7D,UAAkD,E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,OAAO,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAC5C,CAAC,CAAA;IACD,iDAAiD;IACjD,oBAAoB,EAAE,CAAO,QAAQ,EAAE,EAAE;QACvC,MAAM,OAAO,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IAC7C,CAAC,CAAA;IACD,qDAAqD;IACrD,cAAc,EAAE,CAAO,MAAkB,EAA2C,EAAE;QACpF,OAAO,MAAM,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC,CAAA;IACD,4CAA4C;IAC5C,gBAAgB,EAAE,CAAO,MAAc,EAAiB,EAAE;QACxD,MAAM,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC,CAAA;IACD,4CAA4C;IAC5C,eAAe,EAAE,CAAO,MAAc,EAAiB,EAAE;QACvD,MAAM,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC,CAAA;CACF,CAAC,CACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CommonCallingHandlers } from '@internal/calling-component-bindings';\nimport { CommonProperties, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ReactElement } from 'react';\nimport memoizeOne from 'memoize-one';\nimport { CommonCallAdapter } from '..';\n/* @conditional-compile-remove(video-background-effects) */\nimport { VideoBackgroundBlurEffect, VideoBackgroundReplacementEffect } from '..';\nimport { useAdapter } from '../adapter/CallAdapterProvider';\nimport { isCameraOn } from '../utils';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { DtmfTone } from '@azure/communication-calling';\n/* @conditional-compile-remove(reaction) */\nimport { Reaction } from '@azure/communication-calling';\n/* @conditional-compile-remove(video-background-effects) */\nimport type { BackgroundReplacementConfig, BackgroundBlurConfig } from '@azure/communication-calling';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { CallSurvey, CallSurveyResponse } from '@azure/communication-calling';\n\n/**\n * @private\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport const useHandlers = <PropsT>(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _component: (props: PropsT) => ReactElement | null\n): Pick<CommonCallingHandlers, CommonProperties<CommonCallingHandlers, PropsT>> => {\n return createCompositeHandlers(useAdapter());\n};\n\nconst createCompositeHandlers = memoizeOne(\n (adapter: CommonCallAdapter): CommonCallingHandlers => ({\n onCreateLocalStreamView: async (options) => {\n return await adapter.createStreamView(undefined, options);\n },\n onCreateRemoteStreamView: async (userId, options) => {\n return await adapter.createStreamView(userId, options);\n },\n onHangUp: async (forEveryone?: boolean) => {\n await adapter.leaveCall(forEveryone);\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onToggleHold: async () => {\n return adapter.getState().call?.state === 'LocalHold' ? await adapter.resumeCall() : await adapter.holdCall();\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant: async (participant, options?) => {\n return await adapter.addParticipant(participant, options);\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onSendDtmfTone: async (dtmfTone: DtmfTone) => {\n await adapter.sendDtmfTone(dtmfTone);\n },\n onRemoveParticipant: async (userId) => {\n await adapter.removeParticipant(userId);\n },\n /* @conditional-compile-remove(raise-hand) */\n onRaiseHand: async () => {\n await adapter.raiseHand();\n },\n /* @conditional-compile-remove(raise-hand) */\n onLowerHand: async () => {\n await adapter.lowerHand();\n },\n /* @conditional-compile-remove(raise-hand) */\n onToggleRaiseHand: async () => {\n adapter.getState().call?.raiseHand.localParticipantRaisedHand\n ? await adapter.lowerHand()\n : await adapter.raiseHand();\n },\n /* @conditional-compile-remove(reaction) */\n onReactionClicked: async (reaction: Reaction) => {\n await adapter.onReactionClicked(reaction);\n },\n onSelectCamera: async (deviceInfo, options) => {\n await adapter.setCamera(deviceInfo, options);\n },\n onSelectMicrophone: async (deviceInfo) => {\n await adapter.setMicrophone(deviceInfo);\n },\n onSelectSpeaker: async (deviceInfo) => {\n await adapter.setSpeaker(deviceInfo);\n },\n onStartCall: (participants, options?) => {\n const rawIds = participants.map((participant) => toFlatCommunicationIdentifier(participant));\n return adapter.startCall(rawIds, options);\n },\n onStartScreenShare: async () => {\n await adapter.startScreenShare();\n },\n onStopScreenShare: async () => {\n await adapter.stopScreenShare();\n },\n onToggleCamera: async (options) => {\n isCameraOn(adapter.getState()) ? await adapter.stopCamera() : await adapter.startCamera(options);\n },\n onToggleMicrophone: async () => {\n return adapter.getState().call?.isMuted ? await adapter.unmute() : await adapter.mute();\n },\n onToggleScreenShare: async () => {\n return adapter.getState().call?.isScreenSharingOn\n ? await adapter.stopScreenShare()\n : await adapter.startScreenShare();\n },\n onStartLocalVideo: async () => {\n if (adapter.getState().call) {\n return adapter.startCamera();\n }\n },\n onDisposeLocalStreamView: async () => {\n return adapter.disposeLocalVideoStreamView();\n },\n onDisposeRemoteStreamView: async (userId) => {\n return adapter.disposeStreamView(userId);\n },\n onDisposeRemoteScreenShareStreamView: async (userId) => {\n return adapter.disposeScreenShareStreamView(userId);\n },\n onDisposeRemoteVideoStreamView: async (userId) => {\n return adapter.disposeRemoteVideoStreamView(userId);\n },\n /* @conditional-compile-remove(call-readiness) */\n askDevicePermission: async (constrain) => {\n return adapter.askDevicePermission(constrain);\n },\n /* @conditional-compile-remove(video-background-effects) */\n onRemoveVideoBackgroundEffects: async () => {\n return await adapter.stopVideoBackgroundEffects();\n },\n /* @conditional-compile-remove(video-background-effects) */\n onBlurVideoBackground: async (backgroundBlurConfig?: BackgroundBlurConfig) => {\n const blurConfig: VideoBackgroundBlurEffect = {\n effectName: 'blur',\n ...backgroundBlurConfig\n };\n return await adapter.startVideoBackgroundEffect(blurConfig);\n },\n /* @conditional-compile-remove(video-background-effects) */\n onReplaceVideoBackground: async (backgroundReplacementConfig: BackgroundReplacementConfig) => {\n const replacementConfig: VideoBackgroundReplacementEffect = {\n effectName: 'replacement',\n ...backgroundReplacementConfig\n };\n return await adapter.startVideoBackgroundEffect(replacementConfig);\n },\n /* @conditional-compile-remove(close-captions) */\n onStartCaptions: async (options) => {\n await adapter.startCaptions(options);\n },\n /* @conditional-compile-remove(close-captions) */\n onStopCaptions: async () => {\n await adapter.stopCaptions();\n },\n /* @conditional-compile-remove(close-captions) */\n onSetSpokenLanguage: async (language) => {\n await adapter.setSpokenLanguage(language);\n },\n /* @conditional-compile-remove(close-captions) */\n onSetCaptionLanguage: async (language) => {\n await adapter.setCaptionLanguage(language);\n },\n /* @conditional-compile-remove(end-of-call-survey) */\n onSubmitSurvey: async (survey: CallSurvey): Promise<CallSurveyResponse | undefined> => {\n return await adapter.submitSurvey(survey);\n },\n /* @conditional-compile-remove(spotlight) */\n onStartSpotlight: async (userId: string): Promise<void> => {\n await adapter.startSpotlight(userId);\n },\n /* @conditional-compile-remove(spotlight) */\n onStopSpotlight: async (userId: string): Promise<void> => {\n await adapter.stopSpotlight(userId);\n }\n })\n);\n"]}
1
+ {"version":3,"file":"useHandlers.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/hooks/useHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAGlC,OAAO,EAAoB,6BAA6B,EAAE,yCAAgC;AAE1F,OAAO,UAAU,MAAM,aAAa,CAAC;AAIrC,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAUtC;;GAEG;AACH,+HAA+H;AAC/H,MAAM,CAAC,MAAM,WAAW,GAAG;AACzB,6DAA6D;AAC7D,UAAkD,EAC4B,EAAE;IAChF,OAAO,uBAAuB,CAAC,UAAU,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG,UAAU,CACxC,CAAC,OAA0B,EAAyB,EAAE,CAAC,CAAC;IACtD,uBAAuB,EAAE,CAAO,OAAO,EAAE,EAAE;QACzC,OAAO,MAAM,OAAO,CAAC,g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,cAAc,EAAE,CAAO,MAAkB,EAA2C,EAAE;QACpF,OAAO,MAAM,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAC5C,CAAC,CAAA;IACD,4CAA4C;IAC5C,gBAAgB,EAAE,CAAO,MAAc,EAAiB,EAAE;QACxD,MAAM,OAAO,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC,CAAA;IACD,4CAA4C;IAC5C,eAAe,EAAE,CAAO,MAAc,EAAiB,EAAE;QACvD,MAAM,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC,CAAA;CACF,CAAC,CACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CommonCallingHandlers } from '@internal/calling-component-bindings';\nimport { CommonProperties, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ReactElement } from 'react';\nimport memoizeOne from 'memoize-one';\nimport { CommonCallAdapter } from '..';\n/* @conditional-compile-remove(video-background-effects) */\nimport { VideoBackgroundBlurEffect, VideoBackgroundReplacementEffect } from '..';\nimport { useAdapter } from '../adapter/CallAdapterProvider';\nimport { isCameraOn } from '../utils';\n/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(dtmf-dialer) */\nimport { DtmfTone } from '@azure/communication-calling';\n/* @conditional-compile-remove(reaction) */\nimport { Reaction } from '@azure/communication-calling';\n/* @conditional-compile-remove(video-background-effects) */\nimport type { BackgroundReplacementConfig, BackgroundBlurConfig } from '@azure/communication-calling';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { CallSurvey, CallSurveyResponse } from '@azure/communication-calling';\n\n/**\n * @private\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport const useHandlers = <PropsT>(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _component: (props: PropsT) => ReactElement | null\n): Pick<CommonCallingHandlers, CommonProperties<CommonCallingHandlers, PropsT>> => {\n return createCompositeHandlers(useAdapter());\n};\n\nconst createCompositeHandlers = memoizeOne(\n (adapter: CommonCallAdapter): CommonCallingHandlers => ({\n onCreateLocalStreamView: async (options) => {\n return await adapter.createStreamView(undefined, options);\n },\n onCreateRemoteStreamView: async (userId, options) => {\n return await adapter.createStreamView(userId, options);\n },\n onHangUp: async (forEveryone?: boolean) => {\n await adapter.leaveCall(forEveryone);\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onToggleHold: async () => {\n return adapter.getState().call?.state === 'LocalHold' ? await adapter.resumeCall() : await adapter.holdCall();\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant: async (participant, options?) => {\n return await adapter.addParticipant(participant, options);\n },\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(dtmf-dialer) */\n onSendDtmfTone: async (dtmfTone: DtmfTone) => {\n await adapter.sendDtmfTone(dtmfTone);\n },\n onRemoveParticipant: async (userId) => {\n await adapter.removeParticipant(userId);\n },\n /* @conditional-compile-remove(raise-hand) */\n onRaiseHand: async () => {\n await adapter.raiseHand();\n },\n /* @conditional-compile-remove(raise-hand) */\n onLowerHand: async () => {\n await adapter.lowerHand();\n },\n /* @conditional-compile-remove(raise-hand) */\n onToggleRaiseHand: async () => {\n adapter.getState().call?.raiseHand.localParticipantRaisedHand\n ? await adapter.lowerHand()\n : await adapter.raiseHand();\n },\n /* @conditional-compile-remove(reaction) */\n onReactionClicked: async (reaction: Reaction) => {\n await adapter.onReactionClicked(reaction);\n },\n onSelectCamera: async (deviceInfo, options) => {\n await adapter.setCamera(deviceInfo, options);\n },\n onSelectMicrophone: async (deviceInfo) => {\n await adapter.setMicrophone(deviceInfo);\n },\n onSelectSpeaker: async (deviceInfo) => {\n await adapter.setSpeaker(deviceInfo);\n },\n onStartCall: (participants, options?) => {\n const rawIds = participants.map((participant) => toFlatCommunicationIdentifier(participant));\n return adapter.startCall(rawIds, options);\n },\n onStartScreenShare: async () => {\n await adapter.startScreenShare();\n },\n onStopScreenShare: async () => {\n await adapter.stopScreenShare();\n },\n onToggleCamera: async (options) => {\n isCameraOn(adapter.getState()) ? await adapter.stopCamera() : await adapter.startCamera(options);\n },\n onToggleMicrophone: async () => {\n return adapter.getState().call?.isMuted ? await adapter.unmute() : await adapter.mute();\n },\n onToggleScreenShare: async () => {\n return adapter.getState().call?.isScreenSharingOn\n ? await adapter.stopScreenShare()\n : await adapter.startScreenShare();\n },\n onStartLocalVideo: async () => {\n if (adapter.getState().call) {\n return adapter.startCamera();\n }\n },\n onDisposeLocalStreamView: async () => {\n return adapter.disposeLocalVideoStreamView();\n },\n onDisposeRemoteStreamView: async (userId) => {\n return adapter.disposeStreamView(userId);\n },\n onDisposeRemoteScreenShareStreamView: async (userId) => {\n return adapter.disposeScreenShareStreamView(userId);\n },\n onDisposeRemoteVideoStreamView: async (userId) => {\n return adapter.disposeRemoteVideoStreamView(userId);\n },\n /* @conditional-compile-remove(call-readiness) */\n askDevicePermission: async (constrain) => {\n return adapter.askDevicePermission(constrain);\n },\n /* @conditional-compile-remove(video-background-effects) */\n onRemoveVideoBackgroundEffects: async () => {\n return await adapter.stopVideoBackgroundEffects();\n },\n /* @conditional-compile-remove(video-background-effects) */\n onBlurVideoBackground: async (backgroundBlurConfig?: BackgroundBlurConfig) => {\n const blurConfig: VideoBackgroundBlurEffect = {\n effectName: 'blur',\n ...backgroundBlurConfig\n };\n return await adapter.startVideoBackgroundEffect(blurConfig);\n },\n /* @conditional-compile-remove(video-background-effects) */\n onReplaceVideoBackground: async (backgroundReplacementConfig: BackgroundReplacementConfig) => {\n const replacementConfig: VideoBackgroundReplacementEffect = {\n effectName: 'replacement',\n ...backgroundReplacementConfig\n };\n return await adapter.startVideoBackgroundEffect(replacementConfig);\n },\n /* @conditional-compile-remove(close-captions) */\n onStartCaptions: async (options) => {\n await adapter.startCaptions(options);\n },\n /* @conditional-compile-remove(close-captions) */\n onStopCaptions: async () => {\n await adapter.stopCaptions();\n },\n /* @conditional-compile-remove(close-captions) */\n onSetSpokenLanguage: async (language) => {\n await adapter.setSpokenLanguage(language);\n },\n /* @conditional-compile-remove(close-captions) */\n onSetCaptionLanguage: async (language) => {\n await adapter.setCaptionLanguage(language);\n },\n /* @conditional-compile-remove(end-of-call-survey) */\n onSubmitSurvey: async (survey: CallSurvey): Promise<CallSurveyResponse | undefined> => {\n return await adapter.submitSurvey(survey);\n },\n /* @conditional-compile-remove(spotlight) */\n onStartSpotlight: async (userId: string): Promise<void> => {\n await adapter.startSpotlight(userId);\n },\n /* @conditional-compile-remove(spotlight) */\n onStopSpotlight: async (userId: string): Promise<void> => {\n await adapter.stopSpotlight(userId);\n }\n })\n);\n"]}
@@ -19,4 +19,5 @@ export type { TransferRequestedListener } from './adapter';
19
19
  export type { CapabilitiesChangedListener } from './adapter';
20
20
  export type { CapabilityChangedNotificationStrings } from './components/CapabilitiesChangedNotificationBar';
21
21
  export type { CallingSounds, SoundEffect } from './adapter';
22
+ export type { SpotlightPromptStrings } from './components/Prompt';
22
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallComposite/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAQhD,cAAc,WAAW,CAAC;AAE1B,OAAO,EACL,mCAAmC,EACnC,6CAA6C,EAC7C,gCAAgC,EACjC,MAAM,WAAW,CAAC;AAEnB,yDAAyD;AACzD,OAAO,EAAE,sBAAsB,EAAE,gCAAgC,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { CallComposite } from './CallComposite';\nexport type { CallCompositeOptions, CallCompositeProps, RemoteVideoTileMenuOptions } from './CallComposite';\n/* @conditional-compile-remove(call-readiness) */\nexport type { DeviceCheckOptions } from './CallComposite';\n/* @conditional-compile-remove(click-to-call) */\nexport type { LocalVideoTileOptions } from './CallComposite';\nexport type { CallControlOptions } from './types/CallControlOptions';\n\nexport * from './Strings';\n\nexport {\n createAzureCommunicationCallAdapter,\n createAzureCommunicationCallAdapterFromClient,\n useAzureCommunicationCallAdapter\n} from './adapter';\n\n/* @conditional-compile-remove(teams-identity-support) */\nexport { createTeamsCallAdapter, createTeamsCallAdapterFromClient, useTeamsCallAdapter } from './adapter';\n\nexport type { TeamsAdapterOptions } from './adapter';\n\n/* @conditional-compile-remove(teams-identity-support) */\nexport type { TeamsCallAdapter, TeamsCallAdapterArgs, Profile, OnFetchProfileCallback } from './adapter';\n\nexport type {\n AzureCommunicationCallAdapterArgs,\n CallAdapterLocator,\n CommonCallAdapter,\n CallAdapterCallOperations,\n AzureCommunicationOutboundCallAdapterArgs\n} from './adapter';\n\n/* @conditional-compile-remove(video-background-effects) */\nexport type { AzureCommunicationCallAdapterOptions } from './adapter';\n\n/* @conditional-compile-remove(video-background-effects) */\nexport type { CommonCallAdapterOptions } from './adapter';\n\n/* @conditional-compile-remove(teams-adhoc-call) */\nexport type { CallParticipantsLocator } from './adapter';\n\n/* @conditional-compile-remove(video-background-effects) */\nexport type {\n VideoBackgroundImage,\n VideoBackgroundEffect,\n VideoBackgroundNoEffect,\n VideoBackgroundBlurEffect,\n VideoBackgroundReplacementEffect\n} from './adapter/CallAdapter';\n\nexport type {\n CallAdapter,\n CallAdapterCallEndedEvent,\n CallAdapterCallManagement,\n CallAdapterClientState,\n CallAdapterDeviceManagement,\n CallAdapterState,\n CallAdapterSubscribers,\n CallAdapterUiState,\n CallCompositePage,\n CallEndedListener,\n CallIdChangedListener,\n DiagnosticChangedEventListner,\n DisplayNameChangedListener,\n IsLocalScreenSharingActiveChangedListener,\n IsMutedChangedListener,\n IsSpeakingChangedListener,\n MediaDiagnosticChangedEvent,\n NetworkDiagnosticChangedEvent,\n ParticipantsJoinedListener,\n ParticipantsLeftListener,\n JoinCallOptions,\n StartCallIdentifier\n} from './adapter';\n\n/* @conditional-compile-remove(close-captions) */\nexport type {\n CaptionsReceivedListener,\n IsCaptionsActiveChangedListener,\n IsCaptionLanguageChangedListener,\n IsSpokenLanguageChangedListener\n} from './adapter';\n\n/* @conditional-compile-remove(call-transfer) */\nexport type { TransferRequestedListener } from './adapter';\n\n/* @conditional-compile-remove(capabilities) */\nexport type { CapabilitiesChangedListener } from './adapter';\n/* @conditional-compile-remove(capabilities) */\nexport type { CapabilityChangedNotificationStrings } from './components/CapabilitiesChangedNotificationBar';\n\n/* @conditional-compile-remove(calling-sounds) */\nexport type { CallingSounds, SoundEffect } from './adapter';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallComposite/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAQhD,cAAc,WAAW,CAAC;AAE1B,OAAO,EACL,mCAAmC,EACnC,6CAA6C,EAC7C,gCAAgC,EACjC,MAAM,WAAW,CAAC;AAEnB,yDAAyD;AACzD,OAAO,EAAE,sBAAsB,EAAE,gCAAgC,EAAE,mBAAmB,EAAE,MAAM,WAAW,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { CallComposite } from './CallComposite';\nexport type { CallCompositeOptions, CallCompositeProps, RemoteVideoTileMenuOptions } from './CallComposite';\n/* @conditional-compile-remove(call-readiness) */\nexport type { DeviceCheckOptions } from './CallComposite';\n/* @conditional-compile-remove(click-to-call) */\nexport type { LocalVideoTileOptions } from './CallComposite';\nexport type { CallControlOptions } from './types/CallControlOptions';\n\nexport * from './Strings';\n\nexport {\n createAzureCommunicationCallAdapter,\n createAzureCommunicationCallAdapterFromClient,\n useAzureCommunicationCallAdapter\n} from './adapter';\n\n/* @conditional-compile-remove(teams-identity-support) */\nexport { createTeamsCallAdapter, createTeamsCallAdapterFromClient, useTeamsCallAdapter } from './adapter';\n\nexport type { TeamsAdapterOptions } from './adapter';\n\n/* @conditional-compile-remove(teams-identity-support) */\nexport type { TeamsCallAdapter, TeamsCallAdapterArgs, Profile, OnFetchProfileCallback } from './adapter';\n\nexport type {\n AzureCommunicationCallAdapterArgs,\n CallAdapterLocator,\n CommonCallAdapter,\n CallAdapterCallOperations,\n AzureCommunicationOutboundCallAdapterArgs\n} from './adapter';\n\n/* @conditional-compile-remove(video-background-effects) */\nexport type { AzureCommunicationCallAdapterOptions } from './adapter';\n\n/* @conditional-compile-remove(video-background-effects) */\nexport type { CommonCallAdapterOptions } from './adapter';\n\n/* @conditional-compile-remove(teams-adhoc-call) */\nexport type { CallParticipantsLocator } from './adapter';\n\n/* @conditional-compile-remove(video-background-effects) */\nexport type {\n VideoBackgroundImage,\n VideoBackgroundEffect,\n VideoBackgroundNoEffect,\n VideoBackgroundBlurEffect,\n VideoBackgroundReplacementEffect\n} from './adapter/CallAdapter';\n\nexport type {\n CallAdapter,\n CallAdapterCallEndedEvent,\n CallAdapterCallManagement,\n CallAdapterClientState,\n CallAdapterDeviceManagement,\n CallAdapterState,\n CallAdapterSubscribers,\n CallAdapterUiState,\n CallCompositePage,\n CallEndedListener,\n CallIdChangedListener,\n DiagnosticChangedEventListner,\n DisplayNameChangedListener,\n IsLocalScreenSharingActiveChangedListener,\n IsMutedChangedListener,\n IsSpeakingChangedListener,\n MediaDiagnosticChangedEvent,\n NetworkDiagnosticChangedEvent,\n ParticipantsJoinedListener,\n ParticipantsLeftListener,\n JoinCallOptions,\n StartCallIdentifier\n} from './adapter';\n\n/* @conditional-compile-remove(close-captions) */\nexport type {\n CaptionsReceivedListener,\n IsCaptionsActiveChangedListener,\n IsCaptionLanguageChangedListener,\n IsSpokenLanguageChangedListener\n} from './adapter';\n\n/* @conditional-compile-remove(call-transfer) */\nexport type { TransferRequestedListener } from './adapter';\n\n/* @conditional-compile-remove(capabilities) */\nexport type { CapabilitiesChangedListener } from './adapter';\n/* @conditional-compile-remove(capabilities) */\nexport type { CapabilityChangedNotificationStrings } from './components/CapabilitiesChangedNotificationBar';\n\n/* @conditional-compile-remove(calling-sounds) */\nexport type { CallingSounds, SoundEffect } from './adapter';\n\n/* @conditional-compile-remove(spotlight) */\nexport type { SpotlightPromptStrings } from './components/Prompt';\n"]}
@@ -5,8 +5,10 @@ import { useId } from '@fluentui/react-hooks';
5
5
  import { _isInCall } from "../../../../../calling-component-bindings/src";
6
6
  import { ErrorBar } from "../../../../../react-components/src";
7
7
  import React from 'react';
8
+ /* @conditional-compile-remove(dtmf-dialer) */ /* @conditional-compile-remove(spotlight) */
9
+ import { useState } from 'react';
8
10
  /* @conditional-compile-remove(dtmf-dialer) */
9
- import { useState, useEffect, useRef } from 'react';
11
+ import { useEffect, useRef } from 'react';
10
12
  import { useLocale } from '../../localization';
11
13
  import { CallArrangement } from '../components/CallArrangement';
12
14
  import { MediaGallery } from '../components/MediaGallery';
@@ -28,6 +30,8 @@ import { DtmfDialpadPage } from './DtmfDialpadPage';
28
30
  import { showDtmfDialer } from '../utils/MediaGalleryUtils';
29
31
  /* @conditional-compile-remove(dtmf-dialer) */
30
32
  import { getTargetCallees } from '../selectors/baseSelectors';
33
+ /* @conditional-compile-remove(spotlight) */
34
+ import { Prompt } from '../components/Prompt';
31
35
  /**
32
36
  * @private
33
37
  */
@@ -75,6 +79,10 @@ export const CallPage = (props) => {
75
79
  // Reduce the controls shown when mobile view is enabled.
76
80
  const callControlOptions = mobileView ? reduceCallControlsForMobile(options === null || options === void 0 ? void 0 : options.callControls) : options === null || options === void 0 ? void 0 : options.callControls;
77
81
  const drawerMenuHostId = useId('drawerMenuHost');
82
+ /* @conditional-compile-remove(spotlight) */
83
+ const [isPromptOpen, setIsPromptOpen] = useState(false);
84
+ /* @conditional-compile-remove(spotlight) */
85
+ const [promptProps, setPromptProps] = useState();
78
86
  const onRenderGalleryContentTrampoline = () => {
79
87
  /* @conditional-compile-remove(dtmf-dialer) */
80
88
  if (dtmfDialerPresent) {
@@ -89,7 +97,11 @@ export const CallPage = (props) => {
89
97
  /* @conditional-compile-remove(gallery-layouts) */
90
98
  userSetOverflowGalleryPosition: userSetOverflowGalleryPosition,
91
99
  /* @conditional-compile-remove(gallery-layouts) */
92
- userSetGalleryLayout: galleryLayout })));
100
+ userSetGalleryLayout: galleryLayout,
101
+ /* @conditional-compile-remove(spotlight) */
102
+ setIsPromptOpen: setIsPromptOpen,
103
+ /* @conditional-compile-remove(spotlight) */
104
+ setPromptProps: setPromptProps })));
93
105
  }
94
106
  return (React.createElement(MediaGallery, Object.assign({ isMobile: mobileView }, mediaGalleryProps, mediaGalleryHandlers, { onFetchAvatarPersonaData: onFetchAvatarPersonaData, remoteVideoTileMenuOptions: options === null || options === void 0 ? void 0 : options.remoteVideoTileMenuOptions, drawerMenuHostId: drawerMenuHostId,
95
107
  /* @conditional-compile-remove(click-to-call) */
@@ -97,28 +109,39 @@ export const CallPage = (props) => {
97
109
  /* @conditional-compile-remove(gallery-layouts) */
98
110
  userSetOverflowGalleryPosition: userSetOverflowGalleryPosition,
99
111
  /* @conditional-compile-remove(gallery-layouts) */
100
- userSetGalleryLayout: galleryLayout })));
112
+ userSetGalleryLayout: galleryLayout,
113
+ /* @conditional-compile-remove(spotlight) */
114
+ setIsPromptOpen: setIsPromptOpen,
115
+ /* @conditional-compile-remove(spotlight) */
116
+ setPromptProps: setPromptProps })));
101
117
  };
102
- return (React.createElement(CallArrangement, { id: drawerMenuHostId, complianceBannerProps: Object.assign(Object.assign({}, complianceBannerProps), { strings }), errorBarProps: (options === null || options === void 0 ? void 0 : options.errorBar) !== false && errorBarProps, mutedNotificationProps: mutedNotificationProps, callControlProps: {
103
- callInvitationURL: callInvitationURL,
104
- onFetchParticipantMenuItems: onFetchParticipantMenuItems,
105
- options: callControlOptions,
106
- increaseFlyoutItemSize: mobileView
107
- },
108
- /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(close-captions) */
109
- onFetchAvatarPersonaData: onFetchAvatarPersonaData, mobileView: mobileView, modalLayerHostId: props.modalLayerHostId, onRenderGalleryContent: () => _isInCall(callStatus) ? (isNetworkHealthy(networkReconnectTileProps.networkReconnectValue) ? (onRenderGalleryContentTrampoline()) : (React.createElement(NetworkReconnectTile, Object.assign({}, networkReconnectTileProps)))) : (React.createElement(React.Fragment, null)), updateSidePaneRenderer: props.updateSidePaneRenderer, mobileChatTabHeader: props.mobileChatTabHeader, onCloseChatPane: onCloseChatPane, dataUiId: 'call-page', latestErrors: props.latestErrors, onDismissError: props.onDismissError,
110
- /* @conditional-compile-remove(gallery-layouts) */
111
- onUserSetOverflowGalleryPositionChange: onSetUserSetOverflowGalleryPosition,
112
- /* @conditional-compile-remove(gallery-layouts) */
113
- onUserSetGalleryLayoutChange: onUserSetGalleryLayoutChange,
114
- /* @conditional-compile-remove(gallery-layouts) */
115
- userSetGalleryLayout: galleryLayout,
116
- /* @conditional-compile-remove(capabilities) */
117
- capabilitiesChangedNotificationBarProps: props.capabilitiesChangedNotificationBarProps,
118
- /* @conditional-compile-remove(dtmf-dialer) */
119
- onSetDialpadPage: () => setDtmfDialerPresent(!dtmfDialerPresent),
120
- /* @conditional-compile-remove(dtmf-dialer) */
121
- dtmfDialerPresent: dtmfDialerPresent }));
118
+ return (React.createElement(React.Fragment, null,
119
+ React.createElement(CallArrangement, { id: drawerMenuHostId, complianceBannerProps: Object.assign(Object.assign({}, complianceBannerProps), { strings }), errorBarProps: (options === null || options === void 0 ? void 0 : options.errorBar) !== false && errorBarProps, mutedNotificationProps: mutedNotificationProps, callControlProps: {
120
+ callInvitationURL: callInvitationURL,
121
+ onFetchParticipantMenuItems: onFetchParticipantMenuItems,
122
+ options: callControlOptions,
123
+ increaseFlyoutItemSize: mobileView
124
+ },
125
+ /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(close-captions) */
126
+ onFetchAvatarPersonaData: onFetchAvatarPersonaData, mobileView: mobileView, modalLayerHostId: props.modalLayerHostId, onRenderGalleryContent: () => _isInCall(callStatus) ? (isNetworkHealthy(networkReconnectTileProps.networkReconnectValue) ? (onRenderGalleryContentTrampoline()) : (React.createElement(NetworkReconnectTile, Object.assign({}, networkReconnectTileProps)))) : (React.createElement(React.Fragment, null)), updateSidePaneRenderer: props.updateSidePaneRenderer, mobileChatTabHeader: props.mobileChatTabHeader, onCloseChatPane: onCloseChatPane, dataUiId: 'call-page', latestErrors: props.latestErrors, onDismissError: props.onDismissError,
127
+ /* @conditional-compile-remove(gallery-layouts) */
128
+ onUserSetOverflowGalleryPositionChange: onSetUserSetOverflowGalleryPosition,
129
+ /* @conditional-compile-remove(gallery-layouts) */
130
+ onUserSetGalleryLayoutChange: onUserSetGalleryLayoutChange,
131
+ /* @conditional-compile-remove(gallery-layouts) */
132
+ userSetGalleryLayout: galleryLayout,
133
+ /* @conditional-compile-remove(capabilities) */
134
+ capabilitiesChangedNotificationBarProps: props.capabilitiesChangedNotificationBarProps,
135
+ /* @conditional-compile-remove(dtmf-dialer) */
136
+ onSetDialpadPage: () => setDtmfDialerPresent(!dtmfDialerPresent),
137
+ /* @conditional-compile-remove(dtmf-dialer) */
138
+ dtmfDialerPresent: dtmfDialerPresent,
139
+ /* @conditional-compile-remove(spotlight) */
140
+ setIsPromptOpen: setIsPromptOpen,
141
+ /* @conditional-compile-remove(spotlight) */
142
+ setPromptProps: setPromptProps }),
143
+ /* @conditional-compile-remove(spotlight) */
144
+ React.createElement(Prompt, Object.assign({ isOpen: isPromptOpen, onDismiss: () => setIsPromptOpen(false) }, promptProps))));
122
145
  };
123
146
  /**
124
147
  * @private
@@ -1 +1 @@
1
- {"version":3,"file":"CallPage.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/pages/CallPage.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,SAAS,EA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,CAAC,CAAC,CACtB,gBAAgB,CAAC,yBAAyB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC,CAClE,gCAAgC,EAAE,CACnC,CAAC,CAAC,CAAC,CACF,oBAAC,oBAAoB,oBAAK,yBAAyB,EAAI,CACxD,CACF,CAAC,CAAC,CAAC,CACF,yCAAK,CACN,EAEH,sBAAsB,EAAE,KAAK,CAAC,sBAAsB,EACpD,mBAAmB,EAAE,KAAK,CAAC,mBAAmB,EAC9C,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,WAAW,EACrB,YAAY,EAAE,KAAK,CAAC,YAAY,EAChC,cAAc,EAAE,KAAK,CAAC,cAAc;QACpC,kDAAkD;QAClD,sCAAsC,EAAE,mCAAmC;QAC3E,kDAAkD;QAClD,4BAA4B,EAAE,4BAA4B;QAC1D,kDAAkD;QAClD,oBAAoB,EAAE,aAAa;QACnC,+CAA+C;QAC/C,uCAAuC,EAAE,KAAK,CAAC,uCAAuC;QACtF,8CAA8C;QAC9C,gBAAgB,EAAE,GAAG,EAAE,CAAC,oBAAoB,CAAC,CAAC,iBAAiB,CAAC;QAChE,8CAA8C;QAC9C,iBAAiB,EAAE,iBAAiB,GACpC,CACH,CAAC;AACJ,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAA8C,EAAW,EAAE;IAC1F,oFAAoF;IACpF,4EAA4E;IAC5E,uEAAuE;IACvE,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,iBAAiB,CAAC,IAAI,CAAC;AACtG,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DiagnosticQuality } from '@azure/communication-calling';\nimport { useId } from '@fluentui/react-hooks';\nimport { _isInCall } from '@internal/calling-component-bindings';\nimport { ActiveErrorMessage, ErrorBar, ParticipantMenuItemsCallback } from '@internal/react-components';\n/* @conditional-compile-remove(gallery-layouts) */\nimport { VideoGalleryLayout } from '@internal/react-components';\nimport React from 'react';\n/* @conditional-compile-remove(dtmf-dialer) */\nimport { useState, useEffect, useRef } from 'react';\nimport { AvatarPersonaDataCallback } from '../../common/AvatarPersona';\nimport { useLocale } from '../../localization';\nimport { CallCompositeOptions } from '../CallComposite';\nimport { CallArrangement } from '../components/CallArrangement';\nimport { MediaGallery } from '../components/MediaGallery';\nimport { NetworkReconnectTile } from '../components/NetworkReconnectTile';\nimport { useHandlers } from '../hooks/useHandlers';\nimport { usePropsFor } from '../hooks/usePropsFor';\nimport { useSelector } from '../hooks/useSelector';\nimport { callStatusSelector } from '../selectors/callStatusSelector';\nimport { complianceBannerSelector } from '../selectors/complianceBannerSelector';\nimport { mediaGallerySelector } from '../selectors/mediaGallerySelector';\n/* @conditional-compile-remove(dtmf-dialer) */\nimport { getRemoteParticipantsConnectedSelector } from '../selectors/mediaGallerySelector';\nimport { mutedNotificationSelector } from '../selectors/mutedNotificationSelector';\nimport { networkReconnectTileSelector } from '../selectors/networkReconnectTileSelector';\nimport { reduceCallControlsForMobile } from '../utils';\nimport { MobileChatSidePaneTabHeaderProps } from '../../common/TabHeader';\nimport { SidePaneRenderer } from '../components/SidePane/SidePaneProvider';\n/* @conditional-compile-remove(capabilities) */\nimport { CapabilitiesChangeNotificationBarProps } from '../components/CapabilitiesChangedNotificationBar';\n/* @conditional-compile-remove(dtmf-dialer) */\nimport { DtmfDialpadPage } from './DtmfDialpadPage';\n/* @conditional-compile-remove(dtmf-dialer) */\nimport { showDtmfDialer } from '../utils/MediaGalleryUtils';\n/* @conditional-compile-remove(dtmf-dialer) */\nimport { getTargetCallees } from '../selectors/baseSelectors';\n\n/**\n * @private\n */\nexport interface CallPageProps {\n mobileView: boolean;\n modalLayerHostId: string;\n callInvitationURL?: string;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n updateSidePaneRenderer: (renderer: SidePaneRenderer | undefined) => void;\n mobileChatTabHeader?: MobileChatSidePaneTabHeaderProps;\n options?: CallCompositeOptions;\n latestErrors: ActiveErrorMessage[];\n onDismissError: (error: ActiveErrorMessage) => void;\n /* @conditional-compile-remove(gallery-layouts) */\n galleryLayout: VideoGalleryLayout;\n /* @conditional-compile-remove(capabilities) */\n capabilitiesChangedNotificationBarProps?: CapabilitiesChangeNotificationBarProps;\n /* @conditional-compile-remove(gallery-layouts) */\n onUserSetGalleryLayoutChange?: (layout: VideoGalleryLayout) => void;\n /* @conditional-compile-remove(gallery-layouts) */\n userSetOverflowGalleryPosition?: 'Responsive' | 'horizontalTop';\n /* @conditional-compile-remove(gallery-layouts) */\n onSetUserSetOverflowGalleryPosition?: (position: 'Responsive' | 'horizontalTop') => void;\n onCloseChatPane?: () => void;\n}\n\n/**\n * @private\n */\nexport const CallPage = (props: CallPageProps): JSX.Element => {\n const {\n callInvitationURL,\n onFetchAvatarPersonaData,\n onFetchParticipantMenuItems,\n options,\n mobileView,\n /* @conditional-compile-remove(gallery-layouts) */\n galleryLayout = 'floatingLocalVideo',\n /* @conditional-compile-remove(gallery-layouts) */\n onUserSetGalleryLayoutChange,\n /* @conditional-compile-remove(gallery-layouts) */\n userSetOverflowGalleryPosition = 'Responsive',\n /* @conditional-compile-remove(gallery-layouts) */\n onSetUserSetOverflowGalleryPosition,\n onCloseChatPane\n } = props;\n\n // To use useProps to get these states, we need to create another file wrapping Call,\n // It seems unnecessary in this case, so we get the updated states using this approach.\n const { callStatus } = useSelector(callStatusSelector);\n const mediaGalleryProps = useSelector(mediaGallerySelector);\n const mediaGalleryHandlers = useHandlers(MediaGallery);\n const complianceBannerProps = useSelector(complianceBannerSelector);\n const errorBarProps = usePropsFor(ErrorBar);\n const mutedNotificationProps = useSelector(mutedNotificationSelector);\n const networkReconnectTileProps = useSelector(networkReconnectTileSelector);\n /* @conditional-compile-remove(dtmf-dialer) */\n const remoteParticipantsConnected = useSelector(getRemoteParticipantsConnectedSelector);\n\n /* @conditional-compile-remove(dtmf-dialer) */\n const callees = useSelector(getTargetCallees);\n /* @conditional-compile-remove(dtmf-dialer) */\n const renderDtmfDialerFromStart = showDtmfDialer(callees);\n\n /* @conditional-compile-remove(dtmf-dialer) */\n const [dtmfDialerPresent, setDtmfDialerPresent] = useState<boolean>(renderDtmfDialerFromStart);\n /* @conditional-compile-remove(dtmf-dialer) */\n const dialerShouldAutoDismiss = useRef<boolean>(renderDtmfDialerFromStart);\n\n /* @conditional-compile-remove(dtmf-dialer) */\n /**\n * This useEffect is about clearing the dtmf dialer should there be a new participant that joins the call.\n * This will only happen the first time should the dialer be present when the call starts.\n */\n useEffect(() => {\n if (remoteParticipantsConnected.length > 1 && dtmfDialerPresent && dialerShouldAutoDismiss.current) {\n setDtmfDialerPresent(false);\n dialerShouldAutoDismiss.current = false;\n }\n }, [dtmfDialerPresent, remoteParticipantsConnected, setDtmfDialerPresent]);\n\n const strings = useLocale().strings.call;\n\n // Reduce the controls shown when mobile view is enabled.\n const callControlOptions = mobileView ? reduceCallControlsForMobile(options?.callControls) : options?.callControls;\n\n const drawerMenuHostId = useId('drawerMenuHost');\n\n const onRenderGalleryContentTrampoline = (): JSX.Element => {\n /* @conditional-compile-remove(dtmf-dialer) */\n if (dtmfDialerPresent) {\n return (\n <DtmfDialpadPage\n mobileView={props.mobileView}\n modalLayerHostId={props.modalLayerHostId}\n options={props.options}\n updateSidePaneRenderer={props.updateSidePaneRenderer}\n mobileChatTabHeader={props.mobileChatTabHeader}\n latestErrors={props.latestErrors}\n onDismissError={props.onDismissError}\n /* @conditional-compile-remove(capabilities) */\n capabilitiesChangedNotificationBarProps={props.capabilitiesChangedNotificationBarProps}\n onSetDialpadPage={() => setDtmfDialerPresent(!dtmfDialerPresent)}\n dtmfDialerPresent={dtmfDialerPresent}\n />\n );\n } else {\n return (\n <MediaGallery\n isMobile={mobileView}\n {...mediaGalleryProps}\n {...mediaGalleryHandlers}\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n remoteVideoTileMenuOptions={options?.remoteVideoTileMenuOptions}\n drawerMenuHostId={drawerMenuHostId}\n /* @conditional-compile-remove(click-to-call) */\n localVideoTileOptions={options?.localVideoTile}\n /* @conditional-compile-remove(gallery-layouts) */\n userSetOverflowGalleryPosition={userSetOverflowGalleryPosition}\n /* @conditional-compile-remove(gallery-layouts) */\n userSetGalleryLayout={galleryLayout}\n />\n );\n }\n return (\n <MediaGallery\n isMobile={mobileView}\n {...mediaGalleryProps}\n {...mediaGalleryHandlers}\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n remoteVideoTileMenuOptions={options?.remoteVideoTileMenuOptions}\n drawerMenuHostId={drawerMenuHostId}\n /* @conditional-compile-remove(click-to-call) */\n localVideoTileOptions={options?.localVideoTile}\n /* @conditional-compile-remove(gallery-layouts) */\n userSetOverflowGalleryPosition={userSetOverflowGalleryPosition}\n /* @conditional-compile-remove(gallery-layouts) */\n userSetGalleryLayout={galleryLayout}\n />\n );\n };\n\n return (\n <CallArrangement\n id={drawerMenuHostId}\n complianceBannerProps={{ ...complianceBannerProps, strings }}\n errorBarProps={options?.errorBar !== false && errorBarProps}\n mutedNotificationProps={mutedNotificationProps}\n callControlProps={{\n callInvitationURL: callInvitationURL,\n onFetchParticipantMenuItems: onFetchParticipantMenuItems,\n options: callControlOptions,\n increaseFlyoutItemSize: mobileView\n }}\n /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(close-captions) */\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n mobileView={mobileView}\n modalLayerHostId={props.modalLayerHostId}\n onRenderGalleryContent={() =>\n _isInCall(callStatus) ? (\n isNetworkHealthy(networkReconnectTileProps.networkReconnectValue) ? (\n onRenderGalleryContentTrampoline()\n ) : (\n <NetworkReconnectTile {...networkReconnectTileProps} />\n )\n ) : (\n <></>\n )\n }\n updateSidePaneRenderer={props.updateSidePaneRenderer}\n mobileChatTabHeader={props.mobileChatTabHeader}\n onCloseChatPane={onCloseChatPane}\n dataUiId={'call-page'}\n latestErrors={props.latestErrors}\n onDismissError={props.onDismissError}\n /* @conditional-compile-remove(gallery-layouts) */\n onUserSetOverflowGalleryPositionChange={onSetUserSetOverflowGalleryPosition}\n /* @conditional-compile-remove(gallery-layouts) */\n onUserSetGalleryLayoutChange={onUserSetGalleryLayoutChange}\n /* @conditional-compile-remove(gallery-layouts) */\n userSetGalleryLayout={galleryLayout}\n /* @conditional-compile-remove(capabilities) */\n capabilitiesChangedNotificationBarProps={props.capabilitiesChangedNotificationBarProps}\n /* @conditional-compile-remove(dtmf-dialer) */\n onSetDialpadPage={() => setDtmfDialerPresent(!dtmfDialerPresent)}\n /* @conditional-compile-remove(dtmf-dialer) */\n dtmfDialerPresent={dtmfDialerPresent}\n />\n );\n};\n\n/**\n * @private\n */\nexport const isNetworkHealthy = (value: DiagnosticQuality | boolean | undefined): boolean => {\n // We know that the value is actually of type DiagnosticQuality for this diagnostic.\n // We ignore any boolen values, considering the network to still be healthy.\n // Thus, only DiagnosticQuality.Poor or .Bad indicate network problems.\n return value === true || value === false || value === undefined || value === DiagnosticQuality.Good;\n};\n"]}
1
+ {"version":3,"file":"CallPage.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/pages/CallPage.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AACjE,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,sDAA6C;AACjE,OAAO,EAAsB,QAAQ,EAAgC,4CAAmC;AAGxG,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,8CAA8C,CAAC,4CAA4C;AAC3F,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,8CAA8C;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,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;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAA8C,EAAW,EAAE;IAC1F,oFAAoF;IACpF,4EAA4E;IAC5E,uEAAuE;IACvE,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,iBAAiB,CAAC,IAAI,CAAC;AACtG,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { DiagnosticQuality } from '@azure/communication-calling';\nimport { useId } from '@fluentui/react-hooks';\nimport { _isInCall } from '@internal/calling-component-bindings';\nimport { ActiveErrorMessage, ErrorBar, ParticipantMenuItemsCallback } from '@internal/react-components';\n/* @conditional-compile-remove(gallery-layouts) */\nimport { VideoGalleryLayout } from '@internal/react-components';\nimport React from 'react';\n/* @conditional-compile-remove(dtmf-dialer) */ /* @conditional-compile-remove(spotlight) */\nimport { useState } from 'react';\n/* @conditional-compile-remove(dtmf-dialer) */\nimport { useEffect, useRef } from 'react';\nimport { AvatarPersonaDataCallback } from '../../common/AvatarPersona';\nimport { useLocale } from '../../localization';\nimport { CallCompositeOptions } from '../CallComposite';\nimport { CallArrangement } from '../components/CallArrangement';\nimport { MediaGallery } from '../components/MediaGallery';\nimport { NetworkReconnectTile } from '../components/NetworkReconnectTile';\nimport { useHandlers } from '../hooks/useHandlers';\nimport { usePropsFor } from '../hooks/usePropsFor';\nimport { useSelector } from '../hooks/useSelector';\nimport { callStatusSelector } from '../selectors/callStatusSelector';\nimport { complianceBannerSelector } from '../selectors/complianceBannerSelector';\nimport { mediaGallerySelector } from '../selectors/mediaGallerySelector';\n/* @conditional-compile-remove(dtmf-dialer) */\nimport { getRemoteParticipantsConnectedSelector } from '../selectors/mediaGallerySelector';\nimport { mutedNotificationSelector } from '../selectors/mutedNotificationSelector';\nimport { networkReconnectTileSelector } from '../selectors/networkReconnectTileSelector';\nimport { reduceCallControlsForMobile } from '../utils';\nimport { MobileChatSidePaneTabHeaderProps } from '../../common/TabHeader';\nimport { SidePaneRenderer } from '../components/SidePane/SidePaneProvider';\n/* @conditional-compile-remove(capabilities) */\nimport { CapabilitiesChangeNotificationBarProps } from '../components/CapabilitiesChangedNotificationBar';\n/* @conditional-compile-remove(dtmf-dialer) */\nimport { DtmfDialpadPage } from './DtmfDialpadPage';\n/* @conditional-compile-remove(dtmf-dialer) */\nimport { showDtmfDialer } from '../utils/MediaGalleryUtils';\n/* @conditional-compile-remove(dtmf-dialer) */\nimport { getTargetCallees } from '../selectors/baseSelectors';\n/* @conditional-compile-remove(spotlight) */\nimport { Prompt, PromptProps } from '../components/Prompt';\n\n/**\n * @private\n */\nexport interface CallPageProps {\n mobileView: boolean;\n modalLayerHostId: string;\n callInvitationURL?: string;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n updateSidePaneRenderer: (renderer: SidePaneRenderer | undefined) => void;\n mobileChatTabHeader?: MobileChatSidePaneTabHeaderProps;\n options?: CallCompositeOptions;\n latestErrors: ActiveErrorMessage[];\n onDismissError: (error: ActiveErrorMessage) => void;\n /* @conditional-compile-remove(gallery-layouts) */\n galleryLayout: VideoGalleryLayout;\n /* @conditional-compile-remove(capabilities) */\n capabilitiesChangedNotificationBarProps?: CapabilitiesChangeNotificationBarProps;\n /* @conditional-compile-remove(gallery-layouts) */\n onUserSetGalleryLayoutChange?: (layout: VideoGalleryLayout) => void;\n /* @conditional-compile-remove(gallery-layouts) */\n userSetOverflowGalleryPosition?: 'Responsive' | 'horizontalTop';\n /* @conditional-compile-remove(gallery-layouts) */\n onSetUserSetOverflowGalleryPosition?: (position: 'Responsive' | 'horizontalTop') => void;\n onCloseChatPane?: () => void;\n}\n\n/**\n * @private\n */\nexport const CallPage = (props: CallPageProps): JSX.Element => {\n const {\n callInvitationURL,\n onFetchAvatarPersonaData,\n onFetchParticipantMenuItems,\n options,\n mobileView,\n /* @conditional-compile-remove(gallery-layouts) */\n galleryLayout = 'floatingLocalVideo',\n /* @conditional-compile-remove(gallery-layouts) */\n onUserSetGalleryLayoutChange,\n /* @conditional-compile-remove(gallery-layouts) */\n userSetOverflowGalleryPosition = 'Responsive',\n /* @conditional-compile-remove(gallery-layouts) */\n onSetUserSetOverflowGalleryPosition,\n onCloseChatPane\n } = props;\n\n // To use useProps to get these states, we need to create another file wrapping Call,\n // It seems unnecessary in this case, so we get the updated states using this approach.\n const { callStatus } = useSelector(callStatusSelector);\n const mediaGalleryProps = useSelector(mediaGallerySelector);\n const mediaGalleryHandlers = useHandlers(MediaGallery);\n const complianceBannerProps = useSelector(complianceBannerSelector);\n const errorBarProps = usePropsFor(ErrorBar);\n const mutedNotificationProps = useSelector(mutedNotificationSelector);\n const networkReconnectTileProps = useSelector(networkReconnectTileSelector);\n /* @conditional-compile-remove(dtmf-dialer) */\n const remoteParticipantsConnected = useSelector(getRemoteParticipantsConnectedSelector);\n\n /* @conditional-compile-remove(dtmf-dialer) */\n const callees = useSelector(getTargetCallees);\n /* @conditional-compile-remove(dtmf-dialer) */\n const renderDtmfDialerFromStart = showDtmfDialer(callees);\n\n /* @conditional-compile-remove(dtmf-dialer) */\n const [dtmfDialerPresent, setDtmfDialerPresent] = useState<boolean>(renderDtmfDialerFromStart);\n /* @conditional-compile-remove(dtmf-dialer) */\n const dialerShouldAutoDismiss = useRef<boolean>(renderDtmfDialerFromStart);\n\n /* @conditional-compile-remove(dtmf-dialer) */\n /**\n * This useEffect is about clearing the dtmf dialer should there be a new participant that joins the call.\n * This will only happen the first time should the dialer be present when the call starts.\n */\n useEffect(() => {\n if (remoteParticipantsConnected.length > 1 && dtmfDialerPresent && dialerShouldAutoDismiss.current) {\n setDtmfDialerPresent(false);\n dialerShouldAutoDismiss.current = false;\n }\n }, [dtmfDialerPresent, remoteParticipantsConnected, setDtmfDialerPresent]);\n\n const strings = useLocale().strings.call;\n\n // Reduce the controls shown when mobile view is enabled.\n const callControlOptions = mobileView ? reduceCallControlsForMobile(options?.callControls) : options?.callControls;\n\n const drawerMenuHostId = useId('drawerMenuHost');\n /* @conditional-compile-remove(spotlight) */\n const [isPromptOpen, setIsPromptOpen] = useState<boolean>(false);\n /* @conditional-compile-remove(spotlight) */\n const [promptProps, setPromptProps] = useState<PromptProps>();\n\n const onRenderGalleryContentTrampoline = (): JSX.Element => {\n /* @conditional-compile-remove(dtmf-dialer) */\n if (dtmfDialerPresent) {\n return (\n <DtmfDialpadPage\n mobileView={props.mobileView}\n modalLayerHostId={props.modalLayerHostId}\n options={props.options}\n updateSidePaneRenderer={props.updateSidePaneRenderer}\n mobileChatTabHeader={props.mobileChatTabHeader}\n latestErrors={props.latestErrors}\n onDismissError={props.onDismissError}\n /* @conditional-compile-remove(capabilities) */\n capabilitiesChangedNotificationBarProps={props.capabilitiesChangedNotificationBarProps}\n onSetDialpadPage={() => setDtmfDialerPresent(!dtmfDialerPresent)}\n dtmfDialerPresent={dtmfDialerPresent}\n />\n );\n } else {\n return (\n <MediaGallery\n isMobile={mobileView}\n {...mediaGalleryProps}\n {...mediaGalleryHandlers}\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n remoteVideoTileMenuOptions={options?.remoteVideoTileMenuOptions}\n drawerMenuHostId={drawerMenuHostId}\n /* @conditional-compile-remove(click-to-call) */\n localVideoTileOptions={options?.localVideoTile}\n /* @conditional-compile-remove(gallery-layouts) */\n userSetOverflowGalleryPosition={userSetOverflowGalleryPosition}\n /* @conditional-compile-remove(gallery-layouts) */\n userSetGalleryLayout={galleryLayout}\n /* @conditional-compile-remove(spotlight) */\n setIsPromptOpen={setIsPromptOpen}\n /* @conditional-compile-remove(spotlight) */\n setPromptProps={setPromptProps}\n />\n );\n }\n return (\n <MediaGallery\n isMobile={mobileView}\n {...mediaGalleryProps}\n {...mediaGalleryHandlers}\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n remoteVideoTileMenuOptions={options?.remoteVideoTileMenuOptions}\n drawerMenuHostId={drawerMenuHostId}\n /* @conditional-compile-remove(click-to-call) */\n localVideoTileOptions={options?.localVideoTile}\n /* @conditional-compile-remove(gallery-layouts) */\n userSetOverflowGalleryPosition={userSetOverflowGalleryPosition}\n /* @conditional-compile-remove(gallery-layouts) */\n userSetGalleryLayout={galleryLayout}\n /* @conditional-compile-remove(spotlight) */\n setIsPromptOpen={setIsPromptOpen}\n /* @conditional-compile-remove(spotlight) */\n setPromptProps={setPromptProps}\n />\n );\n };\n\n return (\n <>\n <CallArrangement\n id={drawerMenuHostId}\n complianceBannerProps={{ ...complianceBannerProps, strings }}\n errorBarProps={options?.errorBar !== false && errorBarProps}\n mutedNotificationProps={mutedNotificationProps}\n callControlProps={{\n callInvitationURL: callInvitationURL,\n onFetchParticipantMenuItems: onFetchParticipantMenuItems,\n options: callControlOptions,\n increaseFlyoutItemSize: mobileView\n }}\n /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(close-captions) */\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n mobileView={mobileView}\n modalLayerHostId={props.modalLayerHostId}\n onRenderGalleryContent={() =>\n _isInCall(callStatus) ? (\n isNetworkHealthy(networkReconnectTileProps.networkReconnectValue) ? (\n onRenderGalleryContentTrampoline()\n ) : (\n <NetworkReconnectTile {...networkReconnectTileProps} />\n )\n ) : (\n <></>\n )\n }\n updateSidePaneRenderer={props.updateSidePaneRenderer}\n mobileChatTabHeader={props.mobileChatTabHeader}\n onCloseChatPane={onCloseChatPane}\n dataUiId={'call-page'}\n latestErrors={props.latestErrors}\n onDismissError={props.onDismissError}\n /* @conditional-compile-remove(gallery-layouts) */\n onUserSetOverflowGalleryPositionChange={onSetUserSetOverflowGalleryPosition}\n /* @conditional-compile-remove(gallery-layouts) */\n onUserSetGalleryLayoutChange={onUserSetGalleryLayoutChange}\n /* @conditional-compile-remove(gallery-layouts) */\n userSetGalleryLayout={galleryLayout}\n /* @conditional-compile-remove(capabilities) */\n capabilitiesChangedNotificationBarProps={props.capabilitiesChangedNotificationBarProps}\n /* @conditional-compile-remove(dtmf-dialer) */\n onSetDialpadPage={() => setDtmfDialerPresent(!dtmfDialerPresent)}\n /* @conditional-compile-remove(dtmf-dialer) */\n dtmfDialerPresent={dtmfDialerPresent}\n /* @conditional-compile-remove(spotlight) */\n setIsPromptOpen={setIsPromptOpen}\n /* @conditional-compile-remove(spotlight) */\n setPromptProps={setPromptProps}\n />\n {\n /* @conditional-compile-remove(spotlight) */\n <Prompt isOpen={isPromptOpen} onDismiss={() => setIsPromptOpen(false)} {...promptProps} />\n }\n </>\n );\n};\n\n/**\n * @private\n */\nexport const isNetworkHealthy = (value: DiagnosticQuality | boolean | undefined): boolean => {\n // We know that the value is actually of type DiagnosticQuality for this diagnostic.\n // We ignore any boolen values, considering the network to still be healthy.\n // Thus, only DiagnosticQuality.Poor or .Bad indicate network problems.\n return value === true || value === false || value === undefined || value === DiagnosticQuality.Good;\n};\n"]}
@@ -0,0 +1,9 @@
1
+ import { PromptProps } from '../components/Prompt';
2
+ /**
3
+ * @internal
4
+ */
5
+ export declare const useSpotlightCallbacksWithPrompt: (onStartSpotlight: (userId: string) => Promise<void>, onStopSpotlight: (userId: string) => Promise<void>, setIsPromptOpen?: ((isOpen: boolean) => void) | undefined, setPromptProps?: ((promptProps: PromptProps) => void) | undefined) => {
6
+ onStartSpotlightWithPrompt: (userId: string) => Promise<void>;
7
+ onStopSpotlightWithPrompt: (userId: string) => Promise<void>;
8
+ };
9
+ //# sourceMappingURL=spotlightUtils.d.ts.map
@@ -0,0 +1,81 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
4
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
5
+ return new (P || (P = Promise))(function (resolve, reject) {
6
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
7
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
8
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
9
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
10
+ });
11
+ };
12
+ /* @conditional-compile-remove(spotlight) */
13
+ import { useMemo } from 'react';
14
+ /* @conditional-compile-remove(spotlight) */
15
+ import { toFlatCommunicationIdentifier } from "../../../../../acs-ui-common/src";
16
+ /* @conditional-compile-remove(spotlight) */
17
+ import { useLocale } from '../../localization';
18
+ /* @conditional-compile-remove(spotlight) */
19
+ import { useAdapter } from '../adapter/CallAdapterProvider';
20
+ /* @conditional-compile-remove(spotlight) */
21
+ /**
22
+ * @internal
23
+ */
24
+ export const useSpotlightCallbacksWithPrompt = (onStartSpotlight, onStopSpotlight, setIsPromptOpen, setPromptProps) => {
25
+ const myUserId = toFlatCommunicationIdentifier(useAdapter().getState().userId);
26
+ const strings = useLocale().strings.call;
27
+ return useMemo(() => {
28
+ if (!setIsPromptOpen || !setPromptProps) {
29
+ return { onStartSpotlightWithPrompt: onStartSpotlight, onStopSpotlightWithPrompt: onStopSpotlight };
30
+ }
31
+ return {
32
+ onStartSpotlightWithPrompt: getStartSpotlightWithPromptCallback(myUserId, onStartSpotlight, setIsPromptOpen, setPromptProps, strings),
33
+ onStopSpotlightWithPrompt: getStopSpotlightWithPromptCallback(myUserId, onStopSpotlight, setIsPromptOpen, setPromptProps, strings)
34
+ };
35
+ }, [myUserId, onStartSpotlight, onStopSpotlight, setIsPromptOpen, setPromptProps, strings]);
36
+ };
37
+ /* @conditional-compile-remove(spotlight) */
38
+ const getStartSpotlightWithPromptCallback = (myUserId, onStartSpotlight, setIsPromptOpen, setPromptProps, strings) => {
39
+ return (userId) => __awaiter(void 0, void 0, void 0, function* () {
40
+ const startSpotlightPromptText = userId === myUserId
41
+ ? strings.spotlightPrompt.startSpotlightOnSelfText
42
+ : strings.spotlightPrompt.startSpotlightText;
43
+ setPromptProps({
44
+ heading: strings.spotlightPrompt.startSpotlightHeading,
45
+ text: startSpotlightPromptText,
46
+ confirmButtonLabel: strings.spotlightPrompt.startSpotlightConfirmButtonLabel,
47
+ cancelButtonLabel: strings.spotlightPrompt.startSpotlightCancelButtonLabel,
48
+ onConfirm: () => {
49
+ onStartSpotlight(userId);
50
+ setIsPromptOpen(false);
51
+ },
52
+ onCancel: () => setIsPromptOpen(false)
53
+ });
54
+ setIsPromptOpen(true);
55
+ });
56
+ };
57
+ /* @conditional-compile-remove(spotlight) */
58
+ const getStopSpotlightWithPromptCallback = (myUserId, onStopSpotlight, setIsPromptOpen, setPromptProps, strings) => {
59
+ return (userId) => __awaiter(void 0, void 0, void 0, function* () {
60
+ const stopSpotlightPromptHeading = userId === myUserId
61
+ ? strings.spotlightPrompt.stopSpotlightOnSelfHeading
62
+ : strings.spotlightPrompt.stopSpotlightHeading;
63
+ const stopSpotlightPromptText = userId === myUserId ? strings.spotlightPrompt.stopSpotlightOnSelfText : strings.spotlightPrompt.stopSpotlightText;
64
+ const stopSpotlightPromptConfirmButtonLabel = userId === myUserId
65
+ ? strings.spotlightPrompt.stopSpotlightOnSelfConfirmButtonLabel
66
+ : strings.spotlightPrompt.stopSpotlightConfirmButtonLabel;
67
+ setPromptProps({
68
+ heading: stopSpotlightPromptHeading,
69
+ text: stopSpotlightPromptText,
70
+ confirmButtonLabel: stopSpotlightPromptConfirmButtonLabel,
71
+ cancelButtonLabel: strings.spotlightPrompt.stopSpotlightCancelButtonLabel,
72
+ onConfirm: () => {
73
+ onStopSpotlight(userId);
74
+ setIsPromptOpen(false);
75
+ },
76
+ onCancel: () => setIsPromptOpen(false)
77
+ });
78
+ setIsPromptOpen(true);
79
+ });
80
+ };
81
+ //# sourceMappingURL=spotlightUtils.js.map