@azure/communication-react 1.13.0-alpha-202402040013 → 1.13.0-alpha-202402070012

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