@azure/communication-react 1.4.3-alpha-202212150014.0 → 1.4.3-alpha-202212170012.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/communication-react.d.ts +27 -1
  2. package/dist/dist-cjs/communication-react/index.js +560 -336
  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/baseSelectors.d.ts +1 -1
  7. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +2 -1
  8. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  9. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js +21 -10
  10. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js.map +1 -1
  11. package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js +6 -2
  12. package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js.map +1 -1
  13. package/dist/dist-esm/react-components/src/components/DevicePermissions/DomainPermissions.d.ts +4 -0
  14. package/dist/dist-esm/react-components/src/components/DevicePermissions/DomainPermissions.js +9 -3
  15. package/dist/dist-esm/react-components/src/components/DevicePermissions/DomainPermissions.js.map +1 -1
  16. package/dist/dist-esm/react-components/src/components/ErrorBar.d.ts +8 -0
  17. package/dist/dist-esm/react-components/src/components/ErrorBar.js.map +1 -1
  18. package/dist/dist-esm/react-components/src/components/ParticipantsButton.d.ts +4 -0
  19. package/dist/dist-esm/react-components/src/components/ParticipantsButton.js +25 -4
  20. package/dist/dist-esm/react-components/src/components/ParticipantsButton.js.map +1 -1
  21. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.d.ts +1 -1
  22. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js +2 -2
  23. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js.map +1 -1
  24. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.d.ts +1 -1
  25. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js +2 -2
  26. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js.map +1 -1
  27. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.d.ts +2 -27
  28. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +1 -1
  29. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
  30. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.d.ts +2 -26
  31. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +2 -2
  32. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
  33. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.d.ts +34 -0
  34. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.js +4 -0
  35. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.js.map +1 -0
  36. package/dist/dist-esm/react-components/src/components/VideoGallery/PinnedParticipantsLayout.d.ts +25 -0
  37. package/dist/dist-esm/react-components/src/components/VideoGallery/PinnedParticipantsLayout.js +62 -0
  38. package/dist/dist-esm/react-components/src/components/VideoGallery/PinnedParticipantsLayout.js.map +1 -0
  39. package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.d.ts +3 -1
  40. package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.js +3 -1
  41. package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.js.map +1 -1
  42. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.d.ts +1 -0
  43. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js +2 -1
  44. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js.map +1 -1
  45. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.d.ts +0 -14
  46. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.js +1 -8
  47. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.js.map +1 -1
  48. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.d.ts +36 -0
  49. package/dist/dist-esm/react-components/src/components/VideoGallery/{videoGalleryUtils.js → utils/videoGalleryLayoutUtils.js} +46 -2
  50. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -0
  51. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +4 -0
  52. package/dist/dist-esm/react-components/src/components/VideoGallery.js +47 -3
  53. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  54. package/dist/dist-esm/react-components/src/components/utils.js +4 -0
  55. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  56. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +6 -0
  57. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
  58. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +22 -1
  59. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +12 -12
  60. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  61. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.d.ts +3 -4
  62. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js +55 -24
  63. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js.map +1 -1
  64. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js +1 -1
  65. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js.map +1 -1
  66. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +27 -5
  67. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  68. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js +1 -1
  69. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js.map +1 -1
  70. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.d.ts +0 -4
  71. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js +0 -8
  72. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js.map +1 -1
  73. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +5 -0
  74. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +9 -0
  75. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  76. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js +1 -11
  77. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js.map +1 -1
  78. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.d.ts +0 -2
  79. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js +0 -15
  80. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js.map +1 -1
  81. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js +26 -3
  82. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js.map +1 -1
  83. package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.js +1 -1
  84. package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.js.map +1 -1
  85. package/package.json +8 -8
  86. package/dist/dist-esm/react-components/src/components/VideoGallery/videoGalleryUtils.d.ts +0 -17
  87. package/dist/dist-esm/react-components/src/components/VideoGallery/videoGalleryUtils.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CallReadinessModal.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/components/CallReadinessModal.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,iDAAiD;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,iDAAiD;AACjD,OAAO,EACL,oCAAoC,EACpC,uBAAuB,EACvB,2BAA2B,EAC3B,cAAc,EACf,4CAAmC;AACpC,iDAAiD;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AACvE,iDAAiD;AACjD,MAAM,kBAAkB,GAAG,EAAE,CAAC,CAAC,6DAA6D;AAE5F,iDAAiD;AACjD;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAclC,EAAe,EAAE;IAChB,MAAM,EACJ,UAAU,EACV,UAAU,EACV,UAAU,EACV,gBAAgB,EAChB,2BAA2B,EAC3B,8BAA8B,EAC9B,iCAAiC,EAClC,GAAG,KAAK,CAAC;IACV,MAAM,uBAAuB,GAAG,GAAS,EAAE;QACzC,kBAAkB;QAClB,2GAA2G;IAC7G,CAAC,CAAC;IAEF,MAAM,SAAS,GACb,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,QAAQ,CAAC;IAE3G,MAAM,KAAK,GAAoC,CAAC,SAAS;QACvD,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,GAAG,EAAE;YACH,iDAAiD;YACjD,IAAI,UAAU,KAAK,QAAQ,IAAI,UAAU,KAAK,QAAQ,EAAE;gBACtD,OAAO,CACL,oBAAC,oCAAoC,IACnC,OAAO,EAAE,KAAK,EACd,sBAAsB,EACpB,iCAAiC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,EAAE,EAAE;gBAEhE,oBAAC,oCAAoC,IACnC,OAAO,EAAE,KAAK,EACd,sBAAsB,EACpB,iCAAiC;wBAC/B,CAAC,CAAC,GAAG,EAAE;4BACH,iCAAiC,CAAC,gBAAgB,CAAC,CAAC;wBACtD,CAAC;wBACH,CAAC,CAAC,SAAS,EAEf,IAAI,EAAC,OAAO,GACZ,CACI,CACT;YAEA,CAAC,2BAA2B,IAAI,KAAK,KAAK,SAAS,IAAI,CACtD,oBAAC,KAAK,IACJ,MAAM,EAAE,2BAA2B,EACnC,UAAU,EAAE,KAAK,EACjB,SAAS,EAAE,GAAG,EAAE;oBACd,8BAA8B,CAAC,KAAK,CAAC,CAAC;gBACxC,CAAC,EACD,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,iBAAiB,EAAE,EAAE,EAAE,IAE/D,KAAK,EAAE,CACF,CACT,CACA,CACJ,CAAC;KACH;AACH,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAgB,EAAE;IAC7D,OAAO,yCAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React from 'react';\n/* @conditional-compile-remove(call-readiness) */\nimport { Modal } from '@fluentui/react';\n/* @conditional-compile-remove(call-readiness) */\nimport {\n CameraAndMicrophoneDomainPermissions,\n CameraDomainPermissions,\n MicrophoneDomainPermissions,\n _DrawerSurface\n} from '@internal/react-components';\n/* @conditional-compile-remove(call-readiness) */\nimport { drawerContainerStyles } from '../styles/CallComposite.styles';\n/* @conditional-compile-remove(call-readiness) */\nconst DRAWER_HIGH_Z_BAND = 99; // setting z index to 99 so that it sit above all components\n\n/* @conditional-compile-remove(call-readiness) */\n/**\n * Modal that guides user through enabling their camera and mic access\n * @private\n */\nexport const CallReadinessModal = (props: {\n mobileView: boolean;\n audioState: PermissionState;\n videoState: PermissionState;\n permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n };\n isPermissionsModalDismissed: boolean;\n setIsPermissionsModalDismissed: (boolean) => void;\n onPermissionsTroubleshootingClick?: (permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n }) => void;\n}): JSX.Element => {\n const {\n mobileView,\n audioState,\n videoState,\n permissionsState,\n isPermissionsModalDismissed,\n setIsPermissionsModalDismissed,\n onPermissionsTroubleshootingClick\n } = props;\n const onLightDismissTriggered = (): void => {\n // do nothing here\n // only way to dismiss this drawer is clicking on allow access which will leads to device permission prompt\n };\n\n const showModal =\n videoState === 'denied' || videoState === 'prompt' || audioState === 'denied' || audioState === 'prompt';\n\n const modal: undefined | (() => JSX.Element) = !showModal\n ? undefined\n : () => {\n // if both video and audio permission are not set\n if (videoState === 'prompt' && audioState === 'prompt') {\n return (\n <CameraAndMicrophoneDomainPermissions\n appName={'app'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n type=\"request\"\n />\n );\n }\n // if audio permission is set up but video is not\n else if (videoState === 'prompt') {\n return (\n <CameraDomainPermissions\n appName={'app'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n onContinueAnywayClick={() => {\n setIsPermissionsModalDismissed(false);\n }}\n type=\"request\"\n />\n );\n }\n // if video permission is set up but audio is not\n else if (audioState === 'prompt') {\n return (\n <MicrophoneDomainPermissions\n appName={'app'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n type=\"request\"\n />\n );\n }\n // if both video and audio are denied\n else if (videoState === 'denied' && audioState === 'denied') {\n return (\n <CameraAndMicrophoneDomainPermissions\n appName={'app'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n type=\"denied\"\n />\n );\n }\n // if only video is denied\n else if (videoState === 'denied') {\n return (\n <CameraDomainPermissions\n appName={'app'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n onContinueAnywayClick={() => {\n setIsPermissionsModalDismissed(false);\n }}\n type=\"denied\"\n />\n );\n }\n // if only audio is denied\n else {\n return (\n <MicrophoneDomainPermissions\n appName={'app'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n type=\"denied\"\n />\n );\n }\n };\n\n if (mobileView && modal !== undefined) {\n return (\n <>\n {isPermissionsModalDismissed && (\n <_DrawerSurface onLightDismiss={onLightDismissTriggered} styles={drawerContainerStyles(DRAWER_HIGH_Z_BAND)}>\n {modal()}\n </_DrawerSurface>\n )}\n </>\n );\n } else if (!mobileView && modal !== undefined) {\n return (\n <Modal\n isOpen={isPermissionsModalDismissed}\n isBlocking={false}\n onDismiss={() => {\n setIsPermissionsModalDismissed(false);\n }}\n overlay={{ styles: { root: { background: 'rgba(0,0,0,0.9)' } } }}\n >\n {modal()}\n </Modal>\n );\n } else {\n return <></>;\n }\n};\n\n/* @conditional-compile-remove(call-readiness) */\n/**\n * Modal that guides user through enabling their camera and mic access\n * This is used when permission API is not supported\n * @private\n */\nexport const CallReadinessModalFallBack = (props: {\n mobileView: boolean;\n cameraPermissionGranted: boolean | undefined;\n microphonePermissionGranted: boolean | undefined;\n checkPermissionModalShowing: boolean;\n permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n };\n isPermissionsModalDismissed: boolean;\n setIsPermissionsModalDismissed: (boolean) => void;\n onPermissionsTroubleshootingClick?: (permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n }) => void;\n}): JSX.Element => {\n const {\n mobileView,\n cameraPermissionGranted,\n microphonePermissionGranted,\n checkPermissionModalShowing,\n permissionsState,\n isPermissionsModalDismissed,\n setIsPermissionsModalDismissed,\n onPermissionsTroubleshootingClick\n } = props;\n const onLightDismissTriggered = (): void => {\n // do nothing here\n // only way to dismiss this drawer is clicking on allow access which will leads to device permission prompt\n };\n\n // When permissions are not set, value is undefined, do nothing here\n // When permissions are set to denied, value is false, show helper screen\n const showModal = cameraPermissionGranted === false || microphonePermissionGranted === false;\n\n const modal: undefined | (() => JSX.Element) = !showModal\n ? undefined\n : () => {\n if (cameraPermissionGranted === false && microphonePermissionGranted === false) {\n return (\n <CameraAndMicrophoneDomainPermissions\n appName={'app'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n type=\"denied\"\n />\n );\n } else if (cameraPermissionGranted === false && microphonePermissionGranted) {\n return (\n <CameraDomainPermissions\n appName={'app'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n onContinueAnywayClick={() => {\n setIsPermissionsModalDismissed(false);\n }}\n type=\"denied\"\n />\n );\n } else {\n return (\n <MicrophoneDomainPermissions\n appName={'app'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n type=\"denied\"\n />\n );\n }\n };\n\n if (mobileView) {\n return (\n <>\n {(checkPermissionModalShowing ||\n microphonePermissionGranted === undefined ||\n cameraPermissionGranted === undefined) && (\n <_DrawerSurface onLightDismiss={onLightDismissTriggered} styles={drawerContainerStyles(DRAWER_HIGH_Z_BAND)}>\n <CameraAndMicrophoneDomainPermissions\n appName={'app'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n type=\"check\"\n />\n </_DrawerSurface>\n )}\n {isPermissionsModalDismissed && !checkPermissionModalShowing && modal !== undefined && (\n <_DrawerSurface onLightDismiss={onLightDismissTriggered} styles={drawerContainerStyles(DRAWER_HIGH_Z_BAND)}>\n {modal()}\n </_DrawerSurface>\n )}\n </>\n );\n } else {\n return (\n <>\n {(checkPermissionModalShowing ||\n microphonePermissionGranted === undefined ||\n cameraPermissionGranted === undefined) && (\n <Modal\n isOpen={isPermissionsModalDismissed}\n isBlocking={false}\n onDismiss={() => {\n setIsPermissionsModalDismissed(false);\n }}\n overlay={{ styles: { root: { background: 'rgba(0,0,0,0.9)' } } }}\n >\n <CameraAndMicrophoneDomainPermissions\n appName={'app'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n type=\"check\"\n />\n </Modal>\n )}\n\n {!checkPermissionModalShowing && modal !== undefined && (\n <Modal\n isOpen={isPermissionsModalDismissed}\n isBlocking={false}\n onDismiss={() => {\n setIsPermissionsModalDismissed(false);\n }}\n overlay={{ styles: { root: { background: 'rgba(0,0,0,0.9)' } } }}\n >\n {modal()}\n </Modal>\n )}\n </>\n );\n }\n};\n\n/**\n * Placeholder for conditional compile\n * @private\n */\nexport const CallReadinessModalPlaceHolder = (): JSX.Element => {\n return <></>;\n};\n\"../../../../../react-components/src\""]}
