@azure/communication-react 1.18.0-alpha-202406260014 → 1.18.0-alpha-202406280014
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 +98 -106
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-_hqOwT_h.js → ChatMessageComponentAsRichTextEditBox-Bl9FzI6X.js} +2 -2
- package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-_hqOwT_h.js.map → ChatMessageComponentAsRichTextEditBox-Bl9FzI6X.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-D-KYGmZ9.js → RichTextSendBoxWrapper-G-04IaQB.js} +2 -2
- package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-D-KYGmZ9.js.map → RichTextSendBoxWrapper-G-04IaQB.js.map} +1 -1
- package/dist/dist-cjs/communication-react/{index-DCf8u3Nr.js → index-CWs0GTYF.js} +75 -158
- package/dist/dist-cjs/communication-react/index-CWs0GTYF.js.map +1 -0
- package/dist/dist-cjs/communication-react/index.js +3 -3
- 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/errorBarSelector.js +5 -20
- package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/index.d.ts +2 -2
- package/dist/dist-esm/calling-component-bindings/src/index.js +1 -1
- package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/{errorNotificationsSelector.d.ts → notificationStackSelector.d.ts} +4 -3
- package/dist/dist-esm/calling-component-bindings/src/{errorNotificationsSelector.js → notificationStackSelector.js} +7 -3
- package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js.map +1 -0
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallDeclarative.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +1 -0
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +9 -0
- package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/StatefulChatClient.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.d.ts +2 -2
- package/dist/dist-esm/communication-react/src/index.js +1 -1
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/communication-react/src/mergedHooks.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ControlBarButton.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ErrorBar.d.ts +4 -0
- package/dist/dist-esm/react-components/src/components/ErrorBar.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.d.ts +1 -21
- package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.js +8 -8
- package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/{NotificationBar.d.ts → Notification.d.ts} +8 -8
- package/dist/dist-esm/react-components/src/components/{NotificationBar.js → Notification.js} +5 -5
- package/dist/dist-esm/react-components/src/components/Notification.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/{Notifications.d.ts → NotificationStack.d.ts} +46 -42
- package/dist/dist-esm/react-components/src/components/{Notifications.js → NotificationStack.js} +7 -7
- package/dist/dist-esm/react-components/src/components/NotificationStack.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js +1 -1
- package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.js.map +1 -1
- 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.map +1 -1
- package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.d.ts +2 -2
- package/dist/dist-esm/react-components/src/components/index.js +2 -2
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/{NotificationBar.styles.d.ts → Notification.styles.d.ts} +1 -1
- package/dist/dist-esm/react-components/src/components/styles/{NotificationBar.styles.js → Notification.styles.js} +1 -1
- package/dist/dist-esm/react-components/src/components/styles/Notification.styles.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/merge.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils.d.ts +1 -1
- package/dist/dist-esm/react-components/src/components/utils.js +3 -1
- package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +4 -4
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +10 -10
- package/dist/dist-esm/react-components/src/theming/icons.d.ts +1 -0
- package/dist/dist-esm/react-components/src/theming/icons.js +4 -0
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +3 -13
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -0
- 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 +9 -1
- 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.d.ts +0 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +3 -9
- 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/LocalDeviceSettings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.d.ts +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js +12 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.d.ts +2 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.d.ts +0 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +2 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CallControlOptions.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/CaptionsBannerMoreButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/MeetingPhoneInfoPaneContent.js +6 -0
- package/dist/dist-esm/react-composites/src/composites/common/MeetingPhoneInfoPaneContent.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.d.ts +2 -3
- package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +2 -40
- package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +1 -7
- package/package.json +2 -2
- package/dist/dist-cjs/communication-react/index-DCf8u3Nr.js.map +0 -1
- package/dist/dist-esm/calling-component-bindings/src/errorNotificationsSelector.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/NotificationBar.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/Notifications.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/NotificationBar.styles.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BadNetworkQualityNotificationBar.d.ts +0 -22
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BadNetworkQualityNotificationBar.js +0 -40
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BadNetworkQualityNotificationBar.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/badNetworkQualitySelector.d.ts +0 -19
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/badNetworkQualitySelector.js +0 -26
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/badNetworkQualitySelector.js.map +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CallDeclarativeCommon.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/CallDeclarativeCommon.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAIlC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAQxD;;GAEG;AACH,MAAM,OAAgB,eAAe;IAGnC,YAAY,OAAoB;QAC9B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAEM,WAAW;QAChB,6EAA6E;IAC/E,CAAC;IAES,UAAU;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAEM,GAAG,CAA6B,MAAkB,EAAE,IAAO;QAChE,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,MAAM,CAAC,CAAC,CAAC;gBACZ,OAAO,IAAI,CAAC,QAAQ,CAAC,yBAAyB,CAAC,UAAgB,GAAG,IAAoC;;wBACpG,OAAO,MAAM,MA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;6BACtB,CAAC,CAAC;4BACH,QAAQ,CAAC,IAAI,CAAC,CAAC;wBACjB,CAAC,CAAC;wBACF,OAAO,MAAM,CAAC,EAAE,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;oBACpD,CAAC;gBACH,CAAC,CAAC;YACJ;gBACE,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CallContext } from './CallContext';\nimport { CallCommon } from './BetaToStableTypes';\nimport { Features } from '@azure/communication-calling';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { PropertyChangedEvent, CaptionsCallFeature } from '@azure/communication-calling';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { Captions } from '@azure/communication-calling';\nimport { TeamsCaptions } from '@azure/communication-calling';\nimport { TransferCallFeature, TransferAcceptedEvent, TransferEventArgs } from '@azure/communication-calling';\nimport { SpotlightCallFeature } from '@azure/communication-calling';\n/**\n * @private\n */\nexport abstract class ProxyCallCommon implements ProxyHandler<CallCommon> {\n private _context: CallContext;\n\n constructor(context: CallContext) {\n this._context = context;\n }\n\n public unsubscribe(): void {\n /** No subscriptions yet. But there will be one for transfer feature soon. */\n }\n\n protected getContext(): CallContext {\n return this._context;\n }\n\n public get<P extends keyof CallCommon>(target: CallCommon, prop: P): any {\n switch (prop) {\n case 'mute': {\n return this._context.withAsyncErrorTeedToState(async function (...args: Parameters<CallCommon['mute']>) {\n return await target.mute(...args);\n }, 'Call.mute');\n }\n case 'unmute': {\n return this._context.withAsyncErrorTeedToState(async function (...args: Parameters<CallCommon['unmute']>) {\n return await target.unmute(...args);\n }, 'Call.unmute');\n }\n case 'startVideo': {\n return this._context.withAsyncErrorTeedToState(async function (...args: Parameters<CallCommon['startVideo']>) {\n return await target.startVideo(...args);\n }, 'Call.startVideo');\n }\n case 'stopVideo': {\n return this._context.withAsyncErrorTeedToState(async function (...args: Parameters<CallCommon['stopVideo']>) {\n return await target.stopVideo(...args);\n }, 'Call.stopVideo');\n }\n case 'startScreenSharing': {\n return this._context.withAsyncErrorTeedToState(async function (\n ...args: Parameters<CallCommon['startScreenSharing']>\n ) {\n return await target.startScreenSharing(...args);\n },\n 'Call.startScreenSharing');\n }\n case 'stopScreenSharing': {\n return this._context.withAsyncErrorTeedToState(async function (\n ...args: Parameters<CallCommon['stopScreenSharing']>\n ) {\n return await target.stopScreenSharing(...args);\n },\n 'Call.stopScreenSharing');\n }\n case 'hold': {\n return this._context.withAsyncErrorTeedToState(async function (...args: Parameters<CallCommon['hold']>) {\n return await target.hold(...args);\n }, 'Call.hold');\n }\n case 'resume': {\n return this._context.withAsyncErrorTeedToState(async function (...args: Parameters<CallCommon['resume']>) {\n return await target.resume(...args);\n }, 'Call.resume');\n }\n case 'feature': {\n // these are mini version of Proxy object - if it grows too big, a real Proxy object should be used.\n return this._context.withErrorTeedToState((...args: Parameters<CallCommon['feature']>) => {\n if (args[0] === Features.Captions) {\n const captionsFeature = target.feature(Features.Captions);\n let proxyFeature;\n /* @conditional-compile-remove(acs-close-captions) */\n if (captionsFeature.captions.kind === 'Captions') {\n proxyFeature = new ProxyCaptions(this._context, target);\n return {\n captions: new Proxy(captionsFeature.captions, proxyFeature),\n on: (...args: Parameters<CaptionsCallFeature['on']>): void => {\n const isCaptionsKindChanged = args[0] === 'CaptionsKindChanged';\n if (isCaptionsKindChanged) {\n const listener = args[1] as PropertyChangedEvent;\n const newListener = (): void => {\n listener();\n };\n return captionsFeature.on('CaptionsKindChanged', newListener);\n }\n },\n off: (...args: Parameters<CaptionsCallFeature['off']>): void => {\n const isCaptionsKindChanged = args[0] === 'CaptionsKindChanged';\n if (isCaptionsKindChanged) {\n return captionsFeature.off('CaptionsKindChanged', args[1]);\n }\n }\n };\n }\n proxyFeature = new ProxyTeamsCaptions(this._context, target);\n return {\n captions: new Proxy(captionsFeature.captions, proxyFeature)\n };\n }\n if (args[0] === Features.Transfer) {\n const transferFeature = target.feature(Features.Transfer);\n const proxyFeature = new ProxyTransferCallFeature(this._context, target);\n return new Proxy(transferFeature, proxyFeature);\n }\n if (args[0] === Features.Spotlight) {\n const spotlightFeature = target.feature(Features.Spotlight);\n const proxyFeature = new ProxySpotlightCallFeature(this._context);\n return new Proxy(spotlightFeature, proxyFeature);\n }\n return target.feature(...args);\n }, 'Call.feature');\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n/**\n * @private\n */\nclass ProxyTeamsCaptions implements ProxyHandler<TeamsCaptions> {\n private _context: CallContext;\n private _call: CallCommon;\n\n constructor(context: CallContext, call: CallCommon) {\n this._context = context;\n this._call = call;\n }\n\n public get<P extends keyof TeamsCaptions>(target: TeamsCaptions, prop: P): any {\n switch (prop) {\n case 'startCaptions':\n return this._context.withAsyncErrorTeedToState(async (...args: Parameters<TeamsCaptions['startCaptions']>) => {\n this._context.setStartCaptionsInProgress(this._call.id, true);\n try {\n const ret = await target.startCaptions(...args);\n this._context.setSelectedSpokenLanguage(this._call.id, args[0]?.spokenLanguage ?? 'en-us');\n return ret;\n } catch (e) {\n this._context.setStartCaptionsInProgress(this._call.id, false);\n throw e;\n }\n }, 'Call.feature');\n break;\n case 'stopCaptions':\n return this._context.withAsyncErrorTeedToState(async (...args: Parameters<TeamsCaptions['stopCaptions']>) => {\n const ret = await target.stopCaptions(...args);\n this._context.setIsCaptionActive(this._call.id, false);\n this._context.setStartCaptionsInProgress(this._call.id, false);\n this._context.clearCaptions(this._call.id);\n return ret;\n }, 'Call.feature');\n case 'setSpokenLanguage':\n return this._context.withAsyncErrorTeedToState(\n async (...args: Parameters<TeamsCaptions['setSpokenLanguage']>) => {\n const ret = await target.setSpokenLanguage(...args);\n this._context.setSelectedSpokenLanguage(this._call.id, args[0]);\n return ret;\n },\n 'Call.feature'\n );\n case 'setCaptionLanguage':\n return this._context.withAsyncErrorTeedToState(\n async (...args: Parameters<TeamsCaptions['setCaptionLanguage']>) => {\n const ret = await target.setCaptionLanguage(...args);\n this._context.setSelectedCaptionLanguage(this._call.id, args[0]);\n return ret;\n },\n 'Call.feature'\n );\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n/* @conditional-compile-remove(acs-close-captions) */\n/**\n * @private\n */\nclass ProxyCaptions implements ProxyHandler<Captions> {\n private _context: CallContext;\n private _call: CallCommon;\n\n constructor(context: CallContext, call: CallCommon) {\n this._context = context;\n this._call = call;\n }\n\n public get<P extends keyof Captions>(target: Captions, prop: P): any {\n switch (prop) {\n case 'startCaptions':\n return this._context.withAsyncErrorTeedToState(async (...args: Parameters<TeamsCaptions['startCaptions']>) => {\n this._context.setStartCaptionsInProgress(this._call.id, true);\n try {\n const ret = await target.startCaptions(...args);\n this._context.setSelectedSpokenLanguage(this._call.id, args[0]?.spokenLanguage ?? 'en-us');\n return ret;\n } catch (e) {\n this._context.setStartCaptionsInProgress(this._call.id, false);\n throw e;\n }\n }, 'Call.feature');\n break;\n case 'stopCaptions':\n return this._context.withAsyncErrorTeedToState(async (...args: Parameters<TeamsCaptions['stopCaptions']>) => {\n const ret = await target.stopCaptions(...args);\n this._context.setIsCaptionActive(this._call.id, false);\n this._context.setStartCaptionsInProgress(this._call.id, false);\n this._context.clearCaptions(this._call.id);\n return ret;\n }, 'Call.feature');\n case 'setSpokenLanguage':\n return this._context.withAsyncErrorTeedToState(\n async (...args: Parameters<TeamsCaptions['setSpokenLanguage']>) => {\n const ret = await target.setSpokenLanguage(...args);\n this._context.setSelectedSpokenLanguage(this._call.id, args[0]);\n return ret;\n },\n 'Call.feature'\n );\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n/**\n * @private\n */\nclass ProxySpotlightCallFeature implements ProxyHandler<SpotlightCallFeature> {\n private _context: CallContext;\n\n constructor(context: CallContext) {\n this._context = context;\n }\n\n public get<P extends keyof SpotlightCallFeature>(target: SpotlightCallFeature, prop: P): any {\n switch (prop) {\n case 'startSpotlight':\n return this._context.withAsyncErrorTeedToState(\n async (...args: Parameters<SpotlightCallFeature['startSpotlight']>) => {\n const ret = await target.startSpotlight(...args);\n return ret;\n },\n 'Call.feature'\n );\n break;\n case 'stopSpotlight':\n return this._context.withAsyncErrorTeedToState(\n async (...args: Parameters<SpotlightCallFeature['stopSpotlight']>) => {\n const ret = await target.stopSpotlight(...args);\n return ret;\n },\n 'Call.feature'\n );\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n/**\n * @private\n */\nclass ProxyTransferCallFeature implements ProxyHandler<TransferCallFeature> {\n private _context: CallContext;\n private _call: CallCommon;\n\n constructor(context: CallContext, call: CallCommon) {\n this._context = context;\n this._call = call;\n }\n\n public get<P extends keyof TransferCallFeature>(target: TransferCallFeature, prop: P): any {\n switch (prop) {\n case 'on':\n return (...args: Parameters<TransferCallFeature['on']>): void => {\n const isTransferAccepted = args[0] === 'transferAccepted';\n if (isTransferAccepted) {\n const listener = args[1] as TransferAcceptedEvent;\n const newListener = (args: TransferEventArgs): void => {\n this._context.setAcceptedTransfer(this._call.id, {\n callId: args.targetCall.id,\n timestamp: new Date()\n });\n listener(args);\n };\n return target.on('transferAccepted', newListener);\n }\n };\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n"]}
|
1
|
+
{"version":3,"file":"CallDeclarativeCommon.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/CallDeclarativeCommon.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAIlC,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAQxD;;GAEG;AACH,MAAM,OAAgB,eAAe;IAGnC,YAAY,OAAoB;QAC9B,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;IAEM,WAAW;QAChB,6EAA6E;IAC/E,CAAC;IAES,UAAU;QAClB,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAEM,GAAG,CAA6B,MAAkB,EAAE,IAAO;QAChE,QAAQ,IAAI,EAAE,CAAC;YACb,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AC,IAAI,CAAC,KAAK,CAAC,EAAE,EAAE;gCAC/C,MAAM,EAAE,IAAI,CAAC,UAAU,CAAC,EAAE;gCAC1B,SAAS,EAAE,IAAI,IAAI,EAAE;6BACtB,CAAC,CAAC;4BACH,QAAQ,CAAC,IAAI,CAAC,CAAC;wBACjB,CAAC,CAAC;wBACF,OAAO,MAAM,CAAC,EAAE,CAAC,kBAAkB,EAAE,WAAW,CAAC,CAAC;oBACpD,CAAC;gBACH,CAAC,CAAC;YACJ;gBACE,OAAO,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CallContext } from './CallContext';\nimport { CallCommon } from './BetaToStableTypes';\nimport { Features } from '@azure/communication-calling';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { PropertyChangedEvent, CaptionsCallFeature } from '@azure/communication-calling';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { Captions } from '@azure/communication-calling';\nimport { TeamsCaptions } from '@azure/communication-calling';\nimport { TransferCallFeature, TransferAcceptedEvent, TransferEventArgs } from '@azure/communication-calling';\nimport { SpotlightCallFeature } from '@azure/communication-calling';\n/**\n * @private\n */\nexport abstract class ProxyCallCommon implements ProxyHandler<CallCommon> {\n private _context: CallContext;\n\n constructor(context: CallContext) {\n this._context = context;\n }\n\n public unsubscribe(): void {\n /** No subscriptions yet. But there will be one for transfer feature soon. */\n }\n\n protected getContext(): CallContext {\n return this._context;\n }\n\n public get<P extends keyof CallCommon>(target: CallCommon, prop: P): any {\n switch (prop) {\n case 'mute': {\n return this._context.withAsyncErrorTeedToState(async function (...args: Parameters<CallCommon['mute']>) {\n return await target.mute(...args);\n }, 'Call.mute');\n }\n case 'unmute': {\n return this._context.withAsyncErrorTeedToState(async function (...args: Parameters<CallCommon['unmute']>) {\n return await target.unmute(...args);\n }, 'Call.unmute');\n }\n case 'startVideo': {\n return this._context.withAsyncErrorTeedToState(async function (...args: Parameters<CallCommon['startVideo']>) {\n return await target.startVideo(...args);\n }, 'Call.startVideo');\n }\n case 'stopVideo': {\n return this._context.withAsyncErrorTeedToState(async function (...args: Parameters<CallCommon['stopVideo']>) {\n return await target.stopVideo(...args);\n }, 'Call.stopVideo');\n }\n case 'startScreenSharing': {\n return this._context.withAsyncErrorTeedToState(async function (\n ...args: Parameters<CallCommon['startScreenSharing']>\n ) {\n return await target.startScreenSharing(...args);\n }, 'Call.startScreenSharing');\n }\n case 'stopScreenSharing': {\n return this._context.withAsyncErrorTeedToState(async function (\n ...args: Parameters<CallCommon['stopScreenSharing']>\n ) {\n return await target.stopScreenSharing(...args);\n }, 'Call.stopScreenSharing');\n }\n case 'hold': {\n return this._context.withAsyncErrorTeedToState(async function (...args: Parameters<CallCommon['hold']>) {\n return await target.hold(...args);\n }, 'Call.hold');\n }\n case 'resume': {\n return this._context.withAsyncErrorTeedToState(async function (...args: Parameters<CallCommon['resume']>) {\n return await target.resume(...args);\n }, 'Call.resume');\n }\n case 'feature': {\n // these are mini version of Proxy object - if it grows too big, a real Proxy object should be used.\n return this._context.withErrorTeedToState((...args: Parameters<CallCommon['feature']>) => {\n if (args[0] === Features.Captions) {\n const captionsFeature = target.feature(Features.Captions);\n let proxyFeature;\n /* @conditional-compile-remove(acs-close-captions) */\n if (captionsFeature.captions.kind === 'Captions') {\n proxyFeature = new ProxyCaptions(this._context, target);\n return {\n captions: new Proxy(captionsFeature.captions, proxyFeature),\n on: (...args: Parameters<CaptionsCallFeature['on']>): void => {\n const isCaptionsKindChanged = args[0] === 'CaptionsKindChanged';\n if (isCaptionsKindChanged) {\n const listener = args[1] as PropertyChangedEvent;\n const newListener = (): void => {\n listener();\n };\n return captionsFeature.on('CaptionsKindChanged', newListener);\n }\n },\n off: (...args: Parameters<CaptionsCallFeature['off']>): void => {\n const isCaptionsKindChanged = args[0] === 'CaptionsKindChanged';\n if (isCaptionsKindChanged) {\n return captionsFeature.off('CaptionsKindChanged', args[1]);\n }\n }\n };\n }\n proxyFeature = new ProxyTeamsCaptions(this._context, target);\n return {\n captions: new Proxy(captionsFeature.captions, proxyFeature)\n };\n }\n if (args[0] === Features.Transfer) {\n const transferFeature = target.feature(Features.Transfer);\n const proxyFeature = new ProxyTransferCallFeature(this._context, target);\n return new Proxy(transferFeature, proxyFeature);\n }\n if (args[0] === Features.Spotlight) {\n const spotlightFeature = target.feature(Features.Spotlight);\n const proxyFeature = new ProxySpotlightCallFeature(this._context);\n return new Proxy(spotlightFeature, proxyFeature);\n }\n return target.feature(...args);\n }, 'Call.feature');\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n/**\n * @private\n */\nclass ProxyTeamsCaptions implements ProxyHandler<TeamsCaptions> {\n private _context: CallContext;\n private _call: CallCommon;\n\n constructor(context: CallContext, call: CallCommon) {\n this._context = context;\n this._call = call;\n }\n\n public get<P extends keyof TeamsCaptions>(target: TeamsCaptions, prop: P): any {\n switch (prop) {\n case 'startCaptions':\n return this._context.withAsyncErrorTeedToState(async (...args: Parameters<TeamsCaptions['startCaptions']>) => {\n this._context.setStartCaptionsInProgress(this._call.id, true);\n try {\n const ret = await target.startCaptions(...args);\n this._context.setSelectedSpokenLanguage(this._call.id, args[0]?.spokenLanguage ?? 'en-us');\n return ret;\n } catch (e) {\n this._context.setStartCaptionsInProgress(this._call.id, false);\n throw e;\n }\n }, 'Call.feature');\n break;\n case 'stopCaptions':\n return this._context.withAsyncErrorTeedToState(async (...args: Parameters<TeamsCaptions['stopCaptions']>) => {\n const ret = await target.stopCaptions(...args);\n this._context.setIsCaptionActive(this._call.id, false);\n this._context.setStartCaptionsInProgress(this._call.id, false);\n this._context.clearCaptions(this._call.id);\n return ret;\n }, 'Call.feature');\n case 'setSpokenLanguage':\n return this._context.withAsyncErrorTeedToState(\n async (...args: Parameters<TeamsCaptions['setSpokenLanguage']>) => {\n const ret = await target.setSpokenLanguage(...args);\n this._context.setSelectedSpokenLanguage(this._call.id, args[0]);\n return ret;\n },\n 'Call.feature'\n );\n case 'setCaptionLanguage':\n return this._context.withAsyncErrorTeedToState(\n async (...args: Parameters<TeamsCaptions['setCaptionLanguage']>) => {\n const ret = await target.setCaptionLanguage(...args);\n this._context.setSelectedCaptionLanguage(this._call.id, args[0]);\n return ret;\n },\n 'Call.feature'\n );\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n/* @conditional-compile-remove(acs-close-captions) */\n/**\n * @private\n */\nclass ProxyCaptions implements ProxyHandler<Captions> {\n private _context: CallContext;\n private _call: CallCommon;\n\n constructor(context: CallContext, call: CallCommon) {\n this._context = context;\n this._call = call;\n }\n\n public get<P extends keyof Captions>(target: Captions, prop: P): any {\n switch (prop) {\n case 'startCaptions':\n return this._context.withAsyncErrorTeedToState(async (...args: Parameters<TeamsCaptions['startCaptions']>) => {\n this._context.setStartCaptionsInProgress(this._call.id, true);\n try {\n const ret = await target.startCaptions(...args);\n this._context.setSelectedSpokenLanguage(this._call.id, args[0]?.spokenLanguage ?? 'en-us');\n return ret;\n } catch (e) {\n this._context.setStartCaptionsInProgress(this._call.id, false);\n throw e;\n }\n }, 'Call.feature');\n break;\n case 'stopCaptions':\n return this._context.withAsyncErrorTeedToState(async (...args: Parameters<TeamsCaptions['stopCaptions']>) => {\n const ret = await target.stopCaptions(...args);\n this._context.setIsCaptionActive(this._call.id, false);\n this._context.setStartCaptionsInProgress(this._call.id, false);\n this._context.clearCaptions(this._call.id);\n return ret;\n }, 'Call.feature');\n case 'setSpokenLanguage':\n return this._context.withAsyncErrorTeedToState(\n async (...args: Parameters<TeamsCaptions['setSpokenLanguage']>) => {\n const ret = await target.setSpokenLanguage(...args);\n this._context.setSelectedSpokenLanguage(this._call.id, args[0]);\n return ret;\n },\n 'Call.feature'\n );\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n/**\n * @private\n */\nclass ProxySpotlightCallFeature implements ProxyHandler<SpotlightCallFeature> {\n private _context: CallContext;\n\n constructor(context: CallContext) {\n this._context = context;\n }\n\n public get<P extends keyof SpotlightCallFeature>(target: SpotlightCallFeature, prop: P): any {\n switch (prop) {\n case 'startSpotlight':\n return this._context.withAsyncErrorTeedToState(\n async (...args: Parameters<SpotlightCallFeature['startSpotlight']>) => {\n const ret = await target.startSpotlight(...args);\n return ret;\n },\n 'Call.feature'\n );\n break;\n case 'stopSpotlight':\n return this._context.withAsyncErrorTeedToState(\n async (...args: Parameters<SpotlightCallFeature['stopSpotlight']>) => {\n const ret = await target.stopSpotlight(...args);\n return ret;\n },\n 'Call.feature'\n );\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n/**\n * @private\n */\nclass ProxyTransferCallFeature implements ProxyHandler<TransferCallFeature> {\n private _context: CallContext;\n private _call: CallCommon;\n\n constructor(context: CallContext, call: CallCommon) {\n this._context = context;\n this._call = call;\n }\n\n public get<P extends keyof TransferCallFeature>(target: TransferCallFeature, prop: P): any {\n switch (prop) {\n case 'on':\n return (...args: Parameters<TransferCallFeature['on']>): void => {\n const isTransferAccepted = args[0] === 'transferAccepted';\n if (isTransferAccepted) {\n const listener = args[1] as TransferAcceptedEvent;\n const newListener = (args: TransferEventArgs): void => {\n this._context.setAcceptedTransfer(this._call.id, {\n callId: args.targetCall.id,\n timestamp: new Date()\n });\n listener(args);\n };\n return target.on('transferAccepted', newListener);\n }\n };\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n"]}
|
@@ -38,6 +38,7 @@ export declare class CallSubscriber {
|
|
38
38
|
private isMuteChanged;
|
39
39
|
private callRoleChangedHandler;
|
40
40
|
private totalParticipantCountChangedHandler;
|
41
|
+
private mutedByOthersHandler;
|
41
42
|
private remoteParticipantsUpdated;
|
42
43
|
private localVideoStreamsUpdated;
|
43
44
|
private dominantSpeakersChanged;
|
@@ -41,6 +41,8 @@ export class CallSubscriber {
|
|
41
41
|
this._call.feature(Features.DominantSpeakers).on('dominantSpeakersChanged', this.dominantSpeakersChanged);
|
42
42
|
/* @conditional-compile-remove(total-participant-count) */
|
43
43
|
this._call.on('totalParticipantCountChanged', this.totalParticipantCountChangedHandler);
|
44
|
+
/* @conditional-compile-remove(soft-mute) */
|
45
|
+
this._call.on('mutedByOthers', this.mutedByOthersHandler);
|
44
46
|
for (const localVideoStream of this._call.localVideoStreams) {
|
45
47
|
this._internalContext.setLocalRenderInfo(this._callIdRef.callId, localVideoStream.mediaStreamType, localVideoStream, 'NotRendered', undefined);
|
46
48
|
}
|
@@ -67,6 +69,8 @@ export class CallSubscriber {
|
|
67
69
|
this._call.off('roleChanged', this.callRoleChangedHandler);
|
68
70
|
/* @conditional-compile-remove(total-participant-count) */
|
69
71
|
this._call.off('totalParticipantCountChanged', this.totalParticipantCountChangedHandler);
|
72
|
+
/* @conditional-compile-remove(soft-mute) */
|
73
|
+
this._call.off('mutedByOthers', this.mutedByOthersHandler);
|
70
74
|
this._participantSubscribers.forEach((participantSubscriber) => {
|
71
75
|
participantSubscriber.unsubscribe();
|
72
76
|
});
|
@@ -140,6 +144,11 @@ export class CallSubscriber {
|
|
140
144
|
this.totalParticipantCountChangedHandler = () => {
|
141
145
|
this._context.setTotalParticipantCount(this._callIdRef.callId, this._call.totalParticipantCount);
|
142
146
|
};
|
147
|
+
// TODO: Tee to notification state once available
|
148
|
+
/* @conditional-compile-remove(soft-mute) */
|
149
|
+
this.mutedByOthersHandler = () => {
|
150
|
+
this._context.teeErrorToState({ name: 'mutedByOthers', message: 'Muted by another participant' }, 'Call.mutedByOthers');
|
151
|
+
};
|
143
152
|
this.remoteParticipantsUpdated = (event) => {
|
144
153
|
event.added.forEach((participant) => {
|
145
154
|
this.addParticipantListener(participant);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CallSubscriber.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/CallSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,QAAQ,EAAuC,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,6BAA6B,EAAE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CAAC,QAAQ,CAAC,SAAS,CAAC,CACvC,CAAC;QAEF,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IA4FO,sBAAsB,CAAC,WAA8B;;QAC3D,MAAM,cAAc,GAAG,6BAA6B,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC7E,MAAA,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,0CAAE,WAAW,EAAE,CAAC;QAChE,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAC9B,cAAc,EACd,IAAI,qBAAqB,CAAC,IAAI,CAAC,UAAU,EAAE,WAAW,EAAE,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,gBAAgB,CAAC,CAC9F,CAAC;IACJ,CAAC;IAEO,yBAAyB,CAAC,WAA8B;QAC9D,MAAM,cAAc,GAAG,6BAA6B,CAAC,WAAW,CAAC,UAAU,CAAC,CAAC;QAC7E,MAAM,qBAAqB,GAAG,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC/E,IAAI,qBAAqB,EAAE,CAAC;YAC1B,qBAAqB,CAAC,WAAW,EAAE,CAAC;YACpC,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;CAkJF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Features, LocalVideoStream, RemoteParticipant } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { CallCommon } from './BetaToStableTypes';\nimport { CallContext } from './CallContext';\nimport { CallIdRef } from './CallIdRef';\nimport { CaptionsFeatureSubscriber } from './CaptionsSubscriber';\nimport {\n convertSdkLocalStreamToDeclarativeLocalStream,\n convertSdkParticipantToDeclarativeParticipant\n} from './Converter';\nimport { InternalCallContext } from './InternalCallContext';\n\nimport { LocalVideoStreamVideoEffectsSubscriber } from './LocalVideoStreamVideoEffectsSubscriber';\nimport { ParticipantSubscriber } from './ParticipantSubscriber';\nimport { RecordingSubscriber } from './RecordingSubscriber';\nimport { PPTLiveSubscriber } from './PPTLiveSubscriber';\nimport { disposeView } from './StreamUtils';\nimport { TranscriptionSubscriber } from './TranscriptionSubscriber';\nimport { UserFacingDiagnosticsSubscriber } from './UserFacingDiagnosticsSubscriber';\nimport { RaiseHandSubscriber } from './RaiseHandSubscriber';\nimport { OptimalVideoCountSubscriber } from './OptimalVideoCountSubscriber';\n\nimport { CapabilitiesSubscriber } from './CapabilitiesSubscriber';\nimport { ReactionSubscriber } from './ReactionSubscriber';\nimport { SpotlightSubscriber } from './SpotlightSubscriber';\n/* @conditional-compile-remove(local-recording-notification) */\nimport { LocalRecordingSubscriber } from './LocalRecordingSubscriber';\n\n/**\n * Keeps track of the listeners assigned to a particular call because when we get an event from SDK, it doesn't tell us\n * which call it is for. If we keep track of this then we know which call in the state that needs an update and also\n * which property of that call. Also we can use this when unregistering to a call.\n */\nexport class CallSubscriber {\n private _call: CallCommon;\n private _callIdRef: CallIdRef;\n private _context: CallContext;\n private _internalContext: InternalCallContext;\n\n private _diagnosticsSubscriber: UserFacingDiagnosticsSubscriber;\n private _participantSubscribers: Map<string, ParticipantSubscriber>;\n private _recordingSubscriber: RecordingSubscriber;\n private _transcriptionSubscriber: TranscriptionSubscriber;\n /* @conditional-compile-remove(local-recording-notification) */\n private _localRecordingSubscriber?: LocalRecordingSubscriber;\n private _pptLiveSubscriber: PPTLiveSubscriber;\n private _optimalVideoCountSubscriber: OptimalVideoCountSubscriber;\n private _CaptionsFeatureSubscriber?: CaptionsFeatureSubscriber;\n private _raiseHandSubscriber?: RaiseHandSubscriber;\n private _reactionSubscriber?: ReactionSubscriber;\n\n private _localVideoStreamVideoEffectsSubscribers: Map<string, LocalVideoStreamVideoEffectsSubscriber>;\n\n private _capabilitiesSubscriber: CapabilitiesSubscriber;\n private _spotlightSubscriber: SpotlightSubscriber;\n\n constructor(call: CallCommon, context: CallContext, internalContext: InternalCallContext) {\n this._call = call;\n this._callIdRef = { callId: call.id };\n this._context = context;\n this._internalContext = internalContext;\n\n this._diagnosticsSubscriber = new UserFacingDiagnosticsSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.UserFacingDiagnostics)\n );\n this._participantSubscribers = new Map<string, ParticipantSubscriber>();\n this._recordingSubscriber = new RecordingSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Recording)\n );\n this._pptLiveSubscriber = new PPTLiveSubscriber(this._callIdRef, this._context, this._call);\n this._transcriptionSubscriber = new TranscriptionSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Transcription)\n );\n this._raiseHandSubscriber = new RaiseHandSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.RaiseHand)\n );\n this._reactionSubscriber = new ReactionSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Reaction)\n );\n this._optimalVideoCountSubscriber = new OptimalVideoCountSubscriber({\n callIdRef: this._callIdRef,\n context: this._context,\n localOptimalVideoCountFeature: this._call.feature(Features.OptimalVideoCount)\n });\n\n this._localVideoStreamVideoEffectsSubscribers = new Map();\n\n this._capabilitiesSubscriber = new CapabilitiesSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Capabilities)\n );\n\n this._spotlightSubscriber = new SpotlightSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Spotlight)\n );\n\n this.subscribe();\n }\n\n private subscribe = (): void => {\n this._call.on('stateChanged', this.stateChanged);\n this._call.on('stateChanged', this.initCaptionSubscriber);\n /* @conditional-compile-remove(teams-meeting-conference) */\n this._call.on('stateChanged', this.initTeamsMeetingConference);\n /* @conditional-compile-remove(local-recording-notification) */\n this._call.on('stateChanged', this.initLocalRecordingNotificationSubscriber);\n this._call.on('idChanged', this.idChanged);\n this._call.on('isScreenSharingOnChanged', this.isScreenSharingOnChanged);\n this._call.on('remoteParticipantsUpdated', this.remoteParticipantsUpdated);\n this._call.on('localVideoStreamsUpdated', this.localVideoStreamsUpdated);\n this._call.on('isMutedChanged', this.isMuteChanged);\n this._call.on('roleChanged', this.callRoleChangedHandler);\n this._call.feature(Features.DominantSpeakers).on('dominantSpeakersChanged', this.dominantSpeakersChanged);\n /* @conditional-compile-remove(total-participant-count) */\n this._call.on('totalParticipantCountChanged', this.totalParticipantCountChangedHandler);\n\n for (const localVideoStream of this._call.localVideoStreams) {\n this._internalContext.setLocalRenderInfo(\n this._callIdRef.callId,\n localVideoStream.mediaStreamType,\n localVideoStream,\n 'NotRendered',\n undefined\n );\n }\n\n if (this._call.remoteParticipants.length > 0) {\n this._call.remoteParticipants.forEach((participant: RemoteParticipant) => {\n this.addParticipantListener(participant);\n });\n\n this._context.setCallRemoteParticipants(\n this._callIdRef.callId,\n this._call.remoteParticipants.map(convertSdkParticipantToDeclarativeParticipant),\n []\n );\n }\n };\n\n public unsubscribe = (): void => {\n this._call.off('stateChanged', this.stateChanged);\n this._call.off('stateChanged', this.initCaptionSubscriber);\n /* @conditional-compile-remove(local-recording-notification) */\n this._call.off('stateChanged', this.initLocalRecordingNotificationSubscriber);\n /* @conditional-compile-remove(teams-meeting-conference) */\n this._call.off('stateChanged', this.initTeamsMeetingConference);\n this._call.off('idChanged', this.idChanged);\n this._call.off('isScreenSharingOnChanged', this.isScreenSharingOnChanged);\n this._call.off('remoteParticipantsUpdated', this.remoteParticipantsUpdated);\n this._call.off('localVideoStreamsUpdated', this.localVideoStreamsUpdated);\n this._call.off('isMutedChanged', this.isMuteChanged);\n this._call.off('roleChanged', this.callRoleChangedHandler);\n /* @conditional-compile-remove(total-participant-count) */\n this._call.off('totalParticipantCountChanged', this.totalParticipantCountChangedHandler);\n\n this._participantSubscribers.forEach((participantSubscriber: ParticipantSubscriber) => {\n participantSubscriber.unsubscribe();\n });\n this._participantSubscribers.clear();\n\n // If we are unsubscribing that means we no longer want to display any video for this call (callEnded or callAgent\n // disposed) and we should not be updating it any more. So if video is rendering we stop rendering.\n for (const localVideoStream of this._call.localVideoStreams) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n disposeView(\n this._context,\n this._internalContext,\n this._callIdRef.callId,\n undefined,\n convertSdkLocalStreamToDeclarativeLocalStream(localVideoStream)\n );\n this._internalContext.deleteLocalRenderInfo(this._callIdRef.callId, mediaStreamType);\n }\n\n this._diagnosticsSubscriber.unsubscribe();\n this._recordingSubscriber.unsubscribe();\n this._transcriptionSubscriber.unsubscribe();\n /* @conditional-compile-remove(local-recording-notification) */\n this._localRecordingSubscriber?.unsubscribe();\n this._optimalVideoCountSubscriber.unsubscribe();\n this._pptLiveSubscriber.unsubscribe();\n this._CaptionsFeatureSubscriber?.unsubscribe();\n this._raiseHandSubscriber?.unsubscribe();\n\n this._capabilitiesSubscriber.unsubscribe();\n this._reactionSubscriber?.unsubscribe();\n this._spotlightSubscriber.unsubscribe();\n };\n\n private addParticipantListener(participant: RemoteParticipant): void {\n const participantKey = toFlatCommunicationIdentifier(participant.identifier);\n this._participantSubscribers.get(participantKey)?.unsubscribe();\n this._participantSubscribers.set(\n participantKey,\n new ParticipantSubscriber(this._callIdRef, participant, this._context, this._internalContext)\n );\n }\n\n private removeParticipantListener(participant: RemoteParticipant): void {\n const participantKey = toFlatCommunicationIdentifier(participant.identifier);\n const participantSubscriber = this._participantSubscribers.get(participantKey);\n if (participantSubscriber) {\n participantSubscriber.unsubscribe();\n this._participantSubscribers.delete(participantKey);\n }\n }\n\n private stateChanged = (): void => {\n this._context.setCallState(this._callIdRef.callId, this._call.state);\n };\n\n private initCaptionSubscriber = (): void => {\n // subscribe to captions here so that we don't call captions when call is not initialized\n if (this._call.state === 'Connected' && !this._CaptionsFeatureSubscriber) {\n this._CaptionsFeatureSubscriber = new CaptionsFeatureSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Captions)\n );\n this._call.off('stateChanged', this.initCaptionSubscriber);\n }\n };\n\n /* @conditional-compile-remove(teams-meeting-conference) */\n private initTeamsMeetingConference = (): void => {\n if (this._call.state === 'Connected') {\n this._call\n .feature(Features.TeamsMeetingAudioConferencing)\n .getTeamsMeetingAudioConferencingDetails()\n .then((teamsMeetingConferenceDetails) => {\n this._context.setTeamsMeetingConference(this._callIdRef.callId, teamsMeetingConferenceDetails);\n });\n this._call.off('stateChanged', this.initTeamsMeetingConference);\n }\n };\n\n /* @conditional-compile-remove(local-recording-notification) */\n private initLocalRecordingNotificationSubscriber = (): void => {\n // Subscribe to LocalRecordingFeature as it is only available in interop scenarios\n // Will throw an error if not in interop scenarios\n if (this._call.state === 'Connected' && this._call.kind === 'TeamsCall' && !this._localRecordingSubscriber) {\n this._localRecordingSubscriber = new LocalRecordingSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.LocalRecording)\n );\n this._call.off('stateChanged', this.initLocalRecordingNotificationSubscriber);\n }\n };\n\n private idChanged = (): void => {\n this._internalContext.setCallId(this._call.id, this._callIdRef.callId);\n this._context.setCallId(this._call.id, this._callIdRef.callId);\n this._callIdRef.callId = this._call.id;\n };\n\n private isScreenSharingOnChanged = (): void => {\n this._context.setCallIsScreenSharingOn(this._callIdRef.callId, this._call.isScreenSharingOn);\n };\n\n private isMuteChanged = (): void => {\n this._context.setCallIsMicrophoneMuted(this._callIdRef.callId, this._call.isMuted);\n };\n\n private callRoleChangedHandler = (): void => {\n this._context.setRole(this._callIdRef.callId, this._call.role);\n };\n\n /* @conditional-compile-remove(total-participant-count) */\n private totalParticipantCountChangedHandler = (): void => {\n this._context.setTotalParticipantCount(this._callIdRef.callId, this._call.totalParticipantCount);\n };\n\n private remoteParticipantsUpdated = (event: { added: RemoteParticipant[]; removed: RemoteParticipant[] }): void => {\n event.added.forEach((participant: RemoteParticipant) => {\n this.addParticipantListener(participant);\n });\n event.removed.forEach((participant: RemoteParticipant) => {\n this.removeParticipantListener(participant);\n });\n\n // Remove any added participants from remoteParticipantsEnded if they are there and add any removed participants to\n // remoteParticipantsEnded.\n this._context.setCallRemoteParticipantsEnded(\n this._callIdRef.callId,\n event.removed.map(convertSdkParticipantToDeclarativeParticipant),\n event.added.map((participant: RemoteParticipant) => {\n return toFlatCommunicationIdentifier(participant.identifier);\n })\n );\n\n // Add added participants to remoteParticipants and remove removed participants from remoteParticipants.\n this._context.setCallRemoteParticipants(\n this._callIdRef.callId,\n event.added.map(convertSdkParticipantToDeclarativeParticipant),\n event.removed.map((participant: RemoteParticipant) => {\n return toFlatCommunicationIdentifier(participant.identifier);\n })\n );\n };\n\n private localVideoStreamsUpdated = (event: { added: LocalVideoStream[]; removed: LocalVideoStream[] }): void => {\n for (const localVideoStream of event.added) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n // IMPORTANT: The internalContext should be set before context. This is done to ensure that the internal context\n // has the required data when component re-renders due to external state changes.\n this._internalContext.setLocalRenderInfo(\n this._callIdRef.callId,\n mediaStreamType,\n localVideoStream,\n 'NotRendered',\n undefined\n );\n\n // Subscribe to video effect changes\n this._localVideoStreamVideoEffectsSubscribers.get(mediaStreamType)?.unsubscribe();\n this._localVideoStreamVideoEffectsSubscribers.set(\n mediaStreamType,\n new LocalVideoStreamVideoEffectsSubscriber({\n parent: this._callIdRef,\n context: this._context,\n localVideoStream: localVideoStream,\n localVideoStreamEffectsAPI: localVideoStream.feature(Features.VideoEffects)\n })\n );\n }\n for (const localVideoStream of event.removed) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n this._localVideoStreamVideoEffectsSubscribers.get(mediaStreamType)?.unsubscribe();\n disposeView(\n this._context,\n this._internalContext,\n this._callIdRef.callId,\n undefined,\n convertSdkLocalStreamToDeclarativeLocalStream(localVideoStream)\n );\n\n this._internalContext.deleteLocalRenderInfo(this._callIdRef.callId, mediaStreamType);\n }\n\n this._context.setCallLocalVideoStream(\n this._callIdRef.callId,\n event.added.map(convertSdkLocalStreamToDeclarativeLocalStream),\n event.removed.map(convertSdkLocalStreamToDeclarativeLocalStream)\n );\n };\n\n private dominantSpeakersChanged = (): void => {\n const dominantSpeakers = this._call.feature(Features.DominantSpeakers).dominantSpeakers;\n this._context.setCallDominantSpeakers(this._callIdRef.callId, dominantSpeakers);\n };\n}\n"]}
|
1
|
+
{"version":3,"file":"CallSubscriber.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/CallSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,QAAQ,EAAuC,MAAM,8BAA8B,CAAC;AAC7F,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAIxE,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EACL,6CAA6C,EAC7C,6CAA6C,EAC9C,MAAM,aAAa,CAAC;AAGrB,OAAO,EAAE,sCAAsC,EAAE,MAAM,0CAA0C,CAAC;AAClG,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AACpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAE5E,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,+DAA+D;AAC/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAEtE;;;;GAIG;AACH,MAAM,OAAO,cAAc;IAuBzB,YAAY,IAAgB,EAAE,OAAoB,EAAE,eAAoC;QAwDhF,cAAS,GAAG,GAAS,EAAE;YAC7B,IAAI,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AC,CAAC;QAC7E,MAAM,qBAAqB,GAAG,IAAI,CAAC,uBAAuB,CAAC,GAAG,CAAC,cAAc,CAAC,CAAC;QAC/E,IAAI,qBAAqB,EAAE,CAAC;YAC1B,qBAAqB,CAAC,WAAW,EAAE,CAAC;YACpC,IAAI,CAAC,uBAAuB,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;CA2JF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Features, LocalVideoStream, RemoteParticipant } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { CallCommon } from './BetaToStableTypes';\nimport { CallContext } from './CallContext';\nimport { CallIdRef } from './CallIdRef';\nimport { CaptionsFeatureSubscriber } from './CaptionsSubscriber';\nimport {\n convertSdkLocalStreamToDeclarativeLocalStream,\n convertSdkParticipantToDeclarativeParticipant\n} from './Converter';\nimport { InternalCallContext } from './InternalCallContext';\n\nimport { LocalVideoStreamVideoEffectsSubscriber } from './LocalVideoStreamVideoEffectsSubscriber';\nimport { ParticipantSubscriber } from './ParticipantSubscriber';\nimport { RecordingSubscriber } from './RecordingSubscriber';\nimport { PPTLiveSubscriber } from './PPTLiveSubscriber';\nimport { disposeView } from './StreamUtils';\nimport { TranscriptionSubscriber } from './TranscriptionSubscriber';\nimport { UserFacingDiagnosticsSubscriber } from './UserFacingDiagnosticsSubscriber';\nimport { RaiseHandSubscriber } from './RaiseHandSubscriber';\nimport { OptimalVideoCountSubscriber } from './OptimalVideoCountSubscriber';\n\nimport { CapabilitiesSubscriber } from './CapabilitiesSubscriber';\nimport { ReactionSubscriber } from './ReactionSubscriber';\nimport { SpotlightSubscriber } from './SpotlightSubscriber';\n/* @conditional-compile-remove(local-recording-notification) */\nimport { LocalRecordingSubscriber } from './LocalRecordingSubscriber';\n\n/**\n * Keeps track of the listeners assigned to a particular call because when we get an event from SDK, it doesn't tell us\n * which call it is for. If we keep track of this then we know which call in the state that needs an update and also\n * which property of that call. Also we can use this when unregistering to a call.\n */\nexport class CallSubscriber {\n private _call: CallCommon;\n private _callIdRef: CallIdRef;\n private _context: CallContext;\n private _internalContext: InternalCallContext;\n\n private _diagnosticsSubscriber: UserFacingDiagnosticsSubscriber;\n private _participantSubscribers: Map<string, ParticipantSubscriber>;\n private _recordingSubscriber: RecordingSubscriber;\n private _transcriptionSubscriber: TranscriptionSubscriber;\n /* @conditional-compile-remove(local-recording-notification) */\n private _localRecordingSubscriber?: LocalRecordingSubscriber;\n private _pptLiveSubscriber: PPTLiveSubscriber;\n private _optimalVideoCountSubscriber: OptimalVideoCountSubscriber;\n private _CaptionsFeatureSubscriber?: CaptionsFeatureSubscriber;\n private _raiseHandSubscriber?: RaiseHandSubscriber;\n private _reactionSubscriber?: ReactionSubscriber;\n\n private _localVideoStreamVideoEffectsSubscribers: Map<string, LocalVideoStreamVideoEffectsSubscriber>;\n\n private _capabilitiesSubscriber: CapabilitiesSubscriber;\n private _spotlightSubscriber: SpotlightSubscriber;\n\n constructor(call: CallCommon, context: CallContext, internalContext: InternalCallContext) {\n this._call = call;\n this._callIdRef = { callId: call.id };\n this._context = context;\n this._internalContext = internalContext;\n\n this._diagnosticsSubscriber = new UserFacingDiagnosticsSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.UserFacingDiagnostics)\n );\n this._participantSubscribers = new Map<string, ParticipantSubscriber>();\n this._recordingSubscriber = new RecordingSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Recording)\n );\n this._pptLiveSubscriber = new PPTLiveSubscriber(this._callIdRef, this._context, this._call);\n this._transcriptionSubscriber = new TranscriptionSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Transcription)\n );\n this._raiseHandSubscriber = new RaiseHandSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.RaiseHand)\n );\n this._reactionSubscriber = new ReactionSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Reaction)\n );\n this._optimalVideoCountSubscriber = new OptimalVideoCountSubscriber({\n callIdRef: this._callIdRef,\n context: this._context,\n localOptimalVideoCountFeature: this._call.feature(Features.OptimalVideoCount)\n });\n\n this._localVideoStreamVideoEffectsSubscribers = new Map();\n\n this._capabilitiesSubscriber = new CapabilitiesSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Capabilities)\n );\n\n this._spotlightSubscriber = new SpotlightSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Spotlight)\n );\n\n this.subscribe();\n }\n\n private subscribe = (): void => {\n this._call.on('stateChanged', this.stateChanged);\n this._call.on('stateChanged', this.initCaptionSubscriber);\n /* @conditional-compile-remove(teams-meeting-conference) */\n this._call.on('stateChanged', this.initTeamsMeetingConference);\n /* @conditional-compile-remove(local-recording-notification) */\n this._call.on('stateChanged', this.initLocalRecordingNotificationSubscriber);\n this._call.on('idChanged', this.idChanged);\n this._call.on('isScreenSharingOnChanged', this.isScreenSharingOnChanged);\n this._call.on('remoteParticipantsUpdated', this.remoteParticipantsUpdated);\n this._call.on('localVideoStreamsUpdated', this.localVideoStreamsUpdated);\n this._call.on('isMutedChanged', this.isMuteChanged);\n this._call.on('roleChanged', this.callRoleChangedHandler);\n this._call.feature(Features.DominantSpeakers).on('dominantSpeakersChanged', this.dominantSpeakersChanged);\n /* @conditional-compile-remove(total-participant-count) */\n this._call.on('totalParticipantCountChanged', this.totalParticipantCountChangedHandler);\n /* @conditional-compile-remove(soft-mute) */\n this._call.on('mutedByOthers', this.mutedByOthersHandler);\n\n for (const localVideoStream of this._call.localVideoStreams) {\n this._internalContext.setLocalRenderInfo(\n this._callIdRef.callId,\n localVideoStream.mediaStreamType,\n localVideoStream,\n 'NotRendered',\n undefined\n );\n }\n\n if (this._call.remoteParticipants.length > 0) {\n this._call.remoteParticipants.forEach((participant: RemoteParticipant) => {\n this.addParticipantListener(participant);\n });\n\n this._context.setCallRemoteParticipants(\n this._callIdRef.callId,\n this._call.remoteParticipants.map(convertSdkParticipantToDeclarativeParticipant),\n []\n );\n }\n };\n\n public unsubscribe = (): void => {\n this._call.off('stateChanged', this.stateChanged);\n this._call.off('stateChanged', this.initCaptionSubscriber);\n /* @conditional-compile-remove(local-recording-notification) */\n this._call.off('stateChanged', this.initLocalRecordingNotificationSubscriber);\n /* @conditional-compile-remove(teams-meeting-conference) */\n this._call.off('stateChanged', this.initTeamsMeetingConference);\n this._call.off('idChanged', this.idChanged);\n this._call.off('isScreenSharingOnChanged', this.isScreenSharingOnChanged);\n this._call.off('remoteParticipantsUpdated', this.remoteParticipantsUpdated);\n this._call.off('localVideoStreamsUpdated', this.localVideoStreamsUpdated);\n this._call.off('isMutedChanged', this.isMuteChanged);\n this._call.off('roleChanged', this.callRoleChangedHandler);\n /* @conditional-compile-remove(total-participant-count) */\n this._call.off('totalParticipantCountChanged', this.totalParticipantCountChangedHandler);\n /* @conditional-compile-remove(soft-mute) */\n this._call.off('mutedByOthers', this.mutedByOthersHandler);\n\n this._participantSubscribers.forEach((participantSubscriber: ParticipantSubscriber) => {\n participantSubscriber.unsubscribe();\n });\n this._participantSubscribers.clear();\n\n // If we are unsubscribing that means we no longer want to display any video for this call (callEnded or callAgent\n // disposed) and we should not be updating it any more. So if video is rendering we stop rendering.\n for (const localVideoStream of this._call.localVideoStreams) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n disposeView(\n this._context,\n this._internalContext,\n this._callIdRef.callId,\n undefined,\n convertSdkLocalStreamToDeclarativeLocalStream(localVideoStream)\n );\n this._internalContext.deleteLocalRenderInfo(this._callIdRef.callId, mediaStreamType);\n }\n\n this._diagnosticsSubscriber.unsubscribe();\n this._recordingSubscriber.unsubscribe();\n this._transcriptionSubscriber.unsubscribe();\n /* @conditional-compile-remove(local-recording-notification) */\n this._localRecordingSubscriber?.unsubscribe();\n this._optimalVideoCountSubscriber.unsubscribe();\n this._pptLiveSubscriber.unsubscribe();\n this._CaptionsFeatureSubscriber?.unsubscribe();\n this._raiseHandSubscriber?.unsubscribe();\n\n this._capabilitiesSubscriber.unsubscribe();\n this._reactionSubscriber?.unsubscribe();\n this._spotlightSubscriber.unsubscribe();\n };\n\n private addParticipantListener(participant: RemoteParticipant): void {\n const participantKey = toFlatCommunicationIdentifier(participant.identifier);\n this._participantSubscribers.get(participantKey)?.unsubscribe();\n this._participantSubscribers.set(\n participantKey,\n new ParticipantSubscriber(this._callIdRef, participant, this._context, this._internalContext)\n );\n }\n\n private removeParticipantListener(participant: RemoteParticipant): void {\n const participantKey = toFlatCommunicationIdentifier(participant.identifier);\n const participantSubscriber = this._participantSubscribers.get(participantKey);\n if (participantSubscriber) {\n participantSubscriber.unsubscribe();\n this._participantSubscribers.delete(participantKey);\n }\n }\n\n private stateChanged = (): void => {\n this._context.setCallState(this._callIdRef.callId, this._call.state);\n };\n\n private initCaptionSubscriber = (): void => {\n // subscribe to captions here so that we don't call captions when call is not initialized\n if (this._call.state === 'Connected' && !this._CaptionsFeatureSubscriber) {\n this._CaptionsFeatureSubscriber = new CaptionsFeatureSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.Captions)\n );\n this._call.off('stateChanged', this.initCaptionSubscriber);\n }\n };\n\n /* @conditional-compile-remove(teams-meeting-conference) */\n private initTeamsMeetingConference = (): void => {\n if (this._call.state === 'Connected') {\n this._call\n .feature(Features.TeamsMeetingAudioConferencing)\n .getTeamsMeetingAudioConferencingDetails()\n .then((teamsMeetingConferenceDetails) => {\n this._context.setTeamsMeetingConference(this._callIdRef.callId, teamsMeetingConferenceDetails);\n });\n this._call.off('stateChanged', this.initTeamsMeetingConference);\n }\n };\n\n /* @conditional-compile-remove(local-recording-notification) */\n private initLocalRecordingNotificationSubscriber = (): void => {\n // Subscribe to LocalRecordingFeature as it is only available in interop scenarios\n // Will throw an error if not in interop scenarios\n if (this._call.state === 'Connected' && this._call.kind === 'TeamsCall' && !this._localRecordingSubscriber) {\n this._localRecordingSubscriber = new LocalRecordingSubscriber(\n this._callIdRef,\n this._context,\n this._call.feature(Features.LocalRecording)\n );\n this._call.off('stateChanged', this.initLocalRecordingNotificationSubscriber);\n }\n };\n\n private idChanged = (): void => {\n this._internalContext.setCallId(this._call.id, this._callIdRef.callId);\n this._context.setCallId(this._call.id, this._callIdRef.callId);\n this._callIdRef.callId = this._call.id;\n };\n\n private isScreenSharingOnChanged = (): void => {\n this._context.setCallIsScreenSharingOn(this._callIdRef.callId, this._call.isScreenSharingOn);\n };\n\n private isMuteChanged = (): void => {\n this._context.setCallIsMicrophoneMuted(this._callIdRef.callId, this._call.isMuted);\n };\n\n private callRoleChangedHandler = (): void => {\n this._context.setRole(this._callIdRef.callId, this._call.role);\n };\n\n /* @conditional-compile-remove(total-participant-count) */\n private totalParticipantCountChangedHandler = (): void => {\n this._context.setTotalParticipantCount(this._callIdRef.callId, this._call.totalParticipantCount);\n };\n\n // TODO: Tee to notification state once available\n /* @conditional-compile-remove(soft-mute) */\n private mutedByOthersHandler = (): void => {\n this._context.teeErrorToState(\n { name: 'mutedByOthers', message: 'Muted by another participant' },\n 'Call.mutedByOthers'\n );\n };\n\n private remoteParticipantsUpdated = (event: { added: RemoteParticipant[]; removed: RemoteParticipant[] }): void => {\n event.added.forEach((participant: RemoteParticipant) => {\n this.addParticipantListener(participant);\n });\n event.removed.forEach((participant: RemoteParticipant) => {\n this.removeParticipantListener(participant);\n });\n\n // Remove any added participants from remoteParticipantsEnded if they are there and add any removed participants to\n // remoteParticipantsEnded.\n this._context.setCallRemoteParticipantsEnded(\n this._callIdRef.callId,\n event.removed.map(convertSdkParticipantToDeclarativeParticipant),\n event.added.map((participant: RemoteParticipant) => {\n return toFlatCommunicationIdentifier(participant.identifier);\n })\n );\n\n // Add added participants to remoteParticipants and remove removed participants from remoteParticipants.\n this._context.setCallRemoteParticipants(\n this._callIdRef.callId,\n event.added.map(convertSdkParticipantToDeclarativeParticipant),\n event.removed.map((participant: RemoteParticipant) => {\n return toFlatCommunicationIdentifier(participant.identifier);\n })\n );\n };\n\n private localVideoStreamsUpdated = (event: { added: LocalVideoStream[]; removed: LocalVideoStream[] }): void => {\n for (const localVideoStream of event.added) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n // IMPORTANT: The internalContext should be set before context. This is done to ensure that the internal context\n // has the required data when component re-renders due to external state changes.\n this._internalContext.setLocalRenderInfo(\n this._callIdRef.callId,\n mediaStreamType,\n localVideoStream,\n 'NotRendered',\n undefined\n );\n\n // Subscribe to video effect changes\n this._localVideoStreamVideoEffectsSubscribers.get(mediaStreamType)?.unsubscribe();\n this._localVideoStreamVideoEffectsSubscribers.set(\n mediaStreamType,\n new LocalVideoStreamVideoEffectsSubscriber({\n parent: this._callIdRef,\n context: this._context,\n localVideoStream: localVideoStream,\n localVideoStreamEffectsAPI: localVideoStream.feature(Features.VideoEffects)\n })\n );\n }\n for (const localVideoStream of event.removed) {\n const mediaStreamType = localVideoStream.mediaStreamType;\n this._localVideoStreamVideoEffectsSubscribers.get(mediaStreamType)?.unsubscribe();\n disposeView(\n this._context,\n this._internalContext,\n this._callIdRef.callId,\n undefined,\n convertSdkLocalStreamToDeclarativeLocalStream(localVideoStream)\n );\n\n this._internalContext.deleteLocalRenderInfo(this._callIdRef.callId, mediaStreamType);\n }\n\n this._context.setCallLocalVideoStream(\n this._callIdRef.callId,\n event.added.map(convertSdkLocalStreamToDeclarativeLocalStream),\n event.removed.map(convertSdkLocalStreamToDeclarativeLocalStream)\n );\n };\n\n private dominantSpeakersChanged = (): void => {\n const dominantSpeakers = this._call.feature(Features.DominantSpeakers).dominantSpeakers;\n this._context.setCallDominantSpeakers(this._callIdRef.callId, dominantSpeakers);\n };\n}\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"TeamsCallDeclarative.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/TeamsCallDeclarative.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAe1D,MAAM,cAAe,SAAQ,eAAe;IACnC,GAAG,CAA4B,MAAiB,EAAE,IAAO;QAC9D,yDAAyD;QACzD,QAAQ,IAAI,EAAE,CAAC;YACb,6CAA6C;YAC7C,KAAK,gBAAgB,CAAC,CAAC,CAAC;gBACtB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,yBAAyB,CAAC,UACjD,GAAG,IAA6C;;wBAEhD,OAAO,MAAM,MAAM,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,CAAC;oBAC9C,CAAC;iBAAA,
|
1
|
+
{"version":3,"file":"TeamsCallDeclarative.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/TeamsCallDeclarative.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAe1D,MAAM,cAAe,SAAQ,eAAe;IACnC,GAAG,CAA4B,MAAiB,EAAE,IAAO;QAC9D,yDAAyD;QACzD,QAAQ,IAAI,EAAE,CAAC;YACb,6CAA6C;YAC7C,KAAK,gBAAgB,CAAC,CAAC,CAAC;gBACtB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC,yBAAyB,CAAC,UACjD,GAAG,IAA6C;;wBAEhD,OAAO,MAAM,MAAM,CAAC,cAAc,CAAC,GAAG,IAAI,CAAC,CAAC;oBAC9C,CAAC;iBAAA,EAAE,0BAA0B,CAAC,CAAC;YACjC,CAAC;YACD;gBACE,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,IAAW,CAAC,CAAC;QAC1C,CAAC;QACD,OAAO,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,IAAW,CAAC,CAAC;IACxC,CAAC;CACF;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,IAAe,EAAE,OAAoB,EAAwB,EAAE;IAClG,MAAM,SAAS,GAAG,IAAI,cAAc,CAAC,OAAO,CAAC,CAAC;IAC9C,SAAS,CAAC,WAAW,EAAE,CAAC;IACxB,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,aAAa,EAAE;QACzC,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,WAAW,EAAE;KACrC,CAAC,CAAC;IAEH,OAAO,IAAI,KAAK,CAAC,IAAI,EAAE,SAAS,CAAyB,CAAC;AAC5D,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ProxyCallCommon } from './CallDeclarativeCommon';\nimport { CallContext } from './CallContext';\nimport { TeamsCall } from './BetaToStableTypes';\n\n/**\n *\n * @private\n */\nexport type DeclarativeTeamsCall = TeamsCall & {\n /**\n * Stop any declarative specific subscriptions and remove declarative subscribers.\n */\n unsubscribe(): void;\n};\n\nclass ProxyTeamsCall extends ProxyCallCommon implements ProxyHandler<TeamsCall> {\n public get<P extends keyof TeamsCall>(target: TeamsCall, prop: P): any {\n /* @conditional-compile-remove(teams-identity-support) */\n switch (prop) {\n /* @conditional-compile-remove(PSTN-calls) */\n case 'addParticipant': {\n return this.getContext().withAsyncErrorTeedToState(async function (\n ...args: Parameters<TeamsCall['addParticipant']>\n ) {\n return await target.addParticipant(...args);\n }, 'TeamsCall.addParticipant');\n }\n default:\n return super.get(target, prop as any);\n }\n return super.get(target, prop as any);\n }\n}\n\n/**\n * Creates a declarative Call by proxying Call with ProxyCall.\n * This should only be used with CallAgentDeclarative as CallAgentDeclarative will add that\n * call to the context properly (need to have the Call in context to update it - CallAgentDeclarative will add Call to\n * context)\n *\n * @param call - TeamsCall from SDK\n * @param context - CallContext from StatefulCallClient\n */\nexport const teamsCallDeclaratify = (call: TeamsCall, context: CallContext): DeclarativeTeamsCall => {\n const proxyCall = new ProxyTeamsCall(context);\n proxyCall.unsubscribe();\n Object.defineProperty(call, 'unsubscribe', {\n configurable: false,\n value: () => proxyCall.unsubscribe()\n });\n\n return new Proxy(call, proxyCall) as DeclarativeTeamsCall;\n};\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"usePropsFor.js","sourceRoot":"","sources":["../../../../../../chat-component-bindings/src/hooks/usePropsFor.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,sCAAmC;AAEhH,mDAAmD;AACnD,OAAO,EAAE,eAAe,EAAE,sCAAmC;AAE7D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAmB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAyB,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAClG,OAAO,EAA2B,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAG9F,OAAO,EAA+B,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC1G,OAAO,EAAoB,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,SAAoB,EAGR,EAAE;IACd,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,WAAW,CAA2B,SAAS,CAAC,CAAC;IAClE,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACxB,OAAO,gCAAK,KAAK,GAAK,QAAQ,CAAS,CAAC;IAC1C,CAAC;IACD,OAAO,SAAgB,CAAC;AAC1B,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"usePropsFor.js","sourceRoot":"","sources":["../../../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C,CAAC;AAEF,MAAM,8BAA8B,GAA6C,EAAE,CAAC;AAEpF,MAAM,YAAY,GAAG,CAAC,SAAkD,EAAO,EAAE;IAC/E,8EAA8E;IAC9E,8FAA8F;IAC9F,yBAAyB;IACzB,MAAM,wBAAwB,GAAgC,GAAG,EAAE;;QACjE,MAAM,QAAQ,GAAG,MAAA,MAAA,UAAU,CAAC,uBAAuB,CAAC,0CAAE,QAAQ,mCAAI,iCAAiC,CAAC;QACpG,IAAI,yBAAyB,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC;QACzE,IAAI,CAAC,yBAAyB,EAAE,CAAC;YAC/B,8BAA8B,CAAC,QAAQ,CAAC,GAAG,+BAA+B,EAAE,CAAC;YAC7E,yBAAyB,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC;QACvE,CAAC;QACD,OAAO,yBAAyB,CAAC;IACnC,CAAC,CAAC;IAEF,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,OAAO;YACV,OAAO,eAAe,CAAC;QACzB,mDAAmD;QACnD,KAAK,eAAe;YAClB,OAAO,eAAe,CAAC;QACzB,KAAK,aAAa;YAChB,OAAO,wBAAwB,EAAE,CAAC;QACpC,KAAK,eAAe;YAClB,OAAO,uBAAuB,CAAC;QACjC,KAAK,eAAe;YAClB,OAAO,2BAA2B,CAAC;QACrC,KAAK,QAAQ;YACX,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { ErrorBar, MessageThread, ParticipantList, SendBox, TypingIndicator } from '@internal/react-components';\n\n/* @conditional-compile-remove(rich-text-editor) */\nimport { RichTextSendBox } from '@internal/react-components';\n\nimport { useHandlers } from './useHandlers';\nimport { useSelector } from './useSelector';\nimport { SendBoxSelector, sendBoxSelector } from '../sendBoxSelector';\nimport { MessageThreadSelector, messageThreadSelectorWithThread } from '../messageThreadSelector';\nimport { TypingIndicatorSelector, typingIndicatorSelector } from '../typingIndicatorSelector';\nimport { Common, AreEqual } from '@internal/acs-ui-common';\nimport { ChatHandlers } from '../handlers/createHandlers';\nimport { ChatParticipantListSelector, chatParticipantListSelector } from '../chatParticipantListSelector';\nimport { ErrorBarSelector, errorBarSelector } from '../errorBarSelector';\nimport { ChatThreadClientContext } from '../providers/ChatThreadClientProvider';\nimport { useContext } from 'react';\n\n/**\n * Primary hook to get all hooks necessary for a chat Component.\n *\n * Most straightforward usage of chat components looks like:\n *\n * @example\n * ```\n * import { ParticipantList, usePropsFor } from '@azure/communication-react';\n *\n * const App = (): JSX.Element => {\n * // ... code to setup Providers ...\n *\n * return <ParticipantList {...usePropsFor(ParticipantList)}/>\n * }\n * ```\n *\n * @public\n */\nexport const usePropsFor = <Component extends (props: any) => JSX.Element>(\n component: Component\n): GetSelector<Component> extends (props: any) => any\n ? ReturnType<GetSelector<Component>> & Common<ChatHandlers, Parameters<Component>[0]>\n : undefined => {\n const selector = getSelector(component);\n const props = useSelector(selector);\n const handlers = useHandlers<Parameters<Component>[0]>(component);\n if (props !== undefined) {\n return { ...props, ...handlers } as any;\n }\n return undefined as any;\n};\n\n/**\n * Specific type of the selector applicable to a given Component.\n *\n * @public\n */\nexport type GetSelector<Component extends (props: any) => JSX.Element | undefined> =\n AreEqual<Component, typeof SendBox> extends true\n ? SendBoxSelector\n : AreEqual<Component, typeof RichTextSendBox> extends true\n ? /* @conditional-compile-remove(rich-text-editor) */ SendBoxSelector\n : AreEqual<Component, typeof MessageThread> extends true\n ? MessageThreadSelector\n : AreEqual<Component, typeof TypingIndicator> extends true\n ? TypingIndicatorSelector\n : AreEqual<Component, typeof ParticipantList> extends true\n ? ChatParticipantListSelector\n : AreEqual<Component, typeof ErrorBar> extends true\n ? ErrorBarSelector\n : undefined;\n\n/**\n * Get the selector for a specified component.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const getSelector = <Component extends (props: any) => JSX.Element | undefined>(\n component: Component\n): GetSelector<Component> => {\n return findSelector(component);\n};\n\nconst messageThreadSelectorsByThread: { [key: string]: MessageThreadSelector } = {};\n\nconst findSelector = (component: (props: any) => JSX.Element | undefined): any => {\n // For the message thread selector we need to create a new one for each thread\n // If we have just one for the entire app, then we will have updates when not expecting due to\n // the arguments changing\n const getMessageThreadSelector: () => MessageThreadSelector = () => {\n const threadId = useContext(ChatThreadClientContext)?.threadId ?? 'default-id-when-not-in-provider';\n let messageThreadSelectorImpl = messageThreadSelectorsByThread[threadId];\n if (!messageThreadSelectorImpl) {\n messageThreadSelectorsByThread[threadId] = messageThreadSelectorWithThread();\n messageThreadSelectorImpl = messageThreadSelectorsByThread[threadId];\n }\n return messageThreadSelectorImpl;\n };\n\n switch (component) {\n case SendBox:\n return sendBoxSelector;\n /* @conditional-compile-remove(rich-text-editor) */\n case RichTextSendBox:\n return sendBoxSelector;\n case MessageThread:\n return getMessageThreadSelector();\n case TypingIndicator:\n return typingIndicatorSelector;\n case ParticipantList:\n return chatParticipantListSelector;\n case ErrorBar:\n return errorBarSelector;\n }\n return undefined;\n};\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"StatefulChatClient.js","sourceRoot":"","sources":["../../../../../chat-stateful-client/src/StatefulChatClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAE,UAAU,EAAqB,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAgC,gCAAgC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAGL,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBA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AAC;IACH,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,eAAe,EAAE;QAC5C,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,CAAC,OAAyC,EAAE,EAAE,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,aAAa,CAAC,OAAO,CAAC;KACtF,CAAC,CAAC;IACH,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,gBAAgB,EAAE;QAC7C,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,CAAC,OAAyC,EAAE,EAAE,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,cAAc,CAAC,OAAO,CAAC;KACvF,CAAC,CAAC;IAEH,OAAO,KAA2B,CAAC;AACrC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatClient, ChatClientOptions } from '@azure/communication-chat';\nimport { _getApplicationId, _TelemetryImplementationHint } from '@internal/acs-ui-common';\nimport { ChatContext } from './ChatContext';\nimport { ChatClientState } from './ChatClientState';\nimport { EventSubscriber } from './EventSubscriber';\nimport { chatThreadClientDeclaratify } from './StatefulChatThreadClient';\nimport { createDecoratedListThreads } from './iterators/createDecoratedListThreads';\nimport {\n CommunicationTokenCredential,\n CommunicationUserIdentifier,\n getIdentifierKind\n} from '@azure/communication-common';\nimport { chatStatefulLogger } from './Logger';\n\n/**\n * Defines the methods that allow {@Link @azure/communication-chat#ChatClient} to be used with a centralized generated state.\n *\n * The interface provides access to proxied state and also allows registering a handler for state change events.\n *\n * @public\n */\nexport interface StatefulChatClient extends ChatClient {\n /**\n * Cleans up the resource cache from the chat thread client.\n */\n dispose(): void;\n /**\n * Holds all the state that we could proxy from ChatClient {@Link @azure/communication-chat#ChatClient} as\n * ChatClientState {@Link ChatClientState}.\n */\n getState(): ChatClientState;\n /**\n * Allows a handler to be registered for 'stateChanged' events.\n *\n * @param handler - Callback to receive the state.\n */\n onStateChange(handler: (state: ChatClientState) => void): void;\n /**\n * Allows unregistering for 'stateChanged' events.\n *\n * @param handler - Original callback to be unsubscribed.\n */\n offStateChange(handler: (state: ChatClientState) => void): void;\n /**\n * Downloads a resource for specific message and caches it.\n *\n * @param threadId - The thread id of the chat thread.\n * @param messageId - The message id of the chat message.\n * @param resourceUrl - The resource url to fetch and cache.\n */\n downloadResourceToCache(threadId: string, messageId: string, resourceUrl: string): void;\n /**\n * Removes a resource from cache for a specific message.\n *\n * @param threadId - The thread id of the chat thread.\n * @param messageId - The message id of the chat message.\n * @param resourceUrl - The resource url to remove from cache.\n */\n removeResourceFromCache(threadId: string, messageId: string, resourceUrl: string): void;\n}\n\ninterface StatefulChatClientWithPrivateProps extends StatefulChatClient {\n context: ChatContext;\n eventSubscriber: EventSubscriber | undefined;\n}\n\nconst proxyChatClient: ProxyHandler<ChatClient> = {\n get: function <P extends keyof StatefulChatClientWithPrivateProps>(\n chatClient: ChatClient,\n prop: P,\n receiver: StatefulChatClientWithPrivateProps\n ) {\n // skip receiver.context call to avoid recursive bugs\n if (prop === 'context') {\n return Reflect.get(chatClient, prop);\n }\n\n const context = receiver.context;\n switch (prop) {\n case 'createChatThread': {\n return context.withAsyncErrorTeedToState(async function (...args: Parameters<ChatClient['createChatThread']>) {\n const result = await chatClient.createChatThread(...args);\n const thread = result.chatThread;\n if (thread) {\n const [request] = args;\n context.createThread(thread.id, { topic: request.topic });\n }\n return result;\n }, 'ChatClient.createChatThread');\n }\n\n case 'deleteChatThread': {\n return context.withAsyncErrorTeedToState(async function (...args: Parameters<ChatClient['deleteChatThread']>) {\n const result = await chatClient.deleteChatThread(...args);\n context.deleteThread(args[0]);\n return result;\n }, 'ChatClient.deleteChatThread');\n }\n case 'listChatThreads': {\n return createDecoratedListThreads(chatClient, context);\n }\n case 'getChatThreadClient': {\n return function (...args: Parameters<ChatClient['getChatThreadClient']>) {\n const chatThreadClient = chatClient.getChatThreadClient(...args);\n // TODO(prprabhu): Ensure that thread properties are fetched into the ChatContext at this point.\n // A new thread might be created here, but the properties will never be fetched.\n return chatThreadClientDeclaratify(chatThreadClient, context);\n };\n }\n case 'startRealtimeNotifications': {\n return context.withAsyncErrorTeedToState(async function (\n ...args: Parameters<ChatClient['startRealtimeNotifications']>\n ) {\n const ret = await chatClient.startRealtimeNotifications(...args);\n if (!receiver.eventSubscriber) {\n receiver.eventSubscriber = new EventSubscriber(chatClient, context);\n }\n return ret;\n },\n 'ChatClient.startRealtimeNotifications');\n }\n case 'stopRealtimeNotifications': {\n return context.withAsyncErrorTeedToState(async function (\n ...args: Parameters<ChatClient['stopRealtimeNotifications']>\n ) {\n const ret = await chatClient.stopRealtimeNotifications(...args);\n if (receiver.eventSubscriber) {\n receiver.eventSubscriber.unsubscribe();\n receiver.eventSubscriber = undefined;\n }\n return ret;\n },\n 'ChatClient.stopRealtimeNotifications');\n }\n default:\n return Reflect.get(chatClient, prop);\n }\n }\n};\n\n/**\n * Arguments to construct the {@link StatefulChatClient}.\n *\n * @public\n */\nexport type StatefulChatClientArgs = {\n userId: CommunicationUserIdentifier;\n displayName: string;\n endpoint: string;\n credential: CommunicationTokenCredential;\n};\n\n/**\n * Options to construct the {@link StatefulChatClient}.\n *\n * @public\n */\nexport type StatefulChatClientOptions = {\n /**\n * Options to construct the {@link @azure/communication-chat#ChatClient} with.\n */\n chatClientOptions: ChatClientOptions;\n /**\n * Sets the max listeners limit of the 'stateChange' event. Defaults to the node.js EventEmitter.defaultMaxListeners\n * if not specified.\n */\n maxStateChangeListeners?: number;\n};\n\n/**\n * Creates a stateful ChatClient {@link StatefulChatClient} by proxying ChatClient\n * {@link @azure/communication-chat#ChatClient} with ProxyChatClient {@link ProxyChatClient} which then allows access\n * to state in a declarative way.\n *\n * @public\n */\nexport const createStatefulChatClient = (\n args: StatefulChatClientArgs,\n options?: StatefulChatClientOptions\n): StatefulChatClient => {\n return _createStatefulChatClientInner(args, options);\n};\n\n/**\n * This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.\n *\n * @internal\n */\nexport const _createStatefulChatClientInner = (\n args: StatefulChatClientArgs,\n options?: StatefulChatClientOptions,\n telemetryImplementationHint: _TelemetryImplementationHint = 'StatefulComponents'\n): StatefulChatClient => {\n chatStatefulLogger.info(\n `Creating chat stateful client using library version: ${_getApplicationId(telemetryImplementationHint)}`\n );\n const tweakedOptions = {\n ...options,\n chatClientOptions: {\n ...options?.chatClientOptions,\n userAgentOptions: { userAgentPrefix: _getApplicationId(telemetryImplementationHint) }\n }\n };\n return _createStatefulChatClientWithDeps(\n new ChatClient(args.endpoint, args.credential, tweakedOptions.chatClientOptions),\n args,\n tweakedOptions\n );\n};\n\n/**\n * A function to modify the state of the StatefulChatClient.\n *\n * Provided as a callback to the {@link StatefulChatClient.modifyState} method.\n *\n * The function must modify the provided state in place as much as possible.\n * Making large modifications can lead to bad performance by causing spurious rerendering of the UI.\n *\n * Consider using commonly used modifier functions exported from this package.\n */\nexport type ChatStateModifier = (state: ChatClientState) => void;\n\n/**\n * Internal implementation of {@link createStatefulChatClient} for dependency injection.\n *\n * Used by tests. Should not be exported out of this package.\n * @internal\n */\nexport const _createStatefulChatClientWithDeps = (\n chatClient: ChatClient,\n args: StatefulChatClientArgs,\n options?: StatefulChatClientOptions\n): StatefulChatClient => {\n const context = new ChatContext(options?.maxStateChangeListeners, args.credential, args.endpoint);\n\n let eventSubscriber: EventSubscriber;\n\n context.updateChatConfig(getIdentifierKind(args.userId), args.displayName);\n\n const proxy = new Proxy(chatClient, proxyChatClient);\n\n Object.defineProperty(proxy, 'context', {\n configurable: false,\n get: () => context\n });\n\n Object.defineProperty(proxy, 'eventSubscriber', {\n configurable: false,\n get: () => eventSubscriber,\n set: (val: EventSubscriber) => {\n eventSubscriber = val;\n }\n });\n Object.defineProperty(proxy, 'dispose', {\n configurable: false,\n value: () => context?.dispose()\n });\n Object.defineProperty(proxy, 'downloadResourceToCache', {\n configurable: false,\n value: (threadId: string, messageId: string, resourceUrl: string) =>\n context?.downloadResourceToCache(threadId, messageId, resourceUrl)\n });\n Object.defineProperty(proxy, 'removeResourceFromCache', {\n configurable: false,\n value: (threadId: string, messageId: string, resourceUrl: string) =>\n context?.removeResourceFromCache(threadId, messageId, resourceUrl)\n });\n Object.defineProperty(proxy, 'getState', {\n configurable: false,\n value: () => context?.getState()\n });\n Object.defineProperty(proxy, 'onStateChange', {\n configurable: false,\n value: (handler: (state: ChatClientState) => void) => context?.onStateChange(handler)\n });\n Object.defineProperty(proxy, 'offStateChange', {\n configurable: false,\n value: (handler: (state: ChatClientState) => void) => context?.offStateChange(handler)\n });\n\n return proxy as StatefulChatClient;\n};\n"]}
|
1
|
+
{"version":3,"file":"StatefulChatClient.js","sourceRoot":"","sources":["../../../../../chat-stateful-client/src/StatefulChatClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAE,UAAU,EAAqB,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAgC,gCAAgC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,wCAAwC,CAAC;AACpF,OAAO,EAGL,iBAAiB,EAClB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAsD9C,MAAM,eAAe,GAA6B;IAChD,GAAG,EAAE,UACH,UAAsB,EACtB,IAAO,EACP,QAA4C;QAE5C,qDAAqD;QACrD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACvC,CAAC;QAED,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;QACjC,QAAQ,IAAI,EAAE,CAAC;YACb,KAAK,kBAAkB,CAAC,CAAC,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AAO,uBAAP,OAAO,CAAE,cAAc,CAAC,OAAO,CAAC;KACvF,CAAC,CAAC;IAEH,OAAO,KAA2B,CAAC;AACrC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatClient, ChatClientOptions } from '@azure/communication-chat';\nimport { _getApplicationId, _TelemetryImplementationHint } from '@internal/acs-ui-common';\nimport { ChatContext } from './ChatContext';\nimport { ChatClientState } from './ChatClientState';\nimport { EventSubscriber } from './EventSubscriber';\nimport { chatThreadClientDeclaratify } from './StatefulChatThreadClient';\nimport { createDecoratedListThreads } from './iterators/createDecoratedListThreads';\nimport {\n CommunicationTokenCredential,\n CommunicationUserIdentifier,\n getIdentifierKind\n} from '@azure/communication-common';\nimport { chatStatefulLogger } from './Logger';\n\n/**\n * Defines the methods that allow {@Link @azure/communication-chat#ChatClient} to be used with a centralized generated state.\n *\n * The interface provides access to proxied state and also allows registering a handler for state change events.\n *\n * @public\n */\nexport interface StatefulChatClient extends ChatClient {\n /**\n * Cleans up the resource cache from the chat thread client.\n */\n dispose(): void;\n /**\n * Holds all the state that we could proxy from ChatClient {@Link @azure/communication-chat#ChatClient} as\n * ChatClientState {@Link ChatClientState}.\n */\n getState(): ChatClientState;\n /**\n * Allows a handler to be registered for 'stateChanged' events.\n *\n * @param handler - Callback to receive the state.\n */\n onStateChange(handler: (state: ChatClientState) => void): void;\n /**\n * Allows unregistering for 'stateChanged' events.\n *\n * @param handler - Original callback to be unsubscribed.\n */\n offStateChange(handler: (state: ChatClientState) => void): void;\n /**\n * Downloads a resource for specific message and caches it.\n *\n * @param threadId - The thread id of the chat thread.\n * @param messageId - The message id of the chat message.\n * @param resourceUrl - The resource url to fetch and cache.\n */\n downloadResourceToCache(threadId: string, messageId: string, resourceUrl: string): void;\n /**\n * Removes a resource from cache for a specific message.\n *\n * @param threadId - The thread id of the chat thread.\n * @param messageId - The message id of the chat message.\n * @param resourceUrl - The resource url to remove from cache.\n */\n removeResourceFromCache(threadId: string, messageId: string, resourceUrl: string): void;\n}\n\ninterface StatefulChatClientWithPrivateProps extends StatefulChatClient {\n context: ChatContext;\n eventSubscriber: EventSubscriber | undefined;\n}\n\nconst proxyChatClient: ProxyHandler<ChatClient> = {\n get: function <P extends keyof StatefulChatClientWithPrivateProps>(\n chatClient: ChatClient,\n prop: P,\n receiver: StatefulChatClientWithPrivateProps\n ) {\n // skip receiver.context call to avoid recursive bugs\n if (prop === 'context') {\n return Reflect.get(chatClient, prop);\n }\n\n const context = receiver.context;\n switch (prop) {\n case 'createChatThread': {\n return context.withAsyncErrorTeedToState(async function (...args: Parameters<ChatClient['createChatThread']>) {\n const result = await chatClient.createChatThread(...args);\n const thread = result.chatThread;\n if (thread) {\n const [request] = args;\n context.createThread(thread.id, { topic: request.topic });\n }\n return result;\n }, 'ChatClient.createChatThread');\n }\n\n case 'deleteChatThread': {\n return context.withAsyncErrorTeedToState(async function (...args: Parameters<ChatClient['deleteChatThread']>) {\n const result = await chatClient.deleteChatThread(...args);\n context.deleteThread(args[0]);\n return result;\n }, 'ChatClient.deleteChatThread');\n }\n case 'listChatThreads': {\n return createDecoratedListThreads(chatClient, context);\n }\n case 'getChatThreadClient': {\n return function (...args: Parameters<ChatClient['getChatThreadClient']>) {\n const chatThreadClient = chatClient.getChatThreadClient(...args);\n // TODO(prprabhu): Ensure that thread properties are fetched into the ChatContext at this point.\n // A new thread might be created here, but the properties will never be fetched.\n return chatThreadClientDeclaratify(chatThreadClient, context);\n };\n }\n case 'startRealtimeNotifications': {\n return context.withAsyncErrorTeedToState(async function (\n ...args: Parameters<ChatClient['startRealtimeNotifications']>\n ) {\n const ret = await chatClient.startRealtimeNotifications(...args);\n if (!receiver.eventSubscriber) {\n receiver.eventSubscriber = new EventSubscriber(chatClient, context);\n }\n return ret;\n }, 'ChatClient.startRealtimeNotifications');\n }\n case 'stopRealtimeNotifications': {\n return context.withAsyncErrorTeedToState(async function (\n ...args: Parameters<ChatClient['stopRealtimeNotifications']>\n ) {\n const ret = await chatClient.stopRealtimeNotifications(...args);\n if (receiver.eventSubscriber) {\n receiver.eventSubscriber.unsubscribe();\n receiver.eventSubscriber = undefined;\n }\n return ret;\n }, 'ChatClient.stopRealtimeNotifications');\n }\n default:\n return Reflect.get(chatClient, prop);\n }\n }\n};\n\n/**\n * Arguments to construct the {@link StatefulChatClient}.\n *\n * @public\n */\nexport type StatefulChatClientArgs = {\n userId: CommunicationUserIdentifier;\n displayName: string;\n endpoint: string;\n credential: CommunicationTokenCredential;\n};\n\n/**\n * Options to construct the {@link StatefulChatClient}.\n *\n * @public\n */\nexport type StatefulChatClientOptions = {\n /**\n * Options to construct the {@link @azure/communication-chat#ChatClient} with.\n */\n chatClientOptions: ChatClientOptions;\n /**\n * Sets the max listeners limit of the 'stateChange' event. Defaults to the node.js EventEmitter.defaultMaxListeners\n * if not specified.\n */\n maxStateChangeListeners?: number;\n};\n\n/**\n * Creates a stateful ChatClient {@link StatefulChatClient} by proxying ChatClient\n * {@link @azure/communication-chat#ChatClient} with ProxyChatClient {@link ProxyChatClient} which then allows access\n * to state in a declarative way.\n *\n * @public\n */\nexport const createStatefulChatClient = (\n args: StatefulChatClientArgs,\n options?: StatefulChatClientOptions\n): StatefulChatClient => {\n return _createStatefulChatClientInner(args, options);\n};\n\n/**\n * This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.\n *\n * @internal\n */\nexport const _createStatefulChatClientInner = (\n args: StatefulChatClientArgs,\n options?: StatefulChatClientOptions,\n telemetryImplementationHint: _TelemetryImplementationHint = 'StatefulComponents'\n): StatefulChatClient => {\n chatStatefulLogger.info(\n `Creating chat stateful client using library version: ${_getApplicationId(telemetryImplementationHint)}`\n );\n const tweakedOptions = {\n ...options,\n chatClientOptions: {\n ...options?.chatClientOptions,\n userAgentOptions: { userAgentPrefix: _getApplicationId(telemetryImplementationHint) }\n }\n };\n return _createStatefulChatClientWithDeps(\n new ChatClient(args.endpoint, args.credential, tweakedOptions.chatClientOptions),\n args,\n tweakedOptions\n );\n};\n\n/**\n * A function to modify the state of the StatefulChatClient.\n *\n * Provided as a callback to the {@link StatefulChatClient.modifyState} method.\n *\n * The function must modify the provided state in place as much as possible.\n * Making large modifications can lead to bad performance by causing spurious rerendering of the UI.\n *\n * Consider using commonly used modifier functions exported from this package.\n */\nexport type ChatStateModifier = (state: ChatClientState) => void;\n\n/**\n * Internal implementation of {@link createStatefulChatClient} for dependency injection.\n *\n * Used by tests. Should not be exported out of this package.\n * @internal\n */\nexport const _createStatefulChatClientWithDeps = (\n chatClient: ChatClient,\n args: StatefulChatClientArgs,\n options?: StatefulChatClientOptions\n): StatefulChatClient => {\n const context = new ChatContext(options?.maxStateChangeListeners, args.credential, args.endpoint);\n\n let eventSubscriber: EventSubscriber;\n\n context.updateChatConfig(getIdentifierKind(args.userId), args.displayName);\n\n const proxy = new Proxy(chatClient, proxyChatClient);\n\n Object.defineProperty(proxy, 'context', {\n configurable: false,\n get: () => context\n });\n\n Object.defineProperty(proxy, 'eventSubscriber', {\n configurable: false,\n get: () => eventSubscriber,\n set: (val: EventSubscriber) => {\n eventSubscriber = val;\n }\n });\n Object.defineProperty(proxy, 'dispose', {\n configurable: false,\n value: () => context?.dispose()\n });\n Object.defineProperty(proxy, 'downloadResourceToCache', {\n configurable: false,\n value: (threadId: string, messageId: string, resourceUrl: string) =>\n context?.downloadResourceToCache(threadId, messageId, resourceUrl)\n });\n Object.defineProperty(proxy, 'removeResourceFromCache', {\n configurable: false,\n value: (threadId: string, messageId: string, resourceUrl: string) =>\n context?.removeResourceFromCache(threadId, messageId, resourceUrl)\n });\n Object.defineProperty(proxy, 'getState', {\n configurable: false,\n value: () => context?.getState()\n });\n Object.defineProperty(proxy, 'onStateChange', {\n configurable: false,\n value: (handler: (state: ChatClientState) => void) => context?.onStateChange(handler)\n });\n Object.defineProperty(proxy, 'offStateChange', {\n configurable: false,\n value: (handler: (state: ChatClientState) => void) => context?.offStateChange(handler)\n });\n\n return proxy as StatefulChatClient;\n};\n"]}
|
@@ -84,7 +84,7 @@ export type { SpokenLanguageStrings, CaptionLanguageStrings } from '../../react-
|
|
84
84
|
export type { SurveyIssues } from '../../react-components/src';
|
85
85
|
export type { SurveyIssuesHeadingStrings } from '../../react-components/src';
|
86
86
|
export type { CallSurveyImprovementSuggestions } from '../../react-components/src';
|
87
|
-
export {
|
88
|
-
export type {
|
87
|
+
export { NotificationStack, Notification } from '../../react-components/src';
|
88
|
+
export type { NotificationStackProps, NotificationProps, NotificationStrings, NotificationStackStrings, NotificationType, ActiveNotification } from '../../react-components/src';
|
89
89
|
export type { MeetingConferencePhoneInfoModalStrings } from '../../react-components/src';
|
90
90
|
//# sourceMappingURL=index.d.ts.map
|
@@ -46,5 +46,5 @@ export { UnsupportedBrowserVersion } from '../../react-components/src';
|
|
46
46
|
/* @conditional-compile-remove(unsupported-browser) */
|
47
47
|
export { UnsupportedOperatingSystem } from '../../react-components/src';
|
48
48
|
/* @conditional-compile-remove(notifications) */
|
49
|
-
export {
|
49
|
+
export { NotificationStack, Notification } from '../../react-components/src';
|
50
50
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAoCzG,OAAO,EACL,kBAAkB,EAClB,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,sCAAsC,CAAC;AAE9C,yDAAyD;AACzD,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,iCAAiC,EAClC,MAAM,sCAAsC,CAAC;AAsB9C,OAAO,EACL,kBAAkB,EAClB,wBAAwB,EACxB,aAAa,EACb,mBAAmB,EACnB,eAAe,EACf,y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C;AACxD,cAAc,eAAe,CAAC;AAE9B,sDAAsD;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGhE,sDAAsD;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAGvE,sDAAsD;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAgBxE,gDAAgD;AAChD,OAAO,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * `@azure/communication-react` is an npm package that exports the functionality of the Azure Communication Services - UI Library.\n *\n * This package makes it easy for you to build modern communications user experiences using Azure Communication Services. It gives you a library of production-ready UI components that you can drop into your applications:\n * - Composites: These components are turn-key solutions that implement common communication scenarios. You can quickly add video calling or chat experiences to your applications. Composites are open-source higher order components built using UI components.\n * - UI Components - These components are open-source building blocks that let you build custom communications experience. Components are offered for both calling and chat capabilities that can be combined to build experiences.\n *\n * These UI client libraries all use Microsoft's Fluent design language and assets. Fluent UI provides a foundational layer for the UI Library and is actively used across Microsoft products.\n *\n * In conjunction with the UI components, the UI Library exposes a stateful client library for calling and chat. This client is agnostic to any specific state management framework and can be integrated with common state managers like Redux or React Context.\n * This stateful client library can be used with the UI Components to pass props and methods for the UI Components to render data. For more information, see Stateful Client Overview.\n *\n * For more information visit: https://aka.ms/acsstorybook\n *\n * @packageDocumentation\n */\n\nexport { fromFlatCommunicationIdentifier, toFlatCommunicationIdentifier } from '../../acs-ui-common/src';\nexport type {\n AreEqual,\n CommonProperties,\n MessageStatus,\n Common,\n AreTypeEqual,\n AreParamEqual\n} from '../../acs-ui-common/src';\n\n// Not to export chat/calling specific hook from binding package\nexport type {\n CallClientProviderProps,\n CallAgentProviderProps,\n CallProviderProps,\n GetCallingSelector,\n CallingHandlers,\n CallingBaseSelectorProps,\n CommonCallingHandlers\n} from '../../calling-component-bindings/src';\n\nexport type { VideoBackgroundEffectsDependency, CallingHandlersOptions } from '../../calling-component-bindings/src';\n\nexport type { CaptionsOptions } from '../../calling-component-bindings/src';\n\nexport type {\n ChatClientProviderProps,\n ChatThreadClientProviderProps,\n GetChatSelector,\n ChatHandlers,\n ChatBaseSelectorProps\n} from '../../chat-component-bindings/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { MessageOptions, ChatMessageType } from '../../acs-ui-common/src';\n\nexport {\n CallClientProvider,\n CallAgentProvider,\n CallProvider,\n useCallClient,\n useCallAgent,\n useCall,\n useDeviceManager,\n getCallingSelector,\n createDefaultCallingHandlers\n} from '../../calling-component-bindings/src';\n\n/* @conditional-compile-remove(teams-identity-support) */\nexport {\n useTeamsCallAgent,\n useTeamsCall,\n createDefaultTeamsCallingHandlers\n} from '../../calling-component-bindings/src';\n\n/* @conditional-compile-remove(teams-identity-support) */\nexport type { TeamsCallingHandlers } from '../../calling-component-bindings/src';\n\nexport type {\n ScreenShareButtonSelector,\n CameraButtonSelector,\n VideoGallerySelector,\n DevicesButtonSelector,\n EmptySelector,\n ErrorBarSelector as CallErrorBarSelector,\n ParticipantListSelector,\n MicrophoneButtonSelector,\n ParticipantsButtonSelector,\n CreateDefaultCallingHandlers\n} from '../../calling-component-bindings/src';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { HoldButtonSelector } from '../../calling-component-bindings/src';\n\nexport type { RaiseHandButtonSelector } from '../../calling-component-bindings/src';\n\nexport {\n ChatClientProvider,\n ChatThreadClientProvider,\n useChatClient,\n useChatThreadClient,\n getChatSelector,\n createDefaultChatHandlers\n} from '../../chat-component-bindings/src';\n\nexport type {\n MessageThreadSelector,\n TypingIndicatorSelector,\n ChatParticipantListSelector,\n SendBoxSelector,\n ErrorBarSelector as ChatErrorBarSelector\n} from '../../chat-component-bindings/src';\n\nexport {\n _IdentifierProvider,\n CameraButton,\n ControlBar,\n ControlBarButton,\n DevicesButton,\n EndCallButton,\n ErrorBar,\n GridLayout,\n LocalizationProvider,\n MessageStatusIndicator,\n MessageThread,\n MicrophoneButton,\n ParticipantItem,\n ParticipantList,\n ParticipantsButton,\n ScreenShareButton,\n SendBox,\n StreamMedia,\n TypingIndicator,\n VideoGallery,\n VideoTile,\n COMPONENT_LOCALE_EN_GB,\n COMPONENT_LOCALE_AR_SA,\n COMPONENT_LOCALE_CS_CZ,\n COMPONENT_LOCALE_DE_DE,\n COMPONENT_LOCALE_ES_ES,\n COMPONENT_LOCALE_FI_FI,\n COMPONENT_LOCALE_FR_FR,\n COMPONENT_LOCALE_HE_IL,\n COMPONENT_LOCALE_IT_IT,\n COMPONENT_LOCALE_JA_JP,\n COMPONENT_LOCALE_KO_KR,\n COMPONENT_LOCALE_NB_NO,\n COMPONENT_LOCALE_NL_NL,\n COMPONENT_LOCALE_PL_PL,\n COMPONENT_LOCALE_PT_BR,\n COMPONENT_LOCALE_RU_RU,\n COMPONENT_LOCALE_SV_SE,\n COMPONENT_LOCALE_TR_TR,\n COMPONENT_LOCALE_ZH_CN,\n COMPONENT_LOCALE_ZH_TW\n} from '../../react-components/src';\nexport { ImageOverlay } from '../../react-components/src';\n/* @conditional-compile-remove(PSTN-calls) */\nexport { HoldButton } from '../../react-components/src';\n\nexport { RaiseHandButton } from '../../react-components/src';\n\nexport { Dialpad } from '../../react-components/src';\n\n/* @conditional-compile-remove(call-readiness) */\nexport {\n CameraAndMicrophoneSitePermissions,\n MicrophoneSitePermissions,\n CameraSitePermissions\n} from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n CameraAndMicrophoneSitePermissionsStrings,\n CameraAndMicrophoneSitePermissionsProps,\n CameraSitePermissionsStrings,\n CameraSitePermissionsProps,\n CommonSitePermissionsProps,\n SitePermissionsStrings,\n SitePermissionsStyles,\n MicrophoneSitePermissionsStrings,\n MicrophoneSitePermissionsProps\n} from '../../react-components/src';\n\n/* @conditional-compile-remove(total-participant-count) */\nexport type { ParticipantListStrings } from '../../react-components/src';\n\n/* @conditional-compile-remove(mention) */\nexport type {\n MentionOptions,\n MentionDisplayOptions,\n MentionLookupOptions,\n Mention,\n MentionPopoverStrings\n} from '../../react-components/src';\n\nexport type {\n _IdentifierProviderProps,\n _Identifiers,\n ActiveErrorMessage,\n BaseCustomStyles,\n CallParticipantListParticipant,\n CameraButtonContextualMenuStyles,\n CameraButtonProps,\n CameraButtonStrings,\n CameraButtonStyles,\n ChatMessage,\n CommunicationParticipant,\n ComponentLocale,\n ComponentSlotStyle,\n ComponentStrings,\n ContentSystemMessage,\n ControlBarButtonProps,\n ControlBarButtonStrings,\n ControlBarButtonStyles,\n ControlBarLayout,\n ControlBarProps,\n CreateVideoStreamViewResult,\n CustomAvatarOptions,\n CustomMessage,\n DevicesButtonContextualMenuStyles,\n DevicesButtonProps,\n DevicesButtonStrings,\n DevicesButtonStyles,\n EndCallButtonProps,\n EndCallButtonStrings,\n ErrorBarProps,\n ErrorBarStrings,\n ErrorType,\n GridLayoutProps,\n GridLayoutStyles,\n HorizontalGalleryStyles,\n JumpToNewMessageButtonProps,\n LocalizationProviderProps,\n LocalVideoCameraCycleButtonProps,\n LoadingState,\n Message,\n MessageAttachedStatus,\n MessageCommon,\n MessageContentType,\n MessageProps,\n MessageRenderer,\n MessageStatusIndicatorProps,\n MessageStatusIndicatorStrings,\n MessageThreadProps,\n MessageThreadStrings,\n MessageThreadStyles,\n MicrophoneButtonContextualMenuStyles,\n MicrophoneButtonProps,\n MicrophoneButtonStrings,\n MicrophoneButtonStyles,\n OnRenderAvatarCallback,\n OptionsDevice,\n ParticipantAddedSystemMessage,\n ParticipantItemProps,\n ParticipantItemStrings,\n ParticipantItemStyles,\n ParticipantListItemStyles,\n ParticipantListParticipant,\n ParticipantListProps,\n ParticipantListStyles,\n ParticipantMenuItemsCallback,\n ParticipantRemovedSystemMessage,\n ParticipantState,\n ParticipantsButtonContextualMenuStyles,\n ParticipantsButtonProps,\n ParticipantsButtonStrings,\n ParticipantsButtonStyles,\n ReadReceiptsBySenderId,\n ScreenShareButtonProps,\n ScreenShareButtonStrings,\n SendBoxProps,\n SendBoxStrings,\n SendBoxStylesProps,\n StreamMediaProps,\n SystemMessage,\n SystemMessageCommon,\n TopicUpdatedSystemMessage,\n TypingIndicatorProps,\n TypingIndicatorStrings,\n TypingIndicatorStylesProps,\n UpdateMessageCallback,\n CancelEditCallback,\n VideoGalleryLayout,\n VideoGalleryLocalParticipant,\n VideoGalleryParticipant,\n VideoGalleryProps,\n VideoGalleryRemoteParticipant,\n VideoGalleryStream,\n VideoGalleryStrings,\n VideoGalleryStyles,\n VideoStreamOptions,\n VideoTileProps,\n VideoTileStylesProps,\n ViewScalingMode,\n VideoTileContextualMenuProps,\n VideoTileDrawerMenuProps,\n VideoTilesOptions\n} from '../../react-components/src';\n\nexport type { RaiseHandButtonProps, RaiseHandButtonStrings, RaisedHand } from '../../react-components/src';\nexport type {\n ReactionButtonStrings,\n Reaction,\n ReactionButtonProps,\n ReactionResources,\n ReactionSprite\n} from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport { RichTextSendBox } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport type { RichTextSendBoxProps, RichTextSendBoxStrings, RichTextStrings } from '../../react-components/src';\nexport type { Spotlight } from '../../react-components/src';\nexport type { ImageOverlayProps, ImageOverlayStrings } from '../../react-components/src';\n/* @conditional-compile-remove(data-loss-prevention) */\nexport type { BlockedMessage } from '../../react-components/src';\nexport type {\n DialpadMode,\n DialpadProps,\n DialpadStrings,\n DialpadStyles,\n DtmfTone,\n LongPressTrigger\n} from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentOptions } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { SendBoxErrorBarError } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentActionHandler } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type {\n AttachmentSelectionHandler,\n AttachmentRemovalHandler,\n AttachmentUploadOptions,\n AttachmentUploadTask\n} from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentMetadata } from '../../acs-ui-common/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentMetadataInProgress, AttachmentProgressError } from '../../acs-ui-common/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentMenuAction, AttachmentDownloadOptions } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport { defaultAttachmentMenuAction } from '../../react-components/src';\nexport type { ChatAttachmentType } from '../../react-components/src';\nexport type { InlineImageOptions, InlineImage } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport type { RichTextEditorOptions } from '../../react-components/src';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { HoldButtonProps, HoldButtonStrings } from '../../react-components/src';\nexport type { VideoTileStrings } from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type { BrowserPermissionDeniedStrings, BrowserPermissionDeniedProps } from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n BrowserPermissionDeniedIOSStrings,\n BrowserPermissionDeniedStyles,\n BrowserPermissionDeniedIOSProps\n} from '../../react-components/src';\nexport type { OverflowGalleryPosition } from '../../react-components/src';\nexport type { LocalVideoTileSize } from '../../react-components/src';\nexport * from '../../react-components/src/localization/locales';\nexport * from '../../react-components/src/theming';\nexport * from '../../calling-stateful-client/src/index-public';\n/* @conditional-compile-remove(one-to-n-calling) */\nexport type { DeclarativeCallAgent } from '../../calling-stateful-client/src';\nexport { createStatefulChatClient } from '../../chat-stateful-client/src';\nexport type {\n StatefulChatClient,\n StatefulChatClientArgs,\n StatefulChatClientOptions,\n ChatMessageWithStatus,\n ChatClientState,\n ChatError,\n ChatErrors,\n ChatThreadClientState,\n ChatThreadProperties,\n ChatErrorTarget\n} from '../../chat-stateful-client/src';\n\nexport type { ResourceFetchResult } from '../../chat-stateful-client/src';\nexport * from '../../react-composites/src/index-public';\nexport * from './mergedHooks';\n\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedBrowser } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedBrowserStrings, UnsupportedBrowserProps } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedBrowserVersion } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedBrowserVersionStrings, UnsupportedBrowserVersionProps } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedOperatingSystem } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedOperatingSystemStrings, UnsupportedOperatingSystemProps } from '../../react-components/src';\nexport type {\n VerticalGalleryStyles,\n VerticalGalleryStrings,\n VerticalGalleryControlBarStyles\n} from '../../react-components/src';\n\nexport type { SpokenLanguageStrings, CaptionLanguageStrings } from '../../react-components/src';\n\nexport type { SurveyIssues } from '../../react-components/src';\n\nexport type { SurveyIssuesHeadingStrings } from '../../react-components/src';\n\nexport type { CallSurveyImprovementSuggestions } from '../../react-components/src';\n/* @conditional-compile-remove(notifications) */\nexport { Notifications, NotificationBar } from '../../react-components/src';\n/* @conditional-compile-remove(notifications) */\nexport type {\n NotificationsProps,\n NotificationBarProps,\n NotificationBarStrings,\n NotificationsStrings,\n NotificationType,\n ActiveNotification\n} from '../../react-components/src';\n/* @conditional-compile-remove(teams-meeting-conference) */\nexport type { MeetingConferencePhoneInfoModalStrings } from '../../react-components/src';\n"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AAoCzG,OAAO,EACL,kBAAkB,EA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4B,CAAC;AA0IpC,mDAAmD;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAoC7D,mDAAmD;AACnD,OAAO,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAC;AAkBzE,cAAc,iDAAiD,CAAC;AAChE,cAAc,oCAAoC,CAAC;AACnD,cAAc,gDAAgD,CAAC;AAG/D,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAe1E,cAAc,yCAAyC,CAAC;AACxD,cAAc,eAAe,CAAC;AAE9B,sDAAsD;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAGhE,sDAAsD;AACtD,OAAO,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAC;AAGvE,sDAAsD;AACtD,OAAO,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAgBxE,gDAAgD;AAChD,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * `@azure/communication-react` is an npm package that exports the functionality of the Azure Communication Services - UI Library.\n *\n * This package makes it easy for you to build modern communications user experiences using Azure Communication Services. It gives you a library of production-ready UI components that you can drop into your applications:\n * - Composites: These components are turn-key solutions that implement common communication scenarios. You can quickly add video calling or chat experiences to your applications. Composites are open-source higher order components built using UI components.\n * - UI Components - These components are open-source building blocks that let you build custom communications experience. Components are offered for both calling and chat capabilities that can be combined to build experiences.\n *\n * These UI client libraries all use Microsoft's Fluent design language and assets. Fluent UI provides a foundational layer for the UI Library and is actively used across Microsoft products.\n *\n * In conjunction with the UI components, the UI Library exposes a stateful client library for calling and chat. This client is agnostic to any specific state management framework and can be integrated with common state managers like Redux or React Context.\n * This stateful client library can be used with the UI Components to pass props and methods for the UI Components to render data. For more information, see Stateful Client Overview.\n *\n * For more information visit: https://aka.ms/acsstorybook\n *\n * @packageDocumentation\n */\n\nexport { fromFlatCommunicationIdentifier, toFlatCommunicationIdentifier } from '../../acs-ui-common/src';\nexport type {\n AreEqual,\n CommonProperties,\n MessageStatus,\n Common,\n AreTypeEqual,\n AreParamEqual\n} from '../../acs-ui-common/src';\n\n// Not to export chat/calling specific hook from binding package\nexport type {\n CallClientProviderProps,\n CallAgentProviderProps,\n CallProviderProps,\n GetCallingSelector,\n CallingHandlers,\n CallingBaseSelectorProps,\n CommonCallingHandlers\n} from '../../calling-component-bindings/src';\n\nexport type { VideoBackgroundEffectsDependency, CallingHandlersOptions } from '../../calling-component-bindings/src';\n\nexport type { CaptionsOptions } from '../../calling-component-bindings/src';\n\nexport type {\n ChatClientProviderProps,\n ChatThreadClientProviderProps,\n GetChatSelector,\n ChatHandlers,\n ChatBaseSelectorProps\n} from '../../chat-component-bindings/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { MessageOptions, ChatMessageType } from '../../acs-ui-common/src';\n\nexport {\n CallClientProvider,\n CallAgentProvider,\n CallProvider,\n useCallClient,\n useCallAgent,\n useCall,\n useDeviceManager,\n getCallingSelector,\n createDefaultCallingHandlers\n} from '../../calling-component-bindings/src';\n\n/* @conditional-compile-remove(teams-identity-support) */\nexport {\n useTeamsCallAgent,\n useTeamsCall,\n createDefaultTeamsCallingHandlers\n} from '../../calling-component-bindings/src';\n\n/* @conditional-compile-remove(teams-identity-support) */\nexport type { TeamsCallingHandlers } from '../../calling-component-bindings/src';\n\nexport type {\n ScreenShareButtonSelector,\n CameraButtonSelector,\n VideoGallerySelector,\n DevicesButtonSelector,\n EmptySelector,\n ErrorBarSelector as CallErrorBarSelector,\n ParticipantListSelector,\n MicrophoneButtonSelector,\n ParticipantsButtonSelector,\n CreateDefaultCallingHandlers\n} from '../../calling-component-bindings/src';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { HoldButtonSelector } from '../../calling-component-bindings/src';\n\nexport type { RaiseHandButtonSelector } from '../../calling-component-bindings/src';\n\nexport {\n ChatClientProvider,\n ChatThreadClientProvider,\n useChatClient,\n useChatThreadClient,\n getChatSelector,\n createDefaultChatHandlers\n} from '../../chat-component-bindings/src';\n\nexport type {\n MessageThreadSelector,\n TypingIndicatorSelector,\n ChatParticipantListSelector,\n SendBoxSelector,\n ErrorBarSelector as ChatErrorBarSelector\n} from '../../chat-component-bindings/src';\n\nexport {\n _IdentifierProvider,\n CameraButton,\n ControlBar,\n ControlBarButton,\n DevicesButton,\n EndCallButton,\n ErrorBar,\n GridLayout,\n LocalizationProvider,\n MessageStatusIndicator,\n MessageThread,\n MicrophoneButton,\n ParticipantItem,\n ParticipantList,\n ParticipantsButton,\n ScreenShareButton,\n SendBox,\n StreamMedia,\n TypingIndicator,\n VideoGallery,\n VideoTile,\n COMPONENT_LOCALE_EN_GB,\n COMPONENT_LOCALE_AR_SA,\n COMPONENT_LOCALE_CS_CZ,\n COMPONENT_LOCALE_DE_DE,\n COMPONENT_LOCALE_ES_ES,\n COMPONENT_LOCALE_FI_FI,\n COMPONENT_LOCALE_FR_FR,\n COMPONENT_LOCALE_HE_IL,\n COMPONENT_LOCALE_IT_IT,\n COMPONENT_LOCALE_JA_JP,\n COMPONENT_LOCALE_KO_KR,\n COMPONENT_LOCALE_NB_NO,\n COMPONENT_LOCALE_NL_NL,\n COMPONENT_LOCALE_PL_PL,\n COMPONENT_LOCALE_PT_BR,\n COMPONENT_LOCALE_RU_RU,\n COMPONENT_LOCALE_SV_SE,\n COMPONENT_LOCALE_TR_TR,\n COMPONENT_LOCALE_ZH_CN,\n COMPONENT_LOCALE_ZH_TW\n} from '../../react-components/src';\nexport { ImageOverlay } from '../../react-components/src';\n/* @conditional-compile-remove(PSTN-calls) */\nexport { HoldButton } from '../../react-components/src';\n\nexport { RaiseHandButton } from '../../react-components/src';\n\nexport { Dialpad } from '../../react-components/src';\n\n/* @conditional-compile-remove(call-readiness) */\nexport {\n CameraAndMicrophoneSitePermissions,\n MicrophoneSitePermissions,\n CameraSitePermissions\n} from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n CameraAndMicrophoneSitePermissionsStrings,\n CameraAndMicrophoneSitePermissionsProps,\n CameraSitePermissionsStrings,\n CameraSitePermissionsProps,\n CommonSitePermissionsProps,\n SitePermissionsStrings,\n SitePermissionsStyles,\n MicrophoneSitePermissionsStrings,\n MicrophoneSitePermissionsProps\n} from '../../react-components/src';\n\n/* @conditional-compile-remove(total-participant-count) */\nexport type { ParticipantListStrings } from '../../react-components/src';\n\n/* @conditional-compile-remove(mention) */\nexport type {\n MentionOptions,\n MentionDisplayOptions,\n MentionLookupOptions,\n Mention,\n MentionPopoverStrings\n} from '../../react-components/src';\n\nexport type {\n _IdentifierProviderProps,\n _Identifiers,\n ActiveErrorMessage,\n BaseCustomStyles,\n CallParticipantListParticipant,\n CameraButtonContextualMenuStyles,\n CameraButtonProps,\n CameraButtonStrings,\n CameraButtonStyles,\n ChatMessage,\n CommunicationParticipant,\n ComponentLocale,\n ComponentSlotStyle,\n ComponentStrings,\n ContentSystemMessage,\n ControlBarButtonProps,\n ControlBarButtonStrings,\n ControlBarButtonStyles,\n ControlBarLayout,\n ControlBarProps,\n CreateVideoStreamViewResult,\n CustomAvatarOptions,\n CustomMessage,\n DevicesButtonContextualMenuStyles,\n DevicesButtonProps,\n DevicesButtonStrings,\n DevicesButtonStyles,\n EndCallButtonProps,\n EndCallButtonStrings,\n ErrorBarProps,\n ErrorBarStrings,\n ErrorType,\n GridLayoutProps,\n GridLayoutStyles,\n HorizontalGalleryStyles,\n JumpToNewMessageButtonProps,\n LocalizationProviderProps,\n LocalVideoCameraCycleButtonProps,\n LoadingState,\n Message,\n MessageAttachedStatus,\n MessageCommon,\n MessageContentType,\n MessageProps,\n MessageRenderer,\n MessageStatusIndicatorProps,\n MessageStatusIndicatorStrings,\n MessageThreadProps,\n MessageThreadStrings,\n MessageThreadStyles,\n MicrophoneButtonContextualMenuStyles,\n MicrophoneButtonProps,\n MicrophoneButtonStrings,\n MicrophoneButtonStyles,\n OnRenderAvatarCallback,\n OptionsDevice,\n ParticipantAddedSystemMessage,\n ParticipantItemProps,\n ParticipantItemStrings,\n ParticipantItemStyles,\n ParticipantListItemStyles,\n ParticipantListParticipant,\n ParticipantListProps,\n ParticipantListStyles,\n ParticipantMenuItemsCallback,\n ParticipantRemovedSystemMessage,\n ParticipantState,\n ParticipantsButtonContextualMenuStyles,\n ParticipantsButtonProps,\n ParticipantsButtonStrings,\n ParticipantsButtonStyles,\n ReadReceiptsBySenderId,\n ScreenShareButtonProps,\n ScreenShareButtonStrings,\n SendBoxProps,\n SendBoxStrings,\n SendBoxStylesProps,\n StreamMediaProps,\n SystemMessage,\n SystemMessageCommon,\n TopicUpdatedSystemMessage,\n TypingIndicatorProps,\n TypingIndicatorStrings,\n TypingIndicatorStylesProps,\n UpdateMessageCallback,\n CancelEditCallback,\n VideoGalleryLayout,\n VideoGalleryLocalParticipant,\n VideoGalleryParticipant,\n VideoGalleryProps,\n VideoGalleryRemoteParticipant,\n VideoGalleryStream,\n VideoGalleryStrings,\n VideoGalleryStyles,\n VideoStreamOptions,\n VideoTileProps,\n VideoTileStylesProps,\n ViewScalingMode,\n VideoTileContextualMenuProps,\n VideoTileDrawerMenuProps,\n VideoTilesOptions\n} from '../../react-components/src';\n\nexport type { RaiseHandButtonProps, RaiseHandButtonStrings, RaisedHand } from '../../react-components/src';\nexport type {\n ReactionButtonStrings,\n Reaction,\n ReactionButtonProps,\n ReactionResources,\n ReactionSprite\n} from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport { RichTextSendBox } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport type { RichTextSendBoxProps, RichTextSendBoxStrings, RichTextStrings } from '../../react-components/src';\nexport type { Spotlight } from '../../react-components/src';\nexport type { ImageOverlayProps, ImageOverlayStrings } from '../../react-components/src';\n/* @conditional-compile-remove(data-loss-prevention) */\nexport type { BlockedMessage } from '../../react-components/src';\nexport type {\n DialpadMode,\n DialpadProps,\n DialpadStrings,\n DialpadStyles,\n DtmfTone,\n LongPressTrigger\n} from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentOptions } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { SendBoxErrorBarError } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentActionHandler } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type {\n AttachmentSelectionHandler,\n AttachmentRemovalHandler,\n AttachmentUploadOptions,\n AttachmentUploadTask\n} from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-teams-interop) @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentMetadata } from '../../acs-ui-common/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentMetadataInProgress, AttachmentProgressError } from '../../acs-ui-common/src';\n\n/* @conditional-compile-remove(file-sharing-acs) */\nexport type { AttachmentMenuAction, AttachmentDownloadOptions } from '../../react-components/src';\n/* @conditional-compile-remove(file-sharing-acs) */\nexport { defaultAttachmentMenuAction } from '../../react-components/src';\nexport type { ChatAttachmentType } from '../../react-components/src';\nexport type { InlineImageOptions, InlineImage } from '../../react-components/src';\n/* @conditional-compile-remove(rich-text-editor) */\nexport type { RichTextEditorOptions } from '../../react-components/src';\n/* @conditional-compile-remove(PSTN-calls) */\nexport type { HoldButtonProps, HoldButtonStrings } from '../../react-components/src';\nexport type { VideoTileStrings } from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type { BrowserPermissionDeniedStrings, BrowserPermissionDeniedProps } from '../../react-components/src';\n/* @conditional-compile-remove(call-readiness) */\nexport type {\n BrowserPermissionDeniedIOSStrings,\n BrowserPermissionDeniedStyles,\n BrowserPermissionDeniedIOSProps\n} from '../../react-components/src';\nexport type { OverflowGalleryPosition } from '../../react-components/src';\nexport type { LocalVideoTileSize } from '../../react-components/src';\nexport * from '../../react-components/src/localization/locales';\nexport * from '../../react-components/src/theming';\nexport * from '../../calling-stateful-client/src/index-public';\n/* @conditional-compile-remove(one-to-n-calling) */\nexport type { DeclarativeCallAgent } from '../../calling-stateful-client/src';\nexport { createStatefulChatClient } from '../../chat-stateful-client/src';\nexport type {\n StatefulChatClient,\n StatefulChatClientArgs,\n StatefulChatClientOptions,\n ChatMessageWithStatus,\n ChatClientState,\n ChatError,\n ChatErrors,\n ChatThreadClientState,\n ChatThreadProperties,\n ChatErrorTarget\n} from '../../chat-stateful-client/src';\n\nexport type { ResourceFetchResult } from '../../chat-stateful-client/src';\nexport * from '../../react-composites/src/index-public';\nexport * from './mergedHooks';\n\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedBrowser } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedBrowserStrings, UnsupportedBrowserProps } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedBrowserVersion } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedBrowserVersionStrings, UnsupportedBrowserVersionProps } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport { UnsupportedOperatingSystem } from '../../react-components/src';\n/* @conditional-compile-remove(unsupported-browser) */\nexport type { UnsupportedOperatingSystemStrings, UnsupportedOperatingSystemProps } from '../../react-components/src';\nexport type {\n VerticalGalleryStyles,\n VerticalGalleryStrings,\n VerticalGalleryControlBarStyles\n} from '../../react-components/src';\n\nexport type { SpokenLanguageStrings, CaptionLanguageStrings } from '../../react-components/src';\n\nexport type { SurveyIssues } from '../../react-components/src';\n\nexport type { SurveyIssuesHeadingStrings } from '../../react-components/src';\n\nexport type { CallSurveyImprovementSuggestions } from '../../react-components/src';\n/* @conditional-compile-remove(notifications) */\nexport { NotificationStack, Notification } from '../../react-components/src';\n/* @conditional-compile-remove(notifications) */\nexport type {\n NotificationStackProps,\n NotificationProps,\n NotificationStrings,\n NotificationStackStrings,\n NotificationType,\n ActiveNotification\n} from '../../react-components/src';\n/* @conditional-compile-remove(teams-meeting-conference) */\nexport type { MeetingConferencePhoneInfoModalStrings } from '../../react-components/src';\n"]}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"mergedHooks.js","sourceRoot":"","sources":["../../../../src/mergedHooks.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAEL,kBAAkB,EAElB,kBAAkB,EAClB,kBAAkB,EACnB,6CAA6C;AAC9C,OAAO,EAEL,eAAe,EAEf,eAAe,EACf,eAAe,EAChB,0CAA0C;AAoB3C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CACzB,QAAgB,EAChB,aAA2E,EAC3E,IAAyB,EACiC,EAAE;IAC5D,oEAAoE;IACpE,8DAA8D;IAC9D,+DAA+D;IAC/D,MAAM,WAAW,GAAG,CAAC,IAAI,IAAI,IAAI,KAAK,SAAS,CAAC;IAChD,MAAM,QAAQ,GAAG,CAAC,IAAI,IAAI,IAAI,KAAK,MAAM,CAAC;IAC1C,MAAM,SAAS,GAAG,kBAAkB,CAAC,WAAW,CAAC,CAAC,CAAE,QAAgB,CAAC,CAAC,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IACjG,MAAM,SAAS,GAAG,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAE,QAAgB,CAAC,CAAC,CAAC,SAAS,EAAE,aAAa,CAAC,CAAC;IAC3F,OAAO,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,SAAS,CAAC;AAChC,CAAC,CAAC;
|
1
|
+
{"version":3,"file":"mergedHooks.js","sourceRoot":"","sources":["../../../../src/mergedHooks.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAEL,kBAAkB,EAElB,kBAAkB,EAClB,kBAAkB,EACnB,6CAA6C;AAC9C,OAAO,EAEL,eAAe,EAEf,eAAe,EACf,eAAe,EAChB,0CAA0C;AAoB3C;;;;;;;GAOG;AACH,MAAM,CAAC,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CAAC;YAClB,MAAM,0DAA0D,CAAC;QACnE,CAAC;QACD,OAAO,gCAAK,SAAS,GAAK,YAAY,CAAS,CAAC;IAClD,CAAC;IAED,IAAI,SAAS,EAAE,CAAC;QACd,IAAI,CAAC,eAAe,EAAE,CAAC;YACrB,MAAM,qCAAqC,CAAC;QAC9C,CAAC;QACD,OAAO,gCAAK,SAAS,GAAK,eAAe,CAAS,CAAC;IACrD,CAAC;IAED,IAAI,CAAC,YAAY,IAAI,CAAC,eAAe,EAAE,CAAC;QACtC,MAAM,iJAAiJ,CAAC;IAC1J,CAAC;SAAM,CAAC;QACN,MAAM,oGAAoG,CAAC;IAC7G,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport {\n CallingHandlers,\n getCallingSelector,\n GetCallingSelector,\n useCallingHandlers,\n useCallingSelector\n} from '@internal/calling-component-bindings';\nimport {\n ChatHandlers,\n getChatSelector,\n GetChatSelector,\n useChatHandlers,\n useChatSelector\n} from '@internal/chat-component-bindings';\nimport { ChatClientState } from '@internal/chat-stateful-client';\nimport { CallClientState } from '@internal/calling-stateful-client';\nimport { Common } from '@internal/acs-ui-common';\n\n/**\n * Centralized state for {@link @azure/communication-calling#CallClient} or {@link @azure/communication-chat#ChatClient}.\n *\n * See also: {@link CallClientState}, {@link ChatClientState}.\n * @public\n */\nexport type ClientState = CallClientState & ChatClientState;\n\n/**\n * An optimized selector that refines {@link ClientState} updates into props for React Components in this library.\n *\n * @public\n */\nexport type Selector = (state: ClientState, props: any) => any;\n\n/**\n * Hook to obtain a selector for a specified component.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const useSelector = <ParamT extends Selector | undefined>(\n selector: ParamT,\n selectorProps?: ParamT extends Selector ? Parameters<ParamT>[1] : undefined,\n type?: 'calling' | 'chat'\n): ParamT extends Selector ? ReturnType<ParamT> : undefined => {\n // Because of react hooks rules, hooks can't be conditionally called\n // We call both call and chat hooks and detect current context\n // Return undefined and skip execution when not in that context\n const callingMode = !type || type === 'calling';\n const chatMode = !type || type === 'chat';\n const callProps = useCallingSelector(callingMode ? (selector as any) : undefined, selectorProps);\n const chatProps = useChatSelector(chatMode ? (selector as any) : undefined, selectorProps);\n return callProps ?? chatProps;\n};\n\n/**\n * Helper type for {@link usePropsFor}.\n *\n * @public\n */\nexport type ChatReturnProps<Component extends (props: any) => JSX.Element> =\n GetChatSelector<Component> extends (state: ChatClientState, props: any) => any\n ? ReturnType<GetChatSelector<Component>> & Common<ChatHandlers, Parameters<Component>[0]>\n : never;\n\n/**\n * Helper type for {@link usePropsFor}.\n *\n * @public\n */\nexport type CallingReturnProps<Component extends (props: any) => JSX.Element> =\n GetCallingSelector<Component> extends (state: CallClientState, props: any) => any\n ? ReturnType<GetCallingSelector<Component>> & Common<CallingHandlers, Parameters<Component>[0]>\n : never;\n\n/**\n * Helper type for {@link usePropsFor}.\n *\n * @public\n */\nexport type ComponentProps<Component extends (props: any) => JSX.Element> =\n ChatReturnProps<Component> extends never\n ? CallingReturnProps<Component> extends never\n ? undefined\n : CallingReturnProps<Component>\n : ChatReturnProps<Component>;\n\n/**\n * Primary hook to get all hooks necessary for a React Component from this library.\n *\n * To call this hook, the component requires to be wrapped under these providers:\n *\n * 1. For chat components: {@link ChatClientProvider} and {@link ChatThreadClientProvider}.\n *\n * 2. For calling components: {@link CallClientProvider}, {@link CallAgentProvider} and {@link CallAgentProvider}.\n *\n * Most straightforward usage of a components looks like:\n *\n * @example\n * ```\n * import { ParticipantList, usePropsFor } from '@azure/communication-react';\n *\n * const App = (): JSX.Element => {\n * // ... code to setup Providers ...\n *\n * return <ParticipantList {...usePropsFor(ParticipantList)}/>\n * }\n * ```\n *\n * @public\n */\nexport const usePropsFor = <Component extends (props: any) => JSX.Element>(\n component: Component,\n type?: 'calling' | 'chat'\n): ComponentProps<Component> => {\n const callingSelector = type === 'calling' || !type ? getCallingSelector(component) : undefined;\n const chatSelector = type === 'chat' || !type ? getChatSelector(component) : undefined;\n const callProps = useCallingSelector(callingSelector);\n const chatProps = useChatSelector(chatSelector);\n const callingHandlers = useCallingHandlers<Parameters<Component>[0]>(component);\n const chatHandlers = useChatHandlers<Parameters<Component>[0]>(component);\n\n if (chatProps) {\n if (!chatHandlers) {\n throw 'Please initialize chatClient and chatThreadClient first!';\n }\n return { ...chatProps, ...chatHandlers } as any;\n }\n\n if (callProps) {\n if (!callingHandlers) {\n throw 'Please initialize callClient first!';\n }\n return { ...callProps, ...callingHandlers } as any;\n }\n\n if (!chatSelector && !callingSelector) {\n throw \"Can't find corresponding selector for this component. Please check the supported components from Azure Communication UI Feature Component List.\";\n } else {\n throw 'Could not find props for this component, ensure the component is wrapped by appropriate providers.';\n }\n};\n"]}
|