@azure/communication-react 1.14.0-alpha-202402290012 → 1.14.0-alpha-202403010014
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/communication-react.d.ts +1 -1
- package/dist/dist-cjs/communication-react/index.js +109 -43
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/common.d.ts +5 -0
- package/dist/dist-esm/acs-ui-common/src/common.js +7 -0
- package/dist/dist-esm/acs-ui-common/src/common.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/index.d.ts +1 -1
- package/dist/dist-esm/acs-ui-common/src/index.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js +4 -4
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.js +1 -1
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ImageOverlay.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/ImageOverlay.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Survey/TagsSurvey/TagsSurvey.js +4 -4
- package/dist/dist-esm/react-components/src/components/Survey/TagsSurvey/TagsSurvey.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils.d.ts +0 -6
- package/dist/dist-esm/react-components/src/components/utils.js +0 -8
- package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/utils.js +2 -2
- package/dist/dist-esm/react-components/src/localization/locales/utils.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +3 -7
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.js +3 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +15 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/TrackCapabilityChangedNotifications.js +9 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/TrackCapabilityChangedNotifications.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +8 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js +6 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js +3 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.d.ts +10 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.js +5 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/CaptionLanguageSettingsDrawer.d.ts +21 -0
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/CaptionLanguageSettingsDrawer.js +43 -0
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/CaptionLanguageSettingsDrawer.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +4 -3
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageSettingsDrawer.d.ts +21 -0
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/{CaptionSettingsDrawer.js → SpokenLanguageSettingsDrawer.js} +4 -3
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageSettingsDrawer.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/MoreButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Survey.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Survey.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/styles/Survey.styles.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/styles/Survey.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/utils.js +5 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/CaptionSettingsDrawer.d.ts +0 -21
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/CaptionSettingsDrawer.js.map +0 -1
@@ -44,9 +44,9 @@ export class CallingSoundSubscriber {
|
|
44
44
|
this.onCallStateChanged();
|
45
45
|
}
|
46
46
|
unsubscribeAll() {
|
47
|
-
var _a;
|
48
|
-
this.call.off('stateChanged', this.onCallStateChanged);
|
49
|
-
if ((
|
47
|
+
var _a, _b;
|
48
|
+
(_a = this.call) === null || _a === void 0 ? void 0 : _a.off('stateChanged', this.onCallStateChanged);
|
49
|
+
if ((_b = this.soundsLoaded) === null || _b === void 0 ? void 0 : _b.callRingingSound) {
|
50
50
|
this.soundsLoaded.callRingingSound.pause();
|
51
51
|
}
|
52
52
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CallingSoundSubscriber.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,iDAAiD;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAStE,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAE/B,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAEnC;;GAEG;AACH,MAAM,OAAO,sBAAsB;IAKjC,YAAY,IAAgB,EAAE,MAAkC,EAAE,MAAsB;QAShF,uBAAkB,GAAG,GAAS,EAAE;YACtC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;;gBAChC,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,KAAI,MAAA,IAAI,CAAC,YAAY,0CAAE,gBAAgB,CAAA,EAAE,CAAC;oBACrF,IAAI,CAAC,YAAY,CAAC,gBAA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U,CAAC,MAAM,CAAC,CAAC;YAC5C,IAAI,CAAC,wBAAwB,EAAE,CAAC;QAClC,CAAC;IACH,CAAC;IA0BO,wBAAwB;QAC9B,IAAI,CAAC,kBAAkB,EAAE,CAAC;IAC5B,CAAC;IAEM,cAAc;;QACnB,IAAI,CAAC,IAAI,
|
1
|
+
{"version":3,"file":"CallingSoundSubscriber.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,iDAAiD;AACjD,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAStE,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAE/B,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,qBAAqB,GAAG,IAAI,CAAC;AAEnC;;GAEG;AACH,MAAM,OAAO,sBAAsB;IAKjC,YAAY,IAAgB,EAAE,MAAkC,EAAE,MAAsB;QAShF,uBAAkB,GAAG,GAAS,EAAE;YACtC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,cAAc,EAAE,GAAG,EAAE;;gBAChC,IAAI,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,KAAI,MAAA,IAAI,CAAC,YAAY,0CAAE,gBAAgB,CAAA,EAAE,CAAC;oBACrF,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,IAAI,GAAG,IAAI,CAAC;oBAC/C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,CAAC;gBACrD,CAAC;gBACD,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,MAAM,CAAC,KAAI,MAAA,IAAI,CAAC,YAAY,0CAAE,gBAAgB,CAAA,EAAE,CAAC;oBACtF,IAAI,CAAC,YAAY,CAAC,gBAAgB,CAAC,IAAI,GAAG,KAAK,CAAC;oB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iDAAiD;IACjD,IACE,MAAM;QACN,MAAM,CAAC,MAAM,IAAI,CAAC;QAClB,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QACnC,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,IAAI,CAAC,KAAK,KAAK,YAAY,CAAC,EACzD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;SAAM,CAAC;QACN,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CallCommon } from '@azure/communication-calling';\nimport { CallingSounds } from './CallAdapter';\n/* @conditional-compile-remove(calling-sounds) */\nimport { isPhoneNumberIdentifier } from '@azure/communication-common';\nimport { CommunicationIdentifier } from '@azure/communication-common';\n\ntype CallingSoundsLoaded = {\n callEndedSound?: HTMLAudioElement;\n callRingingSound?: HTMLAudioElement;\n callBusySound?: HTMLAudioElement;\n};\n\nconst CALL_REJECTED_CODE = 603;\n\nconst CALL_ENDED_CODE = 0;\nconst CALL_TRANSFER_SUBCODE = 7015;\n\n/**\n * @private\n */\nexport class CallingSoundSubscriber {\n private call: CallCommon;\n private soundsLoaded?: CallingSoundsLoaded;\n private callee: CommunicationIdentifier[] | undefined;\n\n constructor(call: CallCommon, callee?: CommunicationIdentifier[], sounds?: CallingSounds) {\n this.call = call;\n this.callee = callee;\n if (sounds) {\n this.soundsLoaded = this.loadSounds(sounds);\n this.subscribeCallSoundEvents();\n }\n }\n\n private onCallStateChanged = (): void => {\n this.call.on('stateChanged', () => {\n if (shouldPlayRinging(this.call, this.callee) && this.soundsLoaded?.callRingingSound) {\n this.soundsLoaded.callRingingSound.loop = true;\n this.playSound(this.soundsLoaded.callRingingSound);\n }\n if (!shouldPlayRinging(this.call, this.callee) && this.soundsLoaded?.callRingingSound) {\n this.soundsLoaded.callRingingSound.loop = false;\n this.soundsLoaded.callRingingSound.pause();\n }\n if (this.call.state === 'Disconnected') {\n if (this.soundsLoaded?.callBusySound && this.call.callEndReason?.code === CALL_REJECTED_CODE) {\n this.playSound(this.soundsLoaded.callBusySound);\n } else if (\n this.soundsLoaded?.callEndedSound &&\n this.call.callEndReason?.code === CALL_ENDED_CODE &&\n this.call.callEndReason?.subCode !== CALL_TRANSFER_SUBCODE\n ) {\n this.playSound(this.soundsLoaded.callEndedSound);\n }\n }\n });\n };\n\n private subscribeCallSoundEvents(): void {\n this.onCallStateChanged();\n }\n\n public unsubscribeAll(): void {\n this.call?.off('stateChanged', this.onCallStateChanged);\n if (this.soundsLoaded?.callRingingSound) {\n this.soundsLoaded.callRingingSound.pause();\n }\n }\n\n private loadSounds(sounds?: CallingSounds): CallingSoundsLoaded | undefined {\n let callEndedSound;\n if (sounds?.callEnded) {\n callEndedSound = new Audio(sounds?.callEnded?.url);\n callEndedSound.preload = 'auto';\n }\n let callRingingSound;\n if (sounds?.callRinging) {\n callRingingSound = new Audio(sounds?.callRinging?.url);\n callRingingSound.preload = 'auto';\n }\n let callBusySound;\n if (sounds?.callBusy) {\n callBusySound = new Audio(sounds?.callBusy?.url);\n callBusySound.preload = 'auto';\n }\n return {\n callEndedSound,\n callRingingSound,\n callBusySound\n };\n }\n\n private playSound(sound: HTMLAudioElement): void {\n sound.play().catch((e) => {\n console.error(e, 'Failed to play sound, check loader config to make sure it is correct');\n });\n }\n}\n\n/**\n * Helper function to allow the calling sound subscriber to determine when to play the ringing\n * sound when making an outbound call.\n */\nconst shouldPlayRinging = (call: CallCommon, callee?: CommunicationIdentifier[]): boolean => {\n /* @conditional-compile-remove(calling-sounds) */\n if (\n callee &&\n callee.length >= 1 &&\n !isPhoneNumberIdentifier(callee[0]) &&\n (call.state === 'Ringing' || call.state === 'Connecting')\n ) {\n return true;\n } else {\n return false;\n }\n return false;\n};\n"]}
|
@@ -13,7 +13,7 @@ export declare const CallReadinessModal: (props: {
|
|
13
13
|
};
|
14
14
|
environmentInfo?: EnvironmentInfo | undefined;
|
15
15
|
isPermissionsModalDismissed: boolean;
|
16
|
-
setIsPermissionsModalDismissed: (
|
16
|
+
setIsPermissionsModalDismissed: (dismissedState: boolean) => void;
|
17
17
|
onPermissionsTroubleshootingClick?: ((permissionsState: {
|
18
18
|
camera: PermissionState;
|
19
19
|
microphone: PermissionState;
|
@@ -34,7 +34,7 @@ export declare const CallReadinessModalFallBack: (props: {
|
|
34
34
|
modalLayerHostId: string;
|
35
35
|
environmentInfo?: EnvironmentInfo | undefined;
|
36
36
|
isPermissionsModalDismissed: boolean;
|
37
|
-
setIsPermissionsModalDismissed: (
|
37
|
+
setIsPermissionsModalDismissed: (dismissedState: boolean) => void;
|
38
38
|
onPermissionsTroubleshootingClick?: ((permissionsState: {
|
39
39
|
camera: PermissionState;
|
40
40
|
microphone: PermissionState;
|
@@ -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,EACL,kCAAkC,EAClC,qBAAqB,EACrB,yBAAyB,EACzB,cAAc,EACf,4CAAmC;AACpC,iDAAiD;AACjD,OAAO,EAAE,WAAW,EAAE,4CAAmC;AACzD,iDAAiD;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAGvE,iDAAiD,CAAC,sDAAsD;AACxG,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,iDAAiD;AACjD,MAAM,kBAAkB,GAAG,EAAE,CAAC,CAAC,6DAA6D;AAE5F,iDAAiD;AACjD;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAelC,EAAe,EAAE;IAChB,MAAM,EACJ,UAAU,EACV,gBAAgB;IAChB,sDAAsD,CAAC,eAAe,EACtE,2BAA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the MIT License.\n\nimport React from 'react';\n/* @conditional-compile-remove(call-readiness) */\nimport {\n CameraAndMicrophoneSitePermissions,\n CameraSitePermissions,\n MicrophoneSitePermissions,\n _DrawerSurface\n} from '@internal/react-components';\n/* @conditional-compile-remove(call-readiness) */\nimport { _ModalClone } 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 modalLayerHostId: string;\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 <CameraAndMicrophoneSitePermissions\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 kind=\"request\"\n />\n );\n }\n // if audio permission is set up but video is not\n else if (videoState === 'prompt') {\n return (\n <CameraSitePermissions\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 kind=\"request\"\n />\n );\n }\n // if video permission is set up but audio is not\n else if (audioState === 'prompt') {\n return (\n <MicrophoneSitePermissions\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 kind=\"request\"\n />\n );\n }\n // if both video and audio are denied\n else if (videoState === 'denied' && audioState === 'denied') {\n return (\n <CameraAndMicrophoneSitePermissions\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 kind=\"denied\"\n />\n );\n }\n // if only video is denied\n else if (videoState === 'denied') {\n return (\n <CameraSitePermissions\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 kind=\"denied\"\n />\n );\n }\n // if only audio is denied\n else {\n return (\n <MicrophoneSitePermissions\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 kind=\"denied\"\n />\n );\n }\n };\n\n if (mobileView && modal !== undefined) {\n return (\n <>\n {isPermissionsModalDismissed && (\n <_DrawerSurface\n disableMaxHeight={true}\n onLightDismiss={onLightDismissTriggered}\n styles={drawerContainerStyles(DRAWER_HIGH_Z_BAND)}\n >\n {modal()}\n </_DrawerSurface>\n )}\n </>\n );\n } else if (!mobileView && modal !== undefined) {\n return (\n <_ModalClone\n styles={{\n root: { position: 'unset' },\n main: { position: 'absolute', left: '50%', top: '50%', transform: 'translate(-50%, -50%)' }\n }}\n layerProps={{ hostId: props.modalLayerHostId }}\n isOpen={isPermissionsModalDismissed}\n isBlocking={false}\n onDismiss={() => {\n setIsPermissionsModalDismissed(false);\n }}\n overlay={{ styles: { root: { background: 'rgba(0,0,0,0.4)' } } }}\n >\n {modal()}\n </_ModalClone>\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 modalLayerHostId: string;\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 <CameraAndMicrophoneSitePermissions\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 kind=\"denied\"\n />\n );\n } else if (videoState === 'denied' && audioState === 'granted') {\n return (\n <CameraSitePermissions\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 kind=\"denied\"\n />\n );\n } else {\n return (\n <MicrophoneSitePermissions\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 kind=\"denied\"\n />\n );\n }\n };\n\n if (mobileView) {\n return (\n <>\n {(checkPermissionModalShowing || audioState === 'prompt' || videoState === 'prompt') && (\n <_DrawerSurface\n disableMaxHeight={true}\n onLightDismiss={onLightDismissTriggered}\n styles={drawerContainerStyles(DRAWER_HIGH_Z_BAND)}\n >\n <CameraAndMicrophoneSitePermissions\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 kind=\"check\"\n />\n </_DrawerSurface>\n )}\n {isPermissionsModalDismissed && !checkPermissionModalShowing && modal !== undefined && (\n <_DrawerSurface\n disableMaxHeight={true}\n onLightDismiss={onLightDismissTriggered}\n styles={drawerContainerStyles(DRAWER_HIGH_Z_BAND)}\n >\n {modal()}\n </_DrawerSurface>\n )}\n </>\n );\n } else {\n return (\n <>\n {(checkPermissionModalShowing || audioState === 'prompt' || videoState === 'prompt') && (\n <_ModalClone\n styles={{\n root: { position: 'unset' },\n main: { position: 'absolute', left: '50%', top: '50%', transform: 'translate(-50%, -50%)' }\n }}\n layerProps={{ hostId: props.modalLayerHostId }}\n isOpen={isPermissionsModalDismissed}\n isBlocking={false}\n onDismiss={() => {\n setIsPermissionsModalDismissed(false);\n }}\n overlay={{ styles: { root: { background: 'rgba(0,0,0,0.4)' } } }}\n >\n <CameraAndMicrophoneSitePermissions\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 kind=\"check\"\n />\n </_ModalClone>\n )}\n\n {!checkPermissionModalShowing && modal !== undefined && (\n <_ModalClone\n styles={{\n root: { position: 'unset' },\n main: { position: 'absolute', left: '50%', top: '50%', transform: 'translate(-50%, -50%)' }\n }}\n layerProps={{ hostId: props.modalLayerHostId }}\n isOpen={isPermissionsModalDismissed}\n isBlocking={false}\n onDismiss={() => {\n setIsPermissionsModalDismissed(false);\n }}\n overlay={{ styles: { root: { background: 'rgba(0,0,0,0.4)' } } }}\n >\n {modal()}\n </_ModalClone>\n )}\n </>\n );\n }\n};\n\n/**\n * Placeholder for conditional compile\n * @private\n */\nexport const CallReadinessModalPlaceHolder = (): JSX.Element => {\n return <></>;\n};\n"]}
|
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,EACL,kCAAkC,EAClC,qBAAqB,EACrB,yBAAyB,EACzB,cAAc,EACf,4CAAmC;AACpC,iDAAiD;AACjD,OAAO,EAAE,WAAW,EAAE,4CAAmC;AACzD,iDAAiD;AACjD,OAAO,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAGvE,iDAAiD,CAAC,sDAAsD;AACxG,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AACrC,iDAAiD;AACjD,MAAM,kBAAkB,GAAG,EAAE,CAAC,CAAC,6DAA6D;AAE5F,iDAAiD;AACjD;;;GAGG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAelC,EAAe,EAAE;IAChB,MAAM,EACJ,UAAU,EACV,gBAAgB;IAChB,sDAAsD,CAAC,eAAe,EACtE,2BAA2B,EAC3B,8BAA8B,EAC9B,iCAAiC,EAClC,GAAG,KAAK,CAAC;IACV,MAAM,uBAAuB,GAAG,GAAS,EAAE;QACzC,kBAAkB;QAClB,2GAA2G;IAC7G,CAAC,CAAC;IAEF,+MAA+M;IAC/M,MAAM,UAAU,GAAoB,gBAAgB,CAAC,MAAM,CAAC;IAC5D,MAAM,UAAU,GAAoB,gBAAgB,CAAC,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CAAC,OAAO,EAC1C,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,CACU,CACf;YAEA,CAAC,2BAA2B,IAAI,KAAK,KAAK,SAAS,IAAI,CACtD,oBAAC,WAAW,IACV,MAAM,EAAE;oBACN,IAAI,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE;oBAC3B,IAAI,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,uBAAuB,EAAE;iBAC5F,EACD,UAAU,EAAE,EAAE,MAAM,EAAE,KAAK,CAAC,gBAAgB,EAAE,EAC9C,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,CACI,CACf,CACA,CACJ,CAAC;IACJ,CAAC;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 {\n CameraAndMicrophoneSitePermissions,\n CameraSitePermissions,\n MicrophoneSitePermissions,\n _DrawerSurface\n} from '@internal/react-components';\n/* @conditional-compile-remove(call-readiness) */\nimport { _ModalClone } 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 modalLayerHostId: string;\n permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n };\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo?: EnvironmentInfo;\n isPermissionsModalDismissed: boolean;\n setIsPermissionsModalDismissed: (dismissedState: 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 <CameraAndMicrophoneSitePermissions\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 kind=\"request\"\n />\n );\n }\n // if audio permission is set up but video is not\n else if (videoState === 'prompt') {\n return (\n <CameraSitePermissions\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 kind=\"request\"\n />\n );\n }\n // if video permission is set up but audio is not\n else if (audioState === 'prompt') {\n return (\n <MicrophoneSitePermissions\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 kind=\"request\"\n />\n );\n }\n // if both video and audio are denied\n else if (videoState === 'denied' && audioState === 'denied') {\n return (\n <CameraAndMicrophoneSitePermissions\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 kind=\"denied\"\n />\n );\n }\n // if only video is denied\n else if (videoState === 'denied') {\n return (\n <CameraSitePermissions\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 kind=\"denied\"\n />\n );\n }\n // if only audio is denied\n else {\n return (\n <MicrophoneSitePermissions\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 kind=\"denied\"\n />\n );\n }\n };\n\n if (mobileView && modal !== undefined) {\n return (\n <>\n {isPermissionsModalDismissed && (\n <_DrawerSurface\n disableMaxHeight={true}\n onLightDismiss={onLightDismissTriggered}\n styles={drawerContainerStyles(DRAWER_HIGH_Z_BAND)}\n >\n {modal()}\n </_DrawerSurface>\n )}\n </>\n );\n } else if (!mobileView && modal !== undefined) {\n return (\n <_ModalClone\n styles={{\n root: { position: 'unset' },\n main: { position: 'absolute', left: '50%', top: '50%', transform: 'translate(-50%, -50%)' }\n }}\n layerProps={{ hostId: props.modalLayerHostId }}\n isOpen={isPermissionsModalDismissed}\n isBlocking={false}\n onDismiss={() => {\n setIsPermissionsModalDismissed(false);\n }}\n overlay={{ styles: { root: { background: 'rgba(0,0,0,0.4)' } } }}\n >\n {modal()}\n </_ModalClone>\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 modalLayerHostId: string;\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo?: EnvironmentInfo;\n isPermissionsModalDismissed: boolean;\n setIsPermissionsModalDismissed: (dismissedState: 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 <CameraAndMicrophoneSitePermissions\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 kind=\"denied\"\n />\n );\n } else if (videoState === 'denied' && audioState === 'granted') {\n return (\n <CameraSitePermissions\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 kind=\"denied\"\n />\n );\n } else {\n return (\n <MicrophoneSitePermissions\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 kind=\"denied\"\n />\n );\n }\n };\n\n if (mobileView) {\n return (\n <>\n {(checkPermissionModalShowing || audioState === 'prompt' || videoState === 'prompt') && (\n <_DrawerSurface\n disableMaxHeight={true}\n onLightDismiss={onLightDismissTriggered}\n styles={drawerContainerStyles(DRAWER_HIGH_Z_BAND)}\n >\n <CameraAndMicrophoneSitePermissions\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 kind=\"check\"\n />\n </_DrawerSurface>\n )}\n {isPermissionsModalDismissed && !checkPermissionModalShowing && modal !== undefined && (\n <_DrawerSurface\n disableMaxHeight={true}\n onLightDismiss={onLightDismissTriggered}\n styles={drawerContainerStyles(DRAWER_HIGH_Z_BAND)}\n >\n {modal()}\n </_DrawerSurface>\n )}\n </>\n );\n } else {\n return (\n <>\n {(checkPermissionModalShowing || audioState === 'prompt' || videoState === 'prompt') && (\n <_ModalClone\n styles={{\n root: { position: 'unset' },\n main: { position: 'absolute', left: '50%', top: '50%', transform: 'translate(-50%, -50%)' }\n }}\n layerProps={{ hostId: props.modalLayerHostId }}\n isOpen={isPermissionsModalDismissed}\n isBlocking={false}\n onDismiss={() => {\n setIsPermissionsModalDismissed(false);\n }}\n overlay={{ styles: { root: { background: 'rgba(0,0,0,0.4)' } } }}\n >\n <CameraAndMicrophoneSitePermissions\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 kind=\"check\"\n />\n </_ModalClone>\n )}\n\n {!checkPermissionModalShowing && modal !== undefined && (\n <_ModalClone\n styles={{\n root: { position: 'unset' },\n main: { position: 'absolute', left: '50%', top: '50%', transform: 'translate(-50%, -50%)' }\n }}\n layerProps={{ hostId: props.modalLayerHostId }}\n isOpen={isPermissionsModalDismissed}\n isBlocking={false}\n onDismiss={() => {\n setIsPermissionsModalDismissed(false);\n }}\n overlay={{ styles: { root: { background: 'rgba(0,0,0,0.4)' } } }}\n >\n {modal()}\n </_ModalClone>\n )}\n </>\n );\n }\n};\n\n/**\n * Placeholder for conditional compile\n * @private\n */\nexport const CallReadinessModalPlaceHolder = (): JSX.Element => {\n return <></>;\n};\n"]}
|
@@ -13,6 +13,8 @@ import { toFlatCommunicationIdentifier } from "../../../../../acs-ui-common/src"
|
|
13
13
|
import memoizeOne from 'memoize-one';
|
14
14
|
import { useAdapter } from '../adapter/CallAdapterProvider';
|
15
15
|
import { isCameraOn } from '../utils';
|
16
|
+
/* @conditional-compile-remove(PSTN-calls) */
|
17
|
+
import { _toCommunicationIdentifier } from "../../../../../acs-ui-common/src";
|
16
18
|
/**
|
17
19
|
* @private
|
18
20
|
*/
|
@@ -49,14 +51,25 @@ const createCompositeHandlers = memoizeOne((adapter) => {
|
|
49
51
|
}),
|
50
52
|
/* @conditional-compile-remove(PSTN-calls) */
|
51
53
|
onAddParticipant: (participant, options) => __awaiter(void 0, void 0, void 0, function* () {
|
52
|
-
|
54
|
+
if ('communicationUserId' in participant) {
|
55
|
+
return yield adapter.addParticipant(participant);
|
56
|
+
}
|
57
|
+
else if ('phoneNumber' in participant) {
|
58
|
+
return yield adapter.addParticipant(participant, options);
|
59
|
+
}
|
53
60
|
}),
|
54
61
|
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(dtmf-dialer) */
|
55
62
|
onSendDtmfTone: (dtmfTone) => __awaiter(void 0, void 0, void 0, function* () {
|
56
63
|
yield adapter.sendDtmfTone(dtmfTone);
|
57
64
|
}),
|
58
65
|
onRemoveParticipant: (userId) => __awaiter(void 0, void 0, void 0, function* () {
|
59
|
-
|
66
|
+
if (typeof userId === 'string') {
|
67
|
+
yield adapter.removeParticipant(userId);
|
68
|
+
}
|
69
|
+
else {
|
70
|
+
/* @conditional-compile-remove(PSTN-calls) */
|
71
|
+
yield adapter.removeParticipant(_toCommunicationIdentifier(userId));
|
72
|
+
}
|
60
73
|
}),
|
61
74
|
/* @conditional-compile-remove(raise-hand) */
|
62
75
|
onRaiseHand: () => __awaiter(void 0, void 0, void 0, function* () {
|
package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useHandlers.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/hooks/useHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAKlC,OAAO,EAAoB,6BAA6B,EAAE,yCAAgC;AAE1F,OAAO,UAAU,MAAM,aAAa,CAAC;AAIrC,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAUtC;;GAEG;AACH,+HAA+H;AAC/H,MAAM,CAAC,MAAM,WAAW,GAAG;AACzB,6DAA6D;AAC7D,UAAkD,EAE8B,EAAE;;IAClF,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,iBAAiB,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAC3D,4CAA4C;IAC5C,MAAM,YAAY,GAAG,MAAA,MAAA,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,0CAAE,mBAAmB,0CAAE,YAAY,CAAC,oBAAoB,CAAC,SAAS,CAAC;IAC/G,4CAA4C;IAC5C,uCACK,iBAAiB,GACjB,CAAC,YAAY;QACd,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,EAAE,qBAAqB,EAAE,SAAS,EAAE,sBAAsB,EAAE,SAAS,EAAE,qBAAqB,EAAE,SAAS,EAAE,CAAC,EAC9G;IACF,OAAO,iBAAiB,CAAC;AAC3B,CAAC,CAAC;AAEF,MAAM,uBAAuB,GAAG,UAAU,CACxC,CACE,OAA0B,EAC+E,EAAE;IAC3G,OAAO;QACL,uBAAuB,EAAE,CAAO,OAAO,EAAE,EAAE;YACzC,OAAO,MAAM,OAAO,CAAC,gBAAgB,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;QAC5D,CAAC,CAAA;QACD,wBAAwB,EAAE,CAAO,MAAM,EAAE,OAAO,EAAE,EAAE;YAClD,OAAO,MA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;QAC5C,gBAAgB,EAAE,CAAO,OAAkB,EAAiB,EAAE;YAC5D,MAAM,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC,CAAA;QACD,4CAA4C;QAC5C,eAAe,EAAE,CAAO,OAAkB,EAAiB,EAAE;YAC3D,MAAM,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC,CAAA;QACD,4CAA4C;QAC5C,qBAAqB,EAAE,GAAwB,EAAE;YAC/C,MAAM,OAAO,CAAC,cAAc,EAAE,CAAC;QACjC,CAAC,CAAA;QACD,4CAA4C;QAC5C,oBAAoB,EAAE,GAAwB,EAAE;YAC9C,MAAM,OAAO,CAAC,aAAa,EAAE,CAAC;QAChC,CAAC,CAAA;QACD,4CAA4C;QAC5C,sBAAsB,EAAE,CAAO,OAAkB,EAAiB,EAAE;YAClE,MAAM,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC,CAAA;QACD,4CAA4C;QAC5C,qBAAqB,EAAE,CAAO,OAAkB,EAAiB,EAAE;YACjE,MAAM,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC,CAAA;KACF,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CommonCallingHandlers } from '@internal/calling-component-bindings';\n/* @conditional-compile-remove(spotlight) */\nimport { _ComponentCallingHandlers } from '@internal/calling-component-bindings';\nimport { CommonProperties, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ReactElement } from 'react';\nimport memoizeOne from 'memoize-one';\nimport { CommonCallAdapter } from '..';\n/* @conditional-compile-remove(video-background-effects) */\nimport { VideoBackgroundBlurEffect, VideoBackgroundReplacementEffect } from '..';\nimport { useAdapter } from '../adapter/CallAdapterProvider';\nimport { isCameraOn } from '../utils';\n/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(dtmf-dialer) */\nimport { DtmfTone } from '@azure/communication-calling';\n/* @conditional-compile-remove(reaction) */\nimport { Reaction } from '@azure/communication-calling';\n/* @conditional-compile-remove(video-background-effects) */\nimport type { BackgroundReplacementConfig, BackgroundBlurConfig } from '@azure/communication-calling';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { CallSurvey, CallSurveyResponse } from '@azure/communication-calling';\n\n/**\n * @private\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport const useHandlers = <PropsT>(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _component: (props: PropsT) => ReactElement | null\n): Pick<CommonCallingHandlers, CommonProperties<CommonCallingHandlers, PropsT>> &\n /* @conditional-compile-remove(spotlight) */ Partial<_ComponentCallingHandlers> => {\n const adapter = useAdapter();\n const compositeHandlers = createCompositeHandlers(adapter);\n /* @conditional-compile-remove(spotlight) */\n const canSpotlight = adapter.getState().call?.capabilitiesFeature?.capabilities.spotlightParticipant.isPresent;\n /* @conditional-compile-remove(spotlight) */\n return {\n ...compositeHandlers,\n ...(canSpotlight\n ? {}\n : { onStartLocalSpotlight: undefined, onStartRemoteSpotlight: undefined, onStopRemoteSpotlight: undefined })\n };\n return compositeHandlers;\n};\n\nconst createCompositeHandlers = memoizeOne(\n (\n adapter: CommonCallAdapter\n ): CommonCallingHandlers & /* @conditional-compile-remove(spotlight) */ Partial<_ComponentCallingHandlers> => {\n return {\n onCreateLocalStreamView: async (options) => {\n return await adapter.createStreamView(undefined, options);\n },\n onCreateRemoteStreamView: async (userId, options) => {\n return await adapter.createStreamView(userId, options);\n },\n onHangUp: async (forEveryone?: boolean) => {\n await adapter.leaveCall(forEveryone);\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onToggleHold: async () => {\n return adapter.getState().call?.state === 'LocalHold' ? await adapter.resumeCall() : await adapter.holdCall();\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant: async (participant, options?) => {\n return await adapter.addParticipant(participant, options);\n },\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(dtmf-dialer) */\n onSendDtmfTone: async (dtmfTone: DtmfTone) => {\n await adapter.sendDtmfTone(dtmfTone);\n },\n onRemoveParticipant: async (userId) => {\n await adapter.removeParticipant(userId);\n },\n /* @conditional-compile-remove(raise-hand) */\n onRaiseHand: async () => {\n await adapter.raiseHand();\n },\n /* @conditional-compile-remove(raise-hand) */\n onLowerHand: async () => {\n await adapter.lowerHand();\n },\n /* @conditional-compile-remove(raise-hand) */\n onToggleRaiseHand: async () => {\n adapter.getState().call?.raiseHand.localParticipantRaisedHand\n ? await adapter.lowerHand()\n : await adapter.raiseHand();\n },\n /* @conditional-compile-remove(reaction) */\n onReactionClick: async (reaction: Reaction) => {\n await adapter.onReactionClick(reaction);\n },\n onSelectCamera: async (deviceInfo, options) => {\n await adapter.setCamera(deviceInfo, options);\n },\n onSelectMicrophone: async (deviceInfo) => {\n await adapter.setMicrophone(deviceInfo);\n },\n onSelectSpeaker: async (deviceInfo) => {\n await adapter.setSpeaker(deviceInfo);\n },\n onStartCall: (participants, options?) => {\n const rawIds = participants.map((participant) => toFlatCommunicationIdentifier(participant));\n return adapter.startCall(rawIds, options);\n },\n onStartScreenShare: async () => {\n await adapter.startScreenShare();\n },\n onStopScreenShare: async () => {\n await adapter.stopScreenShare();\n },\n onToggleCamera: async (options) => {\n isCameraOn(adapter.getState()) ? await adapter.stopCamera() : await adapter.startCamera(options);\n },\n onToggleMicrophone: async () => {\n return adapter.getState().call?.isMuted ? await adapter.unmute() : await adapter.mute();\n },\n onToggleScreenShare: async () => {\n return adapter.getState().call?.isScreenSharingOn\n ? await adapter.stopScreenShare()\n : await adapter.startScreenShare();\n },\n onStartLocalVideo: async () => {\n if (adapter.getState().call) {\n return adapter.startCamera();\n }\n },\n onDisposeLocalStreamView: async () => {\n return adapter.disposeLocalVideoStreamView();\n },\n onDisposeRemoteStreamView: async (userId) => {\n return adapter.disposeStreamView(userId);\n },\n onDisposeRemoteScreenShareStreamView: async (userId) => {\n return adapter.disposeScreenShareStreamView(userId);\n },\n onDisposeRemoteVideoStreamView: async (userId) => {\n return adapter.disposeRemoteVideoStreamView(userId);\n },\n /* @conditional-compile-remove(call-readiness) */\n askDevicePermission: async (constrain) => {\n return adapter.askDevicePermission(constrain);\n },\n /* @conditional-compile-remove(video-background-effects) */\n onRemoveVideoBackgroundEffects: async () => {\n return await adapter.stopVideoBackgroundEffects();\n },\n /* @conditional-compile-remove(video-background-effects) */\n onBlurVideoBackground: async (backgroundBlurConfig?: BackgroundBlurConfig) => {\n const blurConfig: VideoBackgroundBlurEffect = {\n effectName: 'blur',\n ...backgroundBlurConfig\n };\n return await adapter.startVideoBackgroundEffect(blurConfig);\n },\n /* @conditional-compile-remove(video-background-effects) */\n onReplaceVideoBackground: async (backgroundReplacementConfig: BackgroundReplacementConfig) => {\n const replacementConfig: VideoBackgroundReplacementEffect = {\n effectName: 'replacement',\n ...backgroundReplacementConfig\n };\n return await adapter.startVideoBackgroundEffect(replacementConfig);\n },\n /* @conditional-compile-remove(close-captions) */\n onStartCaptions: async (options) => {\n await adapter.startCaptions(options);\n },\n /* @conditional-compile-remove(close-captions) */\n onStopCaptions: async () => {\n await adapter.stopCaptions();\n },\n /* @conditional-compile-remove(close-captions) */\n onSetSpokenLanguage: async (language) => {\n await adapter.setSpokenLanguage(language);\n },\n /* @conditional-compile-remove(close-captions) */\n onSetCaptionLanguage: async (language) => {\n await adapter.setCaptionLanguage(language);\n },\n /* @conditional-compile-remove(end-of-call-survey) */\n onSubmitSurvey: async (survey: CallSurvey): Promise<CallSurveyResponse | undefined> => {\n return await adapter.submitSurvey(survey);\n },\n /* @conditional-compile-remove(spotlight) */\n onStartSpotlight: async (userIds?: string[]): Promise<void> => {\n await adapter.startSpotlight(userIds);\n },\n /* @conditional-compile-remove(spotlight) */\n onStopSpotlight: async (userIds?: string[]): Promise<void> => {\n await adapter.stopSpotlight(userIds);\n },\n /* @conditional-compile-remove(spotlight) */\n onStartLocalSpotlight: async (): Promise<void> => {\n await adapter.startSpotlight();\n },\n /* @conditional-compile-remove(spotlight) */\n onStopLocalSpotlight: async (): Promise<void> => {\n await adapter.stopSpotlight();\n },\n /* @conditional-compile-remove(spotlight) */\n onStartRemoteSpotlight: async (userIds?: string[]): Promise<void> => {\n await adapter.startSpotlight(userIds);\n },\n /* @conditional-compile-remove(spotlight) */\n onStopRemoteSpotlight: async (userIds?: string[]): Promise<void> => {\n await adapter.stopSpotlight(userIds);\n }\n };\n }\n);\n"]}
|
1
|
+
{"version":3,"file":"useHandlers.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/hooks/useHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAKlC,OAAO,EAAoB,6BAA6B,EAAE,yCAAgC;AAE1F,OAAO,UAAU,MAAM,aAAa,CAAC;AAIrC,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAiBtC,6CAA6C;AAC7C,OAAO,EAAE,0BAA0B,EAAE,yCAAgC;AAErE;;GAEG;AACH,+HAA+H;AAC/H,MAAM,CAAC,MAAM,WAAW,GAAG;AACzB,6DAA6D;AAC7D,UAAkD,EAE8B,EAAE;;IAClF,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,iBAAiB,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAC3D,4CAA4C;IAC5C,MAAM,YAAY,GAAG,MAAA,MAAA,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,0CAAE,mBAAmB,0CAAE,YAAY,CAAC,oBAAoB,CAAC,SAAS,CAAC;IAC/G,4CAA4C;IAC5C,uCACK,iBAAiB,GACjB,CAAC,YAAY;QACd,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,EAAE,qBAAqB,EAAE,SAAS,EAAE,sBAAsB,EAAE,SAAS,EAAE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AE,CAAO,OAAkB,EAAiB,EAAE;YAClE,MAAM,OAAO,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;QACxC,CAAC,CAAA;QACD,4CAA4C;QAC5C,qBAAqB,EAAE,CAAO,OAAkB,EAAiB,EAAE;YACjE,MAAM,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;QACvC,CAAC,CAAA;KACF,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CommonCallingHandlers } from '@internal/calling-component-bindings';\n/* @conditional-compile-remove(spotlight) */\nimport { _ComponentCallingHandlers } from '@internal/calling-component-bindings';\nimport { CommonProperties, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ReactElement } from 'react';\nimport memoizeOne from 'memoize-one';\nimport { CommonCallAdapter } from '..';\n/* @conditional-compile-remove(video-background-effects) */\nimport { VideoBackgroundBlurEffect, VideoBackgroundReplacementEffect } from '..';\nimport { useAdapter } from '../adapter/CallAdapterProvider';\nimport { isCameraOn } from '../utils';\n/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(dtmf-dialer) */\nimport { DtmfTone } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(reaction) */\nimport { Reaction } from '@azure/communication-calling';\n/* @conditional-compile-remove(video-background-effects) */\nimport type { BackgroundReplacementConfig, BackgroundBlurConfig } from '@azure/communication-calling';\n/* @conditional-compile-remove(end-of-call-survey) */\nimport { CallSurvey, CallSurveyResponse } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport {\n CommunicationIdentifier,\n CommunicationUserIdentifier,\n PhoneNumberIdentifier\n} from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { _toCommunicationIdentifier } from '@internal/acs-ui-common';\n\n/**\n * @private\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport const useHandlers = <PropsT>(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _component: (props: PropsT) => ReactElement | null\n): Pick<CommonCallingHandlers, CommonProperties<CommonCallingHandlers, PropsT>> &\n /* @conditional-compile-remove(spotlight) */ Partial<_ComponentCallingHandlers> => {\n const adapter = useAdapter();\n const compositeHandlers = createCompositeHandlers(adapter);\n /* @conditional-compile-remove(spotlight) */\n const canSpotlight = adapter.getState().call?.capabilitiesFeature?.capabilities.spotlightParticipant.isPresent;\n /* @conditional-compile-remove(spotlight) */\n return {\n ...compositeHandlers,\n ...(canSpotlight\n ? {}\n : { onStartLocalSpotlight: undefined, onStartRemoteSpotlight: undefined, onStopRemoteSpotlight: undefined })\n };\n return compositeHandlers;\n};\n\nconst createCompositeHandlers = memoizeOne(\n (\n adapter: CommonCallAdapter\n ): CommonCallingHandlers & /* @conditional-compile-remove(spotlight) */ Partial<_ComponentCallingHandlers> => {\n return {\n onCreateLocalStreamView: async (options) => {\n return await adapter.createStreamView(undefined, options);\n },\n onCreateRemoteStreamView: async (userId, options) => {\n return await adapter.createStreamView(userId, options);\n },\n onHangUp: async (forEveryone?: boolean) => {\n await adapter.leaveCall(forEveryone);\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onToggleHold: async () => {\n return adapter.getState().call?.state === 'LocalHold' ? await adapter.resumeCall() : await adapter.holdCall();\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant: async (\n participant: Partial<CommunicationUserIdentifier & PhoneNumberIdentifier>,\n options?: AddPhoneNumberOptions\n ) => {\n if ('communicationUserId' in participant) {\n return await adapter.addParticipant(participant as CommunicationUserIdentifier);\n } else if ('phoneNumber' in participant) {\n return await adapter.addParticipant(participant as PhoneNumberIdentifier, options);\n }\n },\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(dtmf-dialer) */\n onSendDtmfTone: async (dtmfTone: DtmfTone) => {\n await adapter.sendDtmfTone(dtmfTone);\n },\n onRemoveParticipant: async (\n userId: string | /* @conditional-compile-remove(PSTN-calls) */ CommunicationIdentifier\n ) => {\n if (typeof userId === 'string') {\n await adapter.removeParticipant(userId);\n } else {\n /* @conditional-compile-remove(PSTN-calls) */\n await adapter.removeParticipant(_toCommunicationIdentifier(userId));\n }\n },\n /* @conditional-compile-remove(raise-hand) */\n onRaiseHand: async () => {\n await adapter.raiseHand();\n },\n /* @conditional-compile-remove(raise-hand) */\n onLowerHand: async () => {\n await adapter.lowerHand();\n },\n /* @conditional-compile-remove(raise-hand) */\n onToggleRaiseHand: async () => {\n adapter.getState().call?.raiseHand.localParticipantRaisedHand\n ? await adapter.lowerHand()\n : await adapter.raiseHand();\n },\n /* @conditional-compile-remove(reaction) */\n onReactionClick: async (reaction: Reaction) => {\n await adapter.onReactionClick(reaction);\n },\n onSelectCamera: async (deviceInfo, options) => {\n await adapter.setCamera(deviceInfo, options);\n },\n onSelectMicrophone: async (deviceInfo) => {\n await adapter.setMicrophone(deviceInfo);\n },\n onSelectSpeaker: async (deviceInfo) => {\n await adapter.setSpeaker(deviceInfo);\n },\n onStartCall: (participants, options?) => {\n const rawIds = participants.map((participant) => toFlatCommunicationIdentifier(participant));\n return adapter.startCall(rawIds, options);\n },\n onStartScreenShare: async () => {\n await adapter.startScreenShare();\n },\n onStopScreenShare: async () => {\n await adapter.stopScreenShare();\n },\n onToggleCamera: async (options) => {\n isCameraOn(adapter.getState()) ? await adapter.stopCamera() : await adapter.startCamera(options);\n },\n onToggleMicrophone: async () => {\n return adapter.getState().call?.isMuted ? await adapter.unmute() : await adapter.mute();\n },\n onToggleScreenShare: async () => {\n return adapter.getState().call?.isScreenSharingOn\n ? await adapter.stopScreenShare()\n : await adapter.startScreenShare();\n },\n onStartLocalVideo: async () => {\n if (adapter.getState().call) {\n return adapter.startCamera();\n }\n },\n onDisposeLocalStreamView: async () => {\n return adapter.disposeLocalVideoStreamView();\n },\n onDisposeRemoteStreamView: async (userId) => {\n return adapter.disposeStreamView(userId);\n },\n onDisposeRemoteScreenShareStreamView: async (userId) => {\n return adapter.disposeScreenShareStreamView(userId);\n },\n onDisposeRemoteVideoStreamView: async (userId) => {\n return adapter.disposeRemoteVideoStreamView(userId);\n },\n /* @conditional-compile-remove(call-readiness) */\n askDevicePermission: async (constrain) => {\n return adapter.askDevicePermission(constrain);\n },\n /* @conditional-compile-remove(video-background-effects) */\n onRemoveVideoBackgroundEffects: async () => {\n return await adapter.stopVideoBackgroundEffects();\n },\n /* @conditional-compile-remove(video-background-effects) */\n onBlurVideoBackground: async (backgroundBlurConfig?: BackgroundBlurConfig) => {\n const blurConfig: VideoBackgroundBlurEffect = {\n effectName: 'blur',\n ...backgroundBlurConfig\n };\n return await adapter.startVideoBackgroundEffect(blurConfig);\n },\n /* @conditional-compile-remove(video-background-effects) */\n onReplaceVideoBackground: async (backgroundReplacementConfig: BackgroundReplacementConfig) => {\n const replacementConfig: VideoBackgroundReplacementEffect = {\n effectName: 'replacement',\n ...backgroundReplacementConfig\n };\n return await adapter.startVideoBackgroundEffect(replacementConfig);\n },\n /* @conditional-compile-remove(close-captions) */\n onStartCaptions: async (options) => {\n await adapter.startCaptions(options);\n },\n /* @conditional-compile-remove(close-captions) */\n onStopCaptions: async () => {\n await adapter.stopCaptions();\n },\n /* @conditional-compile-remove(close-captions) */\n onSetSpokenLanguage: async (language) => {\n await adapter.setSpokenLanguage(language);\n },\n /* @conditional-compile-remove(close-captions) */\n onSetCaptionLanguage: async (language) => {\n await adapter.setCaptionLanguage(language);\n },\n /* @conditional-compile-remove(end-of-call-survey) */\n onSubmitSurvey: async (survey: CallSurvey): Promise<CallSurveyResponse | undefined> => {\n return await adapter.submitSurvey(survey);\n },\n /* @conditional-compile-remove(spotlight) */\n onStartSpotlight: async (userIds?: string[]): Promise<void> => {\n await adapter.startSpotlight(userIds);\n },\n /* @conditional-compile-remove(spotlight) */\n onStopSpotlight: async (userIds?: string[]): Promise<void> => {\n await adapter.stopSpotlight(userIds);\n },\n /* @conditional-compile-remove(spotlight) */\n onStartLocalSpotlight: async (): Promise<void> => {\n await adapter.startSpotlight();\n },\n /* @conditional-compile-remove(spotlight) */\n onStopLocalSpotlight: async (): Promise<void> => {\n await adapter.stopSpotlight();\n },\n /* @conditional-compile-remove(spotlight) */\n onStartRemoteSpotlight: async (userIds?: string[]): Promise<void> => {\n await adapter.startSpotlight(userIds);\n },\n /* @conditional-compile-remove(spotlight) */\n onStopRemoteSpotlight: async (userIds?: string[]): Promise<void> => {\n await adapter.stopSpotlight(userIds);\n }\n };\n }\n);\n"]}
|
package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js
CHANGED
@@ -38,7 +38,7 @@ const DtmfDialpadPageContent = (props) => {
|
|
38
38
|
return (React.createElement(Stack, { style: { height: '100%', width: '100%', background: theme.palette.white } },
|
39
39
|
React.createElement(Stack, { verticalAlign: 'center', style: { margin: 'auto' } },
|
40
40
|
React.createElement(DtmfDialerContentTimer, null),
|
41
|
-
React.createElement(Text, { style: { margin: 'auto' } }, calleeName !== 'Unnamed participant' ? calleeName : ''),
|
41
|
+
React.createElement(Text, { style: { margin: 'auto' } }, calleeName && calleeName !== 'Unnamed participant' ? calleeName === null || calleeName === void 0 ? void 0 : calleeName.toString() : ''),
|
42
42
|
React.createElement(Dialpad, { onSendDtmfTone: (tone) => __awaiter(void 0, void 0, void 0, function* () {
|
43
43
|
/* @conditional-compile-remove(dtmf-dialer) */
|
44
44
|
yield adapter.sendDtmfTone(tone);
|
package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DtmfDialpadPage.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAsB,OAAO,EAAY,4CAAmC;AAKnF,OAAO,KA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U,GAAI,CAAC;AACpF,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ActiveErrorMessage, Dialpad, DtmfTone } from '@internal/react-components';\nimport { MobileChatSidePaneTabHeaderProps } from '../../common/TabHeader';\nimport { CallCompositeOptions } from '../CallComposite';\nimport { SidePaneRenderer } from '../components/SidePane/SidePaneProvider';\nimport { CapabilitiesChangeNotificationBarProps } from '../components/CapabilitiesChangedNotificationBar';\nimport React, { useEffect, useMemo, useState } from 'react';\nimport { useAdapter } from '../adapter/CallAdapterProvider';\nimport { CommonCallAdapter } from '../adapter';\nimport { Stack, Text, useTheme } from '@fluentui/react';\nimport { getReadableTime } from '../utils/timerUtils';\nimport { DtmfDialpadContentTimerStyles } from '../styles/DtmfDialpadPage.styles';\nimport { RemoteParticipantState } from '@internal/calling-stateful-client';\nimport { isPhoneNumberIdentifier } from '@azure/communication-common';\nimport { useSelector } from '../hooks/useSelector';\nimport { getStartTime } from '../selectors/baseSelectors';\n\n/**\n * @internal\n */\nexport interface DialpadPageProps {\n mobileView: boolean;\n options?: CallCompositeOptions;\n modalLayerHostId: string;\n updateSidePaneRenderer: (renderer: SidePaneRenderer | undefined) => void;\n mobileChatTabHeader?: MobileChatSidePaneTabHeaderProps;\n latestErrors: ActiveErrorMessage[];\n onDismissError: (error: ActiveErrorMessage) => void;\n /* @conditional-compile-remove(capabilities) */\n capabilitiesChangedNotificationBarProps?: CapabilitiesChangeNotificationBarProps;\n onSetDialpadPage: () => void;\n dtmfDialerPresent: boolean;\n}\n\ninterface DialpadPageContentProps {\n mobileView: boolean;\n adapter: CommonCallAdapter;\n}\n\nconst DtmfDialpadPageContent = (props: DialpadPageContentProps): JSX.Element => {\n const { adapter } = props;\n const adapterState = adapter.getState();\n const theme = useTheme();\n\n const calleeId = adapterState.targetCallees?.[0];\n const remoteParticipants = adapterState.call?.remoteParticipants;\n let calleeName;\n\n if (remoteParticipants) {\n const remoteParticipantValues: RemoteParticipantState[] = Object.values(remoteParticipants);\n if (calleeId && isPhoneNumberIdentifier(calleeId)) {\n calleeName = calleeId.phoneNumber;\n } else {\n calleeName = remoteParticipantValues.find((p) => p.identifier === calleeId);\n }\n }\n\n return (\n <Stack style={{ height: '100%', width: '100%', background: theme.palette.white }}>\n <Stack verticalAlign={'center'} style={{ margin: 'auto' }}>\n <DtmfDialerContentTimer />\n <Text style={{ margin: 'auto' }}>\n {calleeName && calleeName !== 'Unnamed participant' ? calleeName?.toString() : ''}\n </Text>\n <Dialpad\n onSendDtmfTone={async (tone: DtmfTone) => {\n /* @conditional-compile-remove(dtmf-dialer) */\n await adapter.sendDtmfTone(tone);\n }}\n longPressTrigger={props.mobileView ? 'touch' : 'mouseAndTouch'}\n dialpadMode={'dtmf'}\n ></Dialpad>\n </Stack>\n </Stack>\n );\n};\n\nconst DtmfDialerContentTimer = (): JSX.Element => {\n const [time, setTime] = useState<number>(0);\n const elapsedTime = getReadableTime(time);\n const statefulStartTime = useSelector(getStartTime);\n const startTime = useMemo(() => {\n return statefulStartTime ?? new Date(Date.now());\n }, [statefulStartTime]);\n\n useEffect(() => {\n const interval = setInterval(() => {\n setTime(new Date(Date.now()).getTime() - startTime?.getTime() ?? 0);\n }, 10);\n return () => {\n clearInterval(interval);\n };\n }, [startTime]);\n\n return <Text styles={DtmfDialpadContentTimerStyles}>{elapsedTime}</Text>;\n};\n\n/**\n * @internal\n */\nexport const DtmfDialpadPage = (props: DialpadPageProps): JSX.Element => {\n const adapter = useAdapter();\n\n return <DtmfDialpadPageContent adapter={adapter} mobileView={props.mobileView} />;\n};\n"]}
|
@@ -76,15 +76,21 @@ export const trackCapabilityChangedNotificationAsDismissed = (capabilityName, tr
|
|
76
76
|
};
|
77
77
|
/* @conditional-compile-remove(capabilities) */
|
78
78
|
const updateLatestCapabilityChangedNotificationMap = (capabilitiesChangedInfoAndRole, activeNotifications) => {
|
79
|
+
var _a, _b;
|
79
80
|
if (!capabilitiesChangedInfoAndRole.capabilitiesChangeInfo) {
|
80
81
|
return activeNotifications;
|
81
82
|
}
|
82
|
-
for (const [
|
83
|
+
for (const [capabilityKey, newCapabilityValue] of Object.entries(capabilitiesChangedInfoAndRole.capabilitiesChangeInfo.newValue)) {
|
84
|
+
// Cast is safe because we are iterating over the enum keys on the object.entries where
|
85
|
+
// newCapabilityValue typing is correctly returned. Object.entries limitations
|
86
|
+
// always returns string for the key
|
87
|
+
const capabilityName = capabilityKey;
|
83
88
|
// If the active notification for a capability has the same `isPresent` value and the same reason as the new
|
84
89
|
// capability value from the SDK then we will not create a new notification to avoid redundancy
|
85
90
|
if (activeNotifications[capabilityName] &&
|
86
|
-
newCapabilityValue.isPresent === activeNotifications[capabilityName].isPresent &&
|
87
|
-
capabilitiesChangedInfoAndRole.capabilitiesChangeInfo.reason ===
|
91
|
+
newCapabilityValue.isPresent === ((_a = activeNotifications[capabilityName]) === null || _a === void 0 ? void 0 : _a.isPresent) &&
|
92
|
+
capabilitiesChangedInfoAndRole.capabilitiesChangeInfo.reason ===
|
93
|
+
((_b = activeNotifications[capabilityName]) === null || _b === void 0 ? void 0 : _b.changedReason)) {
|
88
94
|
continue;
|
89
95
|
}
|
90
96
|
const newCapabilityChangeNotification = {
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TrackCapabilityChangedNotifications.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/utils/TrackCapabilityChangedNotifications.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,+CAA+C;AAC/C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAW1E,+CAA+C;AAC/C;;;;GAIG;AACH,MAAM,CAAC,MAAM,wCAAwC,GAAG,CACtD,8BAA8D,EACtB,EAAE;IAC1C,MAAM,CAAC,qCAAqC,EAAE,wCAAwC,CAAC,GACrF,QAAQ,CAAwC,EAAE,CAAC,CAAC;IAEtD,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/B,eAAe,EAAE,GAAG,OAEtB;AACJ,CAAC,CAAC;AAaF,+CAA+C;AAC/C,MAAM,4CAA4C,GAAG,CACnD,8BAA8D,EAC9D,mBAA8D,EACnB,EAAE;IAC7C,IAAI,CAAC,8BAA8B,CAAC,sBAAsB,EAAE,CAAC;QAC3D,OAAO,mBAAmB,CAAC;IAC7B,CAAC;IAED,KAAK,MAAM,CAAC,cAAc,EAAE,kBAAkB,CAAC,IAAI,MAAM,CAAC,OAAO,CAC/D,8BAA8B,CAAC,sBAAsB,CAAC,QAAQ,CAC/D,EAAE,CAAC;QACF,4GAA4G;QAC5G,+FAA+F;QAC/F,IACE,mBAAmB,CAAC,cAAc,CAAC;YACnC,kBAAkB,CAAC,SAAS,KAAK,mBAAmB,CAAC,cAAc,CAAC,CAAC,SAAS;YAC9E,8BAA8B,CAAC,sBAAsB,CAAC,MAAM,KAAK,mBAAmB,CAAC,cAAc,CAAC,CAAC,aAAa,EAClH,CAAC;YACD,SAAS;QACX,CAAC;QACD,MAAM,+BAA+B,GAAkC;YACrE,cAAc,EAAE,cAA2C;YAC3D,SAAS,EAAE,kBAAkB,CAAC,SAAS;YACvC,aAAa,EAAE,8BAA8B,CAAC,sBAAsB,CAAC,MAAM;YAC3E,IAAI,EAAE,8BAA8B,CAAC,eAAe;YACpD,SAAS,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;SAChC,CAAC;QACF,mBAAmB,CAAC,cAAc,CAAC,GAAG,+BAA+B,CAAC;IACxE,CAAC;IACD,OAAO,mBAAmB,CAAC;AAC7B,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(capabilities) */\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n/* @conditional-compile-remove(capabilities) */\nimport { CapabilitiesChangeInfo, ParticipantCapabilityName, ParticipantRole } from '@azure/communication-calling';\n/* @conditional-compile-remove(capabilities) */\nimport {\n CapabalityChangedNotification,\n CapabilitiesChangeNotificationBarProps\n} from '../components/CapabilitiesChangedNotificationBar';\n/* @conditional-compile-remove(capabilities) */\nimport { TrackedCapabilityChangedNotifications } from '../types/CapabilityChangedNotificationTracking';\n\n/* @conditional-compile-remove(capabilities) */\n/**\n * Create a record for when the notification was most recently dismissed for tracking dismissed notifications.\n *\n * @private\n */\nexport const useTrackedCapabilityChangedNotifications = (\n capabilitiesChangedAndRoleInfo: CapabilitiesChangedInfoAndRole\n): CapabilitiesChangeNotificationBarProps => {\n const [trackedCapabilityChangedNotifications, setTrackedCapabilityChangedNotifications] =\n useState<TrackedCapabilityChangedNotifications>({});\n\n // Initialize a share screen capability changed notification with 'RoleChanged' reason so that the initial\n // share screen capability changed info from the Calling SDK when joining Teams interop will be ignored because\n // being able to share screen is assumed by default. This is inline with what Teams is doing.\n const activeNotifications = useRef<LatestCapabilityChangedNotificationRecord>({\n shareScreen: { capabilityName: 'shareScreen', isPresent: true, changedReason: 'RoleChanged' }\n });\n\n useEffect(() => {\n activeNotifications.current = updateLatestCapabilityChangedNotificationMap(\n capabilitiesChangedAndRoleInfo,\n activeNotifications.current\n );\n setTrackedCapabilityChangedNotifications((prev) =>\n updateTrackedCapabilityChangedNotificationsWithActiveNotifications(\n prev,\n Object.values(activeNotifications.current)\n )\n );\n }, [capabilitiesChangedAndRoleInfo]);\n\n const onDismissCapabilityChangedNotification = useCallback((notification: CapabalityChangedNotification) => {\n setTrackedCapabilityChangedNotifications((prev) =>\n trackCapabilityChangedNotificationAsDismissed(notification.capabilityName, prev)\n );\n }, []);\n\n const latestCapabilityChangedNotifications = useMemo(\n () =>\n filterLatestCapabilityChangedNotifications(\n Object.values(activeNotifications.current),\n trackedCapabilityChangedNotifications\n ),\n [trackedCapabilityChangedNotifications]\n );\n\n return {\n capabilitiesChangedNotifications: latestCapabilityChangedNotifications,\n onDismissNotification: onDismissCapabilityChangedNotification\n };\n};\n\n/* @conditional-compile-remove(capabilities) */\n/**\n * Take the set of active notifications, and filter to only those that are newer than previously dismissed notifications or have never been dismissed.\n *\n * @private\n */\nexport const filterLatestCapabilityChangedNotifications = (\n activeNotifications: CapabalityChangedNotification[],\n trackedNotifications: TrackedCapabilityChangedNotifications\n): CapabalityChangedNotification[] => {\n const filteredNotifications = activeNotifications.filter((activeNotification) => {\n const trackedNotification = trackedNotifications[activeNotification.capabilityName];\n return (\n !trackedNotification ||\n !trackedNotification.lastDismissedAt ||\n trackedNotification.lastDismissedAt < trackedNotification.mostRecentlyActive\n );\n });\n return filteredNotifications;\n};\n\n/* @conditional-compile-remove(capabilities) */\n/**\n * Maintain a record of the most recently active notification for each capability name.\n *\n * @private\n */\nexport const updateTrackedCapabilityChangedNotificationsWithActiveNotifications = (\n existingTrackedNotifications: TrackedCapabilityChangedNotifications,\n activeNotifications: CapabalityChangedNotification[]\n): TrackedCapabilityChangedNotifications => {\n const trackedNotifications: TrackedCapabilityChangedNotifications = {};\n\n // Only care about active notifications. If notifications are no longer active we do not track that they have been previously dismissed.\n for (const activeNotification of activeNotifications) {\n const existingTrackedNotification = existingTrackedNotifications[activeNotification.capabilityName];\n trackedNotifications[activeNotification.capabilityName] = {\n mostRecentlyActive:\n activeNotification.timestamp ?? existingTrackedNotification?.mostRecentlyActive ?? new Date(Date.now()),\n lastDismissedAt: existingTrackedNotification?.lastDismissedAt\n };\n }\n\n return trackedNotifications;\n};\n\n/* @conditional-compile-remove(capabilities) */\n/**\n * Create a record for when the notification was most recently dismissed for tracking dismissed notifications.\n *\n * @private\n */\nexport const trackCapabilityChangedNotificationAsDismissed = (\n capabilityName: ParticipantCapabilityName,\n trackedNotifications: TrackedCapabilityChangedNotifications\n): TrackedCapabilityChangedNotifications => {\n const now = new Date(Date.now());\n const existingNotification = trackedNotifications[capabilityName];\n\n return {\n ...trackedNotifications,\n [capabilityName]: {\n ...(existingNotification || {}),\n lastDismissedAt: now\n }\n };\n};\n\n/* @conditional-compile-remove(capabilities) */\ninterface CapabilitiesChangedInfoAndRole {\n capabilitiesChangeInfo?: CapabilitiesChangeInfo;\n participantRole?: ParticipantRole;\n}\n\n/* @conditional-compile-remove(capabilities) */\ntype LatestCapabilityChangedNotificationRecord = Partial<\n Record<ParticipantCapabilityName, CapabalityChangedNotification>\n>;\n\n/* @conditional-compile-remove(capabilities) */\nconst updateLatestCapabilityChangedNotificationMap = (\n capabilitiesChangedInfoAndRole: CapabilitiesChangedInfoAndRole,\n activeNotifications: LatestCapabilityChangedNotificationRecord\n): LatestCapabilityChangedNotificationRecord => {\n if (!capabilitiesChangedInfoAndRole.capabilitiesChangeInfo) {\n return activeNotifications;\n }\n\n for (const [capabilityName, newCapabilityValue] of Object.entries(\n capabilitiesChangedInfoAndRole.capabilitiesChangeInfo.newValue\n )) {\n // If the active notification for a capability has the same `isPresent` value and the same reason as the new\n // capability value from the SDK then we will not create a new notification to avoid redundancy\n if (\n activeNotifications[capabilityName] &&\n newCapabilityValue.isPresent === activeNotifications[capabilityName].isPresent &&\n capabilitiesChangedInfoAndRole.capabilitiesChangeInfo.reason === activeNotifications[capabilityName].changedReason\n ) {\n continue;\n }\n const newCapabilityChangeNotification: CapabalityChangedNotification = {\n capabilityName: capabilityName as ParticipantCapabilityName,\n isPresent: newCapabilityValue.isPresent,\n changedReason: capabilitiesChangedInfoAndRole.capabilitiesChangeInfo.reason,\n role: capabilitiesChangedInfoAndRole.participantRole,\n timestamp: new Date(Date.now())\n };\n activeNotifications[capabilityName] = newCapabilityChangeNotification;\n }\n return activeNotifications;\n};\n"]}
|
1
|
+
{"version":3,"file":"TrackCapabilityChangedNotifications.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/utils/TrackCapabilityChangedNotifications.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,+CAA+C;AAC/C,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAW1E,+CAA+C;AAC/C;;;;GAIG;A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,CAAC;AAC7B,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(capabilities) */\nimport { useCallback, useEffect, useMemo, useRef, useState } from 'react';\n/* @conditional-compile-remove(capabilities) */\nimport { CapabilitiesChangeInfo, ParticipantCapabilityName, ParticipantRole } from '@azure/communication-calling';\n/* @conditional-compile-remove(capabilities) */\nimport {\n CapabalityChangedNotification,\n CapabilitiesChangeNotificationBarProps\n} from '../components/CapabilitiesChangedNotificationBar';\n/* @conditional-compile-remove(capabilities) */\nimport { TrackedCapabilityChangedNotifications } from '../types/CapabilityChangedNotificationTracking';\n\n/* @conditional-compile-remove(capabilities) */\n/**\n * Create a record for when the notification was most recently dismissed for tracking dismissed notifications.\n *\n * @private\n */\nexport const useTrackedCapabilityChangedNotifications = (\n capabilitiesChangedAndRoleInfo: CapabilitiesChangedInfoAndRole\n): CapabilitiesChangeNotificationBarProps => {\n const [trackedCapabilityChangedNotifications, setTrackedCapabilityChangedNotifications] =\n useState<TrackedCapabilityChangedNotifications>({});\n\n // Initialize a share screen capability changed notification with 'RoleChanged' reason so that the initial\n // share screen capability changed info from the Calling SDK when joining Teams interop will be ignored because\n // being able to share screen is assumed by default. This is inline with what Teams is doing.\n const activeNotifications = useRef<LatestCapabilityChangedNotificationRecord>({\n shareScreen: { capabilityName: 'shareScreen', isPresent: true, changedReason: 'RoleChanged' }\n });\n\n useEffect(() => {\n activeNotifications.current = updateLatestCapabilityChangedNotificationMap(\n capabilitiesChangedAndRoleInfo,\n activeNotifications.current\n );\n setTrackedCapabilityChangedNotifications((prev) =>\n updateTrackedCapabilityChangedNotificationsWithActiveNotifications(\n prev,\n Object.values(activeNotifications.current)\n )\n );\n }, [capabilitiesChangedAndRoleInfo]);\n\n const onDismissCapabilityChangedNotification = useCallback((notification: CapabalityChangedNotification) => {\n setTrackedCapabilityChangedNotifications((prev) =>\n trackCapabilityChangedNotificationAsDismissed(notification.capabilityName, prev)\n );\n }, []);\n\n const latestCapabilityChangedNotifications = useMemo(\n () =>\n filterLatestCapabilityChangedNotifications(\n Object.values(activeNotifications.current),\n trackedCapabilityChangedNotifications\n ),\n [trackedCapabilityChangedNotifications]\n );\n\n return {\n capabilitiesChangedNotifications: latestCapabilityChangedNotifications,\n onDismissNotification: onDismissCapabilityChangedNotification\n };\n};\n\n/* @conditional-compile-remove(capabilities) */\n/**\n * Take the set of active notifications, and filter to only those that are newer than previously dismissed notifications or have never been dismissed.\n *\n * @private\n */\nexport const filterLatestCapabilityChangedNotifications = (\n activeNotifications: CapabalityChangedNotification[],\n trackedNotifications: TrackedCapabilityChangedNotifications\n): CapabalityChangedNotification[] => {\n const filteredNotifications = activeNotifications.filter((activeNotification) => {\n const trackedNotification = trackedNotifications[activeNotification.capabilityName];\n return (\n !trackedNotification ||\n !trackedNotification.lastDismissedAt ||\n trackedNotification.lastDismissedAt < trackedNotification.mostRecentlyActive\n );\n });\n return filteredNotifications;\n};\n\n/* @conditional-compile-remove(capabilities) */\n/**\n * Maintain a record of the most recently active notification for each capability name.\n *\n * @private\n */\nexport const updateTrackedCapabilityChangedNotificationsWithActiveNotifications = (\n existingTrackedNotifications: TrackedCapabilityChangedNotifications,\n activeNotifications: CapabalityChangedNotification[]\n): TrackedCapabilityChangedNotifications => {\n const trackedNotifications: TrackedCapabilityChangedNotifications = {};\n\n // Only care about active notifications. If notifications are no longer active we do not track that they have been previously dismissed.\n for (const activeNotification of activeNotifications) {\n const existingTrackedNotification = existingTrackedNotifications[activeNotification.capabilityName];\n trackedNotifications[activeNotification.capabilityName] = {\n mostRecentlyActive:\n activeNotification.timestamp ?? existingTrackedNotification?.mostRecentlyActive ?? new Date(Date.now()),\n lastDismissedAt: existingTrackedNotification?.lastDismissedAt\n };\n }\n\n return trackedNotifications;\n};\n\n/* @conditional-compile-remove(capabilities) */\n/**\n * Create a record for when the notification was most recently dismissed for tracking dismissed notifications.\n *\n * @private\n */\nexport const trackCapabilityChangedNotificationAsDismissed = (\n capabilityName: ParticipantCapabilityName,\n trackedNotifications: TrackedCapabilityChangedNotifications\n): TrackedCapabilityChangedNotifications => {\n const now = new Date(Date.now());\n const existingNotification = trackedNotifications[capabilityName];\n\n return {\n ...trackedNotifications,\n [capabilityName]: {\n ...(existingNotification || {}),\n lastDismissedAt: now\n }\n };\n};\n\n/* @conditional-compile-remove(capabilities) */\ninterface CapabilitiesChangedInfoAndRole {\n capabilitiesChangeInfo?: CapabilitiesChangeInfo;\n participantRole?: ParticipantRole;\n}\n\n/* @conditional-compile-remove(capabilities) */\ntype LatestCapabilityChangedNotificationRecord = Partial<\n Record<ParticipantCapabilityName, CapabalityChangedNotification>\n>;\n\n/* @conditional-compile-remove(capabilities) */\nconst updateLatestCapabilityChangedNotificationMap = (\n capabilitiesChangedInfoAndRole: CapabilitiesChangedInfoAndRole,\n activeNotifications: LatestCapabilityChangedNotificationRecord\n): LatestCapabilityChangedNotificationRecord => {\n if (!capabilitiesChangedInfoAndRole.capabilitiesChangeInfo) {\n return activeNotifications;\n }\n\n for (const [capabilityKey, newCapabilityValue] of Object.entries(\n capabilitiesChangedInfoAndRole.capabilitiesChangeInfo.newValue\n )) {\n // Cast is safe because we are iterating over the enum keys on the object.entries where\n // newCapabilityValue typing is correctly returned. Object.entries limitations\n // always returns string for the key\n const capabilityName = capabilityKey as ParticipantCapabilityName;\n // If the active notification for a capability has the same `isPresent` value and the same reason as the new\n // capability value from the SDK then we will not create a new notification to avoid redundancy\n if (\n activeNotifications[capabilityName] &&\n newCapabilityValue.isPresent === activeNotifications[capabilityName]?.isPresent &&\n capabilitiesChangedInfoAndRole.capabilitiesChangeInfo.reason ===\n activeNotifications[capabilityName]?.changedReason\n ) {\n continue;\n }\n const newCapabilityChangeNotification: CapabalityChangedNotification = {\n capabilityName: capabilityName,\n isPresent: newCapabilityValue.isPresent,\n changedReason: capabilitiesChangedInfoAndRole.capabilitiesChangeInfo.reason,\n role: capabilitiesChangedInfoAndRole.participantRole,\n timestamp: new Date(Date.now())\n };\n activeNotifications[capabilityName] = newCapabilityChangeNotification;\n }\n return activeNotifications;\n};\n"]}
|
@@ -309,13 +309,21 @@ export const disableCallControls = (callControlOptions, disabledControls) => {
|
|
309
309
|
let newOptions = (_a = (callControlOptions instanceof Object ? Object.assign({}, callControlOptions) : callControlOptions)) !== null && _a !== void 0 ? _a : {};
|
310
310
|
if (newOptions === true || newOptions === undefined) {
|
311
311
|
newOptions = disabledControls.reduce((acc, key) => {
|
312
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
313
|
+
// @ts-expect-error TODO: fix noImplicitAny error here
|
314
|
+
// Not solveable at this time due to typescript limitations. The typing is too complex for typescript to
|
315
|
+
// understand. Will need to revisit when either typescript or the calling component bindings are updated.
|
312
316
|
acc[key] = { disabled: true };
|
313
317
|
return acc;
|
314
318
|
}, {});
|
315
319
|
}
|
316
320
|
else {
|
317
321
|
disabledControls.forEach((key) => {
|
322
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
323
|
+
// @ts-expect-error refer to above comment
|
318
324
|
if (newOptions[key] !== false) {
|
325
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
326
|
+
// @ts-expect-error refer to above comment
|
319
327
|
newOptions[key] = { disabled: true };
|
320
328
|
}
|
321
329
|
});
|