1
+ {"version":3,"file":"CallReadinessModal.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/components/CallReadinessModal.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,iDAAiD;AACjD,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,iDAAiD;AACjD,OAAO,EACL,oCAAoC,EACpC,uBAAuB,EACvB,2BAA2B,EAC3B,cAAc,EACf,4CAAmC;AACpC,iDAAiD;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAGvE,iDAAiD,CAAC,sDAAsD;AACxG,OAAO,EAAE,SAAS,EAAE,MAAM,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AA2B,EACnC,UAAU,EAAE,KAAK,EACjB,SAAS,EAAE,GAAG,EAAE;oBACd,8BAA8B,CAAC,KAAK,CAAC,CAAC;gBACxC,CAAC,EACD,OAAO,EAAE,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,EAAE,UAAU,EAAE,iBAAiB,EAAE,EAAE,EAAE,IAE/D,KAAK,EAAE,CACF,CACT,CACA,CACJ,CAAC;KACH;AACH,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,GAAgB,EAAE;IAC7D,OAAO,yCAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React from 'react';\n/* @conditional-compile-remove(call-readiness) */\nimport { Modal } from '@fluentui/react';\n/* @conditional-compile-remove(call-readiness) */\nimport {\n CameraAndMicrophoneDomainPermissions,\n CameraDomainPermissions,\n MicrophoneDomainPermissions,\n _DrawerSurface\n} from '@internal/react-components';\n/* @conditional-compile-remove(call-readiness) */\nimport { drawerContainerStyles } from '../styles/CallComposite.styles';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(call-readiness) */ /* @conditional-compile-remove(unsupported-browser) */\nimport { _isSafari } from '../utils';\n/* @conditional-compile-remove(call-readiness) */\nconst DRAWER_HIGH_Z_BAND = 99; // setting z index to 99 so that it sit above all components\n\n/* @conditional-compile-remove(call-readiness) */\n/**\n * Modal that guides user through enabling their camera and mic access\n * @private\n */\nexport const CallReadinessModal = (props: {\n mobileView: boolean;\n permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n };\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo?: EnvironmentInfo;\n isPermissionsModalDismissed: boolean;\n setIsPermissionsModalDismissed: (boolean) => void;\n onPermissionsTroubleshootingClick?: (permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n }) => void;\n}): JSX.Element => {\n const {\n mobileView,\n permissionsState,\n /* @conditional-compile-remove(unsupported-browser) */ environmentInfo,\n isPermissionsModalDismissed,\n setIsPermissionsModalDismissed,\n onPermissionsTroubleshootingClick\n } = props;\n const onLightDismissTriggered = (): void => {\n // do nothing here\n // only way to dismiss this drawer is clicking on allow access which will leads to device permission prompt\n };\n\n // On Safari browser with 2 options: don't allow/never for this website again, when don't allow is clicked, permissionAPI returns prompt and PermissionGranted from calling sdk returns false (the right value)\n const videoState: PermissionState = permissionsState.camera;\n const audioState: PermissionState = permissionsState.microphone;\n\n const showModal =\n videoState === 'denied' || videoState === 'prompt' || audioState === 'denied' || audioState === 'prompt';\n /* @conditional-compile-remove(unsupported-browser) */\n const isSafari = _isSafari(environmentInfo);\n\n const modal: undefined | (() => JSX.Element) = !showModal\n ? undefined\n : () => {\n // if both video and audio permission are not set\n if (videoState === 'prompt' && audioState === 'prompt') {\n return (\n <CameraAndMicrophoneDomainPermissions\n appName={'app'}\n /* @conditional-compile-remove(unsupported-browser) */\n browserHint={isSafari ? 'safari' : 'unset'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n type=\"request\"\n />\n );\n }\n // if audio permission is set up but video is not\n else if (videoState === 'prompt') {\n return (\n <CameraDomainPermissions\n appName={'app'}\n /* @conditional-compile-remove(unsupported-browser) */\n browserHint={isSafari ? 'safari' : 'unset'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n onContinueAnywayClick={() => {\n setIsPermissionsModalDismissed(false);\n }}\n type=\"request\"\n />\n );\n }\n // if video permission is set up but audio is not\n else if (audioState === 'prompt') {\n return (\n <MicrophoneDomainPermissions\n appName={'app'}\n /* @conditional-compile-remove(unsupported-browser) */\n browserHint={isSafari ? 'safari' : 'unset'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n type=\"request\"\n />\n );\n }\n // if both video and audio are denied\n else if (videoState === 'denied' && audioState === 'denied') {\n return (\n <CameraAndMicrophoneDomainPermissions\n appName={'app'}\n /* @conditional-compile-remove(unsupported-browser) */\n browserHint={isSafari ? 'safari' : 'unset'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n type=\"denied\"\n />\n );\n }\n // if only video is denied\n else if (videoState === 'denied') {\n return (\n <CameraDomainPermissions\n appName={'app'}\n /* @conditional-compile-remove(unsupported-browser) */\n browserHint={isSafari ? 'safari' : 'unset'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n onContinueAnywayClick={() => {\n setIsPermissionsModalDismissed(false);\n }}\n type=\"denied\"\n />\n );\n }\n // if only audio is denied\n else {\n return (\n <MicrophoneDomainPermissions\n appName={'app'}\n /* @conditional-compile-remove(unsupported-browser) */\n browserHint={isSafari ? 'safari' : 'unset'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n type=\"denied\"\n />\n );\n }\n };\n\n if (mobileView && modal !== undefined) {\n return (\n <>\n {isPermissionsModalDismissed && (\n <_DrawerSurface onLightDismiss={onLightDismissTriggered} styles={drawerContainerStyles(DRAWER_HIGH_Z_BAND)}>\n {modal()}\n </_DrawerSurface>\n )}\n </>\n );\n } else if (!mobileView && modal !== undefined) {\n return (\n <Modal\n isOpen={isPermissionsModalDismissed}\n isBlocking={false}\n onDismiss={() => {\n setIsPermissionsModalDismissed(false);\n }}\n overlay={{ styles: { root: { background: 'rgba(0,0,0,0.9)' } } }}\n >\n {modal()}\n </Modal>\n );\n } else {\n return <></>;\n }\n};\n\n/* @conditional-compile-remove(call-readiness) */\n/**\n * Modal that guides user through enabling their camera and mic access\n * This is used when permission API is not supported\n * @private\n */\nexport const CallReadinessModalFallBack = (props: {\n mobileView: boolean;\n checkPermissionModalShowing: boolean;\n permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n };\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo?: EnvironmentInfo;\n isPermissionsModalDismissed: boolean;\n setIsPermissionsModalDismissed: (boolean) => void;\n onPermissionsTroubleshootingClick?: (permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n }) => void;\n}): JSX.Element => {\n const {\n mobileView,\n checkPermissionModalShowing,\n permissionsState,\n /* @conditional-compile-remove(unsupported-browser) */ environmentInfo,\n isPermissionsModalDismissed,\n setIsPermissionsModalDismissed,\n onPermissionsTroubleshootingClick\n } = props;\n const onLightDismissTriggered = (): void => {\n // do nothing here\n // only way to dismiss this drawer is clicking on allow access which will leads to device permission prompt\n };\n\n const videoState = permissionsState.camera;\n const audioState = permissionsState.microphone;\n\n // When permissions are not set, do nothing here\n // When permissions are set to denied, show helper screen\n const showModal = videoState === 'denied' || audioState === 'denied';\n\n /* @conditional-compile-remove(unsupported-browser) */\n const isSafari = _isSafari(environmentInfo);\n\n const modal: undefined | (() => JSX.Element) = !showModal\n ? undefined\n : () => {\n if (videoState === 'denied' && audioState === 'denied') {\n return (\n <CameraAndMicrophoneDomainPermissions\n appName={'app'}\n /* @conditional-compile-remove(unsupported-browser) */\n browserHint={isSafari ? 'safari' : 'unset'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n type=\"denied\"\n />\n );\n } else if (videoState === 'denied' && audioState === 'granted') {\n return (\n <CameraDomainPermissions\n appName={'app'}\n /* @conditional-compile-remove(unsupported-browser) */\n browserHint={isSafari ? 'safari' : 'unset'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n onContinueAnywayClick={() => {\n setIsPermissionsModalDismissed(false);\n }}\n type=\"denied\"\n />\n );\n } else {\n return (\n <MicrophoneDomainPermissions\n appName={'app'}\n /* @conditional-compile-remove(unsupported-browser) */\n browserHint={isSafari ? 'safari' : 'unset'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n type=\"denied\"\n />\n );\n }\n };\n\n if (mobileView) {\n return (\n <>\n {(checkPermissionModalShowing || audioState === 'prompt' || videoState === 'prompt') && (\n <_DrawerSurface onLightDismiss={onLightDismissTriggered} styles={drawerContainerStyles(DRAWER_HIGH_Z_BAND)}>\n <CameraAndMicrophoneDomainPermissions\n appName={'app'}\n /* @conditional-compile-remove(unsupported-browser) */\n browserHint={isSafari ? 'safari' : 'unset'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n type=\"check\"\n />\n </_DrawerSurface>\n )}\n {isPermissionsModalDismissed && !checkPermissionModalShowing && modal !== undefined && (\n <_DrawerSurface onLightDismiss={onLightDismissTriggered} styles={drawerContainerStyles(DRAWER_HIGH_Z_BAND)}>\n {modal()}\n </_DrawerSurface>\n )}\n </>\n );\n } else {\n return (\n <>\n {(checkPermissionModalShowing || audioState === 'prompt' || videoState === 'prompt') && (\n <Modal\n isOpen={isPermissionsModalDismissed}\n isBlocking={false}\n onDismiss={() => {\n setIsPermissionsModalDismissed(false);\n }}\n overlay={{ styles: { root: { background: 'rgba(0,0,0,0.9)' } } }}\n >\n <CameraAndMicrophoneDomainPermissions\n appName={'app'}\n /* @conditional-compile-remove(unsupported-browser) */\n browserHint={isSafari ? 'safari' : 'unset'}\n onTroubleshootingClick={\n onPermissionsTroubleshootingClick\n ? () => {\n onPermissionsTroubleshootingClick(permissionsState);\n }\n : undefined\n }\n type=\"check\"\n />\n </Modal>\n )}\n\n {!checkPermissionModalShowing && modal !== undefined && (\n <Modal\n isOpen={isPermissionsModalDismissed}\n isBlocking={false}\n onDismiss={() => {\n setIsPermissionsModalDismissed(false);\n }}\n overlay={{ styles: { root: { background: 'rgba(0,0,0,0.9)' } } }}\n >\n {modal()}\n </Modal>\n )}\n </>\n );\n }\n};\n\n/**\n * Placeholder for conditional compile\n * @private\n */\nexport const CallReadinessModalPlaceHolder = (): JSX.Element => {\n return <></>;\n};\n\"../../../../../react-components/src\""]}
@@ -36,6 +36,6 @@ export const Microphone = (props) => {
36
36
  : {};
37
37
  const styles = useMemo(() => { var _a; return concatButtonBaseStyles((_a = props.styles) !== null && _a !== void 0 ? _a : {}); }, [props.styles]);
38
38
  // tab focus on MicrophoneButton on page load
39
- return (React.createElement(MicrophoneButton, Object.assign({ "data-ui-id": "call-composite-microphone-button" }, microphoneButtonProps, { showLabel: props.displayType !== 'compact', styles: styles }, microphoneButtonStrings, { enableDeviceSelectionMenu: props.splitButtonsForDeviceSelection, disabled: microphoneButtonProps.disabled || props.disabled })));
39
+ return (React.createElement(MicrophoneButton, Object.assign({ autoFocus: true, "data-ui-id": "call-composite-microphone-button" }, microphoneButtonProps, { showLabel: props.displayType !== 'compact', styles: styles }, microphoneButtonStrings, { enableDeviceSelectionMenu: props.splitButtonsForDeviceSelection, disabled: microphoneButtonProps.disabled || props.disabled })));
40
40
  };
41
41
  //# sourceMappingURL=Microphone.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Microphone.js","sourceRoot":"","sources":["../../../../../../../../../react-composites/src/composites/CallComposite/components/buttons/Microphone.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,sBAAsB,EAAE,yDAA6C;AAC9E,OAAO,EAA0B,gBAAgB,EAAE,+CAAmC;AACtF,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CA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AC3B,yBAAyB,EAAE,KAAK,CAAC,8BAA8B,EAC/D,QAAQ,EAAE,qBAAqB,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,IAC1D,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { _isInLobbyOrConnecting } from '@internal/calling-component-bindings';\nimport { ControlBarButtonStyles, MicrophoneButton } from '@internal/react-components';\nimport React, { useMemo } from 'react';\nimport { useLocale } from '../../../localization';\nimport { usePropsFor } from '../../hooks/usePropsFor';\nimport { useSelector } from '../../hooks/useSelector';\nimport { getCallStatus, getLocalMicrophoneEnabled } from '../../selectors/baseSelectors';\nimport { CallControlDisplayType } from '../../types/CallControlOptions';\nimport { concatButtonBaseStyles } from '../../styles/Buttons.styles';\n\n/**\n * @private\n */\nexport const Microphone = (props: {\n displayType?: CallControlDisplayType;\n styles?: ControlBarButtonStyles;\n splitButtonsForDeviceSelection?: boolean;\n disabled?: boolean;\n}): JSX.Element => {\n const microphoneButtonProps = usePropsFor(MicrophoneButton);\n const callStatus = useSelector(getCallStatus);\n const isLocalMicrophoneEnabled = useSelector(getLocalMicrophoneEnabled);\n const strings = useLocale().strings.call;\n\n /**\n * When call is in Lobby, microphone button should be disabled.\n * This is due to to headless limitation where a call can not be muted/unmuted in lobby.\n */\n if (_isInLobbyOrConnecting(callStatus)) {\n microphoneButtonProps.disabled = true;\n // Lobby page should show the microphone status that was set on the local preview/configuration\n // page until the user successfully joins the call.\n microphoneButtonProps.checked = isLocalMicrophoneEnabled;\n }\n const microphoneButtonStrings = _isInLobbyOrConnecting(callStatus)\n ? {\n strings: {\n tooltipOffContent: strings.microphoneToggleInLobbyNotAllowed,\n tooltipOnContent: strings.microphoneToggleInLobbyNotAllowed\n }\n }\n : {};\n const styles = useMemo(() => concatButtonBaseStyles(props.styles ?? {}), [props.styles]);\n\n // tab focus on MicrophoneButton on page load\n return (\n <MicrophoneButton\n data-ui-id=\"call-composite-microphone-button\"\n {...microphoneButtonProps}\n showLabel={props.displayType !== 'compact'}\n styles={styles}\n {...microphoneButtonStrings}\n enableDeviceSelectionMenu={props.splitButtonsForDeviceSelection}\n disabled={microphoneButtonProps.disabled || props.disabled}\n />\n );\n};\n\"../../../../../../calling-component-bindings/src\"\"../../../../../../react-components/src\""]}
