@azure/communication-react 1.4.2-alpha-202211220015.0 → 1.4.2-alpha-202211240014.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/communication-react.d.ts +188 -27
- package/dist/dist-cjs/communication-react/index.js +251 -89
- 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/index.d.ts +1 -0
- package/dist/dist-esm/calling-component-bindings/src/index.js +2 -0
- package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.d.ts +7 -0
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js +12 -0
- package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +5 -0
- package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +2 -0
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js +7 -0
- package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +19 -0
- package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ErrorBar.d.ts +10 -0
- package/dist/dist-esm/react-components/src/components/ErrorBar.js +5 -2
- package/dist/dist-esm/react-components/src/components/ErrorBar.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.js +7 -11
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/UnsupportedBrowser.styles.js +1 -2
- package/dist/dist-esm/react-components/src/components/styles/UnsupportedBrowser.styles.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 +5 -1
- package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +5 -6
- 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 +45 -12
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +141 -46
- 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 +135 -27
- 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/CallAdapterProvider.d.ts +3 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapterProvider.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/DiagnosticsForwarder.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/DiagnosticsForwarder.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.d.ts +15 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.js +23 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +4 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js +2 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallPane.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallPane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +8 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js +3 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +3 -1
- 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/HoldPage.js +3 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js +3 -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/pages/UnsupportedBrowser.js +8 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +5 -0
- package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +5 -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 +8 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +8 -4
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +3 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +10 -5
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +3 -0
- 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/package.json +8 -8
package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
import { CallState, DeviceManagerState } from "../../../../../calling-stateful-client/src";
|
2
|
+
import { TeamsCall } from '@azure/communication-calling';
|
2
3
|
import type { AudioDeviceInfo, VideoDeviceInfo, Call, PermissionConstraints, RemoteParticipant, StartCallOptions, MediaDiagnosticChangedEventArgs, NetworkDiagnosticChangedEventArgs, PropertyChangedEvent } from '@azure/communication-calling';
|
3
4
|
import { CreateVideoStreamViewResult, VideoStreamOptions } from "../../../../../react-components/src";
|
4
5
|
import { Role } from "../../../../../react-components/src";
|
5
6
|
import type { CommunicationIdentifierKind } from '@azure/communication-common';
|
6
7
|
import { AddPhoneNumberOptions, DtmfTone } from '@azure/communication-calling';
|
8
|
+
import { EnvironmentInfo } from '@azure/communication-calling';
|
7
9
|
import type { CommunicationIdentifier, CommunicationUserIdentifier, PhoneNumberIdentifier } from '@azure/communication-common';
|
8
10
|
import type { AdapterState, Disposable, AdapterError, AdapterErrors } from '../../common/adapters';
|
9
11
|
/**
|
@@ -18,7 +20,18 @@ export declare type CallCompositePage = 'accessDeniedTeamsMeeting' | 'call' | 'c
|
|
18
20
|
*/
|
19
21
|
export declare const END_CALL_PAGES: CallCompositePage[];
|
20
22
|
/**
|
21
|
-
*
|
23
|
+
* options object to enable opt in features for the CallAdapter
|
24
|
+
*
|
25
|
+
* @beta
|
26
|
+
*/
|
27
|
+
export declare type CallAdapterOptionalFeatures = {
|
28
|
+
/**
|
29
|
+
* Feature flag for enabling the unsupported environment logic in the CallAdapter.
|
30
|
+
*/
|
31
|
+
unsupportedEnvironment?: boolean;
|
32
|
+
};
|
33
|
+
/**
|
34
|
+
* {@link CommonCallAdapter} state for pure UI purposes.
|
22
35
|
*
|
23
36
|
* @public
|
24
37
|
*/
|
@@ -27,7 +40,7 @@ export declare type CallAdapterUiState = {
|
|
27
40
|
page: CallCompositePage;
|
28
41
|
};
|
29
42
|
/**
|
30
|
-
* {@link
|
43
|
+
* {@link CommonCallAdapter} state inferred from Azure Communication Services backend.
|
31
44
|
*
|
32
45
|
* @public
|
33
46
|
*/
|
@@ -46,6 +59,14 @@ export declare type CallAdapterClientState = {
|
|
46
59
|
* Azure communications Phone number to make PSTN calls with.
|
47
60
|
*/
|
48
61
|
alternateCallerId?: string;
|
62
|
+
/**
|
63
|
+
* Environment information about system the adapter is made on
|
64
|
+
*/
|
65
|
+
environmentInfo?: EnvironmentInfo;
|
66
|
+
/**
|
67
|
+
* Optional features that are to be enabled through the adapter.
|
68
|
+
*/
|
69
|
+
features?: CallAdapterOptionalFeatures;
|
49
70
|
/**
|
50
71
|
* Use this to hint the role of the user when the role is not available before a Rooms call is started. This value
|
51
72
|
* should be obtained using the Rooms API. This role will determine permissions in the configuration page of the
|
@@ -54,7 +75,7 @@ export declare type CallAdapterClientState = {
|
|
54
75
|
roleHint?: Role;
|
55
76
|
};
|
56
77
|
/**
|
57
|
-
* {@link
|
78
|
+
* {@link CommonCallAdapter} state.
|
58
79
|
*
|
59
80
|
* @public
|
60
81
|
*/
|
@@ -159,15 +180,7 @@ export declare type DiagnosticChangedEventListner = (event: MediaDiagnosticChang
|
|
159
180
|
*
|
160
181
|
* @public
|
161
182
|
*/
|
162
|
-
export interface
|
163
|
-
/**
|
164
|
-
* Join the call with microphone initially on/off.
|
165
|
-
*
|
166
|
-
* @param microphoneOn - Whether microphone is initially enabled
|
167
|
-
*
|
168
|
-
* @public
|
169
|
-
*/
|
170
|
-
joinCall(microphoneOn?: boolean): Call | undefined;
|
183
|
+
export interface CallAdapterCallOperations {
|
171
184
|
/**
|
172
185
|
* Leave the call
|
173
186
|
*
|
@@ -204,20 +217,6 @@ export interface CallAdapterCallManagement {
|
|
204
217
|
* @public
|
205
218
|
*/
|
206
219
|
unmute(): Promise<void>;
|
207
|
-
/**
|
208
|
-
* Start the call.
|
209
|
-
*
|
210
|
-
* @param participants - An array of participant ids to join
|
211
|
-
*
|
212
|
-
* @public
|
213
|
-
*/
|
214
|
-
startCall(participants: string[], options?: StartCallOptions): Call | undefined;
|
215
|
-
/**
|
216
|
-
* Start the call.
|
217
|
-
* @param participants - An array of {@link @azure/communication-common#CommunicationIdentifier} to be called
|
218
|
-
* @beta
|
219
|
-
*/
|
220
|
-
startCall(participants: CommunicationIdentifier[], options?: StartCallOptions): Call | undefined;
|
221
220
|
/**
|
222
221
|
* Start sharing the screen during a call.
|
223
222
|
*
|
@@ -487,11 +486,120 @@ export interface CallAdapterSubscribers {
|
|
487
486
|
*/
|
488
487
|
off(event: 'error', listener: (e: AdapterError) => void): void;
|
489
488
|
}
|
489
|
+
/**
|
490
|
+
* Functionality for managing the current call or start a new call
|
491
|
+
* @deprecated CallAdapter interface will be flatten, consider using CallAdapter directly
|
492
|
+
* @public
|
493
|
+
*/
|
494
|
+
export interface CallAdapterCallManagement extends CallAdapterCallOperations {
|
495
|
+
/**
|
496
|
+
* Join the call with microphone initially on/off.
|
497
|
+
*
|
498
|
+
* @param microphoneOn - Whether microphone is initially enabled
|
499
|
+
*
|
500
|
+
* @public
|
501
|
+
*/
|
502
|
+
joinCall(microphoneOn?: boolean): Call | undefined;
|
503
|
+
/**
|
504
|
+
* Start the call.
|
505
|
+
*
|
506
|
+
* @param participants - An array of participant ids to join
|
507
|
+
*
|
508
|
+
* @public
|
509
|
+
*/
|
510
|
+
startCall(participants: string[], options?: StartCallOptions): Call | undefined;
|
511
|
+
/**
|
512
|
+
* Start the call.
|
513
|
+
* @param participants - An array of {@link @azure/communication-common#CommunicationIdentifier} to be called
|
514
|
+
* @beta
|
515
|
+
*/
|
516
|
+
startCall(participants: CommunicationIdentifier[], options?: StartCallOptions): Call | undefined;
|
517
|
+
}
|
490
518
|
/**
|
491
519
|
* {@link CallComposite} Adapter interface.
|
492
520
|
*
|
493
521
|
* @public
|
494
522
|
*/
|
495
|
-
export interface
|
523
|
+
export interface CommonCallAdapter extends AdapterState<CallAdapterState>, Disposable, CallAdapterCallOperations, CallAdapterDeviceManagement, CallAdapterSubscribers {
|
524
|
+
/**
|
525
|
+
* Join the call with microphone initially on/off.
|
526
|
+
*
|
527
|
+
* @param microphoneOn - Whether microphone is initially enabled
|
528
|
+
*
|
529
|
+
* @public
|
530
|
+
*/
|
531
|
+
joinCall(microphoneOn?: boolean): void;
|
532
|
+
/**
|
533
|
+
* Start the call.
|
534
|
+
*
|
535
|
+
* @param participants - An array of participant ids to join
|
536
|
+
*
|
537
|
+
* @public
|
538
|
+
*/
|
539
|
+
startCall(participants: string[], options?: StartCallOptions): void;
|
540
|
+
/**
|
541
|
+
* Start the call.
|
542
|
+
* @param participants - An array of {@link @azure/communication-common#CommunicationIdentifier} to be called
|
543
|
+
* @beta
|
544
|
+
*/
|
545
|
+
startCall(participants: CommunicationIdentifier[], options?: StartCallOptions): void;
|
546
|
+
}
|
547
|
+
/**
|
548
|
+
* An Adapter interface specific for Azure Communication identity which extends {@link CommonCallAdapter}.
|
549
|
+
*
|
550
|
+
* @public
|
551
|
+
*/
|
552
|
+
export interface CallAdapter extends CommonCallAdapter {
|
553
|
+
/**
|
554
|
+
* Join the call with microphone initially on/off.
|
555
|
+
*
|
556
|
+
* @param microphoneOn - Whether microphone is initially enabled
|
557
|
+
*
|
558
|
+
* @public
|
559
|
+
*/
|
560
|
+
joinCall(microphoneOn?: boolean): Call | undefined;
|
561
|
+
/**
|
562
|
+
* Start the call.
|
563
|
+
*
|
564
|
+
* @param participants - An array of participant ids to join
|
565
|
+
*
|
566
|
+
* @public
|
567
|
+
*/
|
568
|
+
startCall(participants: string[], options?: StartCallOptions): Call | undefined;
|
569
|
+
/**
|
570
|
+
* Start the call.
|
571
|
+
* @param participants - An array of {@link @azure/communication-common#CommunicationIdentifier} to be called
|
572
|
+
* @beta
|
573
|
+
*/
|
574
|
+
startCall(participants: CommunicationIdentifier[], options?: StartCallOptions): Call | undefined;
|
575
|
+
}
|
576
|
+
/**
|
577
|
+
* An Adapter interface specific for Teams identity which extends {@link CommonCallAdapter}.
|
578
|
+
*
|
579
|
+
* @beta
|
580
|
+
*/
|
581
|
+
export interface TeamsCallAdapter extends CommonCallAdapter {
|
582
|
+
/**
|
583
|
+
* Join the call with microphone initially on/off.
|
584
|
+
*
|
585
|
+
* @param microphoneOn - Whether microphone is initially enabled
|
586
|
+
*
|
587
|
+
* @beta
|
588
|
+
*/
|
589
|
+
joinCall(microphoneOn?: boolean): TeamsCall | undefined;
|
590
|
+
/**
|
591
|
+
* Start the call.
|
592
|
+
*
|
593
|
+
* @param participants - An array of participant ids to join
|
594
|
+
*
|
595
|
+
* @beta
|
596
|
+
*/
|
597
|
+
startCall(participants: string[], options?: StartCallOptions): TeamsCall | undefined;
|
598
|
+
/**
|
599
|
+
* Start the call.
|
600
|
+
* @param participants - An array of {@link @azure/communication-common#CommunicationIdentifier} to be called
|
601
|
+
* @beta
|
602
|
+
*/
|
603
|
+
startCall(participants: CommunicationIdentifier[], options?: StartCallOptions): TeamsCall | undefined;
|
496
604
|
}
|
497
605
|
//# sourceMappingURL=CallAdapter.d.ts.map
|
package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CallAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/CallAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA8ClC;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAwB;IACjD,0BAA0B;IAC1B,8BAA8B;IAC9B,UAAU;IACV,wCAAwC,CAAC,wBAAwB;IACjE,iBAAiB;IACjB,wCAAwC,CAAC,cAAc;IACvD,sDAAsD,CAAC,wBAAwB;CAChF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CallState, DeviceManagerState } from '@internal/calling-stateful-client';\nimport type {\n AudioDeviceInfo,\n VideoDeviceInfo,\n Call,\n PermissionConstraints,\n RemoteParticipant,\n StartCallOptions,\n MediaDiagnosticChangedEventArgs,\n NetworkDiagnosticChangedEventArgs,\n PropertyChangedEvent\n} from '@azure/communication-calling';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\n/* @conditional-compile-remove(rooms) */\nimport { Role } from '@internal/react-components';\nimport type { CommunicationIdentifierKind } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions, DtmfTone } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport type {\n CommunicationIdentifier,\n CommunicationUserIdentifier,\n PhoneNumberIdentifier\n} from '@azure/communication-common';\nimport type { AdapterState, Disposable, AdapterError, AdapterErrors } from '../../common/adapters';\n\n/**\n * Major UI screens shown in the {@link CallComposite}.\n *\n * @public\n */\nexport type CallCompositePage =\n | 'accessDeniedTeamsMeeting'\n | 'call'\n | 'configuration'\n | /* @conditional-compile-remove(PSTN-calls) */ 'hold'\n | 'joinCallFailedDueToNoNetwork'\n | 'leftCall'\n | 'lobby'\n | /* @conditional-compile-remove(rooms) */ 'deniedPermissionToRoom'\n | 'removedFromCall'\n | /* @conditional-compile-remove(rooms) */ 'roomNotFound'\n | /* @conditional-compile-remove(unsupported-browser) */ 'unsupportedEnvironment';\n\n/**\n * Subset of CallCompositePages that represent an end call state.\n * @private\n */\nexport const END_CALL_PAGES: CallCompositePage[] = [\n 'accessDeniedTeamsMeeting',\n 'joinCallFailedDueToNoNetwork',\n 'leftCall',\n /* @conditional-compile-remove(rooms) */ 'deniedPermissionToRoom',\n 'removedFromCall',\n /* @conditional-compile-remove(rooms) */ 'roomNotFound',\n /* @conditional-compile-remove(unsupported-browser) */ 'unsupportedEnvironment'\n];\n\n/**\n * {@link CallAdapter} state for pure UI purposes.\n *\n * @public\n */\nexport type CallAdapterUiState = {\n isLocalPreviewMicrophoneEnabled: boolean;\n page: CallCompositePage;\n};\n\n/**\n * {@link CallAdapter} state inferred from Azure Communication Services backend.\n *\n * @public\n */\nexport type CallAdapterClientState = {\n userId: CommunicationIdentifierKind;\n displayName?: string;\n call?: CallState;\n devices: DeviceManagerState;\n endedCall?: CallState;\n isTeamsCall: boolean;\n /**\n * Latest error encountered for each operation performed via the adapter.\n */\n latestErrors: AdapterErrors;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Azure communications Phone number to make PSTN calls with.\n */\n alternateCallerId?: string;\n /* @conditional-compile-remove(rooms) */\n /**\n * Use this to hint the role of the user when the role is not available before a Rooms call is started. This value\n * should be obtained using the Rooms API. This role will determine permissions in the configuration page of the\n * {@link CallComposite}. The true role of the user will be synced with ACS services when a Rooms call starts.\n */\n roleHint?: Role;\n};\n\n/**\n * {@link CallAdapter} state.\n *\n * @public\n */\nexport type CallAdapterState = CallAdapterUiState & CallAdapterClientState;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'participantsJoined' event.\n *\n * @public\n */\nexport type ParticipantsJoinedListener = (event: { joined: RemoteParticipant[] }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'participantsLeft' event.\n *\n * @public\n */\nexport type ParticipantsLeftListener = (event: { removed: RemoteParticipant[] }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'isMuted' event.\n *\n * @public\n */\nexport type IsMutedChangedListener = (event: { identifier: CommunicationIdentifierKind; isMuted: boolean }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'callIdChanged' event.\n *\n * @public\n */\nexport type CallIdChangedListener = (event: { callId: string }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'isLocalScreenSharingActiveChanged' event.\n *\n * @public\n */\nexport type IsLocalScreenSharingActiveChangedListener = (event: { isScreenSharingOn: boolean }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'isSpeakingChanged' event.\n *\n * @public\n */\nexport type IsSpeakingChangedListener = (event: {\n identifier: CommunicationIdentifierKind;\n isSpeaking: boolean;\n}) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'displayNameChanged' event.\n *\n * @public\n */\nexport type DisplayNameChangedListener = (event: {\n participantId: CommunicationIdentifierKind;\n displayName: string;\n}) => void;\n\n/**\n * Payload for {@link CallEndedListener} containing details on the ended call.\n *\n * @public\n */\nexport type CallAdapterCallEndedEvent = { callId: string };\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'callEnded' event.\n *\n * @public\n */\nexport type CallEndedListener = (event: CallAdapterCallEndedEvent) => void;\n\n/**\n * Payload for {@link DiagnosticChangedEventListner} where there is a change in a media diagnostic.\n *\n * @public\n */\nexport type MediaDiagnosticChangedEvent = MediaDiagnosticChangedEventArgs & {\n type: 'media';\n};\n\n/**\n * Payload for {@link DiagnosticChangedEventListner} where there is a change in a network diagnostic.\n *\n * @public\n */\nexport type NetworkDiagnosticChangedEvent = NetworkDiagnosticChangedEventArgs & {\n type: 'network';\n};\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'diagnosticChanged' event.\n *\n * @public\n */\nexport type DiagnosticChangedEventListner = (\n event: MediaDiagnosticChangedEvent | NetworkDiagnosticChangedEvent\n) => void;\n\n/**\n * Functionality for managing the current call.\n *\n * @public\n */\nexport interface CallAdapterCallManagement {\n /**\n * Join the call with microphone initially on/off.\n *\n * @param microphoneOn - Whether microphone is initially enabled\n *\n * @public\n */\n joinCall(microphoneOn?: boolean): Call | undefined;\n /**\n * Leave the call\n *\n * @param forEveryone - Whether to remove all participants when leaving\n *\n * @public\n */\n leaveCall(forEveryone?: boolean): Promise<void>;\n /**\n * Start the camera\n * This method will start rendering a local camera view when the call is not active\n *\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n startCamera(options?: VideoStreamOptions): Promise<void>;\n /**\n * Stop the camera\n * This method will stop rendering a local camera view when the call is not active\n *\n * @public\n */\n stopCamera(): Promise<void>;\n /**\n * Mute the current user during the call or disable microphone locally\n *\n * @public\n */\n mute(): Promise<void>;\n /**\n * Unmute the current user during the call or enable microphone locally\n *\n * @public\n */\n unmute(): Promise<void>;\n /**\n * Start the call.\n *\n * @param participants - An array of participant ids to join\n *\n * @public\n */\n startCall(participants: string[], options?: StartCallOptions): Call | undefined;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Start the call.\n * @param participants - An array of {@link @azure/communication-common#CommunicationIdentifier} to be called\n * @beta\n */\n startCall(participants: CommunicationIdentifier[], options?: StartCallOptions): Call | undefined;\n /**\n * Start sharing the screen during a call.\n *\n * @public\n */\n startScreenShare(): Promise<void>;\n /**\n * Stop sharing the screen\n *\n * @public\n */\n stopScreenShare(): Promise<void>;\n /**\n * Remove a participant from the call.\n *\n * @param userId - Id of the participant to be removed\n *\n * @public\n */\n removeParticipant(userId: string): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Remove a participant from the call.\n * @param participant - {@link @azure/communication-common#CommunicationIdentifier} of the participant to be removed\n * @beta\n */\n removeParticipant(participant: CommunicationIdentifier): Promise<void>;\n /**\n * Create the html view for a stream.\n *\n * @remarks\n * This method is implemented for composite\n *\n * @param remoteUserId - Id of the participant to render, leave it undefined to create the local camera view\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n createStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void | CreateVideoStreamViewResult>;\n /**\n * Dispose the html view for a stream.\n *\n * @remarks\n * This method is implemented for composite\n *\n * @param remoteUserId - Id of the participant to render, leave it undefined to dispose the local camera view\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n disposeStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Holds the call.\n *\n * @beta\n */\n holdCall(): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Resumes the call from a `LocalHold` state.\n *\n * @beta\n */\n resumeCall(): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Add a participant to the call.\n *\n * @beta\n */\n addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n addParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * send dtmf tone to another participant in a 1:1 PSTN call\n *\n * @beta\n */\n sendDtmfTone(dtmfTone: DtmfTone): Promise<void>;\n}\n\n/**\n * Functionality for managing devices within a call.\n *\n * @public\n */\nexport interface CallAdapterDeviceManagement {\n /**\n * Ask for permissions of devices.\n *\n * @remarks\n * Browser permission window will pop up if permissions are not granted yet\n *\n * @param constrain - Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }\n *\n * @public\n */\n askDevicePermission(constrain: PermissionConstraints): Promise<void>;\n /**\n * Query for available camera devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of video device information entities {@link @azure/communication-calling#VideoDeviceInfo }\n *\n * @public\n */\n queryCameras(): Promise<VideoDeviceInfo[]>;\n /**\n * Query for available microphone devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of audio device information entities {@link @azure/communication-calling#AudioDeviceInfo }\n *\n * @public\n */\n queryMicrophones(): Promise<AudioDeviceInfo[]>;\n /**\n * Query for available microphone devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of audio device information entities {@link @azure/communication-calling#AudioDeviceInfo }\n *\n * @public\n */\n querySpeakers(): Promise<AudioDeviceInfo[]>;\n /**\n * Set the camera to use in the call.\n *\n * @param sourceInfo - Camera device to choose, pick one returned by {@link CallAdapterDeviceManagement#queryCameras }\n * @param options - Options to control how the camera stream is rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n setCamera(sourceInfo: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void>;\n /**\n * Set the microphone to use in the call.\n *\n * @param sourceInfo - Microphone device to choose, pick one returned by {@link CallAdapterDeviceManagement#queryMicrophones }\n *\n * @public\n */\n setMicrophone(sourceInfo: AudioDeviceInfo): Promise<void>;\n /**\n * Set the speaker to use in the call.\n *\n * @param sourceInfo - Speaker device to choose, pick one returned by {@link CallAdapterDeviceManagement#querySpeakers }\n *\n * @public\n */\n setSpeaker(sourceInfo: AudioDeviceInfo): Promise<void>;\n}\n\n/**\n * Call composite events that can be subscribed to.\n *\n * @public\n */\nexport interface CallAdapterSubscribers {\n /**\n * Subscribe function for 'participantsJoined' event.\n */\n on(event: 'participantsJoined', listener: ParticipantsJoinedListener): void;\n /**\n * Subscribe function for 'participantsLeft' event.\n */\n on(event: 'participantsLeft', listener: ParticipantsLeftListener): void;\n /**\n * Subscribe function for 'isMutedChanged' event.\n *\n * @remarks\n * The event will be triggered whenever current user or remote user mute state changed\n *\n */\n on(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n /**\n * Subscribe function for 'callIdChanged' event.\n *\n * @remarks\n * The event will be triggered when callId of current user changed.\n *\n */\n on(event: 'callIdChanged', listener: CallIdChangedListener): void;\n /**\n * Subscribe function for 'isLocalScreenSharingActiveChanged' event.\n */\n on(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n /**\n * Subscribe function for 'displayNameChanged' event.\n */\n on(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n /**\n * Subscribe function for 'isSpeakingChanged' event.\n */\n on(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n /**\n * Subscribe function for 'callEnded' event.\n */\n on(event: 'callEnded', listener: CallEndedListener): void;\n /**\n * Subscribe function for 'diagnosticChanged' event.\n *\n * This event fires whenever there is a change in user facing diagnostics about the ongoing call.\n */\n on(event: 'diagnosticChanged', listener: DiagnosticChangedEventListner): void;\n /**\n * Subscribe function for 'selectedMicrophoneChanged' event.\n *\n * This event fires whenever the user selects a new microphone device.\n */\n on(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n /**\n * Subscribe function for 'selectedSpeakerChanged' event.\n *\n * This event fires whenever the user selects a new speaker device.\n */\n on(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n /**\n * Subscribe function for 'error' event.\n */\n on(event: 'error', listener: (e: AdapterError) => void): void;\n\n /**\n * Unsubscribe function for 'participantsJoined' event.\n */\n off(event: 'participantsJoined', listener: ParticipantsJoinedListener): void;\n /**\n * Unsubscribe function for 'participantsLeft' event.\n */\n off(event: 'participantsLeft', listener: ParticipantsLeftListener): void;\n /**\n * Unsubscribe function for 'isMutedChanged' event.\n */\n off(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n /**\n * Unsubscribe function for 'callIdChanged' event.\n */\n off(event: 'callIdChanged', listener: CallIdChangedListener): void;\n /**\n * Unsubscribe function for 'isLocalScreenSharingActiveChanged' event.\n */\n off(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n /**\n * Unsubscribe function for 'displayNameChanged' event.\n */\n off(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n /**\n * Unsubscribe function for 'isSpeakingChanged' event.\n */\n off(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n /**\n * Unsubscribe function for 'callEnded' event.\n */\n off(event: 'callEnded', listener: CallEndedListener): void;\n /**\n * Unsubscribe function for 'diagnosticChanged' event.\n */\n off(event: 'diagnosticChanged', listener: DiagnosticChangedEventListner): void;\n /**\n * Unsubscribe function for 'selectedMicrophoneChanged' event.\n */\n off(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n /**\n * Unsubscribe function for 'selectedSpeakerChanged' event.\n */\n off(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n /**\n * Unsubscribe function for 'error' event.\n */\n off(event: 'error', listener: (e: AdapterError) => void): void;\n}\n\n/**\n * {@link CallComposite} Adapter interface.\n *\n * @public\n */\nexport interface CallAdapter\n extends AdapterState<CallAdapterState>,\n Disposable,\n CallAdapterCallManagement,\n CallAdapterDeviceManagement,\n CallAdapterSubscribers {}\n\"../../../../../calling-stateful-client/src\"\"../../../../../react-components/src\""]}
|
1
|
+
{"version":3,"file":"CallAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/CallAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAkDlC;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAwB;IACjD,0BAA0B;IAC1B,8BAA8B;IAC9B,UAAU;IACV,wCAAwC,CAAC,wBAAwB;IACjE,iBAAiB;IACjB,wCAAwC,CAAC,cAAc;IACvD,sDAAsD,CAAC,wBAAwB;CAChF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CallState, DeviceManagerState } from '@internal/calling-stateful-client';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { TeamsCall } from '@azure/communication-calling';\nimport type {\n AudioDeviceInfo,\n VideoDeviceInfo,\n Call,\n PermissionConstraints,\n RemoteParticipant,\n StartCallOptions,\n MediaDiagnosticChangedEventArgs,\n NetworkDiagnosticChangedEventArgs,\n PropertyChangedEvent\n} from '@azure/communication-calling';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\n/* @conditional-compile-remove(rooms) */\nimport { Role } from '@internal/react-components';\nimport type { CommunicationIdentifierKind } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions, DtmfTone } from '@azure/communication-calling';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport type {\n CommunicationIdentifier,\n CommunicationUserIdentifier,\n PhoneNumberIdentifier\n} from '@azure/communication-common';\nimport type { AdapterState, Disposable, AdapterError, AdapterErrors } from '../../common/adapters';\n\n/**\n * Major UI screens shown in the {@link CallComposite}.\n *\n * @public\n */\nexport type CallCompositePage =\n | 'accessDeniedTeamsMeeting'\n | 'call'\n | 'configuration'\n | /* @conditional-compile-remove(PSTN-calls) */ 'hold'\n | 'joinCallFailedDueToNoNetwork'\n | 'leftCall'\n | 'lobby'\n | /* @conditional-compile-remove(rooms) */ 'deniedPermissionToRoom'\n | 'removedFromCall'\n | /* @conditional-compile-remove(rooms) */ 'roomNotFound'\n | /* @conditional-compile-remove(unsupported-browser) */ 'unsupportedEnvironment';\n\n/**\n * Subset of CallCompositePages that represent an end call state.\n * @private\n */\nexport const END_CALL_PAGES: CallCompositePage[] = [\n 'accessDeniedTeamsMeeting',\n 'joinCallFailedDueToNoNetwork',\n 'leftCall',\n /* @conditional-compile-remove(rooms) */ 'deniedPermissionToRoom',\n 'removedFromCall',\n /* @conditional-compile-remove(rooms) */ 'roomNotFound',\n /* @conditional-compile-remove(unsupported-browser) */ 'unsupportedEnvironment'\n];\n\n/**\n * options object to enable opt in features for the CallAdapter\n *\n * @beta\n */\nexport type CallAdapterOptionalFeatures = {\n /**\n * Feature flag for enabling the unsupported environment logic in the CallAdapter.\n */\n unsupportedEnvironment?: boolean;\n};\n\n/**\n * {@link CommonCallAdapter} state for pure UI purposes.\n *\n * @public\n */\nexport type CallAdapterUiState = {\n isLocalPreviewMicrophoneEnabled: boolean;\n page: CallCompositePage;\n};\n\n/**\n * {@link CommonCallAdapter} state inferred from Azure Communication Services backend.\n *\n * @public\n */\nexport type CallAdapterClientState = {\n userId: CommunicationIdentifierKind;\n displayName?: string;\n call?: CallState;\n devices: DeviceManagerState;\n endedCall?: CallState;\n isTeamsCall: boolean;\n /**\n * Latest error encountered for each operation performed via the adapter.\n */\n latestErrors: AdapterErrors;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Azure communications Phone number to make PSTN calls with.\n */\n alternateCallerId?: string;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * Environment information about system the adapter is made on\n */\n environmentInfo?: EnvironmentInfo;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * Optional features that are to be enabled through the adapter.\n */\n features?: CallAdapterOptionalFeatures;\n /* @conditional-compile-remove(rooms) */\n /**\n * Use this to hint the role of the user when the role is not available before a Rooms call is started. This value\n * should be obtained using the Rooms API. This role will determine permissions in the configuration page of the\n * {@link CallComposite}. The true role of the user will be synced with ACS services when a Rooms call starts.\n */\n roleHint?: Role;\n};\n\n/**\n * {@link CommonCallAdapter} state.\n *\n * @public\n */\nexport type CallAdapterState = CallAdapterUiState & CallAdapterClientState;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'participantsJoined' event.\n *\n * @public\n */\nexport type ParticipantsJoinedListener = (event: { joined: RemoteParticipant[] }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'participantsLeft' event.\n *\n * @public\n */\nexport type ParticipantsLeftListener = (event: { removed: RemoteParticipant[] }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'isMuted' event.\n *\n * @public\n */\nexport type IsMutedChangedListener = (event: { identifier: CommunicationIdentifierKind; isMuted: boolean }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'callIdChanged' event.\n *\n * @public\n */\nexport type CallIdChangedListener = (event: { callId: string }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'isLocalScreenSharingActiveChanged' event.\n *\n * @public\n */\nexport type IsLocalScreenSharingActiveChangedListener = (event: { isScreenSharingOn: boolean }) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'isSpeakingChanged' event.\n *\n * @public\n */\nexport type IsSpeakingChangedListener = (event: {\n identifier: CommunicationIdentifierKind;\n isSpeaking: boolean;\n}) => void;\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'displayNameChanged' event.\n *\n * @public\n */\nexport type DisplayNameChangedListener = (event: {\n participantId: CommunicationIdentifierKind;\n displayName: string;\n}) => void;\n\n/**\n * Payload for {@link CallEndedListener} containing details on the ended call.\n *\n * @public\n */\nexport type CallAdapterCallEndedEvent = { callId: string };\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'callEnded' event.\n *\n * @public\n */\nexport type CallEndedListener = (event: CallAdapterCallEndedEvent) => void;\n\n/**\n * Payload for {@link DiagnosticChangedEventListner} where there is a change in a media diagnostic.\n *\n * @public\n */\nexport type MediaDiagnosticChangedEvent = MediaDiagnosticChangedEventArgs & {\n type: 'media';\n};\n\n/**\n * Payload for {@link DiagnosticChangedEventListner} where there is a change in a network diagnostic.\n *\n * @public\n */\nexport type NetworkDiagnosticChangedEvent = NetworkDiagnosticChangedEventArgs & {\n type: 'network';\n};\n\n/**\n * Callback for {@link CallAdapterSubscribers} 'diagnosticChanged' event.\n *\n * @public\n */\nexport type DiagnosticChangedEventListner = (\n event: MediaDiagnosticChangedEvent | NetworkDiagnosticChangedEvent\n) => void;\n\n/**\n * Functionality for managing the current call.\n *\n * @public\n */\nexport interface CallAdapterCallOperations {\n /**\n * Leave the call\n *\n * @param forEveryone - Whether to remove all participants when leaving\n *\n * @public\n */\n leaveCall(forEveryone?: boolean): Promise<void>;\n /**\n * Start the camera\n * This method will start rendering a local camera view when the call is not active\n *\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n startCamera(options?: VideoStreamOptions): Promise<void>;\n /**\n * Stop the camera\n * This method will stop rendering a local camera view when the call is not active\n *\n * @public\n */\n stopCamera(): Promise<void>;\n /**\n * Mute the current user during the call or disable microphone locally\n *\n * @public\n */\n mute(): Promise<void>;\n /**\n * Unmute the current user during the call or enable microphone locally\n *\n * @public\n */\n unmute(): Promise<void>;\n /**\n * Start sharing the screen during a call.\n *\n * @public\n */\n startScreenShare(): Promise<void>;\n /**\n * Stop sharing the screen\n *\n * @public\n */\n stopScreenShare(): Promise<void>;\n /**\n * Remove a participant from the call.\n *\n * @param userId - Id of the participant to be removed\n *\n * @public\n */\n removeParticipant(userId: string): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Remove a participant from the call.\n * @param participant - {@link @azure/communication-common#CommunicationIdentifier} of the participant to be removed\n * @beta\n */\n removeParticipant(participant: CommunicationIdentifier): Promise<void>;\n /**\n * Create the html view for a stream.\n *\n * @remarks\n * This method is implemented for composite\n *\n * @param remoteUserId - Id of the participant to render, leave it undefined to create the local camera view\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n createStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void | CreateVideoStreamViewResult>;\n /**\n * Dispose the html view for a stream.\n *\n * @remarks\n * This method is implemented for composite\n *\n * @param remoteUserId - Id of the participant to render, leave it undefined to dispose the local camera view\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n disposeStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Holds the call.\n *\n * @beta\n */\n holdCall(): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Resumes the call from a `LocalHold` state.\n *\n * @beta\n */\n resumeCall(): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Add a participant to the call.\n *\n * @beta\n */\n addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n addParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * send dtmf tone to another participant in a 1:1 PSTN call\n *\n * @beta\n */\n sendDtmfTone(dtmfTone: DtmfTone): Promise<void>;\n}\n\n/**\n * Functionality for managing devices within a call.\n *\n * @public\n */\nexport interface CallAdapterDeviceManagement {\n /**\n * Ask for permissions of devices.\n *\n * @remarks\n * Browser permission window will pop up if permissions are not granted yet\n *\n * @param constrain - Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }\n *\n * @public\n */\n askDevicePermission(constrain: PermissionConstraints): Promise<void>;\n /**\n * Query for available camera devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of video device information entities {@link @azure/communication-calling#VideoDeviceInfo }\n *\n * @public\n */\n queryCameras(): Promise<VideoDeviceInfo[]>;\n /**\n * Query for available microphone devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of audio device information entities {@link @azure/communication-calling#AudioDeviceInfo }\n *\n * @public\n */\n queryMicrophones(): Promise<AudioDeviceInfo[]>;\n /**\n * Query for available microphone devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of audio device information entities {@link @azure/communication-calling#AudioDeviceInfo }\n *\n * @public\n */\n querySpeakers(): Promise<AudioDeviceInfo[]>;\n /**\n * Set the camera to use in the call.\n *\n * @param sourceInfo - Camera device to choose, pick one returned by {@link CallAdapterDeviceManagement#queryCameras }\n * @param options - Options to control how the camera stream is rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n setCamera(sourceInfo: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void>;\n /**\n * Set the microphone to use in the call.\n *\n * @param sourceInfo - Microphone device to choose, pick one returned by {@link CallAdapterDeviceManagement#queryMicrophones }\n *\n * @public\n */\n setMicrophone(sourceInfo: AudioDeviceInfo): Promise<void>;\n /**\n * Set the speaker to use in the call.\n *\n * @param sourceInfo - Speaker device to choose, pick one returned by {@link CallAdapterDeviceManagement#querySpeakers }\n *\n * @public\n */\n setSpeaker(sourceInfo: AudioDeviceInfo): Promise<void>;\n}\n\n/**\n * Call composite events that can be subscribed to.\n *\n * @public\n */\nexport interface CallAdapterSubscribers {\n /**\n * Subscribe function for 'participantsJoined' event.\n */\n on(event: 'participantsJoined', listener: ParticipantsJoinedListener): void;\n /**\n * Subscribe function for 'participantsLeft' event.\n */\n on(event: 'participantsLeft', listener: ParticipantsLeftListener): void;\n /**\n * Subscribe function for 'isMutedChanged' event.\n *\n * @remarks\n * The event will be triggered whenever current user or remote user mute state changed\n *\n */\n on(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n /**\n * Subscribe function for 'callIdChanged' event.\n *\n * @remarks\n * The event will be triggered when callId of current user changed.\n *\n */\n on(event: 'callIdChanged', listener: CallIdChangedListener): void;\n /**\n * Subscribe function for 'isLocalScreenSharingActiveChanged' event.\n */\n on(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n /**\n * Subscribe function for 'displayNameChanged' event.\n */\n on(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n /**\n * Subscribe function for 'isSpeakingChanged' event.\n */\n on(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n /**\n * Subscribe function for 'callEnded' event.\n */\n on(event: 'callEnded', listener: CallEndedListener): void;\n /**\n * Subscribe function for 'diagnosticChanged' event.\n *\n * This event fires whenever there is a change in user facing diagnostics about the ongoing call.\n */\n on(event: 'diagnosticChanged', listener: DiagnosticChangedEventListner): void;\n /**\n * Subscribe function for 'selectedMicrophoneChanged' event.\n *\n * This event fires whenever the user selects a new microphone device.\n */\n on(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n /**\n * Subscribe function for 'selectedSpeakerChanged' event.\n *\n * This event fires whenever the user selects a new speaker device.\n */\n on(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n /**\n * Subscribe function for 'error' event.\n */\n on(event: 'error', listener: (e: AdapterError) => void): void;\n\n /**\n * Unsubscribe function for 'participantsJoined' event.\n */\n off(event: 'participantsJoined', listener: ParticipantsJoinedListener): void;\n /**\n * Unsubscribe function for 'participantsLeft' event.\n */\n off(event: 'participantsLeft', listener: ParticipantsLeftListener): void;\n /**\n * Unsubscribe function for 'isMutedChanged' event.\n */\n off(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n /**\n * Unsubscribe function for 'callIdChanged' event.\n */\n off(event: 'callIdChanged', listener: CallIdChangedListener): void;\n /**\n * Unsubscribe function for 'isLocalScreenSharingActiveChanged' event.\n */\n off(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n /**\n * Unsubscribe function for 'displayNameChanged' event.\n */\n off(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n /**\n * Unsubscribe function for 'isSpeakingChanged' event.\n */\n off(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n /**\n * Unsubscribe function for 'callEnded' event.\n */\n off(event: 'callEnded', listener: CallEndedListener): void;\n /**\n * Unsubscribe function for 'diagnosticChanged' event.\n */\n off(event: 'diagnosticChanged', listener: DiagnosticChangedEventListner): void;\n /**\n * Unsubscribe function for 'selectedMicrophoneChanged' event.\n */\n off(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n /**\n * Unsubscribe function for 'selectedSpeakerChanged' event.\n */\n off(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n /**\n * Unsubscribe function for 'error' event.\n */\n off(event: 'error', listener: (e: AdapterError) => void): void;\n}\n\n// This type remains for non-breaking change reason\n/**\n * Functionality for managing the current call or start a new call\n * @deprecated CallAdapter interface will be flatten, consider using CallAdapter directly\n * @public\n */\nexport interface CallAdapterCallManagement extends CallAdapterCallOperations {\n /**\n * Join the call with microphone initially on/off.\n *\n * @param microphoneOn - Whether microphone is initially enabled\n *\n * @public\n */\n joinCall(microphoneOn?: boolean): Call | undefined;\n /**\n * Start the call.\n *\n * @param participants - An array of participant ids to join\n *\n * @public\n */\n startCall(participants: string[], options?: StartCallOptions): Call | undefined;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Start the call.\n * @param participants - An array of {@link @azure/communication-common#CommunicationIdentifier} to be called\n * @beta\n */\n startCall(participants: CommunicationIdentifier[], options?: StartCallOptions): Call | undefined;\n}\n\n// TODO: Flatten the adapter structure\n/**\n * {@link CallComposite} Adapter interface.\n *\n * @public\n */\nexport interface CommonCallAdapter\n extends AdapterState<CallAdapterState>,\n Disposable,\n CallAdapterCallOperations,\n CallAdapterDeviceManagement,\n CallAdapterSubscribers {\n /**\n * Join the call with microphone initially on/off.\n *\n * @param microphoneOn - Whether microphone is initially enabled\n *\n * @public\n */\n joinCall(microphoneOn?: boolean): void;\n /**\n * Start the call.\n *\n * @param participants - An array of participant ids to join\n *\n * @public\n */\n startCall(participants: string[], options?: StartCallOptions): void;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Start the call.\n * @param participants - An array of {@link @azure/communication-common#CommunicationIdentifier} to be called\n * @beta\n */\n startCall(participants: CommunicationIdentifier[], options?: StartCallOptions): void;\n}\n\n/**\n * An Adapter interface specific for Azure Communication identity which extends {@link CommonCallAdapter}.\n *\n * @public\n */\nexport interface CallAdapter extends CommonCallAdapter {\n /**\n * Join the call with microphone initially on/off.\n *\n * @param microphoneOn - Whether microphone is initially enabled\n *\n * @public\n */\n joinCall(microphoneOn?: boolean): Call | undefined;\n /**\n * Start the call.\n *\n * @param participants - An array of participant ids to join\n *\n * @public\n */\n startCall(participants: string[], options?: StartCallOptions): Call | undefined;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Start the call.\n * @param participants - An array of {@link @azure/communication-common#CommunicationIdentifier} to be called\n * @beta\n */\n startCall(participants: CommunicationIdentifier[], options?: StartCallOptions): Call | undefined;\n}\n\n/* @conditional-compile-remove(teams-identity-support) */\n/**\n * An Adapter interface specific for Teams identity which extends {@link CommonCallAdapter}.\n *\n * @beta\n */\nexport interface TeamsCallAdapter extends CommonCallAdapter {\n /**\n * Join the call with microphone initially on/off.\n *\n * @param microphoneOn - Whether microphone is initially enabled\n *\n * @beta\n */\n joinCall(microphoneOn?: boolean): TeamsCall | undefined;\n /**\n * Start the call.\n *\n * @param participants - An array of participant ids to join\n *\n * @beta\n */\n startCall(participants: string[], options?: StartCallOptions): TeamsCall | undefined;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Start the call.\n * @param participants - An array of {@link @azure/communication-common#CommunicationIdentifier} to be called\n * @beta\n */\n startCall(participants: CommunicationIdentifier[], options?: StartCallOptions): TeamsCall | undefined;\n}\n\"../../../../../calling-stateful-client/src\"\"../../../../../react-components/src\""]}
|
package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapterProvider.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import React from 'react';
|
2
|
-
import {
|
2
|
+
import { CommonCallAdapter } from './CallAdapter';
|
3
3
|
declare type CallProviderProps = {
|
4
4
|
children: React.ReactNode;
|
5
|
-
adapter:
|
5
|
+
adapter: CommonCallAdapter;
|
6
6
|
};
|
7
7
|
/**
|
8
8
|
* @private
|
@@ -11,6 +11,6 @@ export declare const CallAdapterProvider: (props: CallProviderProps) => JSX.Elem
|
|
11
11
|
/**
|
12
12
|
* @private
|
13
13
|
*/
|
14
|
-
export declare const useAdapter: () =>
|
14
|
+
export declare const useAdapter: () => CommonCallAdapter;
|
15
15
|
export {};
|
16
16
|
//# sourceMappingURL=CallAdapterProvider.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CallAdapterProvider.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/CallAdapterProvider.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAQzD,MAAM,kBAAkB,GAAG,aAAa,
|
1
|
+
{"version":3,"file":"CallAdapterProvider.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/CallAdapterProvider.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAQzD,MAAM,kBAAkB,GAAG,aAAa,CAAgC,SAAS,CAAC,CAAC;AAEnF;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAwB,EAAe,EAAE;IAC3E,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC1B,OAAO,oBAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,IAAG,KAAK,CAAC,QAAQ,CAA+B,CAAC;AACrG,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,GAAsB,EAAE;IAChD,MAAM,OAAO,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAC/C,IAAI,CAAC,OAAO,EAAE;QACZ,MAAM,qDAAqD,CAAC;KAC7D;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { createContext, useContext } from 'react';\nimport { CommonCallAdapter } from './CallAdapter';\n\ntype CallProviderProps = {\n children: React.ReactNode;\n adapter: CommonCallAdapter;\n};\n\nconst CallAdapterContext = createContext<CommonCallAdapter | undefined>(undefined);\n\n/**\n * @private\n */\nexport const CallAdapterProvider = (props: CallProviderProps): JSX.Element => {\n const { adapter } = props;\n return <CallAdapterContext.Provider value={adapter}>{props.children}</CallAdapterContext.Provider>;\n};\n\n/**\n * @private\n */\nexport const useAdapter = (): CommonCallAdapter => {\n const adapter = useContext(CallAdapterContext);\n if (!adapter) {\n throw 'Cannot find adapter please initialize before usage.';\n }\n return adapter;\n};\n"]}
|
@@ -1,5 +1,5 @@
|
|
1
1
|
/// <reference types="node" />
|
2
|
-
import {
|
2
|
+
import { CallCommon } from "../../../../../calling-stateful-client/src";
|
3
3
|
import { EventEmitter } from 'events';
|
4
4
|
/**
|
5
5
|
* @private
|
@@ -7,7 +7,7 @@ import { EventEmitter } from 'events';
|
|
7
7
|
export declare class DiagnosticsForwarder {
|
8
8
|
private _diagnostics;
|
9
9
|
private _emitter;
|
10
|
-
constructor(emitter: EventEmitter, call:
|
10
|
+
constructor(emitter: EventEmitter, call: CallCommon);
|
11
11
|
unsubscribe: () => void;
|
12
12
|
private subscribe;
|
13
13
|
private networkDiagnosticsChanged;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"DiagnosticsForwarder.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/DiagnosticsForwarder.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,
|
1
|
+
{"version":3,"file":"DiagnosticsForwarder.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/DiagnosticsForwarder.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAEL,QAAQ,EAGT,MAAM,8BAA8B,CAAC;AAKtC;;GAEG;AACH,MAAM,OAAO,oBAAoB;IAI/B,YAAY,OAAqB,EAAE,IAAgB;QAM5C,gBAAW,GAAG,GAAS,EAAE;YAC9B,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;YAC9F,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5F,CAAC,CAAC;QARA,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;QACjE,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;QACxB,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAOO,SAAS;QACf,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,EAAE,CAAC,mBAAmB,EAAE,IAAI,CAAC,yBAAyB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAC7F,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC,mBAAmB,EAAE,IAAI,CAAC,uBAAuB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3F,CAAC;IAEO,yBAAyB,CAAC,IAAuC;QACvE,MAAM,KAAK,mBACT,IAAI,EAAE,SAAS,IACZ,IAAI,CACR,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;IAEO,uBAAuB,CAAC,IAAqC;QACnE,MAAM,KAAK,mBACT,IAAI,EAAE,OAAO,IACV,IAAI,CACR,CAAC;QACF,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,mBAAmB,EAAE,KAAK,CAAC,CAAC;IACjD,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n UserFacingDiagnosticsFeature,\n Features,\n MediaDiagnosticChangedEventArgs,\n NetworkDiagnosticChangedEventArgs\n} from '@azure/communication-calling';\nimport { CallCommon } from '@internal/calling-stateful-client';\nimport { EventEmitter } from 'events';\nimport { MediaDiagnosticChangedEvent, NetworkDiagnosticChangedEvent } from './CallAdapter';\n\n/**\n * @private\n */\nexport class DiagnosticsForwarder {\n private _diagnostics: UserFacingDiagnosticsFeature;\n private _emitter: EventEmitter;\n\n constructor(emitter: EventEmitter, call: CallCommon) {\n this._diagnostics = call.feature(Features.UserFacingDiagnostics);\n this._emitter = emitter;\n this.subscribe();\n }\n\n public unsubscribe = (): void => {\n this._diagnostics.network.off('diagnosticChanged', this.networkDiagnosticsChanged.bind(this));\n this._diagnostics.media.off('diagnosticChanged', this.mediaDiagnosticsChanged.bind(this));\n };\n\n private subscribe(): void {\n this._diagnostics.network.on('diagnosticChanged', this.networkDiagnosticsChanged.bind(this));\n this._diagnostics.media.on('diagnosticChanged', this.mediaDiagnosticsChanged.bind(this));\n }\n\n private networkDiagnosticsChanged(args: NetworkDiagnosticChangedEventArgs): void {\n const event: NetworkDiagnosticChangedEvent = {\n type: 'network',\n ...args\n };\n this._emitter.emit('diagnosticChanged', event);\n }\n\n private mediaDiagnosticsChanged(args: MediaDiagnosticChangedEventArgs): void {\n const event: MediaDiagnosticChangedEvent = {\n type: 'media',\n ...args\n };\n this._emitter.emit('diagnosticChanged', event);\n }\n}\n\"../../../../../calling-stateful-client/src\""]}
|
package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.d.ts
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
import { CallAgent } from '@azure/communication-calling';
|
2
|
+
import { CallingHandlers } from "../../../../../calling-component-bindings/src";
|
3
|
+
import { TeamsCallingHandlers } from "../../../../../calling-component-bindings/src";
|
4
|
+
import { CallCommon, StatefulCallClient, StatefulDeviceManager, TeamsCallAgent } from "../../../../../calling-stateful-client/src";
|
5
|
+
/**
|
6
|
+
* @private
|
7
|
+
*/
|
8
|
+
export declare type CallHandlersOf<AgentType extends CallAgent | TeamsCallAgent> = AgentType extends CallAgent ? CallingHandlers : never | /* @conditional-compile-remove(teams-identity-support) */ TeamsCallingHandlers;
|
9
|
+
/**
|
10
|
+
* @private
|
11
|
+
*
|
12
|
+
* This is used to create correct handler for generic agent type
|
13
|
+
*/
|
14
|
+
export declare const createHandlers: <AgentType extends CallAgent | import("@azure/communication-calling").TeamsCallAgent>(callClient: StatefulCallClient, callAgent: AgentType, deviceManager: StatefulDeviceManager | undefined, call: CallCommon | undefined) => CallHandlersOf<AgentType>;
|
15
|
+
//# sourceMappingURL=createHandlers.d.ts.map
|
@@ -0,0 +1,23 @@
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
2
|
+
// Licensed under the MIT license.
|
3
|
+
import { createDefaultCallingHandlers } from "../../../../../calling-component-bindings/src";
|
4
|
+
/* @conditional-compile-remove(teams-identity-support)) */
|
5
|
+
import { createDefaultTeamsCallingHandlers } from "../../../../../calling-component-bindings/src";
|
6
|
+
import { _isACSCall, _isACSCallAgent, _isTeamsCall, _isTeamsCallAgent } from "../../../../../calling-stateful-client/src";
|
7
|
+
/**
|
8
|
+
* @private
|
9
|
+
*
|
10
|
+
* This is used to create correct handler for generic agent type
|
11
|
+
*/
|
12
|
+
export const createHandlers = (callClient, callAgent, deviceManager, call) => {
|
13
|
+
// Call can be either undefined or ACS Call
|
14
|
+
if (_isACSCallAgent(callAgent) && (!call || (call && _isACSCall(call)))) {
|
15
|
+
return createDefaultCallingHandlers(callClient, callAgent, deviceManager, call);
|
16
|
+
}
|
17
|
+
/* @conditional-compile-remove(teams-identity-support) */
|
18
|
+
if (_isTeamsCallAgent(callAgent) && (!call || (call && _isTeamsCall(call)))) {
|
19
|
+
return createDefaultTeamsCallingHandlers(callClient, callAgent, deviceManager, call);
|
20
|
+
}
|
21
|
+
throw new Error('Unhandled agent type');
|
22
|
+
};
|
23
|
+
//# sourceMappingURL=createHandlers.js.map
|
package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"createHandlers.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/createHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAmB,4BAA4B,EAAE,sDAA6C;AACrG,0DAA0D;AAC1D,OAAO,EAAE,iCAAiC,EAAwB,sDAA6C;AAC/G,OAAO,EAKL,UAAU,EACV,eAAe,EACf,YAAY,EACZ,iBAAiB,EAClB,mDAA0C;AAS3C;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,UAA8B,EAC9B,SAAoB,EACpB,aAAgD,EAChD,IAA4B,EACD,EAAE;IAC7B,2CAA2C;IAC3C,IAAI,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;QACvE,OAAO,4BAA4B,CAAC,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,IAAI,CAA8B,CAAC;KAC9G;IAED,yDAAyD;IACzD,IAAI,iBAAiB,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE;QAC3E,OAAO,iCAAiC,CAAC,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,IAAI,CAA8B,CAAC;KACnH;IACD,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;AAC1C,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CallAgent } from '@azure/communication-calling';\nimport { CallingHandlers, createDefaultCallingHandlers } from '@internal/calling-component-bindings';\n/* @conditional-compile-remove(teams-identity-support)) */\nimport { createDefaultTeamsCallingHandlers, TeamsCallingHandlers } from '@internal/calling-component-bindings';\nimport {\n CallCommon,\n StatefulCallClient,\n StatefulDeviceManager,\n TeamsCallAgent,\n _isACSCall,\n _isACSCallAgent,\n _isTeamsCall,\n _isTeamsCallAgent\n} from '@internal/calling-stateful-client';\n\n/**\n * @private\n */\nexport type CallHandlersOf<AgentType extends CallAgent | TeamsCallAgent> = AgentType extends CallAgent\n ? CallingHandlers\n : never | /* @conditional-compile-remove(teams-identity-support) */ TeamsCallingHandlers;\n\n/**\n * @private\n *\n * This is used to create correct handler for generic agent type\n */\nexport const createHandlers = <AgentType extends CallAgent | TeamsCallAgent>(\n callClient: StatefulCallClient,\n callAgent: AgentType,\n deviceManager: StatefulDeviceManager | undefined,\n call: CallCommon | undefined\n): CallHandlersOf<AgentType> => {\n // Call can be either undefined or ACS Call\n if (_isACSCallAgent(callAgent) && (!call || (call && _isACSCall(call)))) {\n return createDefaultCallingHandlers(callClient, callAgent, deviceManager, call) as CallHandlersOf<AgentType>;\n }\n\n /* @conditional-compile-remove(teams-identity-support) */\n if (_isTeamsCallAgent(callAgent) && (!call || (call && _isTeamsCall(call)))) {\n return createDefaultTeamsCallingHandlers(callClient, callAgent, deviceManager, call) as CallHandlersOf<AgentType>;\n }\n throw new Error('Unhandled agent type');\n};\n\"../../../../../calling-component-bindings/src\"\"../../../../../calling-stateful-client/src\""]}
|
@@ -1,6 +1,9 @@
|
|
1
1
|
export { createAzureCommunicationCallAdapter, createAzureCommunicationCallAdapterFromClient, useAzureCommunicationCallAdapter } from './AzureCommunicationCallAdapter';
|
2
|
+
export { createAzureCommunicationTeamsCallAdapter, createAzureCommunicationTeamsCallAdapterFromClient, useAzureCommunicationTeamsCallAdapter } from './AzureCommunicationCallAdapter';
|
2
3
|
export type { AzureCommunicationCallAdapterArgs, CallAdapterLocator } from './AzureCommunicationCallAdapter';
|
3
4
|
export type { AzureCommunicationCallAdapterOptions } from './AzureCommunicationCallAdapter';
|
4
5
|
export type { CallParticipantsLocator } from './AzureCommunicationCallAdapter';
|
5
|
-
export type {
|
6
|
+
export type { CallAdapterOptionalFeatures } from './CallAdapter';
|
7
|
+
export type { CallAdapter, CommonCallAdapter, CallAdapterCallEndedEvent, CallAdapterCallManagement, CallAdapterCallOperations, CallAdapterClientState, CallAdapterDeviceManagement, CallAdapterState, CallAdapterSubscribers, CallAdapterUiState, CallCompositePage, CallEndedListener, CallIdChangedListener, DiagnosticChangedEventListner, DisplayNameChangedListener, IsLocalScreenSharingActiveChangedListener, IsMutedChangedListener, IsSpeakingChangedListener, MediaDiagnosticChangedEvent, NetworkDiagnosticChangedEvent, ParticipantsJoinedListener, ParticipantsLeftListener } from './CallAdapter';
|
8
|
+
export type { TeamsCallAdapter } from './CallAdapter';
|
6
9
|
//# sourceMappingURL=index.d.ts.map
|
@@ -1,4 +1,6 @@
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
2
2
|
// Licensed under the MIT license.
|
3
3
|
export { createAzureCommunicationCallAdapter, createAzureCommunicationCallAdapterFromClient, useAzureCommunicationCallAdapter } from './AzureCommunicationCallAdapter';
|
4
|
+
/* @conditional-compile-remove(teams-identity-support) */
|
5
|
+
export { createAzureCommunicationTeamsCallAdapter, createAzureCommunicationTeamsCallAdapterFromClient, useAzureCommunicationTeamsCallAdapter } from './AzureCommunicationCallAdapter';
|
4
6
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,mCAAmC,EACnC,6CAA6C,EAC7C,gCAAgC,EACjC,MAAM,iCAAiC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport {\n createAzureCommunicationCallAdapter,\n createAzureCommunicationCallAdapterFromClient,\n useAzureCommunicationCallAdapter\n} from './AzureCommunicationCallAdapter';\nexport type { AzureCommunicationCallAdapterArgs, CallAdapterLocator } from './AzureCommunicationCallAdapter';\n/* @conditional-compile-remove(rooms) */\nexport type { AzureCommunicationCallAdapterOptions } from './AzureCommunicationCallAdapter';\n\n/* @conditional-compile-remove(teams-adhoc-call) */\nexport type { CallParticipantsLocator } from './AzureCommunicationCallAdapter';\n\nexport type {\n CallAdapter,\n CallAdapterCallEndedEvent,\n CallAdapterCallManagement,\n CallAdapterClientState,\n CallAdapterDeviceManagement,\n CallAdapterState,\n CallAdapterSubscribers,\n CallAdapterUiState,\n CallCompositePage,\n CallEndedListener,\n CallIdChangedListener,\n DiagnosticChangedEventListner,\n DisplayNameChangedListener,\n IsLocalScreenSharingActiveChangedListener,\n IsMutedChangedListener,\n IsSpeakingChangedListener,\n MediaDiagnosticChangedEvent,\n NetworkDiagnosticChangedEvent,\n ParticipantsJoinedListener,\n ParticipantsLeftListener\n} from './CallAdapter';\n"]}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/adapter/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,mCAAmC,EACnC,6CAA6C,EAC7C,gCAAgC,EACjC,MAAM,iCAAiC,CAAC;AAEzC,yDAAyD;AACzD,OAAO,EACL,wCAAwC,EACxC,kDAAkD,EAClD,qCAAqC,EACtC,MAAM,iCAAiC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nexport {\n createAzureCommunicationCallAdapter,\n createAzureCommunicationCallAdapterFromClient,\n useAzureCommunicationCallAdapter\n} from './AzureCommunicationCallAdapter';\n\n/* @conditional-compile-remove(teams-identity-support) */\nexport {\n createAzureCommunicationTeamsCallAdapter,\n createAzureCommunicationTeamsCallAdapterFromClient,\n useAzureCommunicationTeamsCallAdapter\n} from './AzureCommunicationCallAdapter';\nexport type { AzureCommunicationCallAdapterArgs, CallAdapterLocator } from './AzureCommunicationCallAdapter';\n/* @conditional-compile-remove(rooms) */\nexport type { AzureCommunicationCallAdapterOptions } from './AzureCommunicationCallAdapter';\n\n/* @conditional-compile-remove(teams-adhoc-call) */\nexport type { CallParticipantsLocator } from './AzureCommunicationCallAdapter';\n\nexport type { CallAdapterOptionalFeatures } from './CallAdapter';\n\nexport type {\n CallAdapter,\n CommonCallAdapter,\n CallAdapterCallEndedEvent,\n CallAdapterCallManagement,\n CallAdapterCallOperations,\n CallAdapterClientState,\n CallAdapterDeviceManagement,\n CallAdapterState,\n CallAdapterSubscribers,\n CallAdapterUiState,\n CallCompositePage,\n CallEndedListener,\n CallIdChangedListener,\n DiagnosticChangedEventListner,\n DisplayNameChangedListener,\n IsLocalScreenSharingActiveChangedListener,\n IsMutedChangedListener,\n IsSpeakingChangedListener,\n MediaDiagnosticChangedEvent,\n NetworkDiagnosticChangedEvent,\n ParticipantsJoinedListener,\n ParticipantsLeftListener\n} from './CallAdapter';\n\n/* @conditional-compile-remove(teams-identity-support) */\nexport type { TeamsCallAdapter } from './CallAdapter';\n"]}
|
package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallPane.d.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/// <reference types="react" />
|
2
2
|
import { ParticipantMenuItemsCallback } from "../../../../../react-components/src";
|
3
|
-
import {
|
3
|
+
import { CommonCallAdapter, CallControlOptions } from '../';
|
4
4
|
import { AvatarPersonaDataCallback } from '../../common/AvatarPersona';
|
5
5
|
import { CallSidePaneOption } from '../hooks/useSidePaneState';
|
6
6
|
/**
|
@@ -9,7 +9,7 @@ import { CallSidePaneOption } from '../hooks/useSidePaneState';
|
|
9
9
|
*/
|
10
10
|
/** @beta */
|
11
11
|
export declare const CallPane: (props: {
|
12
|
-
callAdapter:
|
12
|
+
callAdapter: CommonCallAdapter;
|
13
13
|
onClose: () => void;
|
14
14
|
onFetchAvatarPersonaData?: AvatarPersonaDataCallback;
|
15
15
|
onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;
|
package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallPane.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"CallPane.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/components/CallPane.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EACL,WAAW,EAKX,QAAQ,EACT,4CAAmC;AACpC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,EACL,iBAAiB,EACjB,mBAAmB,EACnB,2BAA2B,EAC5B,MAAM,iDAAiD,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,qCAAqC,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,gCAA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AAC,WAAW,IAAC,cAAc,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,eAAe,GAAI,CAC/E,CACT,CACK,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { Stack } from '@fluentui/react';\nimport {\n _DrawerMenu,\n _DrawerMenuItemProps,\n _useContainerHeight,\n _useContainerWidth,\n ParticipantMenuItemsCallback,\n useTheme\n} from '@internal/react-components';\nimport React, { useMemo, useState } from 'react';\nimport { CallAdapter, CallControlOptions } from '../';\nimport { CallAdapterProvider } from '../adapter/CallAdapterProvider';\nimport { AvatarPersonaDataCallback } from '../../common/AvatarPersona';\nimport {\n paneBodyContainer,\n scrollableContainer,\n scrollableContainerContents\n} from '../../common/styles/ParticipantContainer.styles';\nimport { SidePaneHeader } from '../../common/SidePaneHeader';\nimport { ModalLocalAndRemotePIP } from '../../common/ModalLocalAndRemotePIP';\nimport { PeoplePaneContent } from '../../common/PeoplePaneContent';\nimport { drawerContainerStyles } from '../styles/CallComposite.styles';\nimport { TabHeader } from '../../common/TabHeader';\nimport { _ICoordinates } from '@internal/react-components';\nimport { _pxToRem } from '@internal/acs-ui-common';\nimport { useLocale } from '../../localization';\nimport { getPipStyles } from '../../common/styles/ModalLocalAndRemotePIP.styles';\nimport { useMinMaxDragPosition } from '../../common/utils';\nimport { availableSpaceStyles, hiddenStyles, sidePaneStyles, sidePaneTokens } from '../../common/styles/Pane.styles';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { PhoneNumberIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { useAdapter } from '../adapter/CallAdapterProvider';\nimport { isDisabled } from '../utils';\nimport { CallSidePaneOption } from '../hooks/useSidePaneState';\n\n/**\n * Pane that is used to store participants for Call composite\n * @private\n */\n/** @beta */\nexport const CallPane = (props: {\n callAdapter: CallAdapter;\n onClose: () => void;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n onPeopleButtonClicked?: () => void;\n modalLayerHostId: string;\n activePane: CallSidePaneOption;\n mobileView?: boolean;\n inviteLink?: string;\n rtl?: boolean;\n callControls?: CallControlOptions;\n}): JSX.Element => {\n const [drawerMenuItems, setDrawerMenuItems] = useState<_DrawerMenuItemProps[]>([]);\n\n const paneStyles = !props.activePane ? hiddenStyles : props.mobileView ? availableSpaceStyles : sidePaneStyles;\n const localeStrings = useLocale();\n\n // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n const getStrings = () => {\n /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */\n return localeStrings.strings.call;\n\n return localeStrings.strings.callWithChat;\n };\n\n const strings = getStrings();\n const theme = useTheme();\n\n const header = !props.activePane ? null : props.mobileView ? (\n <TabHeader\n {...props}\n strings={strings}\n activeTab={props.activePane}\n disablePeopleButton={isDisabled(props.callControls?.participantsButton)}\n />\n ) : (\n <SidePaneHeader\n {...props}\n strings={strings}\n headingText={props.activePane === 'people' ? strings.peoplePaneTitle : ''}\n />\n );\n\n /**\n * In a Call Composite when a participant is removed, we must remove them from the call.\n */\n const removeParticipantFromCall = async (participantId: string): Promise<void> => {\n await props.callAdapter.removeParticipant(participantId);\n };\n\n /* @conditional-compile-remove(PSTN-calls) */\n const addParticipantToCall = async (\n participant: PhoneNumberIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> => {\n await props.callAdapter.addParticipant(participant, options);\n };\n\n const minMaxDragPosition = useMinMaxDragPosition(props.modalLayerHostId, props.rtl);\n\n const pipStyles = useMemo(() => getPipStyles(theme), [theme]);\n\n const dataUiId = props.activePane === 'people' ? 'call-composite-people-pane' : '';\n\n /* @conditional-compile-remove(PSTN-calls) */\n const alternateCallerId = useAdapter().getState().alternateCallerId;\n\n return (\n <Stack verticalFill grow styles={paneStyles} data-ui-id={dataUiId} tokens={props.mobileView ? {} : sidePaneTokens}>\n {header}\n <Stack.Item verticalFill grow styles={paneBodyContainer}>\n <Stack horizontal styles={scrollableContainer}>\n <Stack.Item verticalFill styles={scrollableContainerContents}>\n <Stack styles={props.activePane === 'people' ? availableSpaceStyles : hiddenStyles}>\n <CallAdapterProvider adapter={props.callAdapter}>\n <PeoplePaneContent\n active={props.activePane === 'people'}\n {...props}\n onRemoveParticipant={removeParticipantFromCall}\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant={addParticipantToCall}\n setDrawerMenuItems={setDrawerMenuItems}\n strings={strings}\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId={alternateCallerId}\n />\n </CallAdapterProvider>\n </Stack>\n </Stack.Item>\n </Stack>\n </Stack.Item>\n {props.mobileView && (\n <CallAdapterProvider adapter={props.callAdapter}>\n <ModalLocalAndRemotePIP\n modalLayerHostId={props.modalLayerHostId}\n hidden={!props.activePane}\n styles={pipStyles}\n minDragPosition={minMaxDragPosition.minDragPosition}\n maxDragPosition={minMaxDragPosition.maxDragPosition}\n />\n </CallAdapterProvider>\n )}\n {drawerMenuItems.length > 0 && (\n <Stack styles={drawerContainerStyles()}>\n <_DrawerMenu onLightDismiss={() => setDrawerMenuItems([])} items={drawerMenuItems} />\n </Stack>\n )}\n </Stack>\n );\n};\n\"../../../../../react-components/src\"\"../../../../../acs-ui-common/src\""]}
|
1
|
+
{"version":3,"file":"CallPane.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/components/CallPane.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EACL,WAAW,EAKX,QAAQ,EACT,4CAAmC;AACpC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,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gBAAgB,EACxC,MAAM,EAAE,CAAC,KAAK,CAAC,UAAU,EACzB,MAAM,EAAE,SAAS,EACjB,eAAe,EAAE,kBAAkB,CAAC,eAAe,EACnD,eAAe,EAAE,kBAAkB,CAAC,eAAe,GACnD,CACkB,CACvB;QACA,eAAe,CAAC,MAAM,GAAG,CAAC,IAAI,CAC7B,oBAAC,KAAK,IAAC,MAAM,EAAE,qBAAqB,EAAE;YACpC,oBAAC,WAAW,IAAC,cAAc,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,eAAe,GAAI,CAC/E,CACT,CACK,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { Stack } from '@fluentui/react';\nimport {\n _DrawerMenu,\n _DrawerMenuItemProps,\n _useContainerHeight,\n _useContainerWidth,\n ParticipantMenuItemsCallback,\n useTheme\n} from '@internal/react-components';\nimport React, { useMemo, useState } from 'react';\nimport { CommonCallAdapter, CallControlOptions } from '../';\nimport { CallAdapterProvider } from '../adapter/CallAdapterProvider';\nimport { AvatarPersonaDataCallback } from '../../common/AvatarPersona';\nimport {\n paneBodyContainer,\n scrollableContainer,\n scrollableContainerContents\n} from '../../common/styles/ParticipantContainer.styles';\nimport { SidePaneHeader } from '../../common/SidePaneHeader';\nimport { ModalLocalAndRemotePIP } from '../../common/ModalLocalAndRemotePIP';\nimport { PeoplePaneContent } from '../../common/PeoplePaneContent';\nimport { drawerContainerStyles } from '../styles/CallComposite.styles';\nimport { TabHeader } from '../../common/TabHeader';\nimport { _ICoordinates } from '@internal/react-components';\nimport { _pxToRem } from '@internal/acs-ui-common';\nimport { useLocale } from '../../localization';\nimport { getPipStyles } from '../../common/styles/ModalLocalAndRemotePIP.styles';\nimport { useMinMaxDragPosition } from '../../common/utils';\nimport { availableSpaceStyles, hiddenStyles, sidePaneStyles, sidePaneTokens } from '../../common/styles/Pane.styles';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { PhoneNumberIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { useAdapter } from '../adapter/CallAdapterProvider';\nimport { isDisabled } from '../utils';\nimport { CallSidePaneOption } from '../hooks/useSidePaneState';\n\n/**\n * Pane that is used to store participants for Call composite\n * @private\n */\n/** @beta */\nexport const CallPane = (props: {\n callAdapter: CommonCallAdapter;\n onClose: () => void;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n onPeopleButtonClicked?: () => void;\n modalLayerHostId: string;\n activePane: CallSidePaneOption;\n mobileView?: boolean;\n inviteLink?: string;\n rtl?: boolean;\n callControls?: CallControlOptions;\n}): JSX.Element => {\n const [drawerMenuItems, setDrawerMenuItems] = useState<_DrawerMenuItemProps[]>([]);\n\n const paneStyles = !props.activePane ? hiddenStyles : props.mobileView ? availableSpaceStyles : sidePaneStyles;\n const localeStrings = useLocale();\n\n // eslint-disable-next-line @typescript-eslint/explicit-function-return-type\n const getStrings = () => {\n /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */\n return localeStrings.strings.call;\n\n return localeStrings.strings.callWithChat;\n };\n\n const strings = getStrings();\n const theme = useTheme();\n\n const header = !props.activePane ? null : props.mobileView ? (\n <TabHeader\n {...props}\n strings={strings}\n activeTab={props.activePane}\n disablePeopleButton={isDisabled(props.callControls?.participantsButton)}\n />\n ) : (\n <SidePaneHeader\n {...props}\n strings={strings}\n headingText={props.activePane === 'people' ? strings.peoplePaneTitle : ''}\n />\n );\n\n /**\n * In a Call Composite when a participant is removed, we must remove them from the call.\n */\n const removeParticipantFromCall = async (participantId: string): Promise<void> => {\n await props.callAdapter.removeParticipant(participantId);\n };\n\n /* @conditional-compile-remove(PSTN-calls) */\n const addParticipantToCall = async (\n participant: PhoneNumberIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> => {\n await props.callAdapter.addParticipant(participant, options);\n };\n\n const minMaxDragPosition = useMinMaxDragPosition(props.modalLayerHostId, props.rtl);\n\n const pipStyles = useMemo(() => getPipStyles(theme), [theme]);\n\n const dataUiId = props.activePane === 'people' ? 'call-composite-people-pane' : '';\n\n /* @conditional-compile-remove(PSTN-calls) */\n const alternateCallerId = useAdapter().getState().alternateCallerId;\n\n return (\n <Stack verticalFill grow styles={paneStyles} data-ui-id={dataUiId} tokens={props.mobileView ? {} : sidePaneTokens}>\n {header}\n <Stack.Item verticalFill grow styles={paneBodyContainer}>\n <Stack horizontal styles={scrollableContainer}>\n <Stack.Item verticalFill styles={scrollableContainerContents}>\n <Stack styles={props.activePane === 'people' ? availableSpaceStyles : hiddenStyles}>\n <CallAdapterProvider adapter={props.callAdapter}>\n <PeoplePaneContent\n active={props.activePane === 'people'}\n {...props}\n onRemoveParticipant={removeParticipantFromCall}\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant={addParticipantToCall}\n setDrawerMenuItems={setDrawerMenuItems}\n strings={strings}\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId={alternateCallerId}\n />\n </CallAdapterProvider>\n </Stack>\n </Stack.Item>\n </Stack>\n </Stack.Item>\n {props.mobileView && (\n <CallAdapterProvider adapter={props.callAdapter}>\n <ModalLocalAndRemotePIP\n modalLayerHostId={props.modalLayerHostId}\n hidden={!props.activePane}\n styles={pipStyles}\n minDragPosition={minMaxDragPosition.minDragPosition}\n maxDragPosition={minMaxDragPosition.maxDragPosition}\n />\n </CallAdapterProvider>\n )}\n {drawerMenuItems.length > 0 && (\n <Stack styles={drawerContainerStyles()}>\n <_DrawerMenu onLightDismiss={() => setDrawerMenuItems([])} items={drawerMenuItems} />\n </Stack>\n )}\n </Stack>\n );\n};\n\"../../../../../react-components/src\"\"../../../../../acs-ui-common/src\""]}
|
@@ -1,8 +1,8 @@
|
|
1
|
-
import {
|
1
|
+
import { CommonCallingHandlers } from "../../../../../calling-component-bindings/src";
|
2
2
|
import { CommonProperties } from "../../../../../acs-ui-common/src";
|
3
3
|
import { ReactElement } from 'react';
|
4
4
|
/**
|
5
5
|
* @private
|
6
6
|
*/
|
7
|
-
export declare const useHandlers: <PropsT>(_component: (props: PropsT) => ReactElement | null) => Pick<
|
7
|
+
export declare const useHandlers: <PropsT>(_component: (props: PropsT) => ReactElement | null) => Pick<CommonCallingHandlers, CommonProperties<CommonCallingHandlers, PropsT>>;
|
8
8
|
//# sourceMappingURL=useHandlers.d.ts.map
|
package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"useHandlers.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/hooks/useHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAGlC,OAAO,EAAoB,6BAA6B,EAAE,yCAAgC;AAE1F,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAItC;;GAEG;AACH,+HAA+H;AAC/H,MAAM,CAAC,MAAM,WAAW,GAAG;AACzB,6DAA6D;AAC7D,UAAkD,
|
1
|
+
{"version":3,"file":"useHandlers.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallComposite/hooks/useHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAGlC,OAAO,EAAoB,6BAA6B,EAAE,yCAAgC;AAE1F,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC5D,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAItC;;GAEG;AACH,+HAA+H;AAC/H,MAAM,CAAC,MAAM,WAAW,G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CAAC,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC;IAC1F,CAAC,CAAA;IACD,mBAAmB,EAAE,GAAS,EAAE;;QAC9B,OAAO,CAAA,MAAA,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,0CAAE,iBAAiB;YAC/C,CAAC,CAAC,MAAM,OAAO,CAAC,eAAe,EAAE;YACjC,CAAC,CAAC,MAAM,OAAO,CAAC,gBAAgB,EAAE,CAAC;IACvC,CAAC,CAAA;IACD,iBAAiB,EAAE,GAAS,EAAE;QAC5B,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE;YAC3B,OAAO,OAAO,CAAC,WAAW,EAAE,CAAC;SAC9B;IACH,CAAC,CAAA;IACD,wBAAwB,EAAE,GAAS,EAAE;QACnC,OAAO,OAAO,CAAC,iBAAiB,EAAE,CAAC;IACrC,CAAC,CAAA;IACD,yBAAyB,EAAE,CAAO,MAAM,EAAE,EAAE;QAC1C,OAAO,OAAO,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC;IAC3C,CAAC,CAAA;IACD,iDAAiD;IACjD,mBAAmB,EAAE,CAAO,SAAS,EAAE,EAAE;QACvC,OAAO,OAAO,CAAC,mBAAmB,CAAC,SAAS,CAAC,CAAC;IAChD,CAAC,CAAA;CACF,CAAC,CACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CommonCallingHandlers } from '@internal/calling-component-bindings';\nimport { CommonProperties, toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ReactElement } from 'react';\nimport memoizeOne from 'memoize-one';\nimport { CommonCallAdapter } from '..';\nimport { useAdapter } from '../adapter/CallAdapterProvider';\nimport { isCameraOn } from '../utils';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { DtmfTone } from '@azure/communication-calling';\n\n/**\n * @private\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/explicit-function-return-type\nexport const useHandlers = <PropsT>(\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _component: (props: PropsT) => ReactElement | null\n): Pick<CommonCallingHandlers, CommonProperties<CommonCallingHandlers, PropsT>> => {\n return createCompositeHandlers(useAdapter());\n};\n\nconst createCompositeHandlers = memoizeOne(\n (adapter: CommonCallAdapter): CommonCallingHandlers => ({\n onCreateLocalStreamView: async (options) => {\n return await adapter.createStreamView(undefined, options);\n },\n onCreateRemoteStreamView: async (userId, options) => {\n return await adapter.createStreamView(userId, options);\n },\n onHangUp: async (forEveryone?: boolean) => {\n await adapter.leaveCall(forEveryone);\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onToggleHold: async () => {\n return adapter.getState().call?.state === 'LocalHold' ? await adapter.resumeCall() : await adapter.holdCall();\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant: async (participant, options?) => {\n return await adapter.addParticipant(participant, options);\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onSendDtmfTone: async (dtmfTone: DtmfTone) => {\n await adapter.sendDtmfTone(dtmfTone);\n },\n onRemoveParticipant: async (userId) => {\n await adapter.removeParticipant(userId);\n },\n onSelectCamera: async (deviceInfo, options) => {\n await adapter.setCamera(deviceInfo, options);\n },\n onSelectMicrophone: async (deviceInfo) => {\n await adapter.setMicrophone(deviceInfo);\n },\n onSelectSpeaker: async (deviceInfo) => {\n await adapter.setSpeaker(deviceInfo);\n },\n onStartCall: (participants, options?) => {\n const rawIds = participants.map((participant) => toFlatCommunicationIdentifier(participant));\n return adapter.startCall(rawIds, options);\n },\n onStartScreenShare: async () => {\n await adapter.startScreenShare();\n },\n onStopScreenShare: async () => {\n await adapter.stopScreenShare();\n },\n onToggleCamera: async (options) => {\n isCameraOn(adapter.getState()) ? await adapter.stopCamera() : await adapter.startCamera(options);\n },\n onToggleMicrophone: async () => {\n return adapter.getState().call?.isMuted ? await adapter.unmute() : await adapter.mute();\n },\n onToggleScreenShare: async () => {\n return adapter.getState().call?.isScreenSharingOn\n ? await adapter.stopScreenShare()\n : await adapter.startScreenShare();\n },\n onStartLocalVideo: async () => {\n if (adapter.getState().call) {\n return adapter.startCamera();\n }\n },\n onDisposeLocalStreamView: async () => {\n return adapter.disposeStreamView();\n },\n onDisposeRemoteStreamView: async (userId) => {\n return adapter.disposeStreamView(userId);\n },\n /* @conditional-compile-remove(call-readiness) */\n askDevicePermission: async (constrain) => {\n return adapter.askDevicePermission(constrain);\n }\n })\n);\n\"../../../../../calling-component-bindings/src\"\"../../../../../acs-ui-common/src\""]}
|
@@ -3,6 +3,13 @@ export type { CallCompositeOptions, CallCompositeProps } from './CallComposite';
|
|
3
3
|
export type { DevicePermissionRestrictions } from './CallComposite';
|
4
4
|
export type { CallControlDisplayType, CallControlOptions } from './types/CallControlOptions';
|
5
5
|
export type { CustomCallControlButtonPlacement, CustomCallControlButtonCallback, CustomCallControlButtonCallbackArgs, CustomCallControlButtonProps, CustomControlButtonProps } from './types/CallControlOptions';
|
6
|
-
export * from './adapter';
|
7
6
|
export * from './Strings';
|
7
|
+
export { createAzureCommunicationCallAdapter, createAzureCommunicationCallAdapterFromClient, useAzureCommunicationCallAdapter } from './adapter';
|
8
|
+
export { createAzureCommunicationTeamsCallAdapter, createAzureCommunicationTeamsCallAdapterFromClient, useAzureCommunicationTeamsCallAdapter } from './adapter';
|
9
|
+
export type { TeamsCallAdapter } from './adapter';
|
10
|
+
export type { AzureCommunicationCallAdapterArgs, CallAdapterLocator, CommonCallAdapter, CallAdapterCallOperations } from './adapter';
|
11
|
+
export type { AzureCommunicationCallAdapterOptions } from './adapter';
|
12
|
+
export type { CallParticipantsLocator } from './adapter';
|
13
|
+
export type { CallAdapterOptionalFeatures } from './adapter';
|
14
|
+
export type { CallAdapter, CallAdapterCallEndedEvent, CallAdapterCallManagement, CallAdapterClientState, CallAdapterDeviceManagement, CallAdapterState, CallAdapterSubscribers, CallAdapterUiState, CallCompositePage, CallEndedListener, CallIdChangedListener, DiagnosticChangedEventListner, DisplayNameChangedListener, IsLocalScreenSharingActiveChangedListener, IsMutedChangedListener, IsSpeakingChangedListener, MediaDiagnosticChangedEvent, NetworkDiagnosticChangedEvent, ParticipantsJoinedListener, ParticipantsLeftListener } from './adapter';
|
8
15
|
//# sourceMappingURL=index.d.ts.map
|