@azure/communication-react 1.20.0-alpha-202409241651 → 1.20.0-alpha-202409260015
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 +15 -14
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-4h-naDvk.js → ChatMessageComponentAsRichTextEditBox-D42-cJxc.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-4h-naDvk.js.map → ChatMessageComponentAsRichTextEditBox-D42-cJxc.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-ChJjJ010.js → RichTextSendBoxWrapper-BkOCT0LJ.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-ChJjJ010.js.map → RichTextSendBoxWrapper-BkOCT0LJ.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-DwDfOjtr.js → index-Bb1hVEre.js} +157 -344
- package/dist/dist-cjs/communication-react/index-Bb1hVEre.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +2 -2
- package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js +1 -3
- package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +0 -5
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +3 -12
- package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js +2 -7
- package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.d.ts +3 -0
- package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js +8 -22
- package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/incomingCallStackSelector.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +3 -8
- package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.d.ts +7 -3
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js +8 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.d.ts +3 -2
- package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +2 -4
- package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +1 -6
- package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +3 -3
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/Converter.d.ts +1 -1
- package/dist/dist-esm/calling-stateful-client/src/Converter.js +0 -2
- package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.d.ts +0 -1
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js +0 -4
- package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/UserFacingDiagnosticsSubscriber.js +2 -1
- package/dist/dist-esm/calling-stateful-client/src/UserFacingDiagnosticsSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.js +0 -2
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/IncomingCallNotification.js +7 -30
- package/dist/dist-esm/react-components/src/components/IncomingCallNotification.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/IncomingCallStack.js +1 -5
- package/dist/dist-esm/react-components/src/components/IncomingCallStack.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/InputBoxButton.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/InputBoxButton.js +8 -9
- package/dist/dist-esm/react-components/src/components/InputBoxButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js +0 -2
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantList.js +1 -4
- package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +5 -7
- package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +14 -18
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/SendBox.js +11 -21
- package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/StreamMedia.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/StreamMedia.js +5 -3
- package/dist/dist-esm/react-components/src/components/StreamMedia.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +1 -6
- package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery.js +1 -3
- package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoTile.d.ts +2 -0
- package/dist/dist-esm/react-components/src/components/VideoTile.js +3 -11
- package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.js +0 -2
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.d.ts +1 -4
- package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js +2 -4
- package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/StreamMedia.styles.d.ts +8 -0
- package/dist/dist-esm/react-components/src/components/styles/StreamMedia.styles.js +27 -0
- package/dist/dist-esm/react-components/src/components/styles/StreamMedia.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +3 -3
- package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +3 -3
- package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/theming/icons.js +0 -8
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/OnRender.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/ParticipantListParticipant.d.ts +1 -1
- package/dist/dist-esm/react-components/src/types/ParticipantListParticipant.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +1 -7
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +2 -10
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +3 -15
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +2 -11
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/HoldPane.js +8 -23
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/HoldPane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js +1 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +0 -4
- 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/HoldPage.js +0 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localAndRemotePIPSelector.d.ts +7 -8
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localAndRemotePIPSelector.js +1 -7
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localAndRemotePIPSelector.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +0 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +1 -8
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +5 -15
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +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/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +0 -6
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js +0 -2
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.js +3 -14
- package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/AvatarPersona.js +1 -3
- package/dist/dist-esm/react-composites/src/composites/common/AvatarPersona.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.js +1 -7
- package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +6 -19
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +0 -4
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +0 -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/PreparedMoreDrawer.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +2 -13
- package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/icons.js +0 -4
- package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.d.ts +4 -4
- package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.js.map +1 -1
- package/dist/tsdoc-metadata.json +1 -1
- package/package.json +1 -1
- package/dist/dist-cjs/communication-react/index-DwDfOjtr.js.map +0 -1
@@ -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,EAAuB,MAAM,wBAAwB,CAAC;AAClH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,EAAE,sDAA6C;AAGvG,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAgBtE,MAAM,oCAAoC,GAAG,IAAI,CAAC;AAClD,MAAM,wBAAwB,GAAG,MAAM,CAAC;AACxC,MAAM,2BAA2B,GAAG,CAAC,IAAI,EAAE,IAAI,EAAE,wBAAwB,CAAC,CAAC;AAC3E,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,0BAA0B,GAAG,IAAI,CAAC;AACxC,eAAe;AACf,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAC5C,eAAe;AACf,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAC;AAC5C,eAAe;AACf,MAAM,CAAC,MAAM,4BAA4B,GAAG,IAAI,CAAC;AACjD,eAAe;AACf,MAAM,CAAC,MAAM,+BAA+B,GAAG,IAAI,CAAC;AACpD,eAAe;AACf,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,CAAC;AAC3C,eAAe;AACf,MAAM,CAAC,MAAM,iBAAiB,GAAG,GAAG,CAAC;AACrC,eAAe;AACf,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,CAAC;AACpC,eAAe;AACf,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAAuB,EAAW,EAAE;IAC7D,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;QACf,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,MAAM,E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AAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;SAChC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CallAdapterState, CallCompositePage, END_CALL_PAGES, StartCallIdentifier } from '../adapter/CallAdapter';\nimport { _isInCall, _isPreviewOn, _isInLobbyOrConnecting } from '@internal/calling-component-bindings';\nimport { CallControlOptions } from '../types/CallControlOptions';\nimport { CallState, RemoteParticipantState } from '@internal/calling-stateful-client';\nimport { isPhoneNumberIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\nimport { AdapterStateModifier, CallAdapterLocator } from '../adapter/AzureCommunicationCallAdapter';\n\nimport { VideoBackgroundEffectsDependency } from '@internal/calling-component-bindings';\n\nimport { VideoBackgroundEffect } from '../adapter/CallAdapter';\nimport { VideoDeviceInfo } from '@azure/communication-calling';\n\nimport { VideoEffectProcessor } from '@azure/communication-calling';\nimport { CompositeLocale } from '../../localization';\nimport { CallCompositeIcons } from '../../common/icons';\n\nimport { ActiveNotification } from '@internal/react-components';\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];\nconst CALL_REJECTED_CODE = 603;\nconst INVALID_MEETING_IDENTIFIER = 5751;\n/** @private */\nexport const ROOM_NOT_FOUND_SUB_CODE = 5732;\n/** @private */\nexport const ROOM_NOT_VALID_SUB_CODE = 5829;\n/** @private */\nexport const NOT_INVITED_TO_ROOM_SUB_CODE = 5828;\n/** @private */\nexport const INVITE_TO_ROOM_REMOVED_SUB_CODE = 5317;\n/** @private */\nexport const CALL_TIMEOUT_SUB_CODE = 10004;\n/** @private */\nexport const CALL_TIMEOUT_CODE = 487;\n/** @private */\nexport const BOT_TIMEOUT_CODE = 486;\n/** @private */\nexport const BOT_TIMEOUT_SUB_CODE = 10321;\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 BAD_REQUEST\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 // If the call end reason code is 400, the call is ended due to a bad request. Keep this line at the bottom right before returning normal left call to catch the scenarios not including the ones above.\n if (call.callEndReason?.code === 400) {\n return CallEndReasons.BAD_REQUEST;\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 * Helper function for determine strings and icons for end call page\n * @private\n */\nexport const getEndedCallPageProps = (\n locale: CompositeLocale,\n endedCall?: CallState\n): { title: string; moreDetails?: string; disableStartCallButton: boolean; iconName: keyof CallCompositeIcons } => {\n let title = locale.strings.call.leftCallTitle;\n let moreDetails = locale.strings.call.leftCallMoreDetails;\n let disableStartCallButton = false;\n let iconName: keyof CallCompositeIcons = 'NoticePageLeftCall';\n switch (endedCall?.callEndReason?.subCode) {\n case ROOM_NOT_FOUND_SUB_CODE:\n if (locale.strings.call.roomNotFoundTitle) {\n title = locale.strings.call.roomNotFoundTitle;\n moreDetails = locale.strings.call.roomNotFoundDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageRoomNotFound';\n }\n break;\n case ROOM_NOT_VALID_SUB_CODE:\n if (locale.strings.call.roomNotValidTitle) {\n title = locale.strings.call.roomNotValidTitle;\n moreDetails = locale.strings.call.roomNotValidDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageRoomNotValid';\n }\n break;\n case NOT_INVITED_TO_ROOM_SUB_CODE:\n if (locale.strings.call.notInvitedToRoomTitle) {\n title = locale.strings.call.notInvitedToRoomTitle;\n moreDetails = locale.strings.call.notInvitedToRoomDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageNotInvitedToRoom';\n }\n break;\n case INVITE_TO_ROOM_REMOVED_SUB_CODE:\n if (locale.strings.call.inviteToRoomRemovedTitle) {\n title = locale.strings.call.inviteToRoomRemovedTitle;\n moreDetails = locale.strings.call.inviteToRoomRemovedDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageInviteToRoomRemoved';\n }\n break;\n case CALL_TIMEOUT_SUB_CODE:\n if (endedCall?.callEndReason?.code === CALL_TIMEOUT_CODE && locale.strings.call.callTimeoutTitle) {\n title = locale.strings.call.callTimeoutTitle;\n moreDetails = locale.strings.call.callTimeoutDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageCallTimeout';\n }\n break;\n case BOT_TIMEOUT_SUB_CODE:\n if (endedCall?.callEndReason?.code === BOT_TIMEOUT_CODE && locale.strings.call.callTimeoutBotTitle) {\n title = locale.strings.call.callTimeoutBotTitle;\n moreDetails = locale.strings.call.callTimeoutBotDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageCallTimeout';\n }\n break;\n }\n\n switch (endedCall?.callEndReason?.code) {\n case CALL_REJECTED_CODE:\n if (locale.strings.call.callRejectedTitle) {\n title = locale.strings.call.callRejectedTitle;\n moreDetails = locale.strings.call.callRejectedMoreDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageCallRejected';\n }\n break;\n }\n /* @conditional-compile-remove(teams-adhoc-call) */\n switch (endedCall?.callEndReason?.subCode) {\n case 10037:\n if (locale.strings.call.participantCouldNotBeReachedTitle) {\n title = locale.strings.call.participantCouldNotBeReachedTitle;\n moreDetails = locale.strings.call.participantCouldNotBeReachedMoreDetails;\n disableStartCallButton = true;\n }\n break;\n case 10124:\n if (locale.strings.call.permissionToReachTargetParticipantNotAllowedTitle) {\n title = locale.strings.call.permissionToReachTargetParticipantNotAllowedTitle;\n moreDetails = locale.strings.call.permissionToReachTargetParticipantNotAllowedMoreDetails;\n disableStartCallButton = true;\n }\n break;\n case 10119:\n if (locale.strings.call.unableToResolveTenantTitle) {\n title = locale.strings.call.unableToResolveTenantTitle;\n moreDetails = locale.strings.call.unableToResolveTenantMoreDetails;\n disableStartCallButton = true;\n }\n break;\n case 10044:\n if (locale.strings.call.participantIdIsMalformedTitle) {\n title = locale.strings.call.participantIdIsMalformedTitle;\n moreDetails = locale.strings.call.participantIdIsMalformedMoreDetails;\n disableStartCallButton = true;\n }\n break;\n }\n switch (endedCall?.callEndReason?.subCode) {\n case INVALID_MEETING_IDENTIFIER:\n if (locale.strings.call.callRejectedTitle) {\n title = locale.strings.call.callRejectedTitle;\n moreDetails = locale.strings.call.invalidMeetingIdentifier;\n disableStartCallButton = true;\n }\n break;\n }\n // keep this at the bottom to catch the scenarios not including the ones above.\n switch (endedCall?.callEndReason?.code) {\n case 400:\n if (locale.strings.call.callRejectedTitle) {\n title = locale.strings.call.callRejectedTitle;\n disableStartCallButton = true;\n }\n break;\n }\n return { title, moreDetails, disableStartCallButton, iconName };\n};\n\n/**\n * type definition for conditional-compilation\n */\ntype GetCallCompositePageFunction = ((\n call: CallState | undefined,\n previousCall: CallState | undefined\n) => CallCompositePage) &\n ((\n call: CallState | undefined,\n previousCall: CallState | undefined,\n transferCall?: CallState,\n originCall?: CallState,\n /* @conditional-compile-remove(unsupported-browser) */ unsupportedBrowserInfo?: {\n environmentInfo?: EnvironmentInfo;\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 transferCall?: CallState,\n originCall?: CallState,\n unsupportedBrowserInfo?: {\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo?: EnvironmentInfo;\n unsupportedBrowserVersionOptedIn?: boolean;\n }\n): CallCompositePage => {\n /* @conditional-compile-remove(unsupported-browser) */\n if (\n isUnsupportedEnvironment(\n unsupportedBrowserInfo?.environmentInfo,\n unsupportedBrowserInfo?.unsupportedBrowserVersionOptedIn\n )\n ) {\n return 'unsupportedEnvironment';\n }\n\n if (transferCall !== undefined) {\n return 'transferring';\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 (call?.state === 'Disconnecting') {\n return 'leaving';\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 // /* @conditional-compile-remove(breakout-rooms) */\n if (previousCall?.breakoutRooms?.breakoutRoomOriginCallId && originCall) {\n return 'call';\n }\n\n if (previousCall) {\n const reason = getCallEndReason(previousCall);\n switch (reason) {\n case CallEndReasons.ACCESS_DENIED:\n return 'accessDeniedTeamsMeeting';\n case CallEndReasons.REMOVED_FROM_CALL:\n return 'removedFromCall';\n case CallEndReasons.BAD_REQUEST:\n return 'badRequest';\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: CallCompositePage\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 | boolean | undefined =\n (callControlOptions instanceof Object ? ({ ...callControlOptions } as CallControlOptions) : callControlOptions) ??\n ({} as Partial<CallControlOptions>);\n if (newOptions === true || newOptions === undefined) {\n newOptions = disabledControls.reduce((acc, key) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // @ts-expect-error TODO: fix noImplicitAny error here\n // Not solveable at this time due to typescript limitations. The typing is too complex for typescript to\n // understand. Will need to revisit when either typescript or the calling component bindings are updated.\n acc[key] = { disabled: true };\n return acc;\n }, {} as Partial<CallControlOptions>);\n } else {\n disabledControls.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // @ts-expect-error refer to above comment\n if (newOptions[key] !== false) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // @ts-expect-error refer to above comment\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 * @returns Permissions state for the camera.\n */\nconst queryCameraPermissionFromPermissionsAPI = async (): Promise<PermissionState | 'unsupported'> => {\n try {\n return (await navigator.permissions.query({ name: 'camera' as PermissionName })).state;\n } catch (e) {\n console.info('permissions API is not supported by browser', e);\n return 'unsupported';\n }\n};\n\n/* @conditional-compile-remove(call-readiness) */\n/**\n * @returns Permissions state for the microphone.\n */\nconst queryMicrophonePermissionFromPermissionsAPI = async (): Promise<PermissionState | 'unsupported'> => {\n try {\n return (await navigator.permissions.query({ name: 'microphone' as PermissionName })).state;\n } catch (e) {\n console.info('permissions API is not supported by browser', e);\n return 'unsupported';\n }\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, permission state is set to unsupported.\n * @private\n */\nexport const getDevicePermissionState = async (\n setVideoState: (state: PermissionState | 'unsupported') => void,\n setAudioState: (state: PermissionState | 'unsupported') => void\n): Promise<void> => {\n const [cameraResult, microphoneResult] = await Promise.all([\n queryCameraPermissionFromPermissionsAPI(),\n queryMicrophonePermissionFromPermissionsAPI()\n ]);\n setVideoState(cameraResult);\n setAudioState(microphoneResult);\n};\n/* @conditional-compile-remove(unsupported-browser) */\nconst isUnsupportedEnvironment = (\n environmentInfo?: EnvironmentInfo,\n unsupportedBrowserVersionOptedIn?: boolean\n): boolean => {\n return !!(\n environmentInfo?.isSupportedBrowser === false ||\n (environmentInfo?.isSupportedBrowserVersion === false && !unsupportedBrowserVersionOptedIn) ||\n environmentInfo?.isSupportedPlatform === false\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.toLowerCase() === 'safari';\n return /^((?!chrome|android|crios|fxios).)*safari/i.test(navigator.userAgent);\n};\n\n/**\n * @private\n * This is the util function to create a participant modifier for remote participantList\n * It memoize previous original participant items and only update the changed participant\n * It takes in one modifier function to generate one single participant object, it returns undefined if the object keeps unmodified\n */\nexport const createParticipantModifier = (\n createModifiedParticipant: (id: string, participant: RemoteParticipantState) => RemoteParticipantState | undefined\n): AdapterStateModifier => {\n let previousParticipantState:\n | {\n [keys: string]: RemoteParticipantState;\n }\n | undefined = undefined;\n let modifiedParticipants: {\n [keys: string]: RemoteParticipantState;\n } = {};\n const memoizedParticipants: {\n [id: string]: { originalRef: RemoteParticipantState; newParticipant: RemoteParticipantState };\n } = {};\n\n return (state: CallAdapterState) => {\n // if root state is the same, we don't need to update the participants\n if (state.call?.remoteParticipants !== previousParticipantState) {\n modifiedParticipants = {};\n const originalParticipants = state.call?.remoteParticipants;\n for (const key in originalParticipants) {\n const modifiedParticipant = createModifiedParticipant(key, originalParticipants[key]);\n if (modifiedParticipant === undefined) {\n modifiedParticipants[key] = originalParticipants[key];\n continue;\n }\n // Generate the new item if original cached item has been changed\n if (memoizedParticipants[key]?.originalRef !== originalParticipants[key]) {\n memoizedParticipants[key] = {\n newParticipant: modifiedParticipant,\n originalRef: originalParticipants[key]\n };\n }\n\n // the modified participant is always coming from the memoized cache, whether is was refreshed\n // from the previous closure or not\n modifiedParticipants[key] = memoizedParticipants[key].newParticipant;\n }\n\n previousParticipantState = state.call?.remoteParticipants;\n }\n return {\n ...state,\n call: state.call\n ? {\n ...state.call,\n remoteParticipants: modifiedParticipants\n }\n : undefined\n };\n };\n};\n\n/** @private */\nexport const getBackgroundEffectFromSelectedEffect = (\n selectedEffect: VideoBackgroundEffect | undefined,\n VideoBackgroundEffectsDependency: VideoBackgroundEffectsDependency\n): VideoEffectProcessor | undefined =>\n selectedEffect?.effectName === 'blur'\n ? VideoBackgroundEffectsDependency.createBackgroundBlurEffect()\n : selectedEffect?.effectName === 'replacement'\n ? VideoBackgroundEffectsDependency.createBackgroundReplacementEffect({\n backgroundImageUrl: selectedEffect.backgroundImageUrl\n })\n : undefined;\n\n/**\n * @remarks this logic should mimic the onToggleCamera in the common call handlers.\n * @private\n */\nexport const getSelectedCameraFromAdapterState = (state: CallAdapterState): VideoDeviceInfo | undefined =>\n state.devices.selectedCamera || state.devices.cameras[0];\n\n/**\n * Helper to determine if the adapter has a locator or targetCallees\n * @param locatorOrTargetCallees\n * @returns boolean to determine if the adapter has a locator or targetCallees, true is locator, false is targetCallees\n * @private\n */\nexport const getLocatorOrTargetCallees = (\n locatorOrTargetCallees: CallAdapterLocator | StartCallIdentifier[]\n): locatorOrTargetCallees is StartCallIdentifier[] => {\n return !!Array.isArray(locatorOrTargetCallees);\n};\n\n/**\n * @private\n */\nexport type ComplianceState = 'on' | 'off' | 'stopped';\n\n/**\n * Return different conditions based on the current and previous state of recording and transcribing\n *\n * @param callRecordState - The current call record state: on, off, stopped\n * @param callTranscribeState - The current call transcribe state: on, off, stopped\n *\n * @remarks - The stopped state means: previously on but currently off\n *\n * @private\n */\nexport const computeVariant = (\n callRecordState: ComplianceState,\n callTranscribeState: ComplianceState\n): ComplianceNotificationVariant => {\n if (callRecordState === 'on' && callTranscribeState === 'on') {\n return 'recordingAndTranscriptionStarted';\n } else if (callRecordState === 'on' && callTranscribeState === 'off') {\n return 'recordingStarted';\n } else if (callRecordState === 'off' && callTranscribeState === 'on') {\n return 'transcriptionStarted';\n } else if (callRecordState === 'on' && callTranscribeState === 'stopped') {\n return 'transcriptionStoppedStillRecording';\n } else if (callRecordState === 'stopped' && callTranscribeState === 'on') {\n return 'recordingStoppedStillTranscribing';\n } else if (callRecordState === 'off' && callTranscribeState === 'stopped') {\n return 'transcriptionStopped';\n } else if (callRecordState === 'stopped' && callTranscribeState === 'off') {\n return 'recordingStopped';\n } else if (callRecordState === 'stopped' && callTranscribeState === 'stopped') {\n return 'recordingAndTranscriptionStopped';\n } else {\n return 'noState';\n }\n};\n\n/**\n * @private\n */\nexport type ComplianceNotificationVariant =\n | 'noState'\n | 'recordingStarted'\n | 'transcriptionStarted'\n | 'recordingStopped'\n | 'transcriptionStopped'\n | 'recordingAndTranscriptionStarted'\n | 'recordingAndTranscriptionStopped'\n | 'recordingStoppedStillTranscribing'\n | 'transcriptionStoppedStillRecording';\n\n/**\n * @private\n */\nexport type CachedComplianceNotificationProps = {\n latestBooleanState: {\n callTranscribeState?: boolean;\n callRecordState?: boolean;\n };\n latestStringState: {\n callTranscribeState: ComplianceState;\n callRecordState: ComplianceState;\n };\n // Timestamp for the last time cached state was updated.\n // Represented as milliseconds since epoch (i.e., the value returned by Date.now()).\n lastUpdated: number;\n};\n\n/**\n * @private\n */\nexport function determineStates(previous: ComplianceState, current: boolean | undefined): ComplianceState {\n // if current state is on, then return on\n if (current) {\n return 'on';\n }\n // if current state is off\n else {\n // if previous state is on and current state is off, return stopped (on -> off)\n if (previous === 'on') {\n return 'stopped';\n }\n // otherwise remain previous state unchanged\n else {\n return previous;\n }\n }\n}\n\n// The debounce time for the stopped state to be shown after both states are stopped.\n// This is to prevent stopped messages from being lost by transitioning to \"Off\" too\n// quickly if the states are toggled in quick succession.\n// This also prevents React strict mode from transitioning to \"Off\" too quickly.\nconst ComplianceNotificationOffDebounceTimeMs = 2000;\n\n/**\n * Compute compliance notification based on latest compliance state and cached props.\n * @private\n */\nexport function computeComplianceNotification(\n complianceProps: {\n callTranscribeState: boolean;\n callRecordState: boolean;\n },\n cachedProps: React.MutableRefObject<CachedComplianceNotificationProps>\n): ActiveNotification | undefined {\n // Only update cached props and variant if there is _some_ change in the latest props.\n // This ensures that state machine is only updated if there is an actual change in the props.\n const shouldUpdateCached =\n complianceProps.callRecordState !== cachedProps.current.latestBooleanState.callRecordState ||\n complianceProps.callTranscribeState !== cachedProps.current.latestBooleanState.callTranscribeState;\n\n // The following three operations must be performed in this exact order:\n\n // [1]: Update cached state to transition the state machine.\n if (shouldUpdateCached) {\n cachedProps.current = {\n latestBooleanState: complianceProps,\n latestStringState: {\n callRecordState: determineStates(\n cachedProps.current.latestStringState.callRecordState,\n complianceProps.callRecordState\n ),\n callTranscribeState: determineStates(\n cachedProps.current.latestStringState.callTranscribeState,\n complianceProps.callTranscribeState\n )\n },\n lastUpdated: Date.now()\n };\n }\n\n // [2]: If the callRecordState and callTranscribeState are both stopped for a predetermined amount of time, mark both states as off.\n // NOTE: this can be removed once lastStoppedRecording in the calling stateful client is GA.\n if (\n shouldUpdateCached &&\n cachedProps.current.latestStringState.callRecordState === 'stopped' &&\n cachedProps.current.latestStringState.callTranscribeState === 'stopped' &&\n Date.now() - cachedProps.current.lastUpdated > ComplianceNotificationOffDebounceTimeMs\n ) {\n // When both states are stopped, after displaying message \"RECORDING_AND_TRANSCRIPTION_STOPPED\", change both states to off (going back to the default state).\n cachedProps.current.latestStringState.callRecordState = 'off';\n cachedProps.current.latestStringState.callTranscribeState = 'off';\n }\n\n // [3]: Compute the variant, using the transitioned state machine.\n const variant = computeVariant(\n cachedProps.current.latestStringState.callRecordState,\n cachedProps.current.latestStringState.callTranscribeState\n );\n\n // If the variant is not 'noState', then show the notification.\n if (variant !== 'noState') {\n return {\n type: variant,\n timestamp: new Date(Date.now())\n };\n } else {\n return undefined;\n }\n}\n"]}
|
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,EAAuB,MAAM,wBAAwB,CAAC;AAClH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,sBAAsB,EAAE,sDAA6C;AAGvG,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAgBtE,MAAM,oCAAoC,GAAG,IAAI,CAAC;AAClD,MAAM,wBAAwB,GAAG,MAAM,CA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mBAAmB,CACpC;aACF;YACD,WAAW,EAAE,IAAI,CAAC,GAAG,EAAE;SACxB,CAAC;IACJ,CAAC;IAED,oIAAoI;IACpI,4FAA4F;IAC5F,IACE,kBAAkB;QAClB,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,eAAe,KAAK,SAAS;QACnE,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,mBAAmB,KAAK,SAAS;QACvE,IAAI,CAAC,GAAG,EAAE,GAAG,WAAW,CAAC,OAAO,CAAC,WAAW,GAAG,uCAAuC,EACtF,CAAC;QACD,6JAA6J;QAC7J,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,eAAe,GAAG,KAAK,CAAC;QAC9D,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,mBAAmB,GAAG,KAAK,CAAC;IACpE,CAAC;IAED,kEAAkE;IAClE,MAAM,OAAO,GAAG,cAAc,CAC5B,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,eAAe,EACrD,WAAW,CAAC,OAAO,CAAC,iBAAiB,CAAC,mBAAmB,CAC1D,CAAC;IAEF,+DAA+D;IAC/D,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO;YACL,IAAI,EAAE,OAAO;YACb,SAAS,EAAE,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC;SAChC,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CallAdapterState, CallCompositePage, END_CALL_PAGES, StartCallIdentifier } from '../adapter/CallAdapter';\nimport { _isInCall, _isPreviewOn, _isInLobbyOrConnecting } from '@internal/calling-component-bindings';\nimport { CallControlOptions } from '../types/CallControlOptions';\nimport { CallState, RemoteParticipantState } from '@internal/calling-stateful-client';\nimport { isPhoneNumberIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\nimport { AdapterStateModifier, CallAdapterLocator } from '../adapter/AzureCommunicationCallAdapter';\n\nimport { VideoBackgroundEffectsDependency } from '@internal/calling-component-bindings';\n\nimport { VideoBackgroundEffect } from '../adapter/CallAdapter';\nimport { VideoDeviceInfo } from '@azure/communication-calling';\n\nimport { VideoEffectProcessor } from '@azure/communication-calling';\nimport { CompositeLocale } from '../../localization';\nimport { CallCompositeIcons } from '../../common/icons';\n\nimport { ActiveNotification } from '@internal/react-components';\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];\nconst CALL_REJECTED_CODE = 603;\nconst INVALID_MEETING_IDENTIFIER = 5751;\n/** @private */\nexport const ROOM_NOT_FOUND_SUB_CODE = 5732;\n/** @private */\nexport const ROOM_NOT_VALID_SUB_CODE = 5829;\n/** @private */\nexport const NOT_INVITED_TO_ROOM_SUB_CODE = 5828;\n/** @private */\nexport const INVITE_TO_ROOM_REMOVED_SUB_CODE = 5317;\n/** @private */\nexport const CALL_TIMEOUT_SUB_CODE = 10004;\n/** @private */\nexport const CALL_TIMEOUT_CODE = 487;\n/** @private */\nexport const BOT_TIMEOUT_CODE = 486;\n/** @private */\nexport const BOT_TIMEOUT_SUB_CODE = 10321;\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 BAD_REQUEST\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 // If the call end reason code is 400, the call is ended due to a bad request. Keep this line at the bottom right before returning normal left call to catch the scenarios not including the ones above.\n if (call.callEndReason?.code === 400) {\n return CallEndReasons.BAD_REQUEST;\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 * Helper function for determine strings and icons for end call page\n * @private\n */\nexport const getEndedCallPageProps = (\n locale: CompositeLocale,\n endedCall?: CallState\n): { title: string; moreDetails?: string; disableStartCallButton: boolean; iconName: keyof CallCompositeIcons } => {\n let title = locale.strings.call.leftCallTitle;\n let moreDetails = locale.strings.call.leftCallMoreDetails;\n let disableStartCallButton = false;\n let iconName: keyof CallCompositeIcons = 'NoticePageLeftCall';\n switch (endedCall?.callEndReason?.subCode) {\n case ROOM_NOT_FOUND_SUB_CODE:\n if (locale.strings.call.roomNotFoundTitle) {\n title = locale.strings.call.roomNotFoundTitle;\n moreDetails = locale.strings.call.roomNotFoundDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageRoomNotFound';\n }\n break;\n case ROOM_NOT_VALID_SUB_CODE:\n if (locale.strings.call.roomNotValidTitle) {\n title = locale.strings.call.roomNotValidTitle;\n moreDetails = locale.strings.call.roomNotValidDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageRoomNotValid';\n }\n break;\n case NOT_INVITED_TO_ROOM_SUB_CODE:\n if (locale.strings.call.notInvitedToRoomTitle) {\n title = locale.strings.call.notInvitedToRoomTitle;\n moreDetails = locale.strings.call.notInvitedToRoomDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageNotInvitedToRoom';\n }\n break;\n case INVITE_TO_ROOM_REMOVED_SUB_CODE:\n if (locale.strings.call.inviteToRoomRemovedTitle) {\n title = locale.strings.call.inviteToRoomRemovedTitle;\n moreDetails = locale.strings.call.inviteToRoomRemovedDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageInviteToRoomRemoved';\n }\n break;\n case CALL_TIMEOUT_SUB_CODE:\n if (endedCall?.callEndReason?.code === CALL_TIMEOUT_CODE && locale.strings.call.callTimeoutTitle) {\n title = locale.strings.call.callTimeoutTitle;\n moreDetails = locale.strings.call.callTimeoutDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageCallTimeout';\n }\n break;\n case BOT_TIMEOUT_SUB_CODE:\n if (endedCall?.callEndReason?.code === BOT_TIMEOUT_CODE && locale.strings.call.callTimeoutBotTitle) {\n title = locale.strings.call.callTimeoutBotTitle;\n moreDetails = locale.strings.call.callTimeoutBotDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageCallTimeout';\n }\n break;\n }\n switch (endedCall?.callEndReason?.code) {\n case CALL_REJECTED_CODE:\n if (locale.strings.call.callRejectedTitle) {\n title = locale.strings.call.callRejectedTitle;\n moreDetails = locale.strings.call.callRejectedMoreDetails;\n disableStartCallButton = true;\n iconName = 'NoticePageCallRejected';\n }\n break;\n }\n switch (endedCall?.callEndReason?.subCode) {\n case 10037:\n if (locale.strings.call.participantCouldNotBeReachedTitle) {\n title = locale.strings.call.participantCouldNotBeReachedTitle;\n moreDetails = locale.strings.call.participantCouldNotBeReachedMoreDetails;\n disableStartCallButton = true;\n }\n break;\n case 10124:\n if (locale.strings.call.permissionToReachTargetParticipantNotAllowedTitle) {\n title = locale.strings.call.permissionToReachTargetParticipantNotAllowedTitle;\n moreDetails = locale.strings.call.permissionToReachTargetParticipantNotAllowedMoreDetails;\n disableStartCallButton = true;\n }\n break;\n case 10119:\n if (locale.strings.call.unableToResolveTenantTitle) {\n title = locale.strings.call.unableToResolveTenantTitle;\n moreDetails = locale.strings.call.unableToResolveTenantMoreDetails;\n disableStartCallButton = true;\n }\n break;\n case 10044:\n if (locale.strings.call.participantIdIsMalformedTitle) {\n title = locale.strings.call.participantIdIsMalformedTitle;\n moreDetails = locale.strings.call.participantIdIsMalformedMoreDetails;\n disableStartCallButton = true;\n }\n break;\n }\n switch (endedCall?.callEndReason?.subCode) {\n case INVALID_MEETING_IDENTIFIER:\n if (locale.strings.call.callRejectedTitle) {\n title = locale.strings.call.callRejectedTitle;\n moreDetails = locale.strings.call.invalidMeetingIdentifier;\n disableStartCallButton = true;\n }\n break;\n }\n // keep this at the bottom to catch the scenarios not including the ones above.\n switch (endedCall?.callEndReason?.code) {\n case 400:\n if (locale.strings.call.callRejectedTitle) {\n title = locale.strings.call.callRejectedTitle;\n disableStartCallButton = true;\n }\n break;\n }\n return { title, moreDetails, disableStartCallButton, iconName };\n};\n\n/**\n * type definition for conditional-compilation\n */\ntype GetCallCompositePageFunction = ((\n call: CallState | undefined,\n previousCall: CallState | undefined\n) => CallCompositePage) &\n ((\n call: CallState | undefined,\n previousCall: CallState | undefined,\n transferCall?: CallState,\n originCall?: CallState,\n /* @conditional-compile-remove(unsupported-browser) */ unsupportedBrowserInfo?: {\n environmentInfo?: EnvironmentInfo;\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 transferCall?: CallState,\n originCall?: CallState,\n unsupportedBrowserInfo?: {\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo?: EnvironmentInfo;\n unsupportedBrowserVersionOptedIn?: boolean;\n }\n): CallCompositePage => {\n /* @conditional-compile-remove(unsupported-browser) */\n if (\n isUnsupportedEnvironment(\n unsupportedBrowserInfo?.environmentInfo,\n unsupportedBrowserInfo?.unsupportedBrowserVersionOptedIn\n )\n ) {\n return 'unsupportedEnvironment';\n }\n\n if (transferCall !== undefined) {\n return 'transferring';\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 return 'hold';\n } else if (call?.state === 'Disconnecting') {\n return 'leaving';\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 // /* @conditional-compile-remove(breakout-rooms) */\n if (previousCall?.breakoutRooms?.breakoutRoomOriginCallId && originCall) {\n return 'call';\n }\n\n if (previousCall) {\n const reason = getCallEndReason(previousCall);\n switch (reason) {\n case CallEndReasons.ACCESS_DENIED:\n return 'accessDeniedTeamsMeeting';\n case CallEndReasons.REMOVED_FROM_CALL:\n return 'removedFromCall';\n case CallEndReasons.BAD_REQUEST:\n return 'badRequest';\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: CallCompositePage\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 | boolean | undefined =\n (callControlOptions instanceof Object ? ({ ...callControlOptions } as CallControlOptions) : callControlOptions) ??\n ({} as Partial<CallControlOptions>);\n if (newOptions === true || newOptions === undefined) {\n newOptions = disabledControls.reduce((acc, key) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // @ts-expect-error TODO: fix noImplicitAny error here\n // Not solveable at this time due to typescript limitations. The typing is too complex for typescript to\n // understand. Will need to revisit when either typescript or the calling component bindings are updated.\n acc[key] = { disabled: true };\n return acc;\n }, {} as Partial<CallControlOptions>);\n } else {\n disabledControls.forEach((key) => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // @ts-expect-error refer to above comment\n if (newOptions[key] !== false) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n // @ts-expect-error refer to above comment\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 * @returns Permissions state for the camera.\n */\nconst queryCameraPermissionFromPermissionsAPI = async (): Promise<PermissionState | 'unsupported'> => {\n try {\n return (await navigator.permissions.query({ name: 'camera' as PermissionName })).state;\n } catch (e) {\n console.info('permissions API is not supported by browser', e);\n return 'unsupported';\n }\n};\n\n/* @conditional-compile-remove(call-readiness) */\n/**\n * @returns Permissions state for the microphone.\n */\nconst queryMicrophonePermissionFromPermissionsAPI = async (): Promise<PermissionState | 'unsupported'> => {\n try {\n return (await navigator.permissions.query({ name: 'microphone' as PermissionName })).state;\n } catch (e) {\n console.info('permissions API is not supported by browser', e);\n return 'unsupported';\n }\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, permission state is set to unsupported.\n * @private\n */\nexport const getDevicePermissionState = async (\n setVideoState: (state: PermissionState | 'unsupported') => void,\n setAudioState: (state: PermissionState | 'unsupported') => void\n): Promise<void> => {\n const [cameraResult, microphoneResult] = await Promise.all([\n queryCameraPermissionFromPermissionsAPI(),\n queryMicrophonePermissionFromPermissionsAPI()\n ]);\n setVideoState(cameraResult);\n setAudioState(microphoneResult);\n};\n/* @conditional-compile-remove(unsupported-browser) */\nconst isUnsupportedEnvironment = (\n environmentInfo?: EnvironmentInfo,\n unsupportedBrowserVersionOptedIn?: boolean\n): boolean => {\n return !!(\n environmentInfo?.isSupportedBrowser === false ||\n (environmentInfo?.isSupportedBrowserVersion === false && !unsupportedBrowserVersionOptedIn) ||\n environmentInfo?.isSupportedPlatform === false\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.toLowerCase() === 'safari';\n return /^((?!chrome|android|crios|fxios).)*safari/i.test(navigator.userAgent);\n};\n\n/**\n * @private\n * This is the util function to create a participant modifier for remote participantList\n * It memoize previous original participant items and only update the changed participant\n * It takes in one modifier function to generate one single participant object, it returns undefined if the object keeps unmodified\n */\nexport const createParticipantModifier = (\n createModifiedParticipant: (id: string, participant: RemoteParticipantState) => RemoteParticipantState | undefined\n): AdapterStateModifier => {\n let previousParticipantState:\n | {\n [keys: string]: RemoteParticipantState;\n }\n | undefined = undefined;\n let modifiedParticipants: {\n [keys: string]: RemoteParticipantState;\n } = {};\n const memoizedParticipants: {\n [id: string]: { originalRef: RemoteParticipantState; newParticipant: RemoteParticipantState };\n } = {};\n\n return (state: CallAdapterState) => {\n // if root state is the same, we don't need to update the participants\n if (state.call?.remoteParticipants !== previousParticipantState) {\n modifiedParticipants = {};\n const originalParticipants = state.call?.remoteParticipants;\n for (const key in originalParticipants) {\n const modifiedParticipant = createModifiedParticipant(key, originalParticipants[key]);\n if (modifiedParticipant === undefined) {\n modifiedParticipants[key] = originalParticipants[key];\n continue;\n }\n // Generate the new item if original cached item has been changed\n if (memoizedParticipants[key]?.originalRef !== originalParticipants[key]) {\n memoizedParticipants[key] = {\n newParticipant: modifiedParticipant,\n originalRef: originalParticipants[key]\n };\n }\n\n // the modified participant is always coming from the memoized cache, whether is was refreshed\n // from the previous closure or not\n modifiedParticipants[key] = memoizedParticipants[key].newParticipant;\n }\n\n previousParticipantState = state.call?.remoteParticipants;\n }\n return {\n ...state,\n call: state.call\n ? {\n ...state.call,\n remoteParticipants: modifiedParticipants\n }\n : undefined\n };\n };\n};\n\n/** @private */\nexport const getBackgroundEffectFromSelectedEffect = (\n selectedEffect: VideoBackgroundEffect | undefined,\n VideoBackgroundEffectsDependency: VideoBackgroundEffectsDependency\n): VideoEffectProcessor | undefined =>\n selectedEffect?.effectName === 'blur'\n ? VideoBackgroundEffectsDependency.createBackgroundBlurEffect()\n : selectedEffect?.effectName === 'replacement'\n ? VideoBackgroundEffectsDependency.createBackgroundReplacementEffect({\n backgroundImageUrl: selectedEffect.backgroundImageUrl\n })\n : undefined;\n\n/**\n * @remarks this logic should mimic the onToggleCamera in the common call handlers.\n * @private\n */\nexport const getSelectedCameraFromAdapterState = (state: CallAdapterState): VideoDeviceInfo | undefined =>\n state.devices.selectedCamera || state.devices.cameras[0];\n\n/**\n * Helper to determine if the adapter has a locator or targetCallees\n * @param locatorOrTargetCallees\n * @returns boolean to determine if the adapter has a locator or targetCallees, true is locator, false is targetCallees\n * @private\n */\nexport const getLocatorOrTargetCallees = (\n locatorOrTargetCallees: CallAdapterLocator | StartCallIdentifier[]\n): locatorOrTargetCallees is StartCallIdentifier[] => {\n return !!Array.isArray(locatorOrTargetCallees);\n};\n\n/**\n * @private\n */\nexport type ComplianceState = 'on' | 'off' | 'stopped';\n\n/**\n * Return different conditions based on the current and previous state of recording and transcribing\n *\n * @param callRecordState - The current call record state: on, off, stopped\n * @param callTranscribeState - The current call transcribe state: on, off, stopped\n *\n * @remarks - The stopped state means: previously on but currently off\n *\n * @private\n */\nexport const computeVariant = (\n callRecordState: ComplianceState,\n callTranscribeState: ComplianceState\n): ComplianceNotificationVariant => {\n if (callRecordState === 'on' && callTranscribeState === 'on') {\n return 'recordingAndTranscriptionStarted';\n } else if (callRecordState === 'on' && callTranscribeState === 'off') {\n return 'recordingStarted';\n } else if (callRecordState === 'off' && callTranscribeState === 'on') {\n return 'transcriptionStarted';\n } else if (callRecordState === 'on' && callTranscribeState === 'stopped') {\n return 'transcriptionStoppedStillRecording';\n } else if (callRecordState === 'stopped' && callTranscribeState === 'on') {\n return 'recordingStoppedStillTranscribing';\n } else if (callRecordState === 'off' && callTranscribeState === 'stopped') {\n return 'transcriptionStopped';\n } else if (callRecordState === 'stopped' && callTranscribeState === 'off') {\n return 'recordingStopped';\n } else if (callRecordState === 'stopped' && callTranscribeState === 'stopped') {\n return 'recordingAndTranscriptionStopped';\n } else {\n return 'noState';\n }\n};\n\n/**\n * @private\n */\nexport type ComplianceNotificationVariant =\n | 'noState'\n | 'recordingStarted'\n | 'transcriptionStarted'\n | 'recordingStopped'\n | 'transcriptionStopped'\n | 'recordingAndTranscriptionStarted'\n | 'recordingAndTranscriptionStopped'\n | 'recordingStoppedStillTranscribing'\n | 'transcriptionStoppedStillRecording';\n\n/**\n * @private\n */\nexport type CachedComplianceNotificationProps = {\n latestBooleanState: {\n callTranscribeState?: boolean;\n callRecordState?: boolean;\n };\n latestStringState: {\n callTranscribeState: ComplianceState;\n callRecordState: ComplianceState;\n };\n // Timestamp for the last time cached state was updated.\n // Represented as milliseconds since epoch (i.e., the value returned by Date.now()).\n lastUpdated: number;\n};\n\n/**\n * @private\n */\nexport function determineStates(previous: ComplianceState, current: boolean | undefined): ComplianceState {\n // if current state is on, then return on\n if (current) {\n return 'on';\n }\n // if current state is off\n else {\n // if previous state is on and current state is off, return stopped (on -> off)\n if (previous === 'on') {\n return 'stopped';\n }\n // otherwise remain previous state unchanged\n else {\n return previous;\n }\n }\n}\n\n// The debounce time for the stopped state to be shown after both states are stopped.\n// This is to prevent stopped messages from being lost by transitioning to \"Off\" too\n// quickly if the states are toggled in quick succession.\n// This also prevents React strict mode from transitioning to \"Off\" too quickly.\nconst ComplianceNotificationOffDebounceTimeMs = 2000;\n\n/**\n * Compute compliance notification based on latest compliance state and cached props.\n * @private\n */\nexport function computeComplianceNotification(\n complianceProps: {\n callTranscribeState: boolean;\n callRecordState: boolean;\n },\n cachedProps: React.MutableRefObject<CachedComplianceNotificationProps>\n): ActiveNotification | undefined {\n // Only update cached props and variant if there is _some_ change in the latest props.\n // This ensures that state machine is only updated if there is an actual change in the props.\n const shouldUpdateCached =\n complianceProps.callRecordState !== cachedProps.current.latestBooleanState.callRecordState ||\n complianceProps.callTranscribeState !== cachedProps.current.latestBooleanState.callTranscribeState;\n\n // The following three operations must be performed in this exact order:\n\n // [1]: Update cached state to transition the state machine.\n if (shouldUpdateCached) {\n cachedProps.current = {\n latestBooleanState: complianceProps,\n latestStringState: {\n callRecordState: determineStates(\n cachedProps.current.latestStringState.callRecordState,\n complianceProps.callRecordState\n ),\n callTranscribeState: determineStates(\n cachedProps.current.latestStringState.callTranscribeState,\n complianceProps.callTranscribeState\n )\n },\n lastUpdated: Date.now()\n };\n }\n\n // [2]: If the callRecordState and callTranscribeState are both stopped for a predetermined amount of time, mark both states as off.\n // NOTE: this can be removed once lastStoppedRecording in the calling stateful client is GA.\n if (\n shouldUpdateCached &&\n cachedProps.current.latestStringState.callRecordState === 'stopped' &&\n cachedProps.current.latestStringState.callTranscribeState === 'stopped' &&\n Date.now() - cachedProps.current.lastUpdated > ComplianceNotificationOffDebounceTimeMs\n ) {\n // When both states are stopped, after displaying message \"RECORDING_AND_TRANSCRIPTION_STOPPED\", change both states to off (going back to the default state).\n cachedProps.current.latestStringState.callRecordState = 'off';\n cachedProps.current.latestStringState.callTranscribeState = 'off';\n }\n\n // [3]: Compute the variant, using the transitioned state machine.\n const variant = computeVariant(\n cachedProps.current.latestStringState.callRecordState,\n cachedProps.current.latestStringState.callTranscribeState\n );\n\n // If the variant is not 'noState', then show the notification.\n if (variant !== 'noState') {\n return {\n type: variant,\n timestamp: new Date(Date.now())\n };\n } else {\n return undefined;\n }\n}\n"]}
|
@@ -49,7 +49,7 @@ export interface CallWithChatControlOptions extends CommonCallControlOptions {
|
|
49
49
|
* Show or hide the chat button in the call-with-chat composite control bar.
|
50
50
|
* @defaultValue true
|
51
51
|
*/
|
52
|
-
chatButton?: boolean |
|
52
|
+
chatButton?: boolean | {
|
53
53
|
disabled: boolean;
|
54
54
|
};
|
55
55
|
}
|
package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js
CHANGED
@@ -74,7 +74,7 @@ const CallWithChatScreen = (props) => {
|
|
74
74
|
clearInterval(chatFocusTimeout);
|
75
75
|
}, 300);
|
76
76
|
}, [compositeParentDivId]);
|
77
|
-
const isOnHold =
|
77
|
+
const isOnHold = currentPage === 'hold';
|
78
78
|
useEffect(() => {
|
79
79
|
if (isOnHold) {
|
80
80
|
closeChat();
|
@@ -256,11 +256,9 @@ export const CallWithChatComposite = (props) => {
|
|
256
256
|
richTextEditor: options === null || options === void 0 ? void 0 : options.richTextEditor }))));
|
257
257
|
};
|
258
258
|
const hasJoinedCallFn = (page, callStatus) => {
|
259
|
-
/* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(one-to-n-calling) */
|
260
259
|
return ((page === 'call' &&
|
261
260
|
(callStatus === 'Connected' || callStatus === 'RemoteHold' || callStatus === 'Disconnecting')) ||
|
262
261
|
(page === 'hold' && (callStatus === 'LocalHold' || callStatus === 'Disconnecting')));
|
263
|
-
return page === 'call' && (callStatus === 'Connected' || callStatus === 'Disconnecting');
|
264
262
|
};
|
265
263
|
const checkShowChatButton = (callControls) => {
|
266
264
|
if (callControls === undefined || callControls === true) {
|
@@ -274,9 +272,4 @@ const checkShowChatButton = (callControls) => {
|
|
274
272
|
const checkChatButtonIsDisabled = (callControls) => {
|
275
273
|
return typeof callControls === 'object' && isDisabled(callControls === null || callControls === void 0 ? void 0 : callControls.chatButton);
|
276
274
|
};
|
277
|
-
const isOnHoldTrampoline = (page) => {
|
278
|
-
/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
|
279
|
-
return page === 'hold';
|
280
|
-
return false;
|
281
|
-
};
|
282
275
|
//# sourceMappingURL=CallWithChatComposite.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CallWithChatComposite.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,WAAW,EAAgB,KAAK,EAAS,MAAM,iBAAiB,CAAC;AAC1E,iDAAiD;AACjD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAIvD,OAAO,EAAE,4BAA4B,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AACnH,iDAAiD;AACjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,sCAAsC,CAAC;AAElF,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AAExF,OAAO,EAAE,aAAa,EAAqC,MAAM,kBAAkB,CAAC;AACpF,OAAO,EAAE,YAAY,EAAsB,MAAM,yBAAyB,CAAC;AAK3E,OAAO,EAIL,QAAQ,EACT,yCAAmC;AACpC,OAA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C;IACf,CAAC;IACD,OAAO,YAAY,CAAC,UAAU,KAAK,KAAK,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,YAAmD,EAAW,EAAE;IACjG,OAAO,OAAO,YAAY,KAAK,QAAQ,IAAI,UAAU,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,UAAU,CAAC,CAAC;AAClF,CAAC,CAAC;AAEF,MAAM,kBAAkB,GAAG,CAAC,IAAmC,EAAW,EAAE;IAC1E,6CAA6C,CAAC,mDAAmD;IACjG,OAAO,IAAI,KAAK,MAAM,CAAC;IACvB,OAAO,KAAK,CAAC;AACf,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useCallback, useState, useMemo, useEffect, useRef } from 'react';\nimport { mergeStyles, PartialTheme, Stack, Theme } from '@fluentui/react';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { Spinner, SpinnerSize } from '@fluentui/react';\nimport { CallCompositePage } from '../CallComposite';\nimport { CallSurvey } from '@azure/communication-calling';\nimport { CallState } from '@azure/communication-calling';\nimport { callCompositeContainerStyles, compositeOuterContainerStyles } from './styles/CallWithChatCompositeStyles';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { chatSpinnerContainerStyles } from './styles/CallWithChatCompositeStyles';\nimport { CallWithChatAdapter } from './adapter/CallWithChatAdapter';\nimport { CallWithChatBackedCallAdapter } from './adapter/CallWithChatBackedCallAdapter';\nimport { CallWithChatBackedChatAdapter } from './adapter/CallWithChatBackedChatAdapter';\nimport { CallAdapter } from '../CallComposite';\nimport { ChatComposite, ChatAdapter, ChatCompositeOptions } from '../ChatComposite';\nimport { BaseProvider, BaseCompositeProps } from '../common/BaseComposite';\nimport { CallWithChatCompositeIcons } from '../common/icons';\nimport { AvatarPersonaDataCallback } from '../common/AvatarPersona';\nimport { CallWithChatAdapterState } from './state/CallWithChatAdapterState';\nimport { CallSurveyImprovementSuggestions } from '@internal/react-components';\nimport {\n ParticipantMenuItemsCallback,\n _useContainerHeight,\n _useContainerWidth,\n useTheme\n} from '@internal/react-components';\nimport { useId } from '@fluentui/react-hooks';\nimport { containerDivStyles } from '../common/ContainerRectProps';\nimport { useCallWithChatCompositeStrings } from './hooks/useCallWithChatCompositeStrings';\nimport { CallCompositeInner, CallCompositeOptions } from '../CallComposite/CallComposite';\nimport { RemoteVideoTileMenuOptions } from '../CallComposite/CallComposite';\nimport { LocalVideoTileOptions } from '../CallComposite/CallComposite';\n/* @conditional-compile-remove(call-readiness) */\nimport { DeviceCheckOptions } from '../CallComposite/CallComposite';\nimport { CommonCallControlOptions } from '../common/types/CommonCallControlOptions';\nimport { ChatButtonWithUnreadMessagesBadge } from './ChatButton/ChatButtonWithUnreadMessagesBadge';\nimport { getDesktopCommonButtonStyles } from '../common/ControlBar/CommonCallControlBar';\nimport { InjectedSidePaneProps } from '../CallComposite/components/SidePane/SidePaneProvider';\nimport { isDisabled } from '../CallComposite/utils';\nimport {\n CustomCallControlButtonCallback,\n CustomCallControlButtonCallbackArgs\n} from '../common/ControlBar/CustomButton';\nimport { SidePaneHeader } from '../common/SidePaneHeader';\nimport { CallControlOptions } from '../CallComposite/types/CallControlOptions';\nimport { useUnreadMessagesTracker } from './ChatButton/useUnreadMessagesTracker';\nimport { VideoGalleryLayout } from '@internal/react-components';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentOptions } from '@internal/react-components';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { useLocale } from '../localization';\n\n/**\n * Props required for the {@link CallWithChatComposite}\n *\n * @public\n */\nexport interface CallWithChatCompositeProps extends BaseCompositeProps<CallWithChatCompositeIcons> {\n adapter: CallWithChatAdapter;\n /**\n * Fluent theme for the composite.\n *\n * Defaults to a light theme if undefined.\n */\n fluentTheme?: PartialTheme | Theme;\n /**\n * Optimizes the composite form factor for either desktop or mobile.\n * @remarks `mobile` is currently only optimized for Portrait mode on mobile devices and does not support landscape.\n * @defaultValue 'desktop'\n */\n formFactor?: 'desktop' | 'mobile';\n /**\n * URL that can be used to copy a call-with-chat invite to the Users clipboard.\n */\n joinInvitationURL?: string;\n /**\n * Flags to enable/disable or customize UI elements of the {@link CallWithChatComposite}\n */\n options?: CallWithChatCompositeOptions;\n}\n\n/**\n * Customization options for the control bar in calling with chat experience.\n *\n * @public\n */\nexport interface CallWithChatControlOptions extends CommonCallControlOptions {\n /**\n * Show or hide the chat button in the call-with-chat composite control bar.\n * @defaultValue true\n */\n chatButton?: boolean | /* @conditional-compile-remove(PSTN-calls) */ { disabled: boolean };\n}\n\n/**\n * Optional features of the {@link CallWithChatComposite}.\n *\n * @public\n */\nexport type CallWithChatCompositeOptions = {\n /**\n * Call control options to change what buttons show on the call-with-chat composite control bar.\n * If using the boolean values, true will cause default behavior across the whole control bar. False hides the whole control bar.\n */\n callControls?: boolean | CallWithChatControlOptions;\n /* @conditional-compile-remove(file-sharing-acs) */\n /**\n * Properties for configuring the File Sharing feature.\n * If undefined, file sharing feature will be disabled.\n * @beta\n */\n attachmentOptions?: AttachmentOptions;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Device permissions check options for your call.\n * Here you can choose what device permissions you prompt the user for,\n * as well as what device permissions must be accepted before starting a call.\n */\n deviceChecks?: DeviceCheckOptions;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Callback you may provide to supply users with further steps to troubleshoot why they have been\n * unable to grant your site the required permissions for the call.\n *\n * @example\n * ```ts\n * onPermissionsTroubleshootingClick: () =>\n * window.open('https://contoso.com/permissions-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a 'further troubleshooting' link.\n */\n onPermissionsTroubleshootingClick?: (permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n }) => void;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Optional callback to supply users with further troubleshooting steps for network issues\n * experienced when connecting to a call.\n *\n * @example\n * ```ts\n * onNetworkingTroubleShootingClick?: () =>\n * window.open('https://contoso.com/network-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a 'network troubleshooting' link.\n */\n onNetworkingTroubleShootingClick?: () => void;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * Callback you may provide to supply users with a provided page to showcase supported browsers by ACS.\n *\n * @example\n * ```ts\n * onBrowserTroubleShootingClick?: () =>\n * window.open('https://contoso.com/browser-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a unsupported browser page.\n */\n onEnvironmentInfoTroubleshootingClick?: () => void;\n /**\n * Remote participant video tile menu options\n */\n remoteVideoTileMenuOptions?: RemoteVideoTileMenuOptions;\n /**\n * Options for controlling the local video tile.\n *\n * @remarks if 'false' the local video tile will not be rendered.\n */\n localVideoTile?: boolean | LocalVideoTileOptions;\n /**\n * Options for controlling the starting layout of the composite's video gallery\n */\n galleryOptions?: {\n /**\n * Layout for the gallery when the call starts\n */\n layout?: VideoGalleryLayout;\n };\n /**\n * Options for end of call survey\n */\n surveyOptions?: {\n /**\n * Disable call survey at the end of a call.\n * @defaultValue false\n */\n disableSurvey?: boolean;\n /**\n * Optional callback to redirect users to custom screens when survey is done, note that default end call screen will be shown if this callback is not provided\n * This callback can be used to redirect users to different screens depending on survey state, whether it is submitted, skipped or has a problem when submitting the survey\n */\n onSurveyClosed?: (surveyState: 'sent' | 'skipped' | 'error', surveyError?: string) => void;\n /**\n * Optional callback to handle survey data including free form text response\n * Note that free form text response survey option is only going to be enabled when this callback is provided\n * User will need to handle all free form text response on their own\n */\n onSurveySubmitted?: (\n callId: string,\n surveyId: string,\n /**\n * This is the survey results containing star survey data and API tag survey data.\n * This part of the result will always be sent to the calling sdk\n * This callback provides user with the ability to gain access to survey data\n */\n submittedSurvey: CallSurvey,\n /**\n * This is the survey results containing free form text\n * This part of the result will not be handled by composites\n * User will need to collect and handle this information 100% on their own\n * Free form text survey is not going to show in the UI if onSurveySubmitted is not populated\n */\n improvementSuggestions: CallSurveyImprovementSuggestions\n ) => Promise<void>;\n };\n /**\n * Options for setting additional customizations related to personalized branding.\n */\n branding?: {\n /**\n * Logo displayed on the configuration page.\n */\n logo?: {\n /**\n * URL for the logo image.\n *\n * @remarks\n * Recommended size is 80x80 pixels.\n */\n url: string;\n /**\n * Alt text for the logo image.\n */\n alt?: string;\n /**\n * The logo can be displayed as a circle.\n *\n * @defaultValue 'unset'\n */\n shape?: 'unset' | 'circle';\n };\n /**\n * Background image displayed on the configuration page.\n */\n backgroundImage?: {\n /**\n * URL for the background image.\n *\n * @remarks\n * Background image should be larger than 576x567 pixels and smaller than 2048x2048 pixels pixels.\n */\n url: string;\n };\n };\n /**\n * Options for settings related to spotlight.\n */\n spotlight?: {\n /**\n * Flag to hide the menu buttons to start and stop spotlight for remote participants and the local participant.\n * @defaultValue false\n */\n hideSpotlightButtons?: boolean;\n };\n\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n /**\n * Enables rich text editor for the send and edit boxes\n * @defaultValue `false`\n *\n * @beta\n */\n richTextEditor?: boolean;\n};\n\ntype CallWithChatScreenProps = {\n callWithChatAdapter: CallWithChatAdapter;\n fluentTheme?: PartialTheme | Theme;\n formFactor?: 'desktop' | 'mobile';\n joinInvitationURL?: string;\n callControls?: boolean | CallWithChatControlOptions;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentOptions?: AttachmentOptions;\n rtl?: boolean;\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks?: DeviceCheckOptions;\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(unsupported-browser) */\n onEnvironmentInfoTroubleshootingClick?: () => void;\n remoteVideoTileMenuOptions?: RemoteVideoTileMenuOptions;\n localVideoTile?: boolean | LocalVideoTileOptions;\n galleryOptions?: {\n layout?: VideoGalleryLayout;\n };\n /**\n * Options for end of call survey\n */\n surveyOptions?: {\n /**\n * Disable call survey at the end of a call.\n * @defaultValue false\n */\n disableSurvey?: boolean;\n /**\n * Optional callback to redirect users to custom screens when survey is done, note that default end call screen will be shown if this callback is not provided\n * This callback can be used to redirect users to different screens depending on survey state, whether it is submitted, skipped or has a problem when submitting the survey\n */\n onSurveyClosed?: (surveyState: 'sent' | 'skipped' | 'error', surveyError?: string) => void;\n /**\n * Optional callback to handle survey data including free form text response\n * Note that free form text response survey option is only going to be enabled when this callback is provided\n * User will need to handle all free form text response on their own\n */\n onSurveySubmitted?: (\n callId: string,\n surveyId: string,\n /**\n * This is the survey results containing star survey data and API tag survey data.\n * This part of the result will always be sent to the calling sdk\n * This callback provides user with the ability to gain access to survey data\n */\n submittedSurvey: CallSurvey,\n /**\n * This is the survey results containing free form text\n * This part of the result will not be handled by composites\n * User will need to collect and handle this information 100% on their own\n * Free form text survey is not going to show in the UI if onSurveySubmitted is not populated\n */\n improvementSuggestions: CallSurveyImprovementSuggestions\n ) => Promise<void>;\n };\n logo?: {\n url: string;\n alt?: string;\n shape?: 'unset' | 'circle';\n };\n backgroundImage?: {\n url: string;\n };\n spotlight?: {\n hideSpotlightButtons?: boolean;\n };\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditor?: boolean;\n};\n\nconst CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {\n const { callWithChatAdapter, fluentTheme, formFactor = 'desktop' } = props;\n const { surveyOptions } = props;\n const mobileView = formFactor === 'mobile';\n\n if (!callWithChatAdapter) {\n throw new Error('CallWithChatAdapter is undefined');\n }\n\n const callAdapter: CallAdapter = useMemo(\n () => new CallWithChatBackedCallAdapter(callWithChatAdapter),\n [callWithChatAdapter]\n );\n\n const [currentCallState, setCurrentCallState] = useState<CallState>();\n const [isChatInitialized, setIsChatInitialized] = useState(false);\n const [currentPage, setCurrentPage] = useState<CallCompositePage>();\n const [isChatOpen, setIsChatOpen] = useState(false);\n\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const updateCallWithChatPage = (newState: CallWithChatAdapterState): void => {\n setCurrentPage(newState.page);\n setCurrentCallState(newState.call?.state);\n setIsChatInitialized(newState.chat ? true : false);\n };\n updateCallWithChatPage(callWithChatAdapter.getState());\n callWithChatAdapter.onStateChange(updateCallWithChatPage);\n return () => {\n callWithChatAdapter.offStateChange(updateCallWithChatPage);\n };\n }, [callWithChatAdapter]);\n\n const chatAdapter: ChatAdapter = useMemo(() => {\n return new CallWithChatBackedChatAdapter(callWithChatAdapter);\n }, [callWithChatAdapter]);\n\n /** Constant setting of id for the parent stack of the composite */\n const compositeParentDivId = useId('callWithChatCompositeParentDiv-internal');\n\n const closeChat = useCallback(() => {\n setIsChatOpen(false);\n }, []);\n const openChat = useCallback(() => {\n setIsChatOpen(true);\n // timeout is required to give the window time to render the sendbox so we have something to send focus to.\n // TODO: Selecting elements in the DOM via attributes is not stable. We should expose an API from ChatComposite to be able to focus on the sendbox.\n const chatFocusTimeout = setInterval(() => {\n const callWithChatCompositeRootDiv = document.querySelector(`[id=\"${compositeParentDivId}\"]`);\n const sendbox = callWithChatCompositeRootDiv?.querySelector(`[id=\"sendbox\"]`) as HTMLTextAreaElement;\n if (sendbox !== null) {\n sendbox.focus();\n clearInterval(chatFocusTimeout);\n }\n }, 3);\n setTimeout(() => {\n clearInterval(chatFocusTimeout);\n }, 300);\n }, [compositeParentDivId]);\n\n const isOnHold = isOnHoldTrampoline(currentPage);\n useEffect(() => {\n if (isOnHold) {\n closeChat();\n }\n }, [closeChat, isOnHold]);\n\n const hasJoinedCall = !!(currentPage && hasJoinedCallFn(currentPage, currentCallState ?? 'None'));\n const toggleChat = useCallback(() => {\n isChatOpen || !hasJoinedCall ? closeChat() : openChat();\n }, [closeChat, hasJoinedCall, isChatOpen, openChat]);\n\n const callWithChatStrings = useCallWithChatCompositeStrings();\n const chatButtonStrings = useMemo(\n () => ({\n label: callWithChatStrings.chatButtonLabel,\n tooltipOffContent: callWithChatStrings.chatButtonTooltipOpen,\n tooltipOnContent: callWithChatStrings.chatButtonTooltipClose\n }),\n [callWithChatStrings]\n );\n const theme = useTheme();\n const commonButtonStyles = useMemo(\n () => (!mobileView ? getDesktopCommonButtonStyles(theme) : undefined),\n [mobileView, theme]\n );\n\n const showChatButton = checkShowChatButton(props.callControls);\n const chatButtonDisabled =\n showChatButton && (checkChatButtonIsDisabled(props.callControls) || !hasJoinedCall || isOnHold);\n const chatTabHeaderProps = useMemo(\n () =>\n mobileView && showChatButton\n ? {\n onClick: toggleChat,\n disabled: chatButtonDisabled\n }\n : undefined,\n [chatButtonDisabled, mobileView, toggleChat, showChatButton]\n );\n\n const unreadChatMessagesCount = useUnreadMessagesTracker(chatAdapter, isChatOpen, isChatInitialized);\n\n const customChatButton: CustomCallControlButtonCallback = useCallback(\n (args: CustomCallControlButtonCallbackArgs) => ({\n placement: mobileView ? 'primary' : 'secondary',\n onRenderButton: () => (\n <ChatButtonWithUnreadMessagesBadge\n checked={isChatOpen}\n showLabel={args.displayType !== 'compact'}\n onClick={toggleChat}\n disabled={chatButtonDisabled}\n strings={chatButtonStrings}\n styles={commonButtonStyles}\n newMessageLabel={callWithChatStrings.chatButtonNewMessageNotificationLabel}\n unreadChatMessagesCount={unreadChatMessagesCount}\n // As chat is disabled when on hold, we don't want to show the unread badge when on hold\n hideUnreadChatMessagesBadge={isOnHold}\n disableTooltip={mobileView}\n />\n )\n }),\n [\n callWithChatStrings.chatButtonNewMessageNotificationLabel,\n chatButtonStrings,\n commonButtonStyles,\n isChatOpen,\n chatButtonDisabled,\n mobileView,\n toggleChat,\n unreadChatMessagesCount,\n isOnHold\n ]\n );\n\n const callControlOptionsFromProps = useMemo(\n () => ({\n ...(typeof props.callControls === 'object' ? props.callControls : {})\n }),\n [props.callControls]\n );\n\n const injectedCustomButtonsFromProps = useMemo(() => {\n return [...(callControlOptionsFromProps.onFetchCustomButtonProps ?? [])];\n }, [callControlOptionsFromProps]);\n\n const callCompositeOptions: CallCompositeOptions = useMemo(\n () => ({\n callControls:\n props.callControls === false\n ? false\n : ({\n ...callControlOptionsFromProps,\n onFetchCustomButtonProps: [\n ...(showChatButton ? [customChatButton] : []),\n ...injectedCustomButtonsFromProps\n ],\n legacyControlBarExperience: false\n } as CallControlOptions),\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks: props.deviceChecks,\n /* @conditional-compile-remove(call-readiness) */\n onNetworkingTroubleShootingClick: props.onNetworkingTroubleShootingClick,\n /* @conditional-compile-remove(call-readiness) */\n onPermissionsTroubleshootingClick: props.onPermissionsTroubleshootingClick,\n /* @conditional-compile-remove(unsupported-browser) */\n onEnvironmentInfoTroubleshootingClick: props.onEnvironmentInfoTroubleshootingClick,\n remoteVideoTileMenuOptions: props.remoteVideoTileMenuOptions,\n\n galleryOptions: props.galleryOptions,\n localVideoTile: props.localVideoTile,\n surveyOptions: surveyOptions,\n branding: {\n logo: props.logo,\n backgroundImage: props.backgroundImage\n },\n spotlight: props.spotlight\n }),\n [\n props.callControls,\n callControlOptionsFromProps,\n showChatButton,\n customChatButton,\n injectedCustomButtonsFromProps,\n /* @conditional-compile-remove(call-readiness) */\n props.deviceChecks,\n /* @conditional-compile-remove(unsupported-browser) */\n props.onEnvironmentInfoTroubleshootingClick,\n /* @conditional-compile-remove(call-readiness) */\n props.onNetworkingTroubleShootingClick,\n /* @conditional-compile-remove(call-readiness) */\n props.onPermissionsTroubleshootingClick,\n props.galleryOptions,\n props.localVideoTile,\n props.remoteVideoTileMenuOptions,\n surveyOptions,\n props.logo,\n props.backgroundImage,\n props.spotlight\n ]\n );\n\n const chatCompositeOptions: ChatCompositeOptions = useMemo(\n () => ({\n topic: false,\n /* @conditional-compile-remove(chat-composite-participant-pane) */\n participantPane: false,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentOptions: props.attachmentOptions,\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditor: props.richTextEditor\n }),\n [\n /* @conditional-compile-remove(file-sharing-acs) */\n props.attachmentOptions,\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n props.richTextEditor\n ]\n );\n\n /* @conditional-compile-remove(breakout-rooms) */\n const chatSpinnerLabel = useLocale().strings.callWithChat.chatContentSpinnerLabel;\n\n const onRenderChatContent = useCallback((): JSX.Element => {\n /* @conditional-compile-remove(breakout-rooms) */\n if (!isChatInitialized) {\n return (\n <Stack styles={chatSpinnerContainerStyles}>\n <Spinner label={chatSpinnerLabel} size={SpinnerSize.large} />\n </Stack>\n );\n }\n return (\n <ChatComposite\n adapter={chatAdapter}\n fluentTheme={theme}\n options={chatCompositeOptions}\n onFetchAvatarPersonaData={props.onFetchAvatarPersonaData}\n />\n );\n }, [\n chatAdapter,\n props.onFetchAvatarPersonaData,\n chatCompositeOptions,\n theme,\n /* @conditional-compile-remove(breakout-rooms) */ isChatInitialized,\n /* @conditional-compile-remove(breakout-rooms) */ chatSpinnerLabel\n ]);\n\n let chatPaneTitle = callWithChatStrings.chatPaneTitle;\n /* @conditional-compile-remove(breakout-rooms) */\n if (callAdapter.getState().call?.breakoutRooms?.breakoutRoomOriginCallId) {\n chatPaneTitle = callWithChatStrings.breakoutRoomChatPaneTitle;\n }\n\n const sidePaneHeaderRenderer = useCallback(\n () => (\n <SidePaneHeader\n headingText={chatPaneTitle}\n onClose={closeChat}\n dismissSidePaneButtonAriaLabel={callWithChatStrings.dismissSidePaneButtonLabel ?? ''}\n mobileView={mobileView}\n />\n ),\n [chatPaneTitle, callWithChatStrings.dismissSidePaneButtonLabel, closeChat, mobileView]\n );\n\n const sidePaneContentRenderer = useMemo(\n () => (hasJoinedCall ? onRenderChatContent : undefined),\n [hasJoinedCall, onRenderChatContent]\n );\n\n const sidePaneRenderer = useMemo(\n () => ({\n contentRenderer: sidePaneContentRenderer,\n headerRenderer: sidePaneHeaderRenderer,\n id: 'chat'\n }),\n [sidePaneContentRenderer, sidePaneHeaderRenderer]\n );\n\n const overrideSidePaneProps: InjectedSidePaneProps = useMemo(\n () => ({\n renderer: sidePaneRenderer,\n isActive: isChatOpen,\n persistRenderingWhenClosed: true\n }),\n [isChatOpen, sidePaneRenderer]\n );\n\n const onSidePaneIdChange = useCallback(\n (sidePaneId: string | undefined) => {\n // If the pane is switched to something other than chat, removing rendering chat.\n if (sidePaneId && sidePaneId !== 'chat') {\n closeChat();\n }\n },\n [closeChat]\n );\n\n // When the call ends ensure the side pane is set to closed to prevent the side pane being open if the call is re-joined.\n useEffect(() => {\n callAdapter.on('callEnded', closeChat);\n return () => {\n callAdapter.off('callEnded', closeChat);\n };\n }, [callAdapter, closeChat]);\n\n return (\n <div ref={containerRef} className={mergeStyles(containerDivStyles)}>\n <Stack verticalFill grow styles={compositeOuterContainerStyles} id={compositeParentDivId}>\n <Stack horizontal grow>\n <Stack.Item grow styles={callCompositeContainerStyles(mobileView)}>\n <CallCompositeInner\n {...props}\n formFactor={formFactor}\n options={callCompositeOptions}\n adapter={callAdapter}\n fluentTheme={fluentTheme}\n callInvitationUrl={props.joinInvitationURL}\n overrideSidePane={overrideSidePaneProps}\n onSidePaneIdChange={onSidePaneIdChange}\n mobileChatTabHeader={chatTabHeaderProps}\n onCloseChatPane={closeChat}\n />\n </Stack.Item>\n </Stack>\n </Stack>\n </div>\n );\n};\n\n/**\n * CallWithChatComposite brings together key components to provide a full call with chat experience out of the box.\n *\n * @public\n */\nexport const CallWithChatComposite = (props: CallWithChatCompositeProps): JSX.Element => {\n const { adapter, fluentTheme, rtl, formFactor, joinInvitationURL, options } = props;\n return (\n <BaseProvider\n fluentTheme={fluentTheme}\n rtl={rtl}\n locale={props.locale}\n icons={props.icons}\n formFactor={props.formFactor}\n >\n <CallWithChatScreen\n {...props}\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks={options?.deviceChecks}\n callWithChatAdapter={adapter}\n formFactor={formFactor}\n callControls={options?.callControls}\n joinInvitationURL={joinInvitationURL}\n fluentTheme={fluentTheme}\n remoteVideoTileMenuOptions={options?.remoteVideoTileMenuOptions}\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentOptions={options?.attachmentOptions}\n localVideoTile={options?.localVideoTile}\n galleryOptions={options?.galleryOptions}\n logo={options?.branding?.logo}\n backgroundImage={options?.branding?.backgroundImage}\n surveyOptions={options?.surveyOptions}\n spotlight={options?.spotlight}\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditor={options?.richTextEditor}\n />\n </BaseProvider>\n );\n};\n\nconst hasJoinedCallFn = (page: CallCompositePage, callStatus: CallState): boolean => {\n /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(one-to-n-calling) */\n return (\n (page === 'call' &&\n (callStatus === 'Connected' || callStatus === 'RemoteHold' || callStatus === 'Disconnecting')) ||\n (page === 'hold' && (callStatus === 'LocalHold' || callStatus === 'Disconnecting'))\n );\n return page === 'call' && (callStatus === 'Connected' || callStatus === 'Disconnecting');\n};\n\nconst checkShowChatButton = (callControls?: boolean | CallWithChatControlOptions): boolean => {\n if (callControls === undefined || callControls === true) {\n return true;\n }\n if (callControls === false) {\n return false;\n }\n return callControls.chatButton !== false;\n};\n\nconst checkChatButtonIsDisabled = (callControls?: boolean | CallWithChatControlOptions): boolean => {\n return typeof callControls === 'object' && isDisabled(callControls?.chatButton);\n};\n\nconst isOnHoldTrampoline = (page: CallCompositePage | undefined): boolean => {\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n return page === 'hold';\n return false;\n};\n"]}
|
1
|
+
{"version":3,"file":"CallWithChatComposite.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjF,OA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U,KAAK,YAAY,IAAI,UAAU,KAAK,eAAe,CAAC,CAAC;QAChG,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,UAAU,KAAK,WAAW,IAAI,UAAU,KAAK,eAAe,CAAC,CAAC,CACpF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,YAAmD,EAAW,EAAE;IAC3F,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,IAAI,EAAE,CAAC;QACxD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,YAAY,KAAK,KAAK,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,YAAY,CAAC,UAAU,KAAK,KAAK,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,YAAmD,EAAW,EAAE;IACjG,OAAO,OAAO,YAAY,KAAK,QAAQ,IAAI,UAAU,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,UAAU,CAAC,CAAC;AAClF,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useCallback, useState, useMemo, useEffect, useRef } from 'react';\nimport { mergeStyles, PartialTheme, Stack, Theme } from '@fluentui/react';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { Spinner, SpinnerSize } from '@fluentui/react';\nimport { CallCompositePage } from '../CallComposite';\nimport { CallSurvey } from '@azure/communication-calling';\nimport { CallState } from '@azure/communication-calling';\nimport { callCompositeContainerStyles, compositeOuterContainerStyles } from './styles/CallWithChatCompositeStyles';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { chatSpinnerContainerStyles } from './styles/CallWithChatCompositeStyles';\nimport { CallWithChatAdapter } from './adapter/CallWithChatAdapter';\nimport { CallWithChatBackedCallAdapter } from './adapter/CallWithChatBackedCallAdapter';\nimport { CallWithChatBackedChatAdapter } from './adapter/CallWithChatBackedChatAdapter';\nimport { CallAdapter } from '../CallComposite';\nimport { ChatComposite, ChatAdapter, ChatCompositeOptions } from '../ChatComposite';\nimport { BaseProvider, BaseCompositeProps } from '../common/BaseComposite';\nimport { CallWithChatCompositeIcons } from '../common/icons';\nimport { AvatarPersonaDataCallback } from '../common/AvatarPersona';\nimport { CallWithChatAdapterState } from './state/CallWithChatAdapterState';\nimport { CallSurveyImprovementSuggestions } from '@internal/react-components';\nimport {\n ParticipantMenuItemsCallback,\n _useContainerHeight,\n _useContainerWidth,\n useTheme\n} from '@internal/react-components';\nimport { useId } from '@fluentui/react-hooks';\nimport { containerDivStyles } from '../common/ContainerRectProps';\nimport { useCallWithChatCompositeStrings } from './hooks/useCallWithChatCompositeStrings';\nimport { CallCompositeInner, CallCompositeOptions } from '../CallComposite/CallComposite';\nimport { RemoteVideoTileMenuOptions } from '../CallComposite/CallComposite';\nimport { LocalVideoTileOptions } from '../CallComposite/CallComposite';\n/* @conditional-compile-remove(call-readiness) */\nimport { DeviceCheckOptions } from '../CallComposite/CallComposite';\nimport { CommonCallControlOptions } from '../common/types/CommonCallControlOptions';\nimport { ChatButtonWithUnreadMessagesBadge } from './ChatButton/ChatButtonWithUnreadMessagesBadge';\nimport { getDesktopCommonButtonStyles } from '../common/ControlBar/CommonCallControlBar';\nimport { InjectedSidePaneProps } from '../CallComposite/components/SidePane/SidePaneProvider';\nimport { isDisabled } from '../CallComposite/utils';\nimport {\n CustomCallControlButtonCallback,\n CustomCallControlButtonCallbackArgs\n} from '../common/ControlBar/CustomButton';\nimport { SidePaneHeader } from '../common/SidePaneHeader';\nimport { CallControlOptions } from '../CallComposite/types/CallControlOptions';\nimport { useUnreadMessagesTracker } from './ChatButton/useUnreadMessagesTracker';\nimport { VideoGalleryLayout } from '@internal/react-components';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentOptions } from '@internal/react-components';\n/* @conditional-compile-remove(breakout-rooms) */\nimport { useLocale } from '../localization';\n\n/**\n * Props required for the {@link CallWithChatComposite}\n *\n * @public\n */\nexport interface CallWithChatCompositeProps extends BaseCompositeProps<CallWithChatCompositeIcons> {\n adapter: CallWithChatAdapter;\n /**\n * Fluent theme for the composite.\n *\n * Defaults to a light theme if undefined.\n */\n fluentTheme?: PartialTheme | Theme;\n /**\n * Optimizes the composite form factor for either desktop or mobile.\n * @remarks `mobile` is currently only optimized for Portrait mode on mobile devices and does not support landscape.\n * @defaultValue 'desktop'\n */\n formFactor?: 'desktop' | 'mobile';\n /**\n * URL that can be used to copy a call-with-chat invite to the Users clipboard.\n */\n joinInvitationURL?: string;\n /**\n * Flags to enable/disable or customize UI elements of the {@link CallWithChatComposite}\n */\n options?: CallWithChatCompositeOptions;\n}\n\n/**\n * Customization options for the control bar in calling with chat experience.\n *\n * @public\n */\nexport interface CallWithChatControlOptions extends CommonCallControlOptions {\n /**\n * Show or hide the chat button in the call-with-chat composite control bar.\n * @defaultValue true\n */\n chatButton?: boolean | { disabled: boolean };\n}\n\n/**\n * Optional features of the {@link CallWithChatComposite}.\n *\n * @public\n */\nexport type CallWithChatCompositeOptions = {\n /**\n * Call control options to change what buttons show on the call-with-chat composite control bar.\n * If using the boolean values, true will cause default behavior across the whole control bar. False hides the whole control bar.\n */\n callControls?: boolean | CallWithChatControlOptions;\n /* @conditional-compile-remove(file-sharing-acs) */\n /**\n * Properties for configuring the File Sharing feature.\n * If undefined, file sharing feature will be disabled.\n * @beta\n */\n attachmentOptions?: AttachmentOptions;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Device permissions check options for your call.\n * Here you can choose what device permissions you prompt the user for,\n * as well as what device permissions must be accepted before starting a call.\n */\n deviceChecks?: DeviceCheckOptions;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Callback you may provide to supply users with further steps to troubleshoot why they have been\n * unable to grant your site the required permissions for the call.\n *\n * @example\n * ```ts\n * onPermissionsTroubleshootingClick: () =>\n * window.open('https://contoso.com/permissions-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a 'further troubleshooting' link.\n */\n onPermissionsTroubleshootingClick?: (permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n }) => void;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Optional callback to supply users with further troubleshooting steps for network issues\n * experienced when connecting to a call.\n *\n * @example\n * ```ts\n * onNetworkingTroubleShootingClick?: () =>\n * window.open('https://contoso.com/network-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a 'network troubleshooting' link.\n */\n onNetworkingTroubleShootingClick?: () => void;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * Callback you may provide to supply users with a provided page to showcase supported browsers by ACS.\n *\n * @example\n * ```ts\n * onBrowserTroubleShootingClick?: () =>\n * window.open('https://contoso.com/browser-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a unsupported browser page.\n */\n onEnvironmentInfoTroubleshootingClick?: () => void;\n /**\n * Remote participant video tile menu options\n */\n remoteVideoTileMenuOptions?: RemoteVideoTileMenuOptions;\n /**\n * Options for controlling the local video tile.\n *\n * @remarks if 'false' the local video tile will not be rendered.\n */\n localVideoTile?: boolean | LocalVideoTileOptions;\n /**\n * Options for controlling the starting layout of the composite's video gallery\n */\n galleryOptions?: {\n /**\n * Layout for the gallery when the call starts\n */\n layout?: VideoGalleryLayout;\n };\n /**\n * Options for end of call survey\n */\n surveyOptions?: {\n /**\n * Disable call survey at the end of a call.\n * @defaultValue false\n */\n disableSurvey?: boolean;\n /**\n * Optional callback to redirect users to custom screens when survey is done, note that default end call screen will be shown if this callback is not provided\n * This callback can be used to redirect users to different screens depending on survey state, whether it is submitted, skipped or has a problem when submitting the survey\n */\n onSurveyClosed?: (surveyState: 'sent' | 'skipped' | 'error', surveyError?: string) => void;\n /**\n * Optional callback to handle survey data including free form text response\n * Note that free form text response survey option is only going to be enabled when this callback is provided\n * User will need to handle all free form text response on their own\n */\n onSurveySubmitted?: (\n callId: string,\n surveyId: string,\n /**\n * This is the survey results containing star survey data and API tag survey data.\n * This part of the result will always be sent to the calling sdk\n * This callback provides user with the ability to gain access to survey data\n */\n submittedSurvey: CallSurvey,\n /**\n * This is the survey results containing free form text\n * This part of the result will not be handled by composites\n * User will need to collect and handle this information 100% on their own\n * Free form text survey is not going to show in the UI if onSurveySubmitted is not populated\n */\n improvementSuggestions: CallSurveyImprovementSuggestions\n ) => Promise<void>;\n };\n /**\n * Options for setting additional customizations related to personalized branding.\n */\n branding?: {\n /**\n * Logo displayed on the configuration page.\n */\n logo?: {\n /**\n * URL for the logo image.\n *\n * @remarks\n * Recommended size is 80x80 pixels.\n */\n url: string;\n /**\n * Alt text for the logo image.\n */\n alt?: string;\n /**\n * The logo can be displayed as a circle.\n *\n * @defaultValue 'unset'\n */\n shape?: 'unset' | 'circle';\n };\n /**\n * Background image displayed on the configuration page.\n */\n backgroundImage?: {\n /**\n * URL for the background image.\n *\n * @remarks\n * Background image should be larger than 576x567 pixels and smaller than 2048x2048 pixels pixels.\n */\n url: string;\n };\n };\n /**\n * Options for settings related to spotlight.\n */\n spotlight?: {\n /**\n * Flag to hide the menu buttons to start and stop spotlight for remote participants and the local participant.\n * @defaultValue false\n */\n hideSpotlightButtons?: boolean;\n };\n\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n /**\n * Enables rich text editor for the send and edit boxes\n * @defaultValue `false`\n *\n * @beta\n */\n richTextEditor?: boolean;\n};\n\ntype CallWithChatScreenProps = {\n callWithChatAdapter: CallWithChatAdapter;\n fluentTheme?: PartialTheme | Theme;\n formFactor?: 'desktop' | 'mobile';\n joinInvitationURL?: string;\n callControls?: boolean | CallWithChatControlOptions;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentOptions?: AttachmentOptions;\n rtl?: boolean;\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks?: DeviceCheckOptions;\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(unsupported-browser) */\n onEnvironmentInfoTroubleshootingClick?: () => void;\n remoteVideoTileMenuOptions?: RemoteVideoTileMenuOptions;\n localVideoTile?: boolean | LocalVideoTileOptions;\n galleryOptions?: {\n layout?: VideoGalleryLayout;\n };\n /**\n * Options for end of call survey\n */\n surveyOptions?: {\n /**\n * Disable call survey at the end of a call.\n * @defaultValue false\n */\n disableSurvey?: boolean;\n /**\n * Optional callback to redirect users to custom screens when survey is done, note that default end call screen will be shown if this callback is not provided\n * This callback can be used to redirect users to different screens depending on survey state, whether it is submitted, skipped or has a problem when submitting the survey\n */\n onSurveyClosed?: (surveyState: 'sent' | 'skipped' | 'error', surveyError?: string) => void;\n /**\n * Optional callback to handle survey data including free form text response\n * Note that free form text response survey option is only going to be enabled when this callback is provided\n * User will need to handle all free form text response on their own\n */\n onSurveySubmitted?: (\n callId: string,\n surveyId: string,\n /**\n * This is the survey results containing star survey data and API tag survey data.\n * This part of the result will always be sent to the calling sdk\n * This callback provides user with the ability to gain access to survey data\n */\n submittedSurvey: CallSurvey,\n /**\n * This is the survey results containing free form text\n * This part of the result will not be handled by composites\n * User will need to collect and handle this information 100% on their own\n * Free form text survey is not going to show in the UI if onSurveySubmitted is not populated\n */\n improvementSuggestions: CallSurveyImprovementSuggestions\n ) => Promise<void>;\n };\n logo?: {\n url: string;\n alt?: string;\n shape?: 'unset' | 'circle';\n };\n backgroundImage?: {\n url: string;\n };\n spotlight?: {\n hideSpotlightButtons?: boolean;\n };\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditor?: boolean;\n};\n\nconst CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {\n const { callWithChatAdapter, fluentTheme, formFactor = 'desktop' } = props;\n const { surveyOptions } = props;\n const mobileView = formFactor === 'mobile';\n\n if (!callWithChatAdapter) {\n throw new Error('CallWithChatAdapter is undefined');\n }\n\n const callAdapter: CallAdapter = useMemo(\n () => new CallWithChatBackedCallAdapter(callWithChatAdapter),\n [callWithChatAdapter]\n );\n\n const [currentCallState, setCurrentCallState] = useState<CallState>();\n const [isChatInitialized, setIsChatInitialized] = useState(false);\n const [currentPage, setCurrentPage] = useState<CallCompositePage>();\n const [isChatOpen, setIsChatOpen] = useState(false);\n\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const updateCallWithChatPage = (newState: CallWithChatAdapterState): void => {\n setCurrentPage(newState.page);\n setCurrentCallState(newState.call?.state);\n setIsChatInitialized(newState.chat ? true : false);\n };\n updateCallWithChatPage(callWithChatAdapter.getState());\n callWithChatAdapter.onStateChange(updateCallWithChatPage);\n return () => {\n callWithChatAdapter.offStateChange(updateCallWithChatPage);\n };\n }, [callWithChatAdapter]);\n\n const chatAdapter: ChatAdapter = useMemo(() => {\n return new CallWithChatBackedChatAdapter(callWithChatAdapter);\n }, [callWithChatAdapter]);\n\n /** Constant setting of id for the parent stack of the composite */\n const compositeParentDivId = useId('callWithChatCompositeParentDiv-internal');\n\n const closeChat = useCallback(() => {\n setIsChatOpen(false);\n }, []);\n const openChat = useCallback(() => {\n setIsChatOpen(true);\n // timeout is required to give the window time to render the sendbox so we have something to send focus to.\n // TODO: Selecting elements in the DOM via attributes is not stable. We should expose an API from ChatComposite to be able to focus on the sendbox.\n const chatFocusTimeout = setInterval(() => {\n const callWithChatCompositeRootDiv = document.querySelector(`[id=\"${compositeParentDivId}\"]`);\n const sendbox = callWithChatCompositeRootDiv?.querySelector(`[id=\"sendbox\"]`) as HTMLTextAreaElement;\n if (sendbox !== null) {\n sendbox.focus();\n clearInterval(chatFocusTimeout);\n }\n }, 3);\n setTimeout(() => {\n clearInterval(chatFocusTimeout);\n }, 300);\n }, [compositeParentDivId]);\n\n const isOnHold = currentPage === 'hold';\n useEffect(() => {\n if (isOnHold) {\n closeChat();\n }\n }, [closeChat, isOnHold]);\n\n const hasJoinedCall = !!(currentPage && hasJoinedCallFn(currentPage, currentCallState ?? 'None'));\n const toggleChat = useCallback(() => {\n isChatOpen || !hasJoinedCall ? closeChat() : openChat();\n }, [closeChat, hasJoinedCall, isChatOpen, openChat]);\n\n const callWithChatStrings = useCallWithChatCompositeStrings();\n const chatButtonStrings = useMemo(\n () => ({\n label: callWithChatStrings.chatButtonLabel,\n tooltipOffContent: callWithChatStrings.chatButtonTooltipOpen,\n tooltipOnContent: callWithChatStrings.chatButtonTooltipClose\n }),\n [callWithChatStrings]\n );\n const theme = useTheme();\n const commonButtonStyles = useMemo(\n () => (!mobileView ? getDesktopCommonButtonStyles(theme) : undefined),\n [mobileView, theme]\n );\n\n const showChatButton = checkShowChatButton(props.callControls);\n const chatButtonDisabled =\n showChatButton && (checkChatButtonIsDisabled(props.callControls) || !hasJoinedCall || isOnHold);\n const chatTabHeaderProps = useMemo(\n () =>\n mobileView && showChatButton\n ? {\n onClick: toggleChat,\n disabled: chatButtonDisabled\n }\n : undefined,\n [chatButtonDisabled, mobileView, toggleChat, showChatButton]\n );\n\n const unreadChatMessagesCount = useUnreadMessagesTracker(chatAdapter, isChatOpen, isChatInitialized);\n\n const customChatButton: CustomCallControlButtonCallback = useCallback(\n (args: CustomCallControlButtonCallbackArgs) => ({\n placement: mobileView ? 'primary' : 'secondary',\n onRenderButton: () => (\n <ChatButtonWithUnreadMessagesBadge\n checked={isChatOpen}\n showLabel={args.displayType !== 'compact'}\n onClick={toggleChat}\n disabled={chatButtonDisabled}\n strings={chatButtonStrings}\n styles={commonButtonStyles}\n newMessageLabel={callWithChatStrings.chatButtonNewMessageNotificationLabel}\n unreadChatMessagesCount={unreadChatMessagesCount}\n // As chat is disabled when on hold, we don't want to show the unread badge when on hold\n hideUnreadChatMessagesBadge={isOnHold}\n disableTooltip={mobileView}\n />\n )\n }),\n [\n callWithChatStrings.chatButtonNewMessageNotificationLabel,\n chatButtonStrings,\n commonButtonStyles,\n isChatOpen,\n chatButtonDisabled,\n mobileView,\n toggleChat,\n unreadChatMessagesCount,\n isOnHold\n ]\n );\n\n const callControlOptionsFromProps = useMemo(\n () => ({\n ...(typeof props.callControls === 'object' ? props.callControls : {})\n }),\n [props.callControls]\n );\n\n const injectedCustomButtonsFromProps = useMemo(() => {\n return [...(callControlOptionsFromProps.onFetchCustomButtonProps ?? [])];\n }, [callControlOptionsFromProps]);\n\n const callCompositeOptions: CallCompositeOptions = useMemo(\n () => ({\n callControls:\n props.callControls === false\n ? false\n : ({\n ...callControlOptionsFromProps,\n onFetchCustomButtonProps: [\n ...(showChatButton ? [customChatButton] : []),\n ...injectedCustomButtonsFromProps\n ],\n legacyControlBarExperience: false\n } as CallControlOptions),\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks: props.deviceChecks,\n /* @conditional-compile-remove(call-readiness) */\n onNetworkingTroubleShootingClick: props.onNetworkingTroubleShootingClick,\n /* @conditional-compile-remove(call-readiness) */\n onPermissionsTroubleshootingClick: props.onPermissionsTroubleshootingClick,\n /* @conditional-compile-remove(unsupported-browser) */\n onEnvironmentInfoTroubleshootingClick: props.onEnvironmentInfoTroubleshootingClick,\n remoteVideoTileMenuOptions: props.remoteVideoTileMenuOptions,\n\n galleryOptions: props.galleryOptions,\n localVideoTile: props.localVideoTile,\n surveyOptions: surveyOptions,\n branding: {\n logo: props.logo,\n backgroundImage: props.backgroundImage\n },\n spotlight: props.spotlight\n }),\n [\n props.callControls,\n callControlOptionsFromProps,\n showChatButton,\n customChatButton,\n injectedCustomButtonsFromProps,\n /* @conditional-compile-remove(call-readiness) */\n props.deviceChecks,\n /* @conditional-compile-remove(unsupported-browser) */\n props.onEnvironmentInfoTroubleshootingClick,\n /* @conditional-compile-remove(call-readiness) */\n props.onNetworkingTroubleShootingClick,\n /* @conditional-compile-remove(call-readiness) */\n props.onPermissionsTroubleshootingClick,\n props.galleryOptions,\n props.localVideoTile,\n props.remoteVideoTileMenuOptions,\n surveyOptions,\n props.logo,\n props.backgroundImage,\n props.spotlight\n ]\n );\n\n const chatCompositeOptions: ChatCompositeOptions = useMemo(\n () => ({\n topic: false,\n /* @conditional-compile-remove(chat-composite-participant-pane) */\n participantPane: false,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentOptions: props.attachmentOptions,\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditor: props.richTextEditor\n }),\n [\n /* @conditional-compile-remove(file-sharing-acs) */\n props.attachmentOptions,\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n props.richTextEditor\n ]\n );\n\n /* @conditional-compile-remove(breakout-rooms) */\n const chatSpinnerLabel = useLocale().strings.callWithChat.chatContentSpinnerLabel;\n\n const onRenderChatContent = useCallback((): JSX.Element => {\n /* @conditional-compile-remove(breakout-rooms) */\n if (!isChatInitialized) {\n return (\n <Stack styles={chatSpinnerContainerStyles}>\n <Spinner label={chatSpinnerLabel} size={SpinnerSize.large} />\n </Stack>\n );\n }\n return (\n <ChatComposite\n adapter={chatAdapter}\n fluentTheme={theme}\n options={chatCompositeOptions}\n onFetchAvatarPersonaData={props.onFetchAvatarPersonaData}\n />\n );\n }, [\n chatAdapter,\n props.onFetchAvatarPersonaData,\n chatCompositeOptions,\n theme,\n /* @conditional-compile-remove(breakout-rooms) */ isChatInitialized,\n /* @conditional-compile-remove(breakout-rooms) */ chatSpinnerLabel\n ]);\n\n let chatPaneTitle = callWithChatStrings.chatPaneTitle;\n /* @conditional-compile-remove(breakout-rooms) */\n if (callAdapter.getState().call?.breakoutRooms?.breakoutRoomOriginCallId) {\n chatPaneTitle = callWithChatStrings.breakoutRoomChatPaneTitle;\n }\n\n const sidePaneHeaderRenderer = useCallback(\n () => (\n <SidePaneHeader\n headingText={chatPaneTitle}\n onClose={closeChat}\n dismissSidePaneButtonAriaLabel={callWithChatStrings.dismissSidePaneButtonLabel ?? ''}\n mobileView={mobileView}\n />\n ),\n [chatPaneTitle, callWithChatStrings.dismissSidePaneButtonLabel, closeChat, mobileView]\n );\n\n const sidePaneContentRenderer = useMemo(\n () => (hasJoinedCall ? onRenderChatContent : undefined),\n [hasJoinedCall, onRenderChatContent]\n );\n\n const sidePaneRenderer = useMemo(\n () => ({\n contentRenderer: sidePaneContentRenderer,\n headerRenderer: sidePaneHeaderRenderer,\n id: 'chat'\n }),\n [sidePaneContentRenderer, sidePaneHeaderRenderer]\n );\n\n const overrideSidePaneProps: InjectedSidePaneProps = useMemo(\n () => ({\n renderer: sidePaneRenderer,\n isActive: isChatOpen,\n persistRenderingWhenClosed: true\n }),\n [isChatOpen, sidePaneRenderer]\n );\n\n const onSidePaneIdChange = useCallback(\n (sidePaneId: string | undefined) => {\n // If the pane is switched to something other than chat, removing rendering chat.\n if (sidePaneId && sidePaneId !== 'chat') {\n closeChat();\n }\n },\n [closeChat]\n );\n\n // When the call ends ensure the side pane is set to closed to prevent the side pane being open if the call is re-joined.\n useEffect(() => {\n callAdapter.on('callEnded', closeChat);\n return () => {\n callAdapter.off('callEnded', closeChat);\n };\n }, [callAdapter, closeChat]);\n\n return (\n <div ref={containerRef} className={mergeStyles(containerDivStyles)}>\n <Stack verticalFill grow styles={compositeOuterContainerStyles} id={compositeParentDivId}>\n <Stack horizontal grow>\n <Stack.Item grow styles={callCompositeContainerStyles(mobileView)}>\n <CallCompositeInner\n {...props}\n formFactor={formFactor}\n options={callCompositeOptions}\n adapter={callAdapter}\n fluentTheme={fluentTheme}\n callInvitationUrl={props.joinInvitationURL}\n overrideSidePane={overrideSidePaneProps}\n onSidePaneIdChange={onSidePaneIdChange}\n mobileChatTabHeader={chatTabHeaderProps}\n onCloseChatPane={closeChat}\n />\n </Stack.Item>\n </Stack>\n </Stack>\n </div>\n );\n};\n\n/**\n * CallWithChatComposite brings together key components to provide a full call with chat experience out of the box.\n *\n * @public\n */\nexport const CallWithChatComposite = (props: CallWithChatCompositeProps): JSX.Element => {\n const { adapter, fluentTheme, rtl, formFactor, joinInvitationURL, options } = props;\n return (\n <BaseProvider\n fluentTheme={fluentTheme}\n rtl={rtl}\n locale={props.locale}\n icons={props.icons}\n formFactor={props.formFactor}\n >\n <CallWithChatScreen\n {...props}\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks={options?.deviceChecks}\n callWithChatAdapter={adapter}\n formFactor={formFactor}\n callControls={options?.callControls}\n joinInvitationURL={joinInvitationURL}\n fluentTheme={fluentTheme}\n remoteVideoTileMenuOptions={options?.remoteVideoTileMenuOptions}\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentOptions={options?.attachmentOptions}\n localVideoTile={options?.localVideoTile}\n galleryOptions={options?.galleryOptions}\n logo={options?.branding?.logo}\n backgroundImage={options?.branding?.backgroundImage}\n surveyOptions={options?.surveyOptions}\n spotlight={options?.spotlight}\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditor={options?.richTextEditor}\n />\n </BaseProvider>\n );\n};\n\nconst hasJoinedCallFn = (page: CallCompositePage, callStatus: CallState): boolean => {\n return (\n (page === 'call' &&\n (callStatus === 'Connected' || callStatus === 'RemoteHold' || callStatus === 'Disconnecting')) ||\n (page === 'hold' && (callStatus === 'LocalHold' || callStatus === 'Disconnecting'))\n );\n};\n\nconst checkShowChatButton = (callControls?: boolean | CallWithChatControlOptions): boolean => {\n if (callControls === undefined || callControls === true) {\n return true;\n }\n if (callControls === false) {\n return false;\n }\n return callControls.chatButton !== false;\n};\n\nconst checkChatButtonIsDisabled = (callControls?: boolean | CallWithChatControlOptions): boolean => {\n return typeof callControls === 'object' && isDisabled(callControls?.chatButton);\n};\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"Strings.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallWithChatComposite/Strings.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Strings used by the {@link CallWithChatComposite} directly.\n *\n * This strings are in addition to those used by the components from the component library.\n *\n * @public\n */\nexport interface CallWithChatCompositeStrings {\n /**\n * {@link CallWithChatComposite} control bar People button label\n */\n peopleButtonLabel: string;\n /**\n * {@link CallWithChatComposite} control bar People button label when checked\n */\n selectedPeopleButtonLabel: string;\n /**\n * {@link CallWithChatComposite} aria label for control bar People button when unchecked\n */\n peopleButtonTooltipOpenAriaLabel: string;\n /**\n * {@link CallWithChatComposite} aria label for control bar People button when checked\n */\n peopleButtonTooltipCloseAriaLabel: string;\n /**\n * {@link CallWithChatComposite} control bar People button ToolTipContent\n */\n peopleButtonTooltipOpen: string;\n /**\n * {@link CallWithChatComposite} control bar People button ToolTipContent\n */\n peopleButtonTooltipClose: string;\n /**\n * {@link CallWithChatComposite} control bar Chat button label.\n */\n chatButtonLabel: string;\n /**\n * {@Link CallWithChatComposite} control bar Chat button ToolTipContent.\n */\n chatButtonTooltipOpen: string;\n /**\n * {@Link CallWithChatComposite} control bar Chat button ToolTipContent.\n */\n chatButtonTooltipClose: string;\n /**\n * {@link CallWithChatComposite} control bar Chat button enhanced tooltip string.\n */\n chatButtonTooltipClosedWithMessageCount: string;\n /**\n * Title for the audio device selection sub-menu in more button drawer.\n *\n * Only used with `mobileView` set to `true` and when no speakers are available.\n */\n moreDrawerAudioDeviceMenuTitle?: string;\n /**\n * Title for the microphone selection sub-menu in more button drawer.\n *\n * Only used with `mobileView` set to `true` and when speakers are available.\n */\n moreDrawerMicrophoneMenuTitle: string;\n /**\n * Title for the speaker selection sub-menu in more button drawer.\n *\n * Only used with `mobileView` set to `true`.\n */\n moreDrawerSpeakerMenuTitle: string;\n /**\n * Title for the captions sub-menu in more button drawer.\n *\n * Only used with `mobileView` set to `true`.\n */\n moreDrawerCaptionsMenuTitle: string;\n /**\n * Title for the spoken language sub-menu in more button drawer.\n *\n * Only used with `mobileView` set to `true`.\n */\n moreDrawerSpokenLanguageMenuTitle: string;\n /**\n * Title for the caption language sub-menu in more button drawer.\n *\n * Only used with `mobileView` set to `true`.\n */\n moreDrawerCaptionLanguageMenuTitle: string;\n /**\n * Title for the gallery options sub-menu in the more button drawer.\n */\n moreDrawerGalleryOptionsMenuTitle: string;\n /**\n * {@Link CallWithChatComposite} control bar More button label\n */\n moreDrawerButtonLabel: string;\n /**\n * {@Link CallWithChatComposite} control bar More button tooltip content\n */\n moreDrawerButtonTooltip: string;\n /**\n * Side pane People section Title.\n */\n peoplePaneTitle: string;\n /**\n * Side pane People section subheader.\n */\n peoplePaneSubTitle: string;\n /**\n * Side pane Chat screen title.\n */\n chatPaneTitle: string;\n /* @conditional-compile-remove(breakout-rooms) */\n /**\n * Side pane Chat screen title in a breakout room.\n */\n breakoutRoomChatPaneTitle: string;\n /* @conditional-compile-remove(breakout-rooms) */\n /**\n * Label for spinner when chat content is loading.\n */\n chatContentSpinnerLabel: string;\n /**\n * New Message label for chat button with notification icon component.\n */\n chatButtonNewMessageNotificationLabel: string;\n /**\n * Aria label for the picture in picture in picture tile that.\n * This feature currently only shows on mobileView when the chat or people pane is expanded.\n * @remarks\n * This component displays the local and most-dominant remote participant and when clicked\n * returns the user to the call screen.\n */\n pictureInPictureTileAriaLabel: string;\n /**\n * Label for menu item to remove participant\n */\n removeMenuLabel: string;\n /**\n * Label for button to copy invite link\n */\n copyInviteLinkButtonLabel: string;\n /**\n * Label for button to copy invite link when it has been actioned\n */\n copyInviteLinkButtonActionedLabel: string;\n
|
1
|
+
{"version":3,"file":"Strings.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallWithChatComposite/Strings.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Strings used by the {@link CallWithChatComposite} directly.\n *\n * This strings are in addition to those used by the components from the component library.\n *\n * @public\n */\nexport interface CallWithChatCompositeStrings {\n /**\n * {@link CallWithChatComposite} control bar People button label\n */\n peopleButtonLabel: string;\n /**\n * {@link CallWithChatComposite} control bar People button label when checked\n */\n selectedPeopleButtonLabel: string;\n /**\n * {@link CallWithChatComposite} aria label for control bar People button when unchecked\n */\n peopleButtonTooltipOpenAriaLabel: string;\n /**\n * {@link CallWithChatComposite} aria label for control bar People button when checked\n */\n peopleButtonTooltipCloseAriaLabel: string;\n /**\n * {@link CallWithChatComposite} control bar People button ToolTipContent\n */\n peopleButtonTooltipOpen: string;\n /**\n * {@link CallWithChatComposite} control bar People button ToolTipContent\n */\n peopleButtonTooltipClose: string;\n /**\n * {@link CallWithChatComposite} control bar Chat button label.\n */\n chatButtonLabel: string;\n /**\n * {@Link CallWithChatComposite} control bar Chat button ToolTipContent.\n */\n chatButtonTooltipOpen: string;\n /**\n * {@Link CallWithChatComposite} control bar Chat button ToolTipContent.\n */\n chatButtonTooltipClose: string;\n /**\n * {@link CallWithChatComposite} control bar Chat button enhanced tooltip string.\n */\n chatButtonTooltipClosedWithMessageCount: string;\n /**\n * Title for the audio device selection sub-menu in more button drawer.\n *\n * Only used with `mobileView` set to `true` and when no speakers are available.\n */\n moreDrawerAudioDeviceMenuTitle?: string;\n /**\n * Title for the microphone selection sub-menu in more button drawer.\n *\n * Only used with `mobileView` set to `true` and when speakers are available.\n */\n moreDrawerMicrophoneMenuTitle: string;\n /**\n * Title for the speaker selection sub-menu in more button drawer.\n *\n * Only used with `mobileView` set to `true`.\n */\n moreDrawerSpeakerMenuTitle: string;\n /**\n * Title for the captions sub-menu in more button drawer.\n *\n * Only used with `mobileView` set to `true`.\n */\n moreDrawerCaptionsMenuTitle: string;\n /**\n * Title for the spoken language sub-menu in more button drawer.\n *\n * Only used with `mobileView` set to `true`.\n */\n moreDrawerSpokenLanguageMenuTitle: string;\n /**\n * Title for the caption language sub-menu in more button drawer.\n *\n * Only used with `mobileView` set to `true`.\n */\n moreDrawerCaptionLanguageMenuTitle: string;\n /**\n * Title for the gallery options sub-menu in the more button drawer.\n */\n moreDrawerGalleryOptionsMenuTitle: string;\n /**\n * {@Link CallWithChatComposite} control bar More button label\n */\n moreDrawerButtonLabel: string;\n /**\n * {@Link CallWithChatComposite} control bar More button tooltip content\n */\n moreDrawerButtonTooltip: string;\n /**\n * Side pane People section Title.\n */\n peoplePaneTitle: string;\n /**\n * Side pane People section subheader.\n */\n peoplePaneSubTitle: string;\n /**\n * Side pane Chat screen title.\n */\n chatPaneTitle: string;\n /* @conditional-compile-remove(breakout-rooms) */\n /**\n * Side pane Chat screen title in a breakout room.\n */\n breakoutRoomChatPaneTitle: string;\n /* @conditional-compile-remove(breakout-rooms) */\n /**\n * Label for spinner when chat content is loading.\n */\n chatContentSpinnerLabel: string;\n /**\n * New Message label for chat button with notification icon component.\n */\n chatButtonNewMessageNotificationLabel: string;\n /**\n * Aria label for the picture in picture in picture tile that.\n * This feature currently only shows on mobileView when the chat or people pane is expanded.\n * @remarks\n * This component displays the local and most-dominant remote participant and when clicked\n * returns the user to the call screen.\n */\n pictureInPictureTileAriaLabel: string;\n /**\n * Label for menu item to remove participant\n */\n removeMenuLabel: string;\n /**\n * Label for button to copy invite link\n */\n copyInviteLinkButtonLabel: string;\n /**\n * Label for button to copy invite link when it has been actioned\n */\n copyInviteLinkButtonActionedLabel: string;\n /**\n * Label for button to open dialpad\n */\n openDialpadButtonLabel: string;\n /**\n * Label for SidePaneHeader dismiss button\n */\n dismissSidePaneButtonLabel?: string;\n /**\n * Aria Description string for return to call button\n */\n returnToCallButtonAriaDescription?: string;\n /**\n * Aria label string for return to call back button\n */\n returnToCallButtonAriaLabel?: string;\n\n /**\n * Label for add people dropdown\n */\n peoplePaneAddPeopleButtonLabel: string;\n /**\n * Label for button to start a call\n */\n dialpadStartCallButtonLabel: string;\n /**\n * Title for dialpad Modal\n */\n dialpadModalTitle: string;\n /**\n * Aria Label for dialpad Modal\n */\n dialpadModalAriaLabel: string;\n /**\n * Aria Label for dialpad Modal close button\n */\n dialpadCloseModalButtonAriaLabel: string;\n /**\n * Placeholder text for dtmf dialpad\n */\n dtmfDialpadPlaceholderText: string;\n /**\n * Label for the button to open dtmf dialpad\n */\n openDtmfDialpadLabel: string;\n /**\n * aria label for when the invite link has been actioned\n */\n copyInviteLinkActionedAriaLabel: string;\n}\n"]}
|
@@ -73,7 +73,7 @@ export declare class AzureCommunicationCallWithChatAdapter implements CallWithCh
|
|
73
73
|
/** Dispose of the current CallWithChatAdapter. */
|
74
74
|
dispose(): void;
|
75
75
|
/** Remove a participant from the Call only. */
|
76
|
-
removeParticipant(userId: string |
|
76
|
+
removeParticipant(userId: string | CommunicationIdentifier): Promise<void>;
|
77
77
|
setCamera(device: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void>;
|
78
78
|
/** Set the microphone to be used in the Call. */
|
79
79
|
setMicrophone(device: AudioDeviceInfo): Promise<void>;
|
@@ -14,7 +14,6 @@ import { toFlatCommunicationIdentifier } from "../../../../../acs-ui-common/src"
|
|
14
14
|
import { callWithChatAdapterStateFromBackingStates, mergeCallAdapterStateIntoCallWithChatAdapterState, mergeChatAdapterStateIntoCallWithChatAdapterState } from '../state/CallWithChatAdapterState';
|
15
15
|
import { _createAzureCommunicationChatAdapterInner, _createLazyAzureCommunicationChatAdapterInner, createAzureCommunicationChatAdapterFromClient } from '../../ChatComposite/adapter/AzureCommunicationChatAdapter';
|
16
16
|
import { EventEmitter } from 'events';
|
17
|
-
/* @conditional-compile-remove(PSTN-calls) */
|
18
17
|
import { isCommunicationUserIdentifier } from '@azure/communication-common';
|
19
18
|
import { getChatThreadFromTeamsLink } from './parseTeamsUrl';
|
20
19
|
import { _createAzureCommunicationCallAdapterInner } from '../../CallComposite/adapter/AzureCommunicationCallAdapter';
|
@@ -233,11 +232,8 @@ export class AzureCommunicationCallWithChatAdapter {
|
|
233
232
|
this.off.bind(this);
|
234
233
|
this.downloadResourceToCache = this.downloadResourceToCache.bind(this);
|
235
234
|
this.removeResourceFromCache = this.removeResourceFromCache.bind(this);
|
236
|
-
/* @conditional-compile-remove(PSTN-calls) */
|
237
235
|
this.holdCall.bind(this);
|
238
|
-
/* @conditional-compile-remove(PSTN-calls) */
|
239
236
|
this.resumeCall.bind(this);
|
240
|
-
/* @conditional-compile-remove(PSTN-calls) */
|
241
237
|
this.addParticipant.bind(this);
|
242
238
|
this.sendDtmfTone.bind(this);
|
243
239
|
/* @conditional-compile-remove(unsupported-browser) */
|
@@ -314,7 +310,6 @@ export class AzureCommunicationCallWithChatAdapter {
|
|
314
310
|
removeParticipant(userId) {
|
315
311
|
return __awaiter(this, void 0, void 0, function* () {
|
316
312
|
let participant = userId;
|
317
|
-
/* @conditional-compile-remove(PSTN-calls) */
|
318
313
|
participant = _toCommunicationIdentifier(userId);
|
319
314
|
yield this.callAdapter.removeParticipant(participant);
|
320
315
|
});
|
@@ -531,19 +526,16 @@ export class AzureCommunicationCallWithChatAdapter {
|
|
531
526
|
adapter.removeResourceFromCache(resourceDetails);
|
532
527
|
});
|
533
528
|
}
|
534
|
-
/* @conditional-compile-remove(PSTN-calls) */
|
535
529
|
holdCall() {
|
536
530
|
return __awaiter(this, void 0, void 0, function* () {
|
537
531
|
return yield this.callAdapter.holdCall();
|
538
532
|
});
|
539
533
|
}
|
540
|
-
/* @conditional-compile-remove(PSTN-calls) */
|
541
534
|
resumeCall() {
|
542
535
|
return __awaiter(this, void 0, void 0, function* () {
|
543
536
|
return yield this.callAdapter.resumeCall();
|
544
537
|
});
|
545
538
|
}
|
546
|
-
/* @conditional-compile-remove(PSTN-calls) */
|
547
539
|
addParticipant(participant, options) {
|
548
540
|
return __awaiter(this, void 0, void 0, function* () {
|
549
541
|
if (isCommunicationUserIdentifier(participant)) {
|
@@ -993,15 +985,14 @@ export class TeamsMeetingIdProvider {
|
|
993
985
|
*
|
994
986
|
* @public
|
995
987
|
*/
|
996
|
-
export const createAzureCommunicationCallWithChatAdapter = (_a) => __awaiter(void 0, [_a], void 0, function* ({ userId, displayName, credential, endpoint, locator,
|
997
|
-
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId, callAdapterOptions }) {
|
988
|
+
export const createAzureCommunicationCallWithChatAdapter = (_a) => __awaiter(void 0, [_a], void 0, function* ({ userId, displayName, credential, endpoint, locator, alternateCallerId, callAdapterOptions }) {
|
998
989
|
const callAdapterLocator = isTeamsMeetingLocator(locator) ? locator : locator.callLocator;
|
999
990
|
const callAdapter = _createAzureCommunicationCallAdapterInner({
|
1000
991
|
userId,
|
1001
992
|
displayName,
|
1002
993
|
credential,
|
1003
994
|
locator: callAdapterLocator,
|
1004
|
-
|
995
|
+
alternateCallerId,
|
1005
996
|
options: callAdapterOptions,
|
1006
997
|
telemetryImplementationHint: 'CallWithChat'
|
1007
998
|
});
|
@@ -1056,8 +1047,7 @@ afterCreate,
|
|
1056
1047
|
* This is useful for clean up tasks, e.g., leaving any ongoing calls.
|
1057
1048
|
*/
|
1058
1049
|
beforeDispose) => {
|
1059
|
-
const { credential, displayName, endpoint, locator, userId,
|
1060
|
-
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId, callAdapterOptions } = args;
|
1050
|
+
const { credential, displayName, endpoint, locator, userId, alternateCallerId, callAdapterOptions } = args;
|
1061
1051
|
// State update needed to rerender the parent component when a new adapter is created.
|
1062
1052
|
const [adapter, setAdapter] = useState(undefined);
|
1063
1053
|
// Ref needed for cleanup to access the old adapter created asynchronously.
|
@@ -1099,7 +1089,7 @@ beforeDispose) => {
|
|
1099
1089
|
endpoint,
|
1100
1090
|
locator,
|
1101
1091
|
userId,
|
1102
|
-
|
1092
|
+
alternateCallerId,
|
1103
1093
|
callAdapterOptions
|
1104
1094
|
});
|
1105
1095
|
if (afterCreateRef.current) {
|
@@ -1114,7 +1104,7 @@ beforeDispose) => {
|
|
1114
1104
|
[
|
1115
1105
|
adapterRef,
|
1116
1106
|
afterCreateRef,
|
1117
|
-
|
1107
|
+
alternateCallerId,
|
1118
1108
|
beforeDisposeRef,
|
1119
1109
|
credential,
|
1120
1110
|
displayName,
|