@azure/communication-react 1.13.0-alpha-202402040013 → 1.13.0-alpha-202402060012
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 +114 -56
- package/dist/dist-cjs/communication-react/index.js +772 -645
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +3 -0
- package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.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 +2 -2
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js +3 -3
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +3 -3
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/FluentChatMessageComponentWrapper.js +3 -3
- package/dist/dist-esm/react-components/src/components/ChatMessage/FluentChatMessageComponentWrapper.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ImageOverlay.d.ts +62 -0
- package/dist/dist-esm/react-components/src/components/ImageOverlay.js +52 -0
- package/dist/dist-esm/react-components/src/components/ImageOverlay.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/MessageThread.js +2 -2
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Survey/StarSurvey/StarSurvey.styles.js +4 -4
- package/dist/dist-esm/react-components/src/components/Survey/StarSurvey/StarSurvey.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/Survey/TagsSurvey/TagsSurvey.styles.js +3 -1
- package/dist/dist-esm/react-components/src/components/Survey/TagsSurvey/TagsSurvey.styles.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/assets/RaisedHandIcon.js +56 -56
- package/dist/dist-esm/react-components/src/components/assets/RaisedHandIcon.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.d.ts +3 -3
- 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/{ImageGallery.style.d.ts → ImageOverlay.style.d.ts} +1 -1
- package/dist/dist-esm/react-components/src/components/styles/{ImageGallery.style.js → ImageOverlay.style.js} +7 -7
- package/dist/dist-esm/react-components/src/components/styles/{ImageGallery.style.js.map → ImageOverlay.style.js.map} +1 -1
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +3 -3
- package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/ar-SA/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/fi-FI/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/he-IL/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/nb-NO/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/pl-PL/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/sv-SE/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +1 -1
- package/dist/dist-esm/react-components/src/theming/themes.d.ts +2 -2
- package/dist/dist-esm/react-components/src/theming/themes.js +2 -2
- package/dist/dist-esm/react-components/src/theming/themes.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +3 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +25 -22
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +8 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +60 -8
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +113 -77
- 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 +13 -7
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/NoticePage.d.ts +0 -35
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/NoticePage.js +1 -11
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/NoticePage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/SurveyPage.d.ts +56 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/SurveyPage.js +29 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/SurveyPage.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ThankYouForFeedbackPage.d.ts +14 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ThankYouForFeedbackPage.js +27 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ThankYouForFeedbackPage.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +9 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +9 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +3 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +4 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +9 -4
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +6 -3
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +4 -3
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +9 -5
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +3 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +30 -34
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/Survey.d.ts +20 -0
- package/dist/dist-esm/react-composites/src/composites/common/Survey.js +136 -0
- package/dist/dist-esm/react-composites/src/composites/common/Survey.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/common/{SurveyPaneContent.d.ts → SurveyContent.d.ts} +2 -2
- package/dist/dist-esm/react-composites/src/composites/common/{SurveyPaneContent.js → SurveyContent.js} +4 -4
- package/dist/dist-esm/react-composites/src/composites/common/SurveyContent.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +3 -2
- package/package.json +1 -1
- package/dist/dist-esm/react-components/src/components/ImageGallery.d.ts +0 -71
- package/dist/dist-esm/react-components/src/components/ImageGallery.js +0 -53
- package/dist/dist-esm/react-components/src/components/ImageGallery.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/SurveyPane.d.ts +0 -13
- package/dist/dist-esm/react-composites/src/composites/common/SurveyPane.js +0 -87
- package/dist/dist-esm/react-composites/src/composites/common/SurveyPane.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/SurveyPaneContent.js.map +0 -1
@@ -15,12 +15,10 @@ import { _createStatefulCallClientInner } from "../../../../../calling-stateful-
|
|
15
15
|
/* @conditional-compile-remove(teams-identity-support) */
|
16
16
|
import { _isTeamsCallAgent } from "../../../../../calling-stateful-client/src";
|
17
17
|
import { LocalVideoStream as SDKLocalVideoStream } from '@azure/communication-calling';
|
18
|
-
/* @conditional-compile-remove(call-transfer) */
|
19
|
-
import { LocalVideoStream } from '@azure/communication-calling';
|
20
18
|
/* @conditional-compile-remove(unsupported-browser) */ /* @conditional-compile-remove(video-background-effects) */ /* @conditional-compile-remove(close-captions) */ /* @conditional-compile-remove(capabilities) */
|
21
19
|
import { Features } from '@azure/communication-calling';
|
22
20
|
import { EventEmitter } from 'events';
|
23
|
-
import { getCallCompositePage, IsCallEndedPage, isCameraOn } from '../utils';
|
21
|
+
import { getCallCompositePage, getLocatorOrTargetCallees, IsCallEndedPage, isCameraOn } from '../utils';
|
24
22
|
import { toFlatCommunicationIdentifier, _toCommunicationIdentifier, _isValidIdentifier } from "../../../../../acs-ui-common/src";
|
25
23
|
import { isMicrosoftTeamsUserIdentifier } from '@azure/communication-common';
|
26
24
|
/* @conditional-compile-remove(teams-identity-support) */ /* @conditional-compile-remove(PSTN-calls) */
|
@@ -41,7 +39,7 @@ import { CallingSoundSubscriber } from './CallingSoundSubscriber';
|
|
41
39
|
class CallContext {
|
42
40
|
constructor(clientState, isTeamsCall,
|
43
41
|
/* @conditional-compile-remove(rooms) */
|
44
|
-
isRoomsCall, options) {
|
42
|
+
isRoomsCall, options, targetCallees) {
|
45
43
|
var _a, _b, _c, _d;
|
46
44
|
this.emitter = new EventEmitter();
|
47
45
|
this.state = {
|
@@ -50,7 +48,7 @@ class CallContext {
|
|
50
48
|
displayName: (_a = clientState.callAgent) === null || _a === void 0 ? void 0 : _a.displayName,
|
51
49
|
devices: clientState.deviceManager,
|
52
50
|
call: undefined,
|
53
|
-
/* @conditional-compile-remove(calling-sounds) */ targetCallees:
|
51
|
+
/* @conditional-compile-remove(calling-sounds) */ targetCallees: targetCallees,
|
54
52
|
page: 'configuration',
|
55
53
|
latestErrors: clientState.latestErrors,
|
56
54
|
isTeamsCall,
|
@@ -200,7 +198,7 @@ export class AzureCommunicationCallAdapter {
|
|
200
198
|
this.resetDiagnosticsForwarder(newCall);
|
201
199
|
this._call = newCall;
|
202
200
|
}
|
203
|
-
constructor(callClient,
|
201
|
+
constructor(callClient, locatorOrTargetCalless, callAgent, deviceManager, options) {
|
204
202
|
var _a;
|
205
203
|
this.participantSubscribers = new Map();
|
206
204
|
this.emitter = new EventEmitter();
|
@@ -214,16 +212,23 @@ export class AzureCommunicationCallAdapter {
|
|
214
212
|
this.bindPublicMethods();
|
215
213
|
this.callClient = callClient;
|
216
214
|
this.callAgent = callAgent;
|
217
|
-
this.
|
215
|
+
this.targetCallees =
|
216
|
+
getLocatorOrTargetCallees(locatorOrTargetCalless) === true
|
217
|
+
? locatorOrTargetCalless
|
218
|
+
: undefined;
|
219
|
+
this.locator =
|
220
|
+
getLocatorOrTargetCallees(locatorOrTargetCalless) === false
|
221
|
+
? locatorOrTargetCalless
|
222
|
+
: undefined;
|
218
223
|
this.deviceManager = deviceManager;
|
219
|
-
const isTeamsMeeting = 'meetingLink' in this.locator;
|
224
|
+
const isTeamsMeeting = this.locator ? 'meetingLink' in this.locator : false;
|
220
225
|
/* @conditional-compile-remove(rooms) */
|
221
|
-
const isRoomsCall = 'roomId' in this.locator;
|
226
|
+
const isRoomsCall = this.locator ? 'roomId' in this.locator : false;
|
222
227
|
/* @conditional-compile-remove(video-background-effects) */
|
223
228
|
this.onResolveVideoBackgroundEffectsDependency = (_a = options === null || options === void 0 ? void 0 : options.videoBackgroundOptions) === null || _a === void 0 ? void 0 : _a.onResolveDependency;
|
224
229
|
this.context = new CallContext(callClient.getState(), isTeamsMeeting,
|
225
230
|
/* @conditional-compile-remove(rooms) */ isRoomsCall,
|
226
|
-
/* @conditional-compile-remove(video-background-effects) */ options);
|
231
|
+
/* @conditional-compile-remove(video-background-effects) */ options, this.targetCallees);
|
227
232
|
this.context.onCallEnded((endCallData) => this.emitter.emit('callEnded', endCallData));
|
228
233
|
const onStateChange = (clientState) => {
|
229
234
|
var _a, _b, _c, _d;
|
@@ -446,6 +451,9 @@ export class AzureCommunicationCallAdapter {
|
|
446
451
|
if (_isInCall((_b = (_a = this.getState().call) === null || _a === void 0 ? void 0 : _a.state) !== null && _b !== void 0 ? _b : 'None')) {
|
447
452
|
throw new Error('You are already in the call!');
|
448
453
|
}
|
454
|
+
else if (this.locator === undefined) {
|
455
|
+
throw new Error('Locator is not defined!');
|
456
|
+
}
|
449
457
|
return this.teeErrorToEventEmitter(() => {
|
450
458
|
// Default to keeping camera/mic on if no override argument specified
|
451
459
|
let shouldCameraBeOnInCall = this.getState().cameraStatus === 'On';
|
@@ -469,25 +477,15 @@ export class AzureCommunicationCallAdapter {
|
|
469
477
|
const videoOptions = selectedCamera && shouldCameraBeOnInCall
|
470
478
|
? { localVideoStreams: [new SDKLocalVideoStream(selectedCamera)] }
|
471
479
|
: {};
|
472
|
-
/* @conditional-compile-remove(teams-adhoc-call) */
|
473
|
-
/* @conditional-compile-remove(PSTN-calls) */
|
474
|
-
if (isOutboundCall(this.locator)) {
|
475
|
-
const phoneNumber = this.getState().alternateCallerId;
|
476
|
-
return this.startCall(this.locator.participantIds, {
|
477
|
-
alternateCallerId: phoneNumber ? { phoneNumber: phoneNumber } : undefined,
|
478
|
-
audioOptions,
|
479
|
-
videoOptions
|
480
|
-
});
|
481
|
-
}
|
482
480
|
const call = this._joinCall(audioOptions, videoOptions);
|
483
481
|
this.processNewCall(call);
|
484
482
|
return call;
|
485
483
|
});
|
486
484
|
}
|
487
485
|
_joinCall(audioOptions, videoOptions) {
|
488
|
-
const isTeamsMeeting = 'meetingLink' in this.locator;
|
486
|
+
const isTeamsMeeting = this.locator ? 'meetingLink' in this.locator : false;
|
489
487
|
/* @conditional-compile-remove(rooms) */
|
490
|
-
const isRoomsCall = 'roomId' in this.locator;
|
488
|
+
const isRoomsCall = this.locator ? 'roomId' in this.locator : false;
|
491
489
|
/* @conditional-compile-remove(teams-identity-support) */
|
492
490
|
if (_isTeamsCallAgent(this.callAgent)) {
|
493
491
|
if (!isTeamsMeeting) {
|
@@ -725,6 +723,15 @@ export class AzureCommunicationCallAdapter {
|
|
725
723
|
if (_isInCall((_b = (_a = this.getState().call) === null || _a === void 0 ? void 0 : _a.state) !== null && _b !== void 0 ? _b : 'None')) {
|
726
724
|
throw new Error('You are already in the call.');
|
727
725
|
}
|
726
|
+
const isCameraOn = this.getState().cameraStatus === 'On';
|
727
|
+
const selectedCamera = getSelectedCameraFromAdapterState(this.getState());
|
728
|
+
/* we only configure the video options here since the Calling SDK always unmutes the participant when starting a call */
|
729
|
+
const startCallVideoOptions = selectedCamera
|
730
|
+
? {
|
731
|
+
videoOptions: isCameraOn ? { localVideoStreams: [new SDKLocalVideoStream(selectedCamera)] } : undefined
|
732
|
+
}
|
733
|
+
: {};
|
734
|
+
const combinedCallOptions = Object.assign(Object.assign({}, startCallVideoOptions), options);
|
728
735
|
const idsToAdd = participants.map((participant) => {
|
729
736
|
let backendId = participant;
|
730
737
|
if (typeof participant === 'string') {
|
@@ -740,7 +747,7 @@ export class AzureCommunicationCallAdapter {
|
|
740
747
|
});
|
741
748
|
/* @conditional-compile-remove(calling-sounds) */
|
742
749
|
this.context.setTargetCallee(idsToAdd);
|
743
|
-
const call = this.handlers.onStartCall(idsToAdd,
|
750
|
+
const call = this.handlers.onStartCall(idsToAdd, combinedCallOptions);
|
744
751
|
if (!call) {
|
745
752
|
throw new Error('Unable to start call.');
|
746
753
|
}
|
@@ -996,7 +1003,7 @@ export class AzureCommunicationCallAdapter {
|
|
996
1003
|
},
|
997
1004
|
videoOptions: (_f = options === null || options === void 0 ? void 0 : options.videoOptions) !== null && _f !== void 0 ? _f :
|
998
1005
|
/* maintain video state if options.videoOptions is not defined */
|
999
|
-
(videoSource ? { localVideoStreams: [new
|
1006
|
+
(videoSource ? { localVideoStreams: [new SDKLocalVideoStream(videoSource)] } : undefined)
|
1000
1007
|
});
|
1001
1008
|
} });
|
1002
1009
|
this.emitter.emit('transferRequested', newArgs);
|
@@ -1069,6 +1076,9 @@ export class AzureCommunicationCallAdapter {
|
|
1069
1076
|
}
|
1070
1077
|
}
|
1071
1078
|
}
|
1079
|
+
/**
|
1080
|
+
* @public
|
1081
|
+
*/
|
1072
1082
|
/**
|
1073
1083
|
* Create a {@link CallAdapter} backed by Azure Communication Services.
|
1074
1084
|
*
|
@@ -1078,29 +1088,30 @@ export class AzureCommunicationCallAdapter {
|
|
1078
1088
|
*
|
1079
1089
|
* @public
|
1080
1090
|
*/
|
1081
|
-
export
|
1082
|
-
|
1083
|
-
|
1084
|
-
|
1085
|
-
|
1086
|
-
|
1087
|
-
|
1088
|
-
|
1089
|
-
|
1090
|
-
|
1091
|
-
|
1092
|
-
|
1093
|
-
|
1094
|
-
|
1095
|
-
|
1091
|
+
export function createAzureCommunicationCallAdapter(args) {
|
1092
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1093
|
+
if (isMicrosoftTeamsUserIdentifier(args.userId)) {
|
1094
|
+
throw new Error('Microsoft Teams user identifier is not supported by AzureCommunicationCallAdapter. Instead use TeamsCallAdapter.');
|
1095
|
+
}
|
1096
|
+
return _createAzureCommunicationCallAdapterInner({
|
1097
|
+
userId: args.userId,
|
1098
|
+
displayName: args.displayName,
|
1099
|
+
credential: args.credential,
|
1100
|
+
locator: args.locator,
|
1101
|
+
targetCallees: args.targetCallees,
|
1102
|
+
/* @conditional-compile-remove(PSTN-calls) */
|
1103
|
+
alternateCallerId: args.alternateCallerId,
|
1104
|
+
/* @conditional-compile-remove(video-background-effects) */
|
1105
|
+
options: args.options
|
1106
|
+
});
|
1096
1107
|
});
|
1097
|
-
}
|
1108
|
+
}
|
1098
1109
|
/**
|
1099
1110
|
* This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.
|
1100
1111
|
*
|
1101
1112
|
* @internal
|
1102
1113
|
*/
|
1103
|
-
export const _createAzureCommunicationCallAdapterInner = ({ userId, displayName, credential, locator,
|
1114
|
+
export const _createAzureCommunicationCallAdapterInner = ({ userId, displayName, credential, locator, targetCallees,
|
1104
1115
|
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,
|
1105
1116
|
/* @conditional-compile-remove(video-background-effects) */ options, telemetryImplementationHint = 'Call' }) => __awaiter(void 0, void 0, void 0, function* () {
|
1106
1117
|
if (!_isValidIdentifier(userId)) {
|
@@ -1114,8 +1125,15 @@ export const _createAzureCommunicationCallAdapterInner = ({ userId, displayName,
|
|
1114
1125
|
const callAgent = yield callClient.createCallAgent(credential, {
|
1115
1126
|
displayName
|
1116
1127
|
});
|
1117
|
-
|
1118
|
-
|
1128
|
+
let adapter;
|
1129
|
+
if (locator) {
|
1130
|
+
adapter = createAzureCommunicationCallAdapterFromClient(callClient, callAgent, locator,
|
1131
|
+
/* @conditional-compile-remove(video-background-effects) */ options);
|
1132
|
+
}
|
1133
|
+
else {
|
1134
|
+
adapter = createAzureCommunicationCallAdapterFromClient(callClient, callAgent, targetCallees,
|
1135
|
+
/* @conditional-compile-remove(video-background-effects) */ options);
|
1136
|
+
}
|
1119
1137
|
return adapter;
|
1120
1138
|
});
|
1121
1139
|
/* @conditional-compile-remove(teams-identity-support) */
|
@@ -1138,8 +1156,10 @@ export const createTeamsCallAdapter = ({ userId, credential, locator, options })
|
|
1138
1156
|
/**
|
1139
1157
|
* @private
|
1140
1158
|
*/
|
1141
|
-
|
1142
|
-
const { credential,
|
1159
|
+
function useAzureCommunicationCallAdapterGeneric(args, adapterKind = 'AzureCommunication', afterCreate, beforeDispose) {
|
1160
|
+
const { credential, userId } = args;
|
1161
|
+
const locator = 'locator' in args ? args.locator : undefined;
|
1162
|
+
const targetCallees = 'targetCallees' in args ? args.targetCallees : undefined;
|
1143
1163
|
const displayName = 'displayName' in args ? args.displayName : undefined;
|
1144
1164
|
/* @conditional-compile-remove(PSTN-calls) */
|
1145
1165
|
const alternateCallerId = 'alternateCallerId' in args ? args.alternateCallerId : undefined;
|
@@ -1159,13 +1179,13 @@ const useAzureCommunicationCallAdapterGeneric = (args, afterCreate, beforeDispos
|
|
1159
1179
|
afterCreateRef.current = afterCreate;
|
1160
1180
|
beforeDisposeRef.current = beforeDispose;
|
1161
1181
|
useEffect(() => {
|
1162
|
-
if (!credential || !locator || !userId) {
|
1182
|
+
if (!credential || (!locator && !targetCallees) || !userId) {
|
1163
1183
|
return;
|
1164
1184
|
}
|
1165
1185
|
if (adapterKind === 'AzureCommunication' && !displayName) {
|
1166
1186
|
return;
|
1167
1187
|
}
|
1168
|
-
(() => __awaiter(
|
1188
|
+
(() => __awaiter(this, void 0, void 0, function* () {
|
1169
1189
|
if (adapterRef.current) {
|
1170
1190
|
// Dispose the old adapter when a new one is created.
|
1171
1191
|
//
|
@@ -1189,14 +1209,26 @@ const useAzureCommunicationCallAdapterGeneric = (args, afterCreate, beforeDispos
|
|
1189
1209
|
return;
|
1190
1210
|
}
|
1191
1211
|
creatingAdapterRef.current = true;
|
1192
|
-
|
1193
|
-
|
1194
|
-
|
1195
|
-
|
1196
|
-
|
1197
|
-
|
1198
|
-
|
1199
|
-
|
1212
|
+
if (locator) {
|
1213
|
+
newAdapter = (yield createAzureCommunicationCallAdapter({
|
1214
|
+
credential,
|
1215
|
+
displayName: displayName,
|
1216
|
+
locator,
|
1217
|
+
userId: userId,
|
1218
|
+
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,
|
1219
|
+
/* @conditional-compile-remove(video-background-effects) */ options
|
1220
|
+
}));
|
1221
|
+
}
|
1222
|
+
else if (targetCallees) {
|
1223
|
+
newAdapter = (yield createAzureCommunicationCallAdapter({
|
1224
|
+
credential,
|
1225
|
+
displayName: displayName,
|
1226
|
+
targetCallees,
|
1227
|
+
userId: userId,
|
1228
|
+
/* @conditional-compile-remove(PSTN-calls) */ alternateCallerId,
|
1229
|
+
/* @conditional-compile-remove(video-background-effects) */ options
|
1230
|
+
}));
|
1231
|
+
}
|
1200
1232
|
}
|
1201
1233
|
else if (adapterKind === 'Teams') {
|
1202
1234
|
if (creatingAdapterRef.current) {
|
@@ -1238,13 +1270,13 @@ const useAzureCommunicationCallAdapterGeneric = (args, afterCreate, beforeDispos
|
|
1238
1270
|
displayName,
|
1239
1271
|
/* @conditional-compile-remove(PSTN-calls) */
|
1240
1272
|
alternateCallerId,
|
1241
|
-
|
1242
|
-
|
1273
|
+
options,
|
1274
|
+
targetCallees
|
1243
1275
|
]);
|
1244
1276
|
// Dispose any existing adapter when the component unmounts.
|
1245
1277
|
useEffect(() => {
|
1246
1278
|
return () => {
|
1247
|
-
(() => __awaiter(
|
1279
|
+
(() => __awaiter(this, void 0, void 0, function* () {
|
1248
1280
|
if (adapterRef.current) {
|
1249
1281
|
if (beforeDisposeRef.current) {
|
1250
1282
|
yield beforeDisposeRef.current(adapterRef.current);
|
@@ -1256,7 +1288,7 @@ const useAzureCommunicationCallAdapterGeneric = (args, afterCreate, beforeDispos
|
|
1256
1288
|
};
|
1257
1289
|
}, []);
|
1258
1290
|
return adapter;
|
1259
|
-
}
|
1291
|
+
}
|
1260
1292
|
/**
|
1261
1293
|
* A custom React hook to simplify the creation of {@link CallAdapter}.
|
1262
1294
|
*
|
@@ -1291,7 +1323,7 @@ afterCreate,
|
|
1291
1323
|
* This is useful for clean up tasks, e.g., leaving any ongoing calls.
|
1292
1324
|
*/
|
1293
1325
|
beforeDispose) => {
|
1294
|
-
return useAzureCommunicationCallAdapterGeneric(args, afterCreate, beforeDispose
|
1326
|
+
return useAzureCommunicationCallAdapterGeneric(args, 'AzureCommunication', afterCreate, beforeDispose);
|
1295
1327
|
};
|
1296
1328
|
/* @conditional-compile-remove(teams-identity-support) */
|
1297
1329
|
/**
|
@@ -1328,7 +1360,7 @@ afterCreate,
|
|
1328
1360
|
* This is useful for clean up tasks, e.g., leaving any ongoing calls.
|
1329
1361
|
*/
|
1330
1362
|
beforeDispose) => {
|
1331
|
-
return useAzureCommunicationCallAdapterGeneric(args, afterCreate, beforeDispose
|
1363
|
+
return useAzureCommunicationCallAdapterGeneric(args, 'Teams', afterCreate, beforeDispose);
|
1332
1364
|
};
|
1333
1365
|
/**
|
1334
1366
|
* Create a {@link CallAdapter} using the provided {@link StatefulCallClient}.
|
@@ -1338,17 +1370,26 @@ beforeDispose) => {
|
|
1338
1370
|
*
|
1339
1371
|
* @public
|
1340
1372
|
*/
|
1341
|
-
export
|
1342
|
-
|
1343
|
-
|
1344
|
-
|
1345
|
-
yield deviceManager.
|
1346
|
-
|
1347
|
-
|
1348
|
-
|
1349
|
-
|
1350
|
-
|
1351
|
-
|
1373
|
+
export function createAzureCommunicationCallAdapterFromClient(callClient, callAgent, locatorOrtargetCallees,
|
1374
|
+
/* @conditional-compile-remove(video-background-effects) */ options) {
|
1375
|
+
return __awaiter(this, void 0, void 0, function* () {
|
1376
|
+
const deviceManager = (yield callClient.getDeviceManager());
|
1377
|
+
yield Promise.all([deviceManager.getCameras(), deviceManager.getMicrophones()]);
|
1378
|
+
if (deviceManager.isSpeakerSelectionAvailable) {
|
1379
|
+
yield deviceManager.getSpeakers();
|
1380
|
+
}
|
1381
|
+
/* @conditional-compile-remove(unsupported-browser) */
|
1382
|
+
yield callClient.feature(Features.DebugInfo).getEnvironmentInfo();
|
1383
|
+
if (getLocatorOrTargetCallees(locatorOrtargetCallees)) {
|
1384
|
+
return new AzureCommunicationCallAdapter(callClient, locatorOrtargetCallees, callAgent, deviceManager,
|
1385
|
+
/* @conditional-compile-remove(video-background-effects) */ options);
|
1386
|
+
}
|
1387
|
+
else {
|
1388
|
+
return new AzureCommunicationCallAdapter(callClient, locatorOrtargetCallees, callAgent, deviceManager,
|
1389
|
+
/* @conditional-compile-remove(video-background-effects) */ options);
|
1390
|
+
}
|
1391
|
+
});
|
1392
|
+
}
|
1352
1393
|
/* @conditional-compile-remove(teams-identity-support) */
|
1353
1394
|
/**
|
1354
1395
|
* Create a {@link TeamsCallAdapter} using the provided {@link StatefulCallClient}.
|
@@ -1371,9 +1412,4 @@ export const createTeamsCallAdapterFromClient = (callClient, callAgent, locator,
|
|
1371
1412
|
const isCallError = (e) => {
|
1372
1413
|
return e['target'] !== undefined && e['innerError'] !== undefined;
|
1373
1414
|
};
|
1374
|
-
/* @conditional-compile-remove(teams-adhoc-call) */
|
1375
|
-
/* @conditional-compile-remove(PSTN-calls) */
|
1376
|
-
const isOutboundCall = (callLocator) => {
|
1377
|
-
return 'participantIds' in callLocator;
|
1378
|
-
};
|
1379
1415
|
//# sourceMappingURL=AzureCommunicationCallAdapter.js.map
|