1
+ {"version":3,"file":"Microphone.js","sourceRoot":"","sources":["../../../../../../../../../react-composites/src/composites/CallComposite/components/buttons/Microphone.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,sBAAsB,EAAE,yDAA6C;AAC9E,OAAO,EAA0B,gBAAgB,EAAE,+CAAmC;AACtF,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,yBAAyB,EAAE,MAAM,+BAA+B,CAAC;AAEzF,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AAErE;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAK1B,EAAe,EAAE;IAChB,MAAM,qBAAqB,GAAG,WAAW,CAAC,gBAAgB,CAAC,CAAC;IAC5D,MAAM,UAAU,GAAG,WAAW,CAAC,aAAa,CAAC,CAAC;IAC9C,MAAM,wBAAwB,GAAG,WAAW,CAAC,yBAAyB,CAAC,CAAC;IACxE,MAAM,OAAO,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IAEzC;;;OAGG;IACH,IAAI,sBAAsB,CAAC,UAAU,CAAC,EAAE;QACtC,qBAAqB,CAAC,QAAQ,GAAG,IAAI,CAAC;QACtC,+FAA+F;QAC/F,mDAAmD;QACnD,qBAAqB,CAAC,OAAO,GAAG,wBAAwB,CAAC;KAC1D;IACD,MAAM,uBAAuB,GAAG,sBAAsB,CAAC,UAAU,CAAC;QAChE,CAAC,CAAC;YACE,OAAO,EAAE;gBACP,iBAAiB,EAAE,OAAO,CAAC,iCAAiC;gBAC5D,gBAAgB,EAAE,OAAO,CAAC,iCAAiC;aAC5D;SACF;QACH,CAAC,CAAC,EAAE,CAAC;IACP,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,WAAC,OAAA,sBAAsB,CAAC,MAAA,KAAK,CAAC,MAAM,mCAAI,EAAE,CAAC,CAAA,EAAA,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC;IAEzF,6CAA6C;IAC7C,OAAO,CACL,oBAAC,gBAAgB,kBACf,SAAS,sBACE,kCAAkC,IACzC,qBAAqB,IACzB,SAAS,EAAE,KAAK,CAAC,WAAW,KAAK,SAAS,EAC1C,MAAM,EAAE,MAAM,IACV,uBAAuB,IAC3B,yBAAyB,EAAE,KAAK,CAAC,8BAA8B,EAC/D,QAAQ,EAAE,qBAAqB,CAAC,QAAQ,IAAI,KAAK,CAAC,QAAQ,IAC1D,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { _isInLobbyOrConnecting } from '@internal/calling-component-bindings';\nimport { ControlBarButtonStyles, MicrophoneButton } from '@internal/react-components';\nimport React, { useMemo } from 'react';\nimport { useLocale } from '../../../localization';\nimport { usePropsFor } from '../../hooks/usePropsFor';\nimport { useSelector } from '../../hooks/useSelector';\nimport { getCallStatus, getLocalMicrophoneEnabled } from '../../selectors/baseSelectors';\nimport { CallControlDisplayType } from '../../types/CallControlOptions';\nimport { concatButtonBaseStyles } from '../../styles/Buttons.styles';\n\n/**\n * @private\n */\nexport const Microphone = (props: {\n displayType?: CallControlDisplayType;\n styles?: ControlBarButtonStyles;\n splitButtonsForDeviceSelection?: boolean;\n disabled?: boolean;\n}): JSX.Element => {\n const microphoneButtonProps = usePropsFor(MicrophoneButton);\n const callStatus = useSelector(getCallStatus);\n const isLocalMicrophoneEnabled = useSelector(getLocalMicrophoneEnabled);\n const strings = useLocale().strings.call;\n\n /**\n * When call is in Lobby, microphone button should be disabled.\n * This is due to to headless limitation where a call can not be muted/unmuted in lobby.\n */\n if (_isInLobbyOrConnecting(callStatus)) {\n microphoneButtonProps.disabled = true;\n // Lobby page should show the microphone status that was set on the local preview/configuration\n // page until the user successfully joins the call.\n microphoneButtonProps.checked = isLocalMicrophoneEnabled;\n }\n const microphoneButtonStrings = _isInLobbyOrConnecting(callStatus)\n ? {\n strings: {\n tooltipOffContent: strings.microphoneToggleInLobbyNotAllowed,\n tooltipOnContent: strings.microphoneToggleInLobbyNotAllowed\n }\n }\n : {};\n const styles = useMemo(() => concatButtonBaseStyles(props.styles ?? {}), [props.styles]);\n\n // tab focus on MicrophoneButton on page load\n return (\n <MicrophoneButton\n autoFocus\n data-ui-id=\"call-composite-microphone-button\"\n {...microphoneButtonProps}\n showLabel={props.displayType !== 'compact'}\n styles={styles}\n {...microphoneButtonStrings}\n enableDeviceSelectionMenu={props.splitButtonsForDeviceSelection}\n disabled={microphoneButtonProps.disabled || props.disabled}\n />\n );\n};\n\"../../../../../../calling-component-bindings/src\"\"../../../../../../react-components/src\""]}
@@ -48,13 +48,15 @@ export const ConfigurationPage = (props) => {
48
48
  let errorBarProps = usePropsFor(ErrorBar);
49
49
  const adapter = useAdapter();
50
50
  const deviceState = adapter.getState().devices;
51
+ /* @conditional-compile-remove(unsupported-browser) */
52
+ const environmentInfo = adapter.getState().environmentInfo;
51
53
  let disableStartCallButton = !microphonePermissionGranted || ((_a = deviceState.microphones) === null || _a === void 0 ? void 0 : _a.length) === 0;
52
54
  /* @conditional-compile-remove(rooms) */
53
55
  const rolePermissions = _usePermissions();
54
56
  /* @conditional-compile-remove(rooms) */
55
57
  // TODO: move this logic to the error bar selector once role is plumbed from the headless SDK
56
58
  if (!rolePermissions.cameraButton) {
57
- errorBarProps = Object.assign(Object.assign({}, errorBarProps), { activeErrorMessages: errorBarProps.activeErrorMessages.filter((e) => e.type !== 'callCameraAccessDenied') });
59
+ errorBarProps = Object.assign(Object.assign({}, errorBarProps), { activeErrorMessages: errorBarProps.activeErrorMessages.filter((e) => e.type !== 'callCameraAccessDenied' && e.type !== 'callCameraAccessDeniedSafari') });
58
60
  }
59
61
  /* @conditional-compile-remove(rooms) */
60
62
  if (!rolePermissions.microphoneButton) {
@@ -82,8 +84,24 @@ export const ConfigurationPage = (props) => {
82
84
  /* @conditional-compile-remove(call-readiness) */
83
85
  const permissionsState = {
84
86
  // fall back to using cameraPermissionGranted and microphonePermissionGranted if permission API is not supported
85
- camera: videoState && videoState !== 'unsupported' ? videoState : cameraPermissionGranted ? 'granted' : 'denied',
86
- microphone: audioState && audioState !== 'unsupported' ? audioState : microphonePermissionGranted ? 'granted' : 'denied'
87
+ camera: videoState && videoState !== 'unsupported'
88
+ ? cameraPermissionGranted !== false
89
+ ? videoState
90
+ : 'denied'
91
+ : cameraPermissionGranted !== false
92
+ ? cameraPermissionGranted
93
+ ? 'granted'
94
+ : 'prompt'
95
+ : 'denied',
96
+ microphone: audioState && audioState !== 'unsupported'
97
+ ? microphonePermissionGranted !== false
98
+ ? audioState
99
+ : 'denied'
100
+ : microphonePermissionGranted !== false
101
+ ? microphonePermissionGranted
102
+ ? 'granted'
103
+ : 'prompt'
104
+ : 'denied'
87
105
  };
88
106
  /* @conditional-compile-remove(call-readiness) */
89
107
  const networkErrors = errorBarProps.activeErrorMessages.filter((message) => message.type === 'callNetworkQualityLow');
@@ -122,13 +140,17 @@ export const ConfigurationPage = (props) => {
122
140
  videoState &&
123
141
  videoState !== 'unsupported' &&
124
142
  audioState &&
125
- audioState !== 'unsupported' && (React.createElement(CallReadinessModal, { mobileView: mobileView, audioState: audioState, videoState: videoState, permissionsState: permissionsState, isPermissionsModalDismissed: isPermissionsModalDismissed, setIsPermissionsModalDismissed: setIsPermissionsModalDismissed, onPermissionsTroubleshootingClick: onPermissionsTroubleshootingClick })),
143
+ audioState !== 'unsupported' && (React.createElement(CallReadinessModal, { mobileView: mobileView,
144
+ /* @conditional-compile-remove(unsupported-browser) */
145
+ environmentInfo: environmentInfo, permissionsState: permissionsState, isPermissionsModalDismissed: isPermissionsModalDismissed, setIsPermissionsModalDismissed: setIsPermissionsModalDismissed, onPermissionsTroubleshootingClick: onPermissionsTroubleshootingClick })),
126
146
  /* @conditional-compile-remove(call-readiness) */
127
147
  // show the following screen if permission API is not availible (unsupported) and videoState, audioState is assigned values
128
148
  callReadinessOptedIn &&
129
149
  videoState &&
130
150
  audioState &&
131
- (videoState === 'unsupported' || audioState === 'unsupported') && (React.createElement(CallReadinessModalFallBack, { mobileView: mobileView, cameraPermissionGranted: cameraPermissionGranted, microphonePermissionGranted: microphonePermissionGranted, checkPermissionModalShowing: forceShowingCheckPermissions, permissionsState: permissionsState, isPermissionsModalDismissed: isPermissionsModalDismissed, setIsPermissionsModalDismissed: setIsPermissionsModalDismissed, onPermissionsTroubleshootingClick: onPermissionsTroubleshootingClick })),
151
+ (videoState === 'unsupported' || audioState === 'unsupported') && (React.createElement(CallReadinessModalFallBack, { mobileView: mobileView, checkPermissionModalShowing: forceShowingCheckPermissions, permissionsState: permissionsState, isPermissionsModalDismissed: isPermissionsModalDismissed,
152
+ /* @conditional-compile-remove(unsupported-browser) */
153
+ environmentInfo: environmentInfo, setIsPermissionsModalDismissed: setIsPermissionsModalDismissed, onPermissionsTroubleshootingClick: onPermissionsTroubleshootingClick })),
132
154
  React.createElement(Stack, { grow: true, horizontal: !mobileWithPreview, horizontalAlign: mobileWithPreview ? 'stretch' : 'center', verticalAlign: "center", tokens: mobileWithPreview ? configurationStackTokensMobile : configurationStackTokensDesktop },
133
155
  mobileWithPreview && (React.createElement(Stack.Item, null,
134
156
  title,
@@ -1 +1 @@
1
- {"version":3,"file":"ConfigurationPage.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/pages/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EF,MAAM,sBAAsB,GAAG,CAAC,UAAmB,EAAE,SAAmB,EAA2B,EAAE;IACnG,wCAAwC;IACxC,IAAI,SAAS,EAAE;QACb,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,oBAAC,YAAY,IAAC,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,GAAI,CAAC;AACjF,CAAC,CAAC;AAEF,MAAM,iCAAiC,GAAG,CACxC,uBAA4C,EAC5C,UAAwD,EACnC,EAAE;IACvB,iDAAiD;IACjD,OAAO,UAAU,IAAI,UAAU,KAAK,aAAa,CAAC,CAAC,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,uBAAuB,CAAC;IAEvG,OAAO,uBAAuB,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,8BAA8B,GAAG,CACrC,2BAAgD,EAChD,UAAwD,EACnC,EAAE;IACvB,iDAAiD;IACjD,OAAO,UAAU,IAAI,UAAU,KAAK,aAAa,CAAC,CAAC,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,2BAA2B,CAAC;IAE3G,OAAO,2BAA2B,CAAC;AACrC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React from 'react';\n/* @conditional-compile-remove(call-readiness) */\nimport { useState } from 'react';\nimport { useAdaptedSelector } from '../hooks/useAdaptedSelector';\nimport { useHandlers } from '../hooks/useHandlers';\nimport { LocalDeviceSettings } from '../components/LocalDeviceSettings';\nimport { StartCallButton } from '../components/StartCallButton';\nimport { devicePermissionSelector } from '../selectors/devicePermissionSelector';\nimport { useSelector } from '../hooks/useSelector';\nimport { DevicesButton, ErrorBar } from '@internal/react-components';\n/* @conditional-compile-remove(rooms) */\nimport { _usePermissions, _Permissions } from '@internal/react-components';\nimport { getCallingSelector } from '@internal/calling-component-bindings';\nimport { Stack } from '@fluentui/react';\nimport { LocalPreview } from '../components/LocalPreview';\nimport {\n callDetailsStyleDesktop,\n callDetailsStyleMobile,\n configurationStackTokensDesktop,\n configurationStackTokensMobile,\n configurationContainerStyleDesktop,\n configurationContainerStyleMobile,\n selectionContainerStyle,\n startCallButtonContainerStyleDesktop,\n startCallButtonContainerStyleMobile,\n startCallButtonStyleMobile,\n titleContainerStyleDesktop,\n titleContainerStyleMobile,\n callDetailsContainerStylesDesktop\n} from '../styles/CallConfiguration.styles';\nimport { useLocale } from '../../localization';\nimport { bannerNotificationStyles } from '../styles/CallPage.styles';\nimport { usePropsFor } from '../hooks/usePropsFor';\nimport { useAdapter } from '../adapter/CallAdapterProvider';\n/* @conditional-compile-remove(call-readiness) */\nimport { DevicePermissionRestrictions } from '../CallComposite';\nimport { ConfigurationpageErrorBar } from '../components/ConfigurationpageErrorBar';\n/* @conditional-compile-remove(call-readiness) */\nimport { getDevicePermissionState } from '../utils';\n/* @conditional-compile-remove(call-readiness) */\nimport { CallReadinessModal, CallReadinessModalFallBack } from '../components/CallReadinessModal';\n\n/**\n * @private\n */\nexport interface ConfigurationPageProps {\n mobileView: boolean;\n startCallHandler(): void;\n /* @conditional-compile-remove(call-readiness) */\n devicePermissions?: DevicePermissionRestrictions;\n /* @conditional-compile-remove(call-readiness) */\n onPermissionsTroubleshootingClick?: (permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n }) => void;\n /* @conditional-compile-remove(call-readiness) */\n onNetworkingTroubleShootingClick?: () => void;\n /* @conditional-compile-remove(call-readiness) */\n callReadinessOptedIn?: boolean;\n}\n\n/**\n * @private\n */\nexport const ConfigurationPage = (props: ConfigurationPageProps): JSX.Element => {\n const {\n startCallHandler,\n mobileView,\n /* @conditional-compile-remove(call-readiness) */ devicePermissions,\n /* @conditional-compile-remove(call-readiness) */ onPermissionsTroubleshootingClick,\n /* @conditional-compile-remove(call-readiness) */ onNetworkingTroubleShootingClick,\n /* @conditional-compile-remove(call-readiness) */ callReadinessOptedIn = false\n } = props;\n\n const options = useAdaptedSelector(getCallingSelector(DevicesButton));\n const localDeviceSettingsHandlers = useHandlers(LocalDeviceSettings);\n const { video: cameraPermissionGranted, audio: microphonePermissionGranted } = useSelector(devicePermissionSelector);\n /* @conditional-compile-remove(call-readiness) */\n // use permission API to get video and audio permission state\n const [videoState, setVideoState] = useState<PermissionState | 'unsupported' | undefined>(undefined);\n /* @conditional-compile-remove(call-readiness) */\n const [audioState, setAudioState] = useState<PermissionState | 'unsupported' | undefined>(undefined);\n /* @conditional-compile-remove(call-readiness) */\n getDevicePermissionState(setVideoState, setAudioState);\n\n let errorBarProps = usePropsFor(ErrorBar);\n const adapter = useAdapter();\n const deviceState = adapter.getState().devices;\n\n let disableStartCallButton = !microphonePermissionGranted || deviceState.microphones?.length === 0;\n /* @conditional-compile-remove(rooms) */\n const rolePermissions = _usePermissions();\n\n /* @conditional-compile-remove(rooms) */\n // TODO: move this logic to the error bar selector once role is plumbed from the headless SDK\n if (!rolePermissions.cameraButton) {\n errorBarProps = {\n ...errorBarProps,\n activeErrorMessages: errorBarProps.activeErrorMessages.filter((e) => e.type !== 'callCameraAccessDenied')\n };\n }\n /* @conditional-compile-remove(rooms) */\n if (!rolePermissions.microphoneButton) {\n // If user's role permissions do not allow access to the microphone button then DO NOT disable the start call button\n // because microphone device permission is not needed for the user's role\n disableStartCallButton = false;\n }\n\n /* @conditional-compile-remove(call-readiness) */\n // Overrides role permissions if CallCompositeOptions devicePermissions are set\n if (devicePermissions) {\n if (\n ['doNotPrompt', 'optional'].includes(devicePermissions.camera) &&\n ['doNotPrompt', 'optional'].includes(devicePermissions.microphone)\n ) {\n disableStartCallButton = false;\n } else if (devicePermissions.camera === 'required') {\n disableStartCallButton = !cameraPermissionGranted || deviceState.cameras?.length === 0;\n }\n }\n\n const locale = useLocale();\n const title = (\n <Stack.Item className={mobileView ? titleContainerStyleMobile : titleContainerStyleDesktop}>\n {locale.strings.call.configurationPageTitle}\n </Stack.Item>\n );\n\n const callDescription = locale.strings.call.configurationPageCallDetails && (\n <Stack.Item className={mobileView ? callDetailsStyleMobile : callDetailsStyleDesktop}>\n {locale.strings.call.configurationPageCallDetails}\n </Stack.Item>\n );\n\n let mobileWithPreview = mobileView;\n /* @conditional-compile-remove(rooms) */\n mobileWithPreview = mobileWithPreview && rolePermissions.cameraButton;\n\n /* @conditional-compile-remove(call-readiness) */\n const permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n } = {\n // fall back to using cameraPermissionGranted and microphonePermissionGranted if permission API is not supported\n camera: videoState && videoState !== 'unsupported' ? videoState : cameraPermissionGranted ? 'granted' : 'denied',\n microphone:\n audioState && audioState !== 'unsupported' ? audioState : microphonePermissionGranted ? 'granted' : 'denied'\n };\n /* @conditional-compile-remove(call-readiness) */\n const networkErrors = errorBarProps.activeErrorMessages.filter((message) => message.type === 'callNetworkQualityLow');\n\n /* @conditional-compile-remove(call-readiness) */\n const [isPermissionsModalDismissed, setIsPermissionsModalDismissed] = useState(true);\n\n // When permission API is not available, we want to show screen saying checking for access (disappears on its own)\n // then based on permission setting, we show permission denied or nothing\n /* @conditional-compile-remove(call-readiness) */\n const [minimumFallbackTimerElapsed, setMinimumFallbackTimerElapsed] = useState(false);\n /* @conditional-compile-remove(call-readiness) */\n setTimeout(() => {\n setMinimumFallbackTimerElapsed(true);\n }, 2000);\n /* @conditional-compile-remove(call-readiness) */\n const forceShowingCheckPermissions = !minimumFallbackTimerElapsed;\n\n return (\n <Stack className={mobileView ? configurationContainerStyleMobile : configurationContainerStyleDesktop}>\n <Stack styles={bannerNotificationStyles}>\n <ConfigurationpageErrorBar\n /* @conditional-compile-remove(call-readiness) */\n // show trouble shooting error bar when encountering network error/ permission error\n showTroubleShootingErrorBar={\n !cameraPermissionGranted || !microphonePermissionGranted || networkErrors.length > 0\n }\n /* @conditional-compile-remove(call-readiness) */\n permissionsState={permissionsState}\n /* @conditional-compile-remove(call-readiness) */\n onNetworkingTroubleShootingClick={onNetworkingTroubleShootingClick}\n /* @conditional-compile-remove(call-readiness) */\n onPermissionsTroubleshootingClick={onPermissionsTroubleshootingClick}\n errorBarProps={errorBarProps}\n /* @conditional-compile-remove(call-readiness) */\n callReadinessOptedIn={callReadinessOptedIn}\n />\n </Stack>\n {\n /* @conditional-compile-remove(call-readiness) */\n // show the following screen if permission API is availible (not unsupported) and videoState, audioState is assigned values\n callReadinessOptedIn &&\n videoState &&\n videoState !== 'unsupported' &&\n audioState &&\n audioState !== 'unsupported' && (\n <CallReadinessModal\n mobileView={mobileView}\n audioState={audioState}\n videoState={videoState}\n permissionsState={permissionsState}\n isPermissionsModalDismissed={isPermissionsModalDismissed}\n setIsPermissionsModalDismissed={setIsPermissionsModalDismissed}\n onPermissionsTroubleshootingClick={onPermissionsTroubleshootingClick}\n />\n )\n }\n\n {\n /* @conditional-compile-remove(call-readiness) */\n // show the following screen if permission API is not availible (unsupported) and videoState, audioState is assigned values\n callReadinessOptedIn &&\n videoState &&\n audioState &&\n (videoState === 'unsupported' || audioState === 'unsupported') && (\n <CallReadinessModalFallBack\n mobileView={mobileView}\n cameraPermissionGranted={cameraPermissionGranted}\n microphonePermissionGranted={microphonePermissionGranted}\n checkPermissionModalShowing={forceShowingCheckPermissions}\n permissionsState={permissionsState}\n isPermissionsModalDismissed={isPermissionsModalDismissed}\n setIsPermissionsModalDismissed={setIsPermissionsModalDismissed}\n onPermissionsTroubleshootingClick={onPermissionsTroubleshootingClick}\n />\n )\n }\n\n <Stack\n grow\n horizontal={!mobileWithPreview}\n horizontalAlign={mobileWithPreview ? 'stretch' : 'center'}\n verticalAlign=\"center\"\n tokens={mobileWithPreview ? configurationStackTokensMobile : configurationStackTokensDesktop}\n >\n {mobileWithPreview && (\n <Stack.Item>\n {title}\n {callDescription}\n </Stack.Item>\n )}\n {localPreviewTrampoline(\n mobileWithPreview,\n /* @conditional-compile-remove(rooms) */ !rolePermissions.cameraButton\n )}\n <Stack className={mobileView ? undefined : selectionContainerStyle}>\n {!mobileWithPreview && (\n <>\n <Stack.Item styles={callDetailsContainerStylesDesktop}>\n {title}\n {callDescription}\n </Stack.Item>\n <LocalDeviceSettings\n {...options}\n {...localDeviceSettingsHandlers}\n cameraPermissionGranted={cameraPermissionGrantedTrampoline(\n cameraPermissionGranted,\n /* @conditional-compile-remove(call-readiness) */ videoState\n )}\n microphonePermissionGranted={micPermissionGrantedTrampoline(\n microphonePermissionGranted,\n /* @conditional-compile-remove(call-readiness) */ audioState\n )}\n /* @conditional-compile-remove(call-readiness) */\n callReadinessOptedIn={callReadinessOptedIn}\n /* @conditional-compile-remove(call-readiness) */\n onClickEnableDevicePermission={() => {\n setIsPermissionsModalDismissed(true);\n }}\n />\n </>\n )}\n <Stack\n styles={mobileWithPreview ? startCallButtonContainerStyleMobile : startCallButtonContainerStyleDesktop}\n >\n <StartCallButton\n className={mobileWithPreview ? startCallButtonStyleMobile : undefined}\n onClick={startCallHandler}\n disabled={disableStartCallButton}\n />\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n );\n};\n\nconst localPreviewTrampoline = (mobileView: boolean, doNotShow?: boolean): JSX.Element | undefined => {\n /* @conditional-compile-remove(rooms) */\n if (doNotShow) {\n return undefined;\n }\n return <LocalPreview mobileView={mobileView} showDevicesButton={mobileView} />;\n};\n\nconst cameraPermissionGrantedTrampoline = (\n cameraPermissionGranted: boolean | undefined,\n videoState?: PermissionState | 'unsupported' | undefined\n): boolean | undefined => {\n /* @conditional-compile-remove(call-readiness) */\n return videoState && videoState !== 'unsupported' ? videoState === 'granted' : cameraPermissionGranted;\n\n return cameraPermissionGranted;\n};\n\nconst micPermissionGrantedTrampoline = (\n microphonePermissionGranted: boolean | undefined,\n audioState?: PermissionState | 'unsupported' | undefined\n): boolean | undefined => {\n /* @conditional-compile-remove(call-readiness) */\n return audioState && audioState !== 'unsupported' ? audioState === 'granted' : microphonePermissionGranted;\n\n return microphonePermissionGranted;\n};\n\"../../../../../react-components/src\"\"../../../../../calling-component-bindings/src\""]}
1
+ {"version":3,"file":"ConfigurationPage.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/pages/ConfigurationPage.tsx"],"names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C;wBACvC,CAAC,IACD,CACD,CACJ;gBACD,oBAAC,KAAK,IACJ,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC,oCAAoC;oBAEtG,oBAAC,eAAe,IACd,SAAS,EAAE,iBAAiB,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,SAAS,EACrE,OAAO,EAAE,gBAAgB,EACzB,QAAQ,EAAE,sBAAsB,GAChC,CACI,CACF,CACF,CACF,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,sBAAsB,GAAG,CAAC,UAAmB,EAAE,SAAmB,EAA2B,EAAE;IACnG,wCAAwC;IACxC,IAAI,SAAS,EAAE;QACb,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,oBAAC,YAAY,IAAC,UAAU,EAAE,UAAU,EAAE,iBAAiB,EAAE,UAAU,GAAI,CAAC;AACjF,CAAC,CAAC;AAEF,MAAM,iCAAiC,GAAG,CACxC,uBAA4C,EAC5C,UAAwD,EACnC,EAAE;IACvB,iDAAiD;IACjD,OAAO,UAAU,IAAI,UAAU,KAAK,aAAa,CAAC,CAAC,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,uBAAuB,CAAC;IAEvG,OAAO,uBAAuB,CAAC;AACjC,CAAC,CAAC;AAEF,MAAM,8BAA8B,GAAG,CACrC,2BAAgD,EAChD,UAAwD,EACnC,EAAE;IACvB,iDAAiD;IACjD,OAAO,UAAU,IAAI,UAAU,KAAK,aAAa,CAAC,CAAC,CAAC,UAAU,KAAK,SAAS,CAAC,CAAC,CAAC,2BAA2B,CAAC;IAE3G,OAAO,2BAA2B,CAAC;AACrC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React from 'react';\n/* @conditional-compile-remove(call-readiness) */\nimport { useState } from 'react';\nimport { useAdaptedSelector } from '../hooks/useAdaptedSelector';\nimport { useHandlers } from '../hooks/useHandlers';\nimport { LocalDeviceSettings } from '../components/LocalDeviceSettings';\nimport { StartCallButton } from '../components/StartCallButton';\nimport { devicePermissionSelector } from '../selectors/devicePermissionSelector';\nimport { useSelector } from '../hooks/useSelector';\nimport { DevicesButton, ErrorBar } from '@internal/react-components';\n/* @conditional-compile-remove(rooms) */\nimport { _usePermissions, _Permissions } from '@internal/react-components';\nimport { getCallingSelector } from '@internal/calling-component-bindings';\nimport { Stack } from '@fluentui/react';\nimport { LocalPreview } from '../components/LocalPreview';\nimport {\n callDetailsStyleDesktop,\n callDetailsStyleMobile,\n configurationStackTokensDesktop,\n configurationStackTokensMobile,\n configurationContainerStyleDesktop,\n configurationContainerStyleMobile,\n selectionContainerStyle,\n startCallButtonContainerStyleDesktop,\n startCallButtonContainerStyleMobile,\n startCallButtonStyleMobile,\n titleContainerStyleDesktop,\n titleContainerStyleMobile,\n callDetailsContainerStylesDesktop\n} from '../styles/CallConfiguration.styles';\nimport { useLocale } from '../../localization';\nimport { bannerNotificationStyles } from '../styles/CallPage.styles';\nimport { usePropsFor } from '../hooks/usePropsFor';\nimport { useAdapter } from '../adapter/CallAdapterProvider';\n/* @conditional-compile-remove(call-readiness) */\nimport { DevicePermissionRestrictions } from '../CallComposite';\nimport { ConfigurationpageErrorBar } from '../components/ConfigurationpageErrorBar';\n/* @conditional-compile-remove(call-readiness) */\nimport { getDevicePermissionState } from '../utils';\n/* @conditional-compile-remove(call-readiness) */\nimport { CallReadinessModal, CallReadinessModalFallBack } from '../components/CallReadinessModal';\n\n/**\n * @private\n */\nexport interface ConfigurationPageProps {\n mobileView: boolean;\n startCallHandler(): void;\n /* @conditional-compile-remove(call-readiness) */\n devicePermissions?: DevicePermissionRestrictions;\n /* @conditional-compile-remove(call-readiness) */\n onPermissionsTroubleshootingClick?: (permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n }) => void;\n /* @conditional-compile-remove(call-readiness) */\n onNetworkingTroubleShootingClick?: () => void;\n /* @conditional-compile-remove(call-readiness) */\n callReadinessOptedIn?: boolean;\n}\n\n/**\n * @private\n */\nexport const ConfigurationPage = (props: ConfigurationPageProps): JSX.Element => {\n const {\n startCallHandler,\n mobileView,\n /* @conditional-compile-remove(call-readiness) */ devicePermissions,\n /* @conditional-compile-remove(call-readiness) */ onPermissionsTroubleshootingClick,\n /* @conditional-compile-remove(call-readiness) */ onNetworkingTroubleShootingClick,\n /* @conditional-compile-remove(call-readiness) */ callReadinessOptedIn = false\n } = props;\n\n const options = useAdaptedSelector(getCallingSelector(DevicesButton));\n const localDeviceSettingsHandlers = useHandlers(LocalDeviceSettings);\n const { video: cameraPermissionGranted, audio: microphonePermissionGranted } = useSelector(devicePermissionSelector);\n /* @conditional-compile-remove(call-readiness) */\n // use permission API to get video and audio permission state\n const [videoState, setVideoState] = useState<PermissionState | 'unsupported' | undefined>(undefined);\n /* @conditional-compile-remove(call-readiness) */\n const [audioState, setAudioState] = useState<PermissionState | 'unsupported' | undefined>(undefined);\n /* @conditional-compile-remove(call-readiness) */\n getDevicePermissionState(setVideoState, setAudioState);\n\n let errorBarProps = usePropsFor(ErrorBar);\n const adapter = useAdapter();\n const deviceState = adapter.getState().devices;\n /* @conditional-compile-remove(unsupported-browser) */\n const environmentInfo = adapter.getState().environmentInfo;\n\n let disableStartCallButton = !microphonePermissionGranted || deviceState.microphones?.length === 0;\n /* @conditional-compile-remove(rooms) */\n const rolePermissions = _usePermissions();\n\n /* @conditional-compile-remove(rooms) */\n // TODO: move this logic to the error bar selector once role is plumbed from the headless SDK\n if (!rolePermissions.cameraButton) {\n errorBarProps = {\n ...errorBarProps,\n activeErrorMessages: errorBarProps.activeErrorMessages.filter(\n (e) => e.type !== 'callCameraAccessDenied' && e.type !== 'callCameraAccessDeniedSafari'\n )\n };\n }\n /* @conditional-compile-remove(rooms) */\n if (!rolePermissions.microphoneButton) {\n // If user's role permissions do not allow access to the microphone button then DO NOT disable the start call button\n // because microphone device permission is not needed for the user's role\n disableStartCallButton = false;\n }\n\n /* @conditional-compile-remove(call-readiness) */\n // Overrides role permissions if CallCompositeOptions devicePermissions are set\n if (devicePermissions) {\n if (\n ['doNotPrompt', 'optional'].includes(devicePermissions.camera) &&\n ['doNotPrompt', 'optional'].includes(devicePermissions.microphone)\n ) {\n disableStartCallButton = false;\n } else if (devicePermissions.camera === 'required') {\n disableStartCallButton = !cameraPermissionGranted || deviceState.cameras?.length === 0;\n }\n }\n\n const locale = useLocale();\n const title = (\n <Stack.Item className={mobileView ? titleContainerStyleMobile : titleContainerStyleDesktop}>\n {locale.strings.call.configurationPageTitle}\n </Stack.Item>\n );\n\n const callDescription = locale.strings.call.configurationPageCallDetails && (\n <Stack.Item className={mobileView ? callDetailsStyleMobile : callDetailsStyleDesktop}>\n {locale.strings.call.configurationPageCallDetails}\n </Stack.Item>\n );\n\n let mobileWithPreview = mobileView;\n /* @conditional-compile-remove(rooms) */\n mobileWithPreview = mobileWithPreview && rolePermissions.cameraButton;\n\n /* @conditional-compile-remove(call-readiness) */\n const permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n } = {\n // fall back to using cameraPermissionGranted and microphonePermissionGranted if permission API is not supported\n camera:\n videoState && videoState !== 'unsupported'\n ? cameraPermissionGranted !== false\n ? videoState\n : 'denied'\n : cameraPermissionGranted !== false\n ? cameraPermissionGranted\n ? 'granted'\n : 'prompt'\n : 'denied',\n microphone:\n audioState && audioState !== 'unsupported'\n ? microphonePermissionGranted !== false\n ? audioState\n : 'denied'\n : microphonePermissionGranted !== false\n ? microphonePermissionGranted\n ? 'granted'\n : 'prompt'\n : 'denied'\n };\n /* @conditional-compile-remove(call-readiness) */\n const networkErrors = errorBarProps.activeErrorMessages.filter((message) => message.type === 'callNetworkQualityLow');\n\n /* @conditional-compile-remove(call-readiness) */\n const [isPermissionsModalDismissed, setIsPermissionsModalDismissed] = useState(true);\n\n // When permission API is not available, we want to show screen saying checking for access (disappears on its own)\n // then based on permission setting, we show permission denied or nothing\n /* @conditional-compile-remove(call-readiness) */\n const [minimumFallbackTimerElapsed, setMinimumFallbackTimerElapsed] = useState(false);\n /* @conditional-compile-remove(call-readiness) */\n setTimeout(() => {\n setMinimumFallbackTimerElapsed(true);\n }, 2000);\n /* @conditional-compile-remove(call-readiness) */\n const forceShowingCheckPermissions = !minimumFallbackTimerElapsed;\n\n return (\n <Stack className={mobileView ? configurationContainerStyleMobile : configurationContainerStyleDesktop}>\n <Stack styles={bannerNotificationStyles}>\n <ConfigurationpageErrorBar\n /* @conditional-compile-remove(call-readiness) */\n // show trouble shooting error bar when encountering network error/ permission error\n showTroubleShootingErrorBar={\n !cameraPermissionGranted || !microphonePermissionGranted || networkErrors.length > 0\n }\n /* @conditional-compile-remove(call-readiness) */\n permissionsState={permissionsState}\n /* @conditional-compile-remove(call-readiness) */\n onNetworkingTroubleShootingClick={onNetworkingTroubleShootingClick}\n /* @conditional-compile-remove(call-readiness) */\n onPermissionsTroubleshootingClick={onPermissionsTroubleshootingClick}\n errorBarProps={errorBarProps}\n /* @conditional-compile-remove(call-readiness) */\n callReadinessOptedIn={callReadinessOptedIn}\n />\n </Stack>\n {\n /* @conditional-compile-remove(call-readiness) */\n // show the following screen if permission API is availible (not unsupported) and videoState, audioState is assigned values\n callReadinessOptedIn &&\n videoState &&\n videoState !== 'unsupported' &&\n audioState &&\n audioState !== 'unsupported' && (\n <CallReadinessModal\n mobileView={mobileView}\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo={environmentInfo}\n permissionsState={permissionsState}\n isPermissionsModalDismissed={isPermissionsModalDismissed}\n setIsPermissionsModalDismissed={setIsPermissionsModalDismissed}\n onPermissionsTroubleshootingClick={onPermissionsTroubleshootingClick}\n />\n )\n }\n\n {\n /* @conditional-compile-remove(call-readiness) */\n // show the following screen if permission API is not availible (unsupported) and videoState, audioState is assigned values\n callReadinessOptedIn &&\n videoState &&\n audioState &&\n (videoState === 'unsupported' || audioState === 'unsupported') && (\n <CallReadinessModalFallBack\n mobileView={mobileView}\n checkPermissionModalShowing={forceShowingCheckPermissions}\n permissionsState={permissionsState}\n isPermissionsModalDismissed={isPermissionsModalDismissed}\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo={environmentInfo}\n setIsPermissionsModalDismissed={setIsPermissionsModalDismissed}\n onPermissionsTroubleshootingClick={onPermissionsTroubleshootingClick}\n />\n )\n }\n\n <Stack\n grow\n horizontal={!mobileWithPreview}\n horizontalAlign={mobileWithPreview ? 'stretch' : 'center'}\n verticalAlign=\"center\"\n tokens={mobileWithPreview ? configurationStackTokensMobile : configurationStackTokensDesktop}\n >\n {mobileWithPreview && (\n <Stack.Item>\n {title}\n {callDescription}\n </Stack.Item>\n )}\n {localPreviewTrampoline(\n mobileWithPreview,\n /* @conditional-compile-remove(rooms) */ !rolePermissions.cameraButton\n )}\n <Stack className={mobileView ? undefined : selectionContainerStyle}>\n {!mobileWithPreview && (\n <>\n <Stack.Item styles={callDetailsContainerStylesDesktop}>\n {title}\n {callDescription}\n </Stack.Item>\n <LocalDeviceSettings\n {...options}\n {...localDeviceSettingsHandlers}\n cameraPermissionGranted={cameraPermissionGrantedTrampoline(\n cameraPermissionGranted,\n /* @conditional-compile-remove(call-readiness) */ videoState\n )}\n microphonePermissionGranted={micPermissionGrantedTrampoline(\n microphonePermissionGranted,\n /* @conditional-compile-remove(call-readiness) */ audioState\n )}\n /* @conditional-compile-remove(call-readiness) */\n callReadinessOptedIn={callReadinessOptedIn}\n /* @conditional-compile-remove(call-readiness) */\n onClickEnableDevicePermission={() => {\n setIsPermissionsModalDismissed(true);\n }}\n />\n </>\n )}\n <Stack\n styles={mobileWithPreview ? startCallButtonContainerStyleMobile : startCallButtonContainerStyleDesktop}\n >\n <StartCallButton\n className={mobileWithPreview ? startCallButtonStyleMobile : undefined}\n onClick={startCallHandler}\n disabled={disableStartCallButton}\n />\n </Stack>\n </Stack>\n </Stack>\n </Stack>\n );\n};\n\nconst localPreviewTrampoline = (mobileView: boolean, doNotShow?: boolean): JSX.Element | undefined => {\n /* @conditional-compile-remove(rooms) */\n if (doNotShow) {\n return undefined;\n }\n return <LocalPreview mobileView={mobileView} showDevicesButton={mobileView} />;\n};\n\nconst cameraPermissionGrantedTrampoline = (\n cameraPermissionGranted: boolean | undefined,\n videoState?: PermissionState | 'unsupported' | undefined\n): boolean | undefined => {\n /* @conditional-compile-remove(call-readiness) */\n return videoState && videoState !== 'unsupported' ? videoState === 'granted' : cameraPermissionGranted;\n\n return cameraPermissionGranted;\n};\n\nconst micPermissionGrantedTrampoline = (\n microphonePermissionGranted: boolean | undefined,\n audioState?: PermissionState | 'unsupported' | undefined\n): boolean | undefined => {\n /* @conditional-compile-remove(call-readiness) */\n return audioState && audioState !== 'unsupported' ? audioState === 'granted' : microphonePermissionGranted;\n\n return microphonePermissionGranted;\n};\n\"../../../../../react-components/src\"\"../../../../../calling-component-bindings/src\""]}
@@ -47,7 +47,7 @@ export const UnsupportedBrowserPage = (props) => {
47
47
  pageElement = (React.createElement(UnsupportedBrowser, { onTroubleshootingClick: onTroubleshootingClick, strings: unsupportedBrowserStrings }));
48
48
  }
49
49
  else if (!(environmentInfo === null || environmentInfo === void 0 ? void 0 : environmentInfo.isSupportedBrowserVersion)) {
50
- pageElement = (React.createElement(UnsupportedBrowserVersion, { onTroubleshootingClick: onTroubleshootingClick, strings: unsupportedBrowserVersionStrings, onContinueClick: onContinueClick }));
50
+ pageElement = (React.createElement(UnsupportedBrowserVersion, { onTroubleshootingClick: onTroubleshootingClick, strings: unsupportedBrowserVersionStrings, onContinueAnywayClick: onContinueClick }));
51
51
  }
52
52
  else {
53
53
  throw new Error('There was a problem with your environment info');
@@ -1 +1 @@
1
- {"version":3,"file":"UnsupportedBrowser.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAgB,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACtD,sDAAsD;AACtD,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,0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D,IAAI,CAAC,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,mBAAmB,CAAA,EAAE;QACzC,WAAW,GAAG,CACZ,oBAAC,0BAA0B,IACzB,sBAAsB,EAAE,sBAAsB,EAC9C,OAAO,EAAE,iCAAiC,GAC1C,CACH,CAAC;KACH;SAAM,IAAI,CAAC,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,kBAAkB,CAAA,EAAE;QAC/C,WAAW,GAAG,CACZ,oBAAC,kBAAkB,IAAC,sBAAsB,EAAE,sBAAsB,EAAE,OAAO,EAAE,yBAAyB,GAAI,CAC3G,CAAC;KACH;SAAM,IAAI,CAAC,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,yBAAyB,CAAA,EAAE;QACtD,WAAW,GAAG,CACZ,oBAAC,yBAAyB,IACxB,sBAAsB,EAAE,sBAAsB,EAC9C,OAAO,EAAE,gCAAgC,EACzC,eAAe,EAAE,eAAe,GAChC,CACH,CAAC;KACH;SAAM;QACL,MAAM,IAAI,KAAK,CAAC,gDAAgD,CAAC,CAAC;KACnE;IAED,OAAO,oBAAC,KAAK,IAAC,MAAM,EAAE,eAAe,IAAG,WAAW,CAAS,CAAC;AAC/D,CAAC,CAAC;AAEF,MAAM,eAAe,GAAiB;IACpC,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,MAAM;KACnB;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\nimport { IStackStyles, Stack } from '@fluentui/react';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { UnsupportedBrowser, UnsupportedBrowserVersion, UnsupportedOperatingSystem } from '@internal/react-components';\nimport React from 'react';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { useLocale } from '../../localization';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { useAdapter } from '../adapter/CallAdapterProvider';\n\n/**\n * @internal\n */\nexport type UnsupportedBrowserPageProps = {\n onTroubleshootingClick?: () => void;\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo?: EnvironmentInfo;\n};\n\n/**\n *\n * @internal\n */\nexport const UnsupportedBrowserPage = (props: UnsupportedBrowserPageProps): JSX.Element => {\n /* @conditional-compile-remove(unsupported-browser) */\n const { onTroubleshootingClick, environmentInfo } = props;\n /* @conditional-compile-remove(unsupported-browser) */\n const adapter = useAdapter();\n /* @conditional-compile-remove(unsupported-browser) */\n const unsupportedEnvironmentFeature = adapter.getState().features?.unsupportedEnvironment;\n /* @conditional-compile-remove(unsupported-browser) */\n const onContinueClick =\n unsupportedEnvironmentFeature === true\n ? undefined\n : unsupportedEnvironmentFeature === false || unsupportedEnvironmentFeature === undefined\n ? undefined\n : unsupportedEnvironmentFeature.unsupportedBrowserVersionAllowed\n ? () => {\n adapter.allowUnsupportedBrowserVersion();\n }\n : undefined;\n\n /* @conditional-compile-remove(unsupported-browser) */\n const locale = useLocale();\n /* @conditional-compile-remove(unsupported-browser) */\n const unsupportedBrowserStrings = locale.component.strings.UnsupportedBrowser;\n /* @conditional-compile-remove(unsupported-browser) */\n const unsupportedBrowserVersionStrings = locale.component.strings.UnsupportedBrowserVersion;\n /* @conditional-compile-remove(unsupported-browser) */\n const unsupportedOperatingSystemStrings = locale.component.strings.UnsupportedOperatingSystem;\n\n let pageElement: JSX.Element | undefined = <></>;\n /* @conditional-compile-remove(unsupported-browser) */\n if (!environmentInfo?.isSupportedPlatform) {\n pageElement = (\n <UnsupportedOperatingSystem\n onTroubleshootingClick={onTroubleshootingClick}\n strings={unsupportedOperatingSystemStrings}\n />\n );\n } else if (!environmentInfo?.isSupportedBrowser) {\n pageElement = (\n <UnsupportedBrowser onTroubleshootingClick={onTroubleshootingClick} strings={unsupportedBrowserStrings} />\n );\n } else if (!environmentInfo?.isSupportedBrowserVersion) {\n pageElement = (\n <UnsupportedBrowserVersion\n onTroubleshootingClick={onTroubleshootingClick}\n strings={unsupportedBrowserVersionStrings}\n onContinueClick={onContinueClick}\n />\n );\n } else {\n throw new Error('There was a problem with your environment info');\n }\n\n return <Stack styles={containerStyles}>{pageElement}</Stack>;\n};\n\nconst containerStyles: IStackStyles = {\n root: {\n margin: 'auto',\n paddingTop: '3rem'\n }\n};\n\"../../../../../react-components/src\""]}
1
+ {"version":3,"file":"UnsupportedBrowser.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAgB,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACtD,sDAAsD;AACtD,OAAO,EAAE,kBAAkB,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,4CAAmC;AACvH,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,sDAAsD;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,sDAAsD;AACtD,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAW5D;;;GAGG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAkC,EAAe,EAAE;;IACxF,sDAAsD;IACtD,MAAM,EAAE,sBAAsB,EAAE,eAAe,EAAE,GAAG,KAAK,CAAC;IAC1D,sDAAsD;IACtD,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,sDAAsD;IACtD,MAAM,6BAA6B,GAAG,MAAA,OAAO,CAAC,QAAQ,EAAE,CAAC,QAAQ,0CAAE,sBAAsB,CAAC;IAC1F,sDAAsD;IACtD,MAAM,eAAe,GACnB,6BAA6B,KAAK,IAAI;QACpC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,6BAA6B,KAAK,KAAK,IAAI,6BAA6B,KAAK,SAAS;YACxF,CAAC,CAAC,SAAS;YACX,CAAC,CAAC,6BAA6B,CAAC,gCAAgC;gBAChE,CAAC,CAAC,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AW,CAAS,CAAC;AAC/D,CAAC,CAAC;AAEF,MAAM,eAAe,GAAiB;IACpC,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,MAAM;KACnB;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\nimport { IStackStyles, Stack } from '@fluentui/react';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { UnsupportedBrowser, UnsupportedBrowserVersion, UnsupportedOperatingSystem } from '@internal/react-components';\nimport React from 'react';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { useLocale } from '../../localization';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { useAdapter } from '../adapter/CallAdapterProvider';\n\n/**\n * @internal\n */\nexport type UnsupportedBrowserPageProps = {\n onTroubleshootingClick?: () => void;\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo?: EnvironmentInfo;\n};\n\n/**\n *\n * @internal\n */\nexport const UnsupportedBrowserPage = (props: UnsupportedBrowserPageProps): JSX.Element => {\n /* @conditional-compile-remove(unsupported-browser) */\n const { onTroubleshootingClick, environmentInfo } = props;\n /* @conditional-compile-remove(unsupported-browser) */\n const adapter = useAdapter();\n /* @conditional-compile-remove(unsupported-browser) */\n const unsupportedEnvironmentFeature = adapter.getState().features?.unsupportedEnvironment;\n /* @conditional-compile-remove(unsupported-browser) */\n const onContinueClick =\n unsupportedEnvironmentFeature === true\n ? undefined\n : unsupportedEnvironmentFeature === false || unsupportedEnvironmentFeature === undefined\n ? undefined\n : unsupportedEnvironmentFeature.unsupportedBrowserVersionAllowed\n ? () => {\n adapter.allowUnsupportedBrowserVersion();\n }\n : undefined;\n\n /* @conditional-compile-remove(unsupported-browser) */\n const locale = useLocale();\n /* @conditional-compile-remove(unsupported-browser) */\n const unsupportedBrowserStrings = locale.component.strings.UnsupportedBrowser;\n /* @conditional-compile-remove(unsupported-browser) */\n const unsupportedBrowserVersionStrings = locale.component.strings.UnsupportedBrowserVersion;\n /* @conditional-compile-remove(unsupported-browser) */\n const unsupportedOperatingSystemStrings = locale.component.strings.UnsupportedOperatingSystem;\n\n let pageElement: JSX.Element | undefined = <></>;\n /* @conditional-compile-remove(unsupported-browser) */\n if (!environmentInfo?.isSupportedPlatform) {\n pageElement = (\n <UnsupportedOperatingSystem\n onTroubleshootingClick={onTroubleshootingClick}\n strings={unsupportedOperatingSystemStrings}\n />\n );\n } else if (!environmentInfo?.isSupportedBrowser) {\n pageElement = (\n <UnsupportedBrowser onTroubleshootingClick={onTroubleshootingClick} strings={unsupportedBrowserStrings} />\n );\n } else if (!environmentInfo?.isSupportedBrowserVersion) {\n pageElement = (\n <UnsupportedBrowserVersion\n onTroubleshootingClick={onTroubleshootingClick}\n strings={unsupportedBrowserVersionStrings}\n onContinueAnywayClick={onContinueClick}\n />\n );\n } else {\n throw new Error('There was a problem with your environment info');\n }\n\n return <Stack styles={containerStyles}>{pageElement}</Stack>;\n};\n\nconst containerStyles: IStackStyles = {\n root: {\n margin: 'auto',\n paddingTop: '3rem'\n }\n};\n\"../../../../../react-components/src\""]}
@@ -27,8 +27,4 @@ export declare const notificationsContainerStyles: IStackStyles;
27
27
  * @private
28
28
  */
29
29
  export declare const bannerNotificationStyles: IStackStyles;
30
- /**
31
- * @private
32
- */
33
- export declare const callArrangementContainerStyles: IStackStyles;
34
30
  //# sourceMappingURL=CallPage.styles.d.ts.map
@@ -66,12 +66,4 @@ export const bannerNotificationStyles = {
66
66
  pointerEvents: 'auto' // to allow the dismissal or error and warning bars in the notification container
67
67
  }
68
68
  };
69
- /**
70
- * @private
71
- */
72
- export const callArrangementContainerStyles = {
73
- root: {
74
- flexDirection: 'column-reverse' // to allow first initial keyboard focus on ControlBar
75
- }
76
- };
77
69
  //# sourceMappingURL=CallPage.styles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CallPage.styles.js","sourceRoot":"","sources":["../../../../../../../../react-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B;IACxD,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;QACP,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,8BAA8B;QACtC,aAAa,EAAE,MAAM,CAAC,2EAA2E;KAClG;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAiB;IACpD,IAAI,EAAE;QACJ,aAAa,EAAE,MAAM,CAAC,iFAAiF;KACxG;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,8BAA8B,GAAiB;IAC1D,IAAI,EAAE;QACJ,aAAa,EAAE,gBAAgB,CAAC,sDAAsD;KACvF;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { IStackItemStyles, IStackStyles, IStyle, mergeStyles } from '@fluentui/react';\nimport { controlBarContainerStyles } from './CallControls.styles';\n\nconst VIDEO_GALLERY_Z_INDEX = 1;\n// The control bar must be in a higher z-band than the video gallery so the drop shadow appears on top of the video gallery\nconst CONTROL_BAR_Z_INDEX = VIDEO_GALLERY_Z_INDEX + 1;\n// The notification container should be in the highest z-band to ensure it shows on top of all other content.\nconst NOTIFICATION_CONTAINER_Z_INDEX = Math.max(CONTROL_BAR_Z_INDEX, VIDEO_GALLERY_Z_INDEX) + 1;\n\n/**\n * @private\n */\nexport const callControlsContainerStyles = mergeStyles(controlBarContainerStyles, {\n zIndex: CONTROL_BAR_Z_INDEX\n});\n\nconst containerStyle: IStyle = {\n width: '100%',\n position: 'relative',\n minHeight: '13rem' // linked to minimum space allocated to media gallery\n};\n\n/**\n * @private\n */\nexport const containerStyleDesktop = mergeStyles({\n ...containerStyle,\n minWidth: '30rem'\n});\n\n/**\n * @private\n */\nexport const containerStyleMobile = mergeStyles({\n ...containerStyle,\n minWidth: '17.5rem'\n});\n\n/**\n * @private\n */\nexport const galleryParentContainerStyles = (backgroundColor: string): IStackStyles => ({\n root: {\n zIndex: VIDEO_GALLERY_Z_INDEX,\n width: '100%',\n background: backgroundColor\n }\n});\n\n/**\n * @private\n */\nexport const mediaGalleryContainerStyles: IStackItemStyles = {\n root: {\n height: '100%'\n }\n};\n\n/**\n * @private\n */\nexport const notificationsContainerStyles: IStackStyles = {\n root: {\n width: '100%',\n position: 'absolute',\n top: 0,\n left: 0,\n padding: '1rem',\n zIndex: NOTIFICATION_CONTAINER_Z_INDEX,\n pointerEvents: 'none' // to allow the operation of controls underneath the notification container\n }\n};\n\n/**\n * @private\n */\nexport const bannerNotificationStyles: IStackStyles = {\n root: {\n pointerEvents: 'auto' // to allow the dismissal or error and warning bars in the notification container\n }\n};\n\n/**\n * @private\n */\nexport const callArrangementContainerStyles: IStackStyles = {\n root: {\n flexDirection: 'column-reverse' // to allow first initial keyboard focus on ControlBar\n }\n};\n"]}
1
+ {"version":3,"file":"CallPage.styles.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/styles/CallPage.styles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAA0C,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACtF,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAElE,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAChC,2HAA2H;AAC3H,MAAM,mBAAmB,GAAG,qBAAqB,GAAG,CAAC,CAAC;AACtD,6GAA6G;AAC7G,MAAM,8BAA8B,GAAG,IAAI,CAAC,GAAG,CAAC,mBAAmB,EAAE,qBAAqB,CAAC,GAAG,CAAC,CAAC;AAEhG;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,WAAW,CAAC,yBAAyB,EAAE;IAChF,MAAM,EAAE,mBAAmB;CAC5B,CAAC,CAAC;AAEH,MAAM,cAAc,GAAW;IAC7B,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,UAAU;IACpB,SAAS,EAAE,OAAO,CAAC,qDAAqD;CACzE,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,WAAW,iCAC3C,cAAc,KACjB,QAAQ,EAAE,OAAO,IACjB,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,iCAC1C,cAAc,KACjB,QAAQ,EAAE,SAAS,IACnB,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,eAAuB,EAAgB,EAAE,CAAC,CAAC;IACtF,IAAI,EAAE;QACJ,MAAM,EAAE,qBAAqB;QAC7B,KAAK,EAAE,MAAM;QACb,UAAU,EAAE,eAAe;KAC5B;CACF,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAqB;IAC3D,IAAI,EAAE;QACJ,MAAM,EAAE,MAAM;KACf;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAiB;IACxD,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,CAAC;QACN,IAAI,EAAE,CAAC;QACP,OAAO,EAAE,MAAM;QACf,MAAM,EAAE,8BAA8B;QACtC,aAAa,EAAE,MAAM,CAAC,2EAA2E;KAClG;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAiB;IACpD,IAAI,EAAE;QACJ,aAAa,EAAE,MAAM,CAAC,iFAAiF;KACxG;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { IStackItemStyles, IStackStyles, IStyle, mergeStyles } from '@fluentui/react';\nimport { controlBarContainerStyles } from './CallControls.styles';\n\nconst VIDEO_GALLERY_Z_INDEX = 1;\n// The control bar must be in a higher z-band than the video gallery so the drop shadow appears on top of the video gallery\nconst CONTROL_BAR_Z_INDEX = VIDEO_GALLERY_Z_INDEX + 1;\n// The notification container should be in the highest z-band to ensure it shows on top of all other content.\nconst NOTIFICATION_CONTAINER_Z_INDEX = Math.max(CONTROL_BAR_Z_INDEX, VIDEO_GALLERY_Z_INDEX) + 1;\n\n/**\n * @private\n */\nexport const callControlsContainerStyles = mergeStyles(controlBarContainerStyles, {\n zIndex: CONTROL_BAR_Z_INDEX\n});\n\nconst containerStyle: IStyle = {\n width: '100%',\n position: 'relative',\n minHeight: '13rem' // linked to minimum space allocated to media gallery\n};\n\n/**\n * @private\n */\nexport const containerStyleDesktop = mergeStyles({\n ...containerStyle,\n minWidth: '30rem'\n});\n\n/**\n * @private\n */\nexport const containerStyleMobile = mergeStyles({\n ...containerStyle,\n minWidth: '17.5rem'\n});\n\n/**\n * @private\n */\nexport const galleryParentContainerStyles = (backgroundColor: string): IStackStyles => ({\n root: {\n zIndex: VIDEO_GALLERY_Z_INDEX,\n width: '100%',\n background: backgroundColor\n }\n});\n\n/**\n * @private\n */\nexport const mediaGalleryContainerStyles: IStackItemStyles = {\n root: {\n height: '100%'\n }\n};\n\n/**\n * @private\n */\nexport const notificationsContainerStyles: IStackStyles = {\n root: {\n width: '100%',\n position: 'absolute',\n top: 0,\n left: 0,\n padding: '1rem',\n zIndex: NOTIFICATION_CONTAINER_Z_INDEX,\n pointerEvents: 'none' // to allow the operation of controls underneath the notification container\n }\n};\n\n/**\n * @private\n */\nexport const bannerNotificationStyles: IStackStyles = {\n root: {\n pointerEvents: 'auto' // to allow the dismissal or error and warning bars in the notification container\n }\n};\n"]}
@@ -76,5 +76,10 @@ export declare const getDevicePermissionState: (setVideoState: (state: Permissio
76
76
  * @private
77
77
  */
78
78
  export declare const isValidIdentifier: (identifier: CommunicationIdentifier) => boolean;
79
+ /**
80
+ * Check if we are using safari browser
81
+ * @private
82
+ */
83
+ export declare const _isSafari: (environmentInfo: undefined | /* @conditional-compile-remove(unsupported-browser) */ EnvironmentInfo) => boolean;
79
84
  export {};
80
85
  //# sourceMappingURL=Utils.d.ts.map
@@ -260,4 +260,13 @@ export const isValidIdentifier = (identifier) => {
260
260
  isMicrosoftTeamsUserIdentifier(identifier) ||
261
261
  isUnknownIdentifier(identifier));
262
262
  };
263
+ /**
264
+ * Check if we are using safari browser
265
+ * @private
266
+ */
267
+ export const _isSafari = (environmentInfo) => {
268
+ /* @conditional-compile-remove(unsupported-browser) */
269
+ return (environmentInfo === null || environmentInfo === void 0 ? void 0 : environmentInfo.environment.browser) === 'safari';
270
+ return /^((?!chrome|android|crios|fxios).)*safari/i.test(navigator.userAgent);
271
+ };
263
272
  //# sourceMappingURL=Utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/utils/Utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAuC,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,EAAE,sDAA6C;AAGvG,OAAO,EAEL,6BAA6B,EAC7B,8BAA8B,EAC9B,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,6BAA6B,CAAC;AAMrC,MAAM,oCAAoC,GAAG,IAAI,CAAC;AAClD,MAAM,wBAAwB,GAAG,MAAM,CAAC;AACxC,MAAM,2BAA2B,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,wBAAwB,CAAC,CAAC;AAC3E,wCAAwC;AACxC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AACrC,wCAAwC;AACxC,MAAM,kCAAkC,GAAG,IAAI,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAuB,EAAW,EAAE;IAC7D,IAAI,KAAK,CAAC,IAAI,EAAE;QACd,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,eAAe,KAAK,OAAO,CAAC,CAAC;QACjG,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,CAAC,UAAU,CAAC;QACnC,8BAA8B,CAAC,UAAU,CAAC;QAC1C,mBAAmB,CAAC,UAAU,CAAC,CAChC,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CallAdapterState, CallCompositePage, END_CALL_PAGES } from '../adapter/CallAdapter';\nimport { _isInCall, _isPreviewOn, _isInLobbyOrConnecting } from '@internal/calling-component-bindings';\nimport { CallControlOptions } from '../types/CallControlOptions';\nimport { CallState } from '@internal/calling-stateful-client';\nimport {\n CommunicationIdentifier,\n isCommunicationUserIdentifier,\n isMicrosoftTeamsUserIdentifier,\n isPhoneNumberIdentifier,\n isUnknownIdentifier\n} from '@azure/communication-common';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { CallAdapterOptionalFeatures } from '../adapter/CallAdapter';\n\nconst ACCESS_DENIED_TEAMS_MEETING_SUB_CODE = 5854;\nconst REMOTE_PSTN_USER_HUNG_UP = 560000;\nconst REMOVED_FROM_CALL_SUB_CODES = [5000, 5300, REMOTE_PSTN_USER_HUNG_UP];\n/* @conditional-compile-remove(rooms) */\nconst ROOM_NOT_FOUND_SUB_CODE = 5751;\n/* @conditional-compile-remove(rooms) */\nconst DENIED_PERMISSION_TO_ROOM_SUB_CODE = 5828;\n\n/**\n * @private\n */\nexport const isCameraOn = (state: CallAdapterState): boolean => {\n if (state.call) {\n const stream = state.call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video');\n return !!stream;\n } else {\n if (state.devices.selectedCamera) {\n const previewOn = _isPreviewOn(state.devices);\n return previewOn;\n }\n }\n return false;\n};\n\n/**\n * Reduce the set of call controls visible on mobile.\n * For example do not show screenshare button.\n *\n * @private\n */\nexport const reduceCallControlsForMobile = (\n callControlOptions: CallControlOptions | boolean | undefined\n): CallControlOptions | false => {\n if (callControlOptions === false) {\n return false;\n }\n\n // Ensure call controls a valid object.\n const reduceCallControlOptions = callControlOptions === true ? {} : callControlOptions || {};\n\n // Set to compressed mode when composite is optimized for mobile\n reduceCallControlOptions.displayType = 'compact';\n\n // Do not show screen share button when composite is optimized for mobile unless the developer\n // has explicitly opted in.\n if (reduceCallControlOptions.screenShareButton !== true) {\n reduceCallControlOptions.screenShareButton = false;\n }\n\n return reduceCallControlOptions;\n};\n\nenum CallEndReasons {\n LEFT_CALL,\n ACCESS_DENIED,\n REMOVED_FROM_CALL,\n ROOM_NOT_FOUND,\n DENIED_PERMISSION_TO_ROOM\n}\n\nconst getCallEndReason = (call: CallState): CallEndReasons => {\n const remoteParticipantsEndedArray = Array.from(Object.values(call.remoteParticipantsEnded));\n /**\n * Handle the special case in a PSTN call where removing the last user kicks the caller out of the call.\n * The code and subcode is the same as when a user is removed from a teams interop call.\n * Hence, we look at the last remote participant removed to determine if the last participant removed was a phone number.\n * If yes, the caller was kicked out of the call, but we need to show them that they left the call.\n * Note: This check will only work for 1:1 PSTN Calls. The subcode is different for 1:N PSTN calls, and we do not need to handle that case.\n */\n if (\n remoteParticipantsEndedArray.length === 1 &&\n isPhoneNumberIdentifier(remoteParticipantsEndedArray[0].identifier) &&\n call.callEndReason?.subCode !== REMOTE_PSTN_USER_HUNG_UP\n ) {\n return CallEndReasons.LEFT_CALL;\n }\n\n if (call.callEndReason?.subCode && call.callEndReason.subCode === ACCESS_DENIED_TEAMS_MEETING_SUB_CODE) {\n return CallEndReasons.ACCESS_DENIED;\n }\n\n if (call.callEndReason?.subCode && REMOVED_FROM_CALL_SUB_CODES.includes(call.callEndReason.subCode)) {\n return CallEndReasons.REMOVED_FROM_CALL;\n }\n\n /* @conditional-compile-remove(rooms) */\n if (call.callEndReason?.subCode && call.callEndReason.subCode === ROOM_NOT_FOUND_SUB_CODE) {\n return CallEndReasons.ROOM_NOT_FOUND;\n }\n\n /* @conditional-compile-remove(rooms) */\n if (call.callEndReason?.subCode && call.callEndReason.subCode === DENIED_PERMISSION_TO_ROOM_SUB_CODE) {\n return CallEndReasons.DENIED_PERMISSION_TO_ROOM;\n }\n\n if (call.callEndReason) {\n // No error codes match, assume the user simply left the call regularly\n return CallEndReasons.LEFT_CALL;\n }\n\n throw new Error('No matching call end reason');\n};\n\n/**\n * type definition for conditional-compilation\n */\ntype GetCallCompositePageFunction = ((\n call: CallState | undefined,\n previousCall: CallState | undefined\n) => CallCompositePage) &\n /* @conditional-compile-remove(unsupported-browser) */ ((\n call: CallState | undefined,\n previousCall: CallState | undefined,\n unsupportedBrowserInfo?: {\n environmentInfo?: EnvironmentInfo;\n features?: CallAdapterOptionalFeatures;\n unsupportedBrowserVersionOptedIn?: boolean;\n }\n ) => CallCompositePage);\n/**\n * Get the current call composite page based on the current call composite state\n *\n * @param Call - The current call state\n * @param previousCall - The state of the most recent previous call that has ended.\n *\n * @remarks - The previousCall state is needed to determine if the call has ended.\n * When the call ends a new call object is created, and so we must lookback at the\n * previous call state to understand how the call has ended. If there is no previous\n * call we know that this is a fresh call and can display the configuration page.\n *\n * @private\n */\nexport const getCallCompositePage: GetCallCompositePageFunction = (\n call,\n previousCall?,\n unsupportedBrowserInfo?\n): CallCompositePage => {\n /* @conditional-compile-remove(unsupported-browser) */\n if (\n isUnsupportedEnvironment(\n unsupportedBrowserInfo.features,\n unsupportedBrowserInfo.environmentInfo,\n unsupportedBrowserInfo.unsupportedBrowserVersionOptedIn\n )\n ) {\n return 'unsupportedEnvironment';\n }\n\n if (call) {\n // Must check for ongoing call *before* looking at any previous calls.\n // If the composite completes one call and joins another, the previous calls\n // will be populated, but not relevant for determining the page.\n\n // `_isInLobbyOrConnecting` needs to be checked first because `_isInCall` also returns true when call is in lobby.\n if (_isInLobbyOrConnecting(call?.state)) {\n return 'lobby';\n // `LocalHold` needs to be checked before `isInCall` since it is also a state that's considered in call.\n } else if (call?.state === 'LocalHold') {\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n return 'hold';\n return 'call';\n } else if (_isInCall(call?.state)) {\n return 'call';\n } else {\n // When the call object has been constructed after clicking , but before 'connecting' has been\n // set on the call object, we continue to show the configuration screen.\n // The call object does not correctly reflect local device state until `call.state` moves to `connecting`.\n // Moving to the 'lobby' page too soon leads to components that depend on the `call` object to show incorrect\n // transitional state.\n return 'configuration';\n }\n }\n\n if (previousCall) {\n const reason = getCallEndReason(previousCall);\n /* @conditional-compile-remove(rooms) */\n switch (reason) {\n case CallEndReasons.ROOM_NOT_FOUND:\n return 'roomNotFound';\n case CallEndReasons.DENIED_PERMISSION_TO_ROOM:\n return 'deniedPermissionToRoom';\n }\n switch (reason) {\n case CallEndReasons.ACCESS_DENIED:\n return 'accessDeniedTeamsMeeting';\n case CallEndReasons.REMOVED_FROM_CALL:\n return 'removedFromCall';\n case CallEndReasons.LEFT_CALL:\n if (previousCall.diagnostics.network.latest.noNetwork) {\n return 'joinCallFailedDueToNoNetwork';\n }\n return 'leftCall';\n }\n }\n\n // No call state - show starting page (configuration)\n return 'configuration';\n};\n\n/** @private */\nexport const IsCallEndedPage = (\n /**\n * Explicitly listing the pages of this function intentionally.\n * This protects against adding a new composite page that should be marked as an callEndedPage.\n * EndCallPages are used to trigger onCallEnded events so this could easily be missed.\n * When you add a new composite page this will throw a compiler error. If this new page is an\n * EndCallPage ensure you update the END_CALL_PAGES. Afterwards update the `page` parameter\n * type below to allow your new page, i.e. add `| <your new page>\n */\n page:\n | 'accessDeniedTeamsMeeting'\n | 'call'\n | 'configuration'\n | 'joinCallFailedDueToNoNetwork'\n | 'leftCall'\n | 'lobby'\n | 'removedFromCall'\n | /* @conditional-compile-remove(PSTN-calls) */ 'hold'\n | /* @conditional-compile-remove(rooms) */ 'roomNotFound'\n | /* @conditional-compile-remove(rooms) */ 'deniedPermissionToRoom'\n | /* @conditional-compile-remove(unsupported-browser) */ 'unsupportedEnvironment'\n): boolean => END_CALL_PAGES.includes(page);\n\n/**\n * Creates a new call control options object and sets the correct values for disabling\n * the buttons provided in the `disabledControls` array.\n * Returns a new object without changing the original object.\n * @param callControlOptions options for the call control component that need to be modified.\n * @param disabledControls An array of controls to disable.\n * @returns a copy of callControlOptions with disabledControls disabled\n * @private\n */\nexport const disableCallControls = (\n callControlOptions: CallControlOptions | boolean | undefined,\n disabledControls: (keyof CallControlOptions)[]\n): CallControlOptions | boolean | undefined => {\n if (callControlOptions === false) {\n return false;\n }\n // Ensure we clone the prop if it is an object to ensure we do not mutate the original prop.\n let newOptions = (callControlOptions instanceof Object ? { ...callControlOptions } : callControlOptions) ?? {};\n if (newOptions === true || newOptions === undefined) {\n newOptions = disabledControls.reduce((acc, key) => {\n acc[key] = { disabled: true };\n return acc;\n }, {});\n } else {\n disabledControls.forEach((key) => {\n if (newOptions[key] !== false) {\n newOptions[key] = { disabled: true };\n }\n });\n }\n return newOptions;\n};\n\n/**\n * Check if a disabled object is provided for a button and returns if the button is disabled.\n * A button is only disabled if is explicitly set to disabled.\n *\n * @param option\n * @returns whether a button is disabled\n * @private\n */\nexport const isDisabled = (option: boolean | { disabled: boolean } | undefined): boolean => {\n if (option === undefined || typeof option === 'boolean') {\n return false;\n }\n\n return option.disabled;\n};\n\n/* @conditional-compile-remove(call-readiness) */\n/**\n *\n * This function uses permission API to determine if device permission state is granted, prompt or denied\n * @returns whether device permission state is granted, prompt or denied\n * If permission API is not supported on this browser, do nothing and log out error\n * @private\n */\nexport const getDevicePermissionState = (\n setVideoState: (state: PermissionState | 'unsupported') => void,\n setAudioState: (state: PermissionState | 'unsupported') => void\n): void => {\n navigator.permissions\n .query({ name: 'camera' as PermissionName })\n .then((result) => {\n setVideoState(result.state);\n })\n .catch(() => {\n setVideoState('unsupported');\n });\n\n navigator.permissions\n .query({ name: 'microphone' as PermissionName })\n .then((result) => {\n setAudioState(result.state);\n })\n .catch(() => {\n setAudioState('unsupported');\n });\n};\n/* @conditional-compile-remove(unsupported-browser) */\nconst isUnsupportedEnvironment = (\n features?: CallAdapterOptionalFeatures,\n environmentInfo?: EnvironmentInfo,\n unsupportedBrowserVersionOptedIn?: boolean\n): boolean => {\n return !!(\n features?.unsupportedEnvironment &&\n (environmentInfo?.isSupportedBrowser === false ||\n (environmentInfo?.isSupportedBrowserVersion === false && !unsupportedBrowserVersionOptedIn) ||\n environmentInfo?.isSupportedPlatform === false)\n );\n};\n\n/**\n * Check if an object is identifier.\n *\n * @param identifier\n * @returns whether an identifier is one of identifier types (for runtime validation)\n * @private\n */\nexport const isValidIdentifier = (identifier: CommunicationIdentifier): boolean => {\n return (\n isCommunicationUserIdentifier(identifier) ||\n isPhoneNumberIdentifier(identifier) ||\n isMicrosoftTeamsUserIdentifier(identifier) ||\n isUnknownIdentifier(identifier)\n );\n};\n\"../../../../../calling-component-bindings/src\"\"../../../../../calling-stateful-client/src\""]}
1
+ {"version":3,"file":"Utils.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/utils/Utils.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAuC,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,EAAE,sDAA6C;AAGvG,OAAO,EAEL,6BAA6B,EAC7B,8BAA8B,EAC9B,uBAAuB,EACvB,mBAAmB,EACpB,MAAM,6BAA6B,CAAC;AAMrC,MAAM,oCAAoC,GAAG,IAAI,CAAC;AAClD,MAAM,wBAAwB,GAAG,MAAM,CAAC;AACxC,MAAM,2BAA2B,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,wBAAwB,CAAC,CAAC;AAC3E,wCAAwC;AACxC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AACrC,wCAAwC;AACxC,MAAM,kCAAkC,GAAG,IAAI,CAAC;AAEhD;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAuB,EAAW,EAAE;IAC7D,IAAI,KAAK,CAAC,IAAI,EAAE;QACd,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,iBA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AAM,iBAAiB,GAAG,CAAC,UAAmC,EAAW,EAAE;IAChF,OAAO,CACL,6BAA6B,CAAC,UAAU,CAAC;QACzC,uBAAuB,CAAC,UAAU,CAAC;QACnC,8BAA8B,CAAC,UAAU,CAAC;QAC1C,mBAAmB,CAAC,UAAU,CAAC,CAChC,CAAC;AACJ,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,eAAmG,EAC1F,EAAE;IACX,sDAAsD;IACtD,OAAO,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,WAAW,CAAC,OAAO,MAAK,QAAQ,CAAC;IACzD,OAAO,4CAA4C,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;AAChF,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CallAdapterState, CallCompositePage, END_CALL_PAGES } from '../adapter/CallAdapter';\nimport { _isInCall, _isPreviewOn, _isInLobbyOrConnecting } from '@internal/calling-component-bindings';\nimport { CallControlOptions } from '../types/CallControlOptions';\nimport { CallState } from '@internal/calling-stateful-client';\nimport {\n CommunicationIdentifier,\n isCommunicationUserIdentifier,\n isMicrosoftTeamsUserIdentifier,\n isPhoneNumberIdentifier,\n isUnknownIdentifier\n} from '@azure/communication-common';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { CallAdapterOptionalFeatures } from '../adapter/CallAdapter';\n\nconst ACCESS_DENIED_TEAMS_MEETING_SUB_CODE = 5854;\nconst REMOTE_PSTN_USER_HUNG_UP = 560000;\nconst REMOVED_FROM_CALL_SUB_CODES = [5000, 5300, REMOTE_PSTN_USER_HUNG_UP];\n/* @conditional-compile-remove(rooms) */\nconst ROOM_NOT_FOUND_SUB_CODE = 5751;\n/* @conditional-compile-remove(rooms) */\nconst DENIED_PERMISSION_TO_ROOM_SUB_CODE = 5828;\n\n/**\n * @private\n */\nexport const isCameraOn = (state: CallAdapterState): boolean => {\n if (state.call) {\n const stream = state.call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video');\n return !!stream;\n } else {\n if (state.devices.selectedCamera) {\n const previewOn = _isPreviewOn(state.devices);\n return previewOn;\n }\n }\n return false;\n};\n\n/**\n * Reduce the set of call controls visible on mobile.\n * For example do not show screenshare button.\n *\n * @private\n */\nexport const reduceCallControlsForMobile = (\n callControlOptions: CallControlOptions | boolean | undefined\n): CallControlOptions | false => {\n if (callControlOptions === false) {\n return false;\n }\n\n // Ensure call controls a valid object.\n const reduceCallControlOptions = callControlOptions === true ? {} : callControlOptions || {};\n\n // Set to compressed mode when composite is optimized for mobile\n reduceCallControlOptions.displayType = 'compact';\n\n // Do not show screen share button when composite is optimized for mobile unless the developer\n // has explicitly opted in.\n if (reduceCallControlOptions.screenShareButton !== true) {\n reduceCallControlOptions.screenShareButton = false;\n }\n\n return reduceCallControlOptions;\n};\n\nenum CallEndReasons {\n LEFT_CALL,\n ACCESS_DENIED,\n REMOVED_FROM_CALL,\n ROOM_NOT_FOUND,\n DENIED_PERMISSION_TO_ROOM\n}\n\nconst getCallEndReason = (call: CallState): CallEndReasons => {\n const remoteParticipantsEndedArray = Array.from(Object.values(call.remoteParticipantsEnded));\n /**\n * Handle the special case in a PSTN call where removing the last user kicks the caller out of the call.\n * The code and subcode is the same as when a user is removed from a teams interop call.\n * Hence, we look at the last remote participant removed to determine if the last participant removed was a phone number.\n * If yes, the caller was kicked out of the call, but we need to show them that they left the call.\n * Note: This check will only work for 1:1 PSTN Calls. The subcode is different for 1:N PSTN calls, and we do not need to handle that case.\n */\n if (\n remoteParticipantsEndedArray.length === 1 &&\n isPhoneNumberIdentifier(remoteParticipantsEndedArray[0].identifier) &&\n call.callEndReason?.subCode !== REMOTE_PSTN_USER_HUNG_UP\n ) {\n return CallEndReasons.LEFT_CALL;\n }\n\n if (call.callEndReason?.subCode && call.callEndReason.subCode === ACCESS_DENIED_TEAMS_MEETING_SUB_CODE) {\n return CallEndReasons.ACCESS_DENIED;\n }\n\n if (call.callEndReason?.subCode && REMOVED_FROM_CALL_SUB_CODES.includes(call.callEndReason.subCode)) {\n return CallEndReasons.REMOVED_FROM_CALL;\n }\n\n /* @conditional-compile-remove(rooms) */\n if (call.callEndReason?.subCode && call.callEndReason.subCode === ROOM_NOT_FOUND_SUB_CODE) {\n return CallEndReasons.ROOM_NOT_FOUND;\n }\n\n /* @conditional-compile-remove(rooms) */\n if (call.callEndReason?.subCode && call.callEndReason.subCode === DENIED_PERMISSION_TO_ROOM_SUB_CODE) {\n return CallEndReasons.DENIED_PERMISSION_TO_ROOM;\n }\n\n if (call.callEndReason) {\n // No error codes match, assume the user simply left the call regularly\n return CallEndReasons.LEFT_CALL;\n }\n\n throw new Error('No matching call end reason');\n};\n\n/**\n * type definition for conditional-compilation\n */\ntype GetCallCompositePageFunction = ((\n call: CallState | undefined,\n previousCall: CallState | undefined\n) => CallCompositePage) &\n /* @conditional-compile-remove(unsupported-browser) */ ((\n call: CallState | undefined,\n previousCall: CallState | undefined,\n unsupportedBrowserInfo?: {\n environmentInfo?: EnvironmentInfo;\n features?: CallAdapterOptionalFeatures;\n unsupportedBrowserVersionOptedIn?: boolean;\n }\n ) => CallCompositePage);\n/**\n * Get the current call composite page based on the current call composite state\n *\n * @param Call - The current call state\n * @param previousCall - The state of the most recent previous call that has ended.\n *\n * @remarks - The previousCall state is needed to determine if the call has ended.\n * When the call ends a new call object is created, and so we must lookback at the\n * previous call state to understand how the call has ended. If there is no previous\n * call we know that this is a fresh call and can display the configuration page.\n *\n * @private\n */\nexport const getCallCompositePage: GetCallCompositePageFunction = (\n call,\n previousCall?,\n unsupportedBrowserInfo?\n): CallCompositePage => {\n /* @conditional-compile-remove(unsupported-browser) */\n if (\n isUnsupportedEnvironment(\n unsupportedBrowserInfo.features,\n unsupportedBrowserInfo.environmentInfo,\n unsupportedBrowserInfo.unsupportedBrowserVersionOptedIn\n )\n ) {\n return 'unsupportedEnvironment';\n }\n\n if (call) {\n // Must check for ongoing call *before* looking at any previous calls.\n // If the composite completes one call and joins another, the previous calls\n // will be populated, but not relevant for determining the page.\n\n // `_isInLobbyOrConnecting` needs to be checked first because `_isInCall` also returns true when call is in lobby.\n if (_isInLobbyOrConnecting(call?.state)) {\n return 'lobby';\n // `LocalHold` needs to be checked before `isInCall` since it is also a state that's considered in call.\n } else if (call?.state === 'LocalHold') {\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n return 'hold';\n return 'call';\n } else if (_isInCall(call?.state)) {\n return 'call';\n } else {\n // When the call object has been constructed after clicking , but before 'connecting' has been\n // set on the call object, we continue to show the configuration screen.\n // The call object does not correctly reflect local device state until `call.state` moves to `connecting`.\n // Moving to the 'lobby' page too soon leads to components that depend on the `call` object to show incorrect\n // transitional state.\n return 'configuration';\n }\n }\n\n if (previousCall) {\n const reason = getCallEndReason(previousCall);\n /* @conditional-compile-remove(rooms) */\n switch (reason) {\n case CallEndReasons.ROOM_NOT_FOUND:\n return 'roomNotFound';\n case CallEndReasons.DENIED_PERMISSION_TO_ROOM:\n return 'deniedPermissionToRoom';\n }\n switch (reason) {\n case CallEndReasons.ACCESS_DENIED:\n return 'accessDeniedTeamsMeeting';\n case CallEndReasons.REMOVED_FROM_CALL:\n return 'removedFromCall';\n case CallEndReasons.LEFT_CALL:\n if (previousCall.diagnostics.network.latest.noNetwork) {\n return 'joinCallFailedDueToNoNetwork';\n }\n return 'leftCall';\n }\n }\n\n // No call state - show starting page (configuration)\n return 'configuration';\n};\n\n/** @private */\nexport const IsCallEndedPage = (\n /**\n * Explicitly listing the pages of this function intentionally.\n * This protects against adding a new composite page that should be marked as an callEndedPage.\n * EndCallPages are used to trigger onCallEnded events so this could easily be missed.\n * When you add a new composite page this will throw a compiler error. If this new page is an\n * EndCallPage ensure you update the END_CALL_PAGES. Afterwards update the `page` parameter\n * type below to allow your new page, i.e. add `| <your new page>\n */\n page:\n | 'accessDeniedTeamsMeeting'\n | 'call'\n | 'configuration'\n | 'joinCallFailedDueToNoNetwork'\n | 'leftCall'\n | 'lobby'\n | 'removedFromCall'\n | /* @conditional-compile-remove(PSTN-calls) */ 'hold'\n | /* @conditional-compile-remove(rooms) */ 'roomNotFound'\n | /* @conditional-compile-remove(rooms) */ 'deniedPermissionToRoom'\n | /* @conditional-compile-remove(unsupported-browser) */ 'unsupportedEnvironment'\n): boolean => END_CALL_PAGES.includes(page);\n\n/**\n * Creates a new call control options object and sets the correct values for disabling\n * the buttons provided in the `disabledControls` array.\n * Returns a new object without changing the original object.\n * @param callControlOptions options for the call control component that need to be modified.\n * @param disabledControls An array of controls to disable.\n * @returns a copy of callControlOptions with disabledControls disabled\n * @private\n */\nexport const disableCallControls = (\n callControlOptions: CallControlOptions | boolean | undefined,\n disabledControls: (keyof CallControlOptions)[]\n): CallControlOptions | boolean | undefined => {\n if (callControlOptions === false) {\n return false;\n }\n // Ensure we clone the prop if it is an object to ensure we do not mutate the original prop.\n let newOptions = (callControlOptions instanceof Object ? { ...callControlOptions } : callControlOptions) ?? {};\n if (newOptions === true || newOptions === undefined) {\n newOptions = disabledControls.reduce((acc, key) => {\n acc[key] = { disabled: true };\n return acc;\n }, {});\n } else {\n disabledControls.forEach((key) => {\n if (newOptions[key] !== false) {\n newOptions[key] = { disabled: true };\n }\n });\n }\n return newOptions;\n};\n\n/**\n * Check if a disabled object is provided for a button and returns if the button is disabled.\n * A button is only disabled if is explicitly set to disabled.\n *\n * @param option\n * @returns whether a button is disabled\n * @private\n */\nexport const isDisabled = (option: boolean | { disabled: boolean } | undefined): boolean => {\n if (option === undefined || typeof option === 'boolean') {\n return false;\n }\n\n return option.disabled;\n};\n\n/* @conditional-compile-remove(call-readiness) */\n/**\n *\n * This function uses permission API to determine if device permission state is granted, prompt or denied\n * @returns whether device permission state is granted, prompt or denied\n * If permission API is not supported on this browser, do nothing and log out error\n * @private\n */\nexport const getDevicePermissionState = (\n setVideoState: (state: PermissionState | 'unsupported') => void,\n setAudioState: (state: PermissionState | 'unsupported') => void\n): void => {\n navigator.permissions\n .query({ name: 'camera' as PermissionName })\n .then((result) => {\n setVideoState(result.state);\n })\n .catch(() => {\n setVideoState('unsupported');\n });\n\n navigator.permissions\n .query({ name: 'microphone' as PermissionName })\n .then((result) => {\n setAudioState(result.state);\n })\n .catch(() => {\n setAudioState('unsupported');\n });\n};\n/* @conditional-compile-remove(unsupported-browser) */\nconst isUnsupportedEnvironment = (\n features?: CallAdapterOptionalFeatures,\n environmentInfo?: EnvironmentInfo,\n unsupportedBrowserVersionOptedIn?: boolean\n): boolean => {\n return !!(\n features?.unsupportedEnvironment &&\n (environmentInfo?.isSupportedBrowser === false ||\n (environmentInfo?.isSupportedBrowserVersion === false && !unsupportedBrowserVersionOptedIn) ||\n environmentInfo?.isSupportedPlatform === false)\n );\n};\n\n/**\n * Check if an object is identifier.\n *\n * @param identifier\n * @returns whether an identifier is one of identifier types (for runtime validation)\n * @private\n */\nexport const isValidIdentifier = (identifier: CommunicationIdentifier): boolean => {\n return (\n isCommunicationUserIdentifier(identifier) ||\n isPhoneNumberIdentifier(identifier) ||\n isMicrosoftTeamsUserIdentifier(identifier) ||\n isUnknownIdentifier(identifier)\n );\n};\n\n/**\n * Check if we are using safari browser\n * @private\n */\nexport const _isSafari = (\n environmentInfo: undefined | /* @conditional-compile-remove(unsupported-browser) */ EnvironmentInfo\n): boolean => {\n /* @conditional-compile-remove(unsupported-browser) */\n return environmentInfo?.environment.browser === 'safari';\n return /^((?!chrome|android|crios|fxios).)*safari/i.test(navigator.userAgent);\n};\n\"../../../../../calling-component-bindings/src\"\"../../../../../calling-stateful-client/src\""]}
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
- import React, { useEffect, useMemo } from 'react';
3
+ import React, { useMemo } from 'react';
4
4
  import { CallAdapterProvider } from '../CallComposite/adapter/CallAdapterProvider';
5
5
  import { PeopleButton } from './PeopleButton';
6
6
  import { concatStyleSets, mergeStyles, mergeStyleSets, Stack, useTheme } from '@fluentui/react';
@@ -8,7 +8,6 @@ import { controlBarContainerStyles } from '../CallComposite/styles/CallControls.
8
8
  import { callControlsContainerStyles } from '../CallComposite/styles/CallPage.styles';
9
9
  import { useCallWithChatCompositeStrings } from './hooks/useCallWithChatCompositeStrings';
10
10
  import { ChatButtonWithUnreadMessagesBadge } from './ChatButtonWithUnreadMessagesBadge';
11
- import { ControlBarButton } from "../../../../react-components/src";
12
11
  import { ControlBar } from "../../../../react-components/src";
13
12
  import { Microphone } from '../CallComposite/components/buttons/Microphone';
14
13
  import { Camera } from '../CallComposite/components/buttons/Camera';
@@ -20,7 +19,6 @@ import { CUSTOM_BUTTON_OPTIONS, generateCustomCallWithChatControlBarButton, onFe
20
19
  /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
21
20
  import { DesktopMoreButton } from './components/DesktopMoreButton';
22
21
  import { isDisabled } from '../CallComposite/utils';
23
- import { hiddenAutoFocusButtonStyles } from './styles/CallWithChatCompositeStyles';
24
22
  const inferCallWithChatControlOptions = (mobileView, callWithChatControls) => {
25
23
  if (callWithChatControls === false) {
26
24
  return false;
@@ -42,13 +40,6 @@ const inferCallWithChatControlOptions = (mobileView, callWithChatControls) => {
42
40
  */
43
41
  export const CallWithChatControlBar = (props) => {
44
42
  var _a, _b;
45
- useEffect(() => {
46
- var _a;
47
- // On mount, button used for initial focus is hidden to prevent screen readers from announcing the initial focus
48
- if (document.querySelector('[data-ui-id=call-with-chat-autofocus-hidden-button]') === document.activeElement) {
49
- (_a = document.activeElement) === null || _a === void 0 ? void 0 : _a.setAttribute('hidden', 'true');
50
- }
51
- }, []);
52
43
  const theme = useTheme();
53
44
  const callWithChatStrings = useCallWithChatCompositeStrings();
54
45
  const options = inferCallWithChatControlOptions(props.mobileView, props.callControls);
@@ -89,7 +80,6 @@ export const CallWithChatControlBar = (props) => {
89
80
  React.createElement(Stack.Item, { grow: true },
90
81
  React.createElement(CallAdapterProvider, { adapter: props.callAdapter },
91
82
  React.createElement(Stack, { horizontalAlign: "center" },
92
- React.createElement(ControlBarButton, { autoFocus: true, ariaHidden: true, "data-ui-id": 'call-with-chat-autofocus-hidden-button', styles: hiddenAutoFocusButtonStyles, tabIndex: -1 }),
93
83
  React.createElement(Stack.Item, null,
94
84
  React.createElement(ControlBar, { layout: "horizontal", styles: centerContainerStyles },
95
85
  isEnabled(options.microphoneButton) && (React.createElement(Microphone, { displayType: options.displayType, styles: commonButtonStyles, splitButtonsForDeviceSelection: !props.mobileView,