@azure/communication-react 1.19.0-alpha-202407250014 → 1.19.0-alpha-202407270014

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 (150) hide show
  1. package/dist/communication-react.d.ts +203 -23
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-D4Pf_JpT.js → ChatMessageComponentAsRichTextEditBox-BueeC-ud.js} +14 -15
  3. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-BueeC-ud.js.map +1 -0
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BNwd6bE2.js → RichTextSendBoxWrapper-Br441vhG.js} +2 -3
  5. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BNwd6bE2.js.map → RichTextSendBoxWrapper-Br441vhG.js.map} +1 -1
  6. package/dist/dist-cjs/communication-react/{index-DdAkrosV.js → index-DznlW8XT.js} +411 -246
  7. package/dist/dist-cjs/communication-react/index-DznlW8XT.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +2 -2
  9. package/dist/dist-esm/acs-ui-common/src/index.d.ts +1 -0
  10. package/dist/dist-esm/acs-ui-common/src/index.js +2 -0
  11. package/dist/dist-esm/acs-ui-common/src/index.js.map +1 -1
  12. package/dist/dist-esm/acs-ui-common/src/removeImageTags.d.ts +7 -0
  13. package/dist/dist-esm/acs-ui-common/src/removeImageTags.js +18 -0
  14. package/dist/dist-esm/acs-ui-common/src/removeImageTags.js.map +1 -0
  15. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  16. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  17. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +14 -1
  18. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +16 -0
  19. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  20. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.d.ts +2 -0
  21. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +17 -0
  22. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
  23. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.d.ts +2 -0
  24. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js +17 -0
  25. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map +1 -1
  26. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.d.ts +3 -1
  27. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js +13 -1
  28. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js.map +1 -1
  29. package/dist/dist-esm/calling-component-bindings/src/incomingCallStackSelector.d.ts +16 -0
  30. package/dist/dist-esm/calling-component-bindings/src/incomingCallStackSelector.js +33 -0
  31. package/dist/dist-esm/calling-component-bindings/src/incomingCallStackSelector.js.map +1 -0
  32. package/dist/dist-esm/calling-component-bindings/src/index.d.ts +2 -0
  33. package/dist/dist-esm/calling-component-bindings/src/index.js +1 -0
  34. package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
  35. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.d.ts +6 -1
  36. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js +12 -0
  37. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js.map +1 -1
  38. package/dist/dist-esm/calling-stateful-client/src/BetaToStableTypes.d.ts +2 -7
  39. package/dist/dist-esm/calling-stateful-client/src/BetaToStableTypes.js.map +1 -1
  40. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.d.ts +2 -2
  41. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js +1 -2
  42. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js.map +1 -1
  43. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +62 -3
  44. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  45. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +2 -1
  46. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +6 -1
  47. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  48. package/dist/dist-esm/calling-stateful-client/src/Converter.d.ts +4 -3
  49. package/dist/dist-esm/calling-stateful-client/src/Converter.js +26 -3
  50. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  51. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js +3 -1
  52. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js.map +1 -1
  53. package/dist/dist-esm/calling-stateful-client/src/IncomingCallSubscriber.d.ts +1 -2
  54. package/dist/dist-esm/calling-stateful-client/src/IncomingCallSubscriber.js.map +1 -1
  55. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.d.ts +2 -2
  56. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js.map +1 -1
  57. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +2 -1
  58. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  59. package/dist/dist-esm/calling-stateful-client/src/index.d.ts +1 -1
  60. package/dist/dist-esm/calling-stateful-client/src/index.js.map +1 -1
  61. package/dist/dist-esm/communication-react/src/index.d.ts +3 -2
  62. package/dist/dist-esm/communication-react/src/index.js +1 -1
  63. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  64. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +2 -2
  65. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
  66. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.d.ts +2 -2
  67. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js.map +1 -1
  68. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.d.ts +2 -2
  69. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +12 -12
  70. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +1 -1
  71. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +2 -2
  72. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js +2 -2
  73. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
  74. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +6 -6
  75. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
  76. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +2 -2
  77. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
  78. package/dist/dist-esm/react-components/src/components/IncomingCallNotification.d.ts +27 -1
  79. package/dist/dist-esm/react-components/src/components/IncomingCallNotification.js +73 -36
  80. package/dist/dist-esm/react-components/src/components/IncomingCallNotification.js.map +1 -1
  81. package/dist/dist-esm/react-components/src/components/IncomingCallStack.d.ts +76 -0
  82. package/dist/dist-esm/react-components/src/components/IncomingCallStack.js +23 -0
  83. package/dist/dist-esm/react-components/src/components/IncomingCallStack.js.map +1 -0
  84. package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.d.ts +0 -5
  85. package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.js +3 -23
  86. package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.js.map +1 -1
  87. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +6 -5
  88. package/dist/dist-esm/react-components/src/components/MessageThread.js +3 -3
  89. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  90. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.d.ts +2 -2
  91. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js +15 -5
  92. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js.map +1 -1
  93. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.d.ts +1 -1
  94. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.js.map +1 -1
  95. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.d.ts +1 -1
  96. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +6 -4
  97. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
  98. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.d.ts +1 -1
  99. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +2 -2
  100. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +1 -1
  101. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +13 -11
  102. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +14 -14
  103. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
  104. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js +3 -0
  105. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js.map +1 -1
  106. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +15 -15
  107. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js.map +1 -1
  108. package/dist/dist-esm/react-components/src/components/VideoGallery.js +9 -6
  109. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  110. package/dist/dist-esm/react-components/src/components/index.d.ts +2 -0
  111. package/dist/dist-esm/react-components/src/components/index.js +3 -0
  112. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  113. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.d.ts +1 -1
  114. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +1 -1
  115. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +3 -3
  116. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +14 -11
  117. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  118. package/dist/dist-esm/react-components/src/components/utils/formatPhoneNumber.d.ts +2 -2
  119. package/dist/dist-esm/react-components/src/components/utils/formatPhoneNumber.js +6 -2
  120. package/dist/dist-esm/react-components/src/components/utils/formatPhoneNumber.js.map +1 -1
  121. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +5 -2
  122. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  123. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -2
  124. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +1 -6
  125. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  126. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js +3 -3
  127. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js.map +1 -1
  128. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js +7 -9
  129. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js.map +1 -1
  130. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +36 -33
  131. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
  132. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +6 -4
  133. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  134. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +0 -2
  135. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  136. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +3 -7
  137. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +2 -8
  138. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  139. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +9 -8
  140. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  141. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.d.ts +4 -10
  142. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js +7 -23
  143. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js.map +1 -1
  144. package/dist/dist-esm/react-composites/src/composites/common/MeetingPhoneInfoPaneContent.js +2 -2
  145. package/dist/dist-esm/react-composites/src/composites/common/MeetingPhoneInfoPaneContent.js.map +1 -1
  146. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js +3 -3
  147. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js.map +1 -1
  148. package/package.json +2 -3
  149. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-D4Pf_JpT.js.map +0 -1
  150. package/dist/dist-cjs/communication-react/index-DdAkrosV.js.map +0 -1
@@ -1,12 +1,11 @@
1
1
  'use strict';
2
2
 
3
- var index = require('./index-DdAkrosV.js');
3
+ var index = require('./index-DznlW8XT.js');
4
4
  require('react');
5
5
  require('@fluentui/react');
6
6
  require('@fluentui/react-components');
7
7
  require('@fluentui-contrib/react-chat');
8
8
  require('@fluentui/react-hooks');
9
- require('libphonenumber-js');
10
9
  require('@azure/communication-common');
11
10
  require('react-dom/client');
12
11
  require('@azure/communication-chat');
@@ -104,6 +103,7 @@ exports.GridLayout = index.GridLayout;
104
103
  exports.HoldButton = index.HoldButton;
105
104
  exports.ImageOverlay = index.ImageOverlay;
106
105
  exports.IncomingCallNotification = index.IncomingCallNotification;
106
+ exports.IncomingCallStack = index.IncomingCallStack;
107
107
  exports.LocalizationProvider = index.LocalizationProvider;
108
108
  exports.MessageStatusIndicator = index.MessageStatusIndicator;
109
109
  exports.MessageThread = index.MessageThread;
@@ -5,6 +5,7 @@ export { _formatString } from './localizationUtils';
5
5
  export { _safeJSONStringify } from './safeStringify';
6
6
  export { _convertPxToRem, _convertRemToPx, _preventDismissOnEvent, _getKeys } from './common';
7
7
  export { _base64ToBlob } from './dataConversion';
8
+ export { removeImageTags } from './removeImageTags';
8
9
  export type { Common, CommonProperties } from './commonProperties';
9
10
  export type { CallbackType, FunctionWithKey } from './memoizeFnAll';
10
11
  export type { AreEqual, AreParamEqual, AreTypeEqual } from './areEqual';
@@ -8,6 +8,8 @@ export { _safeJSONStringify } from './safeStringify';
8
8
  export { _convertPxToRem, _convertRemToPx, _preventDismissOnEvent, _getKeys } from './common';
9
9
  /* @conditional-compile-remove(rich-text-editor-image-upload) */
10
10
  export { _base64ToBlob } from './dataConversion';
11
+ /* @conditional-compile-remove(rich-text-editor-image-upload) */
12
+ export { removeImageTags } from './removeImageTags';
11
13
  export { _MAX_EVENT_LISTENERS } from './constants';
12
14
  export { _pxToRem } from './cssUtils';
13
15
  export { _logEvent } from './logEvent';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,+BAA+B,EAC/B,6BAA6B,EAC7B,0BAA0B,EAC1B,kBAAkB,EAClB,6BAA6B,EAC9B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC9F,gEAAgE;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AASjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { memoizeFnAll } from './memoizeFnAll';\nexport {\n fromFlatCommunicationIdentifier,\n toFlatCommunicationIdentifier,\n _toCommunicationIdentifier,\n _isValidIdentifier,\n _isIdentityMicrosoftTeamsUser\n} from './identifier';\nexport { _getApplicationId } from './telemetry';\nexport { _formatString } from './localizationUtils';\nexport { _safeJSONStringify } from './safeStringify';\nexport { _convertPxToRem, _convertRemToPx, _preventDismissOnEvent, _getKeys } from './common';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nexport { _base64ToBlob } from './dataConversion';\n\nexport type { Common, CommonProperties } from './commonProperties';\nexport type { CallbackType, FunctionWithKey } from './memoizeFnAll';\nexport type { AreEqual, AreParamEqual, AreTypeEqual } from './areEqual';\nexport type { MessageStatus } from './MessageStatus';\nexport type { _IObjectMap } from './localizationUtils';\nexport type { _TelemetryImplementationHint } from './telemetry';\n\nexport { _MAX_EVENT_LISTENERS } from './constants';\n\nexport { _pxToRem } from './cssUtils';\n\nexport { _logEvent } from './logEvent';\nexport type { TelemetryEvent } from './logEvent';\n\nexport type { AttachmentMetadata, AttachmentMetadataInProgress, AttachmentProgressError } from './common';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nexport type { UploadChatImageResult } from './common';\n\nexport type { MessageOptions, ChatMessageType } from './common';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EACL,+BAA+B,EAC/B,6BAA6B,EAC7B,0BAA0B,EAC1B,kBAAkB,EAClB,6BAA6B,EAC9B,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC9F,gEAAgE;AAChE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,gEAAgE;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AASpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { memoizeFnAll } from './memoizeFnAll';\nexport {\n fromFlatCommunicationIdentifier,\n toFlatCommunicationIdentifier,\n _toCommunicationIdentifier,\n _isValidIdentifier,\n _isIdentityMicrosoftTeamsUser\n} from './identifier';\nexport { _getApplicationId } from './telemetry';\nexport { _formatString } from './localizationUtils';\nexport { _safeJSONStringify } from './safeStringify';\nexport { _convertPxToRem, _convertRemToPx, _preventDismissOnEvent, _getKeys } from './common';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nexport { _base64ToBlob } from './dataConversion';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nexport { removeImageTags } from './removeImageTags';\n\nexport type { Common, CommonProperties } from './commonProperties';\nexport type { CallbackType, FunctionWithKey } from './memoizeFnAll';\nexport type { AreEqual, AreParamEqual, AreTypeEqual } from './areEqual';\nexport type { MessageStatus } from './MessageStatus';\nexport type { _IObjectMap } from './localizationUtils';\nexport type { _TelemetryImplementationHint } from './telemetry';\n\nexport { _MAX_EVENT_LISTENERS } from './constants';\n\nexport { _pxToRem } from './cssUtils';\n\nexport { _logEvent } from './logEvent';\nexport type { TelemetryEvent } from './logEvent';\n\nexport type { AttachmentMetadata, AttachmentMetadataInProgress, AttachmentProgressError } from './common';\n/* @conditional-compile-remove(rich-text-editor-image-upload) */\nexport type { UploadChatImageResult } from './common';\n\nexport type { MessageOptions, ChatMessageType } from './common';\n"]}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @internal
3
+ */
4
+ export declare const removeImageTags: (event: {
5
+ content: DocumentFragment;
6
+ }) => void;
7
+ //# sourceMappingURL=removeImageTags.d.ts.map
@@ -0,0 +1,18 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ /**
4
+ * @internal
5
+ */
6
+ export const removeImageTags = (event) => {
7
+ event.content.querySelectorAll('img').forEach((image) => {
8
+ // If the image is the only child of its parent, remove all the parents of this img element.
9
+ let parentNode = image.parentElement;
10
+ let currentNode = image;
11
+ while ((parentNode === null || parentNode === void 0 ? void 0 : parentNode.childNodes.length) === 1) {
12
+ currentNode = parentNode;
13
+ parentNode = parentNode.parentElement;
14
+ }
15
+ currentNode === null || currentNode === void 0 ? void 0 : currentNode.remove();
16
+ });
17
+ };
18
+ //# sourceMappingURL=removeImageTags.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"removeImageTags.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/removeImageTags.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAAoC,EAAQ,EAAE;IAC5E,KAAK,CAAC,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;QACtD,4FAA4F;QAC5F,IAAI,UAAU,GAAuB,KAAK,CAAC,aAAa,CAAC;QACzD,IAAI,WAAW,GAAgB,KAAK,CAAC;QACrC,OAAO,CAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,UAAU,CAAC,MAAM,MAAK,CAAC,EAAE,CAAC;YAC3C,WAAW,GAAG,UAAU,CAAC;YACzB,UAAU,GAAG,UAAU,CAAC,aAAa,CAAC;QACxC,CAAC;QACD,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,MAAM,EAAE,CAAC;IACxB,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n/**\n * @internal\n */\nexport const removeImageTags = (event: { content: DocumentFragment }): void => {\n event.content.querySelectorAll('img').forEach((image) => {\n // If the image is the only child of its parent, remove all the parents of this img element.\n let parentNode: HTMLElement | null = image.parentElement;\n let currentNode: HTMLElement = image;\n while (parentNode?.childNodes.length === 1) {\n currentNode = parentNode;\n parentNode = parentNode.parentElement;\n }\n currentNode?.remove();\n });\n};\n"]}
@@ -2,5 +2,5 @@
2
2
  // Copyright (c) Microsoft Corporation.
3
3
  // Licensed under the MIT License.
4
4
  // GENERATED FILE. DO NOT EDIT MANUALLY.
5
- module.exports = '1.19.0-alpha-202407250014';
5
+ module.exports = '1.19.0-alpha-202407270014';
6
6
  //# sourceMappingURL=telemetryVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.19.0-alpha-202407250014';\n"]}
1
+ {"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,2BAA2B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.19.0-alpha-202407270014';\n"]}
@@ -2,7 +2,8 @@ import { DominantSpeakersInfo } from '@azure/communication-calling';
2
2
  import { ParticipantCapabilities } from '@azure/communication-calling';
3
3
  import { EnvironmentInfo } from '@azure/communication-calling';
4
4
  import { ParticipantRole } from '@azure/communication-calling';
5
- import { CallClientState, DeviceManagerState, RemoteParticipantState, LocalVideoStreamState, CallErrors, DiagnosticsCallFeatureState, SpotlightCallFeatureState } from "../../calling-stateful-client/src";
5
+ import { CallClientState, DeviceManagerState, RemoteParticipantState, LocalVideoStreamState, CallErrors, DiagnosticsCallFeatureState, SpotlightCallFeatureState, IncomingCallState } from "../../calling-stateful-client/src";
6
+ import { TeamsIncomingCallState } from "../../calling-stateful-client/src";
6
7
  import { ReactionState } from "../../calling-stateful-client/src";
7
8
  import { CaptionsInfo } from "../../calling-stateful-client/src";
8
9
  import { CaptionsKind } from '@azure/communication-calling';
@@ -123,4 +124,16 @@ export declare const getSupportedCaptionLanguages: (state: CallClientState, prop
123
124
  export declare const getSupportedSpokenLanguages: (state: CallClientState, props: CallingBaseSelectorProps) => _SupportedSpokenLanguage[] | undefined;
124
125
  /** @private */
125
126
  export declare const getMeetingConferencePhones: (state: CallClientState, props: CallingBaseSelectorProps) => ConferencePhoneInfo[] | undefined;
127
+ /**
128
+ * selector for retrieving the incoming calls from state
129
+ * @returns the incoming calls in the call client state
130
+ * @private
131
+ */
132
+ export declare const getIncomingCalls: (state: CallClientState) => IncomingCallState[] | /* @conditional-compile-remove(one-to-n-calling) */ TeamsIncomingCallState[];
133
+ /**
134
+ * selector for retrieving the incoming calls that have been removed from state
135
+ * @returns the incoming calls that have been removed
136
+ * @private
137
+ */
138
+ export declare const getRemovedIncomingCalls: (state: CallClientState) => IncomingCallState[] | /* @conditional-compile-remove(one-to-n-calling) */ TeamsIncomingCallState[];
126
139
  //# sourceMappingURL=baseSelectors.d.ts.map
@@ -161,4 +161,20 @@ export const getMeetingConferencePhones = (state, props) => {
161
161
  var _a, _b;
162
162
  return (_b = (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.meetingConference) === null || _b === void 0 ? void 0 : _b.conferencePhones;
163
163
  };
164
+ /**
165
+ * selector for retrieving the incoming calls from state
166
+ * @returns the incoming calls in the call client state
167
+ * @private
168
+ */
169
+ export const getIncomingCalls = (state) => {
170
+ return Object.values(state.incomingCalls);
171
+ };
172
+ /**
173
+ * selector for retrieving the incoming calls that have been removed from state
174
+ * @returns the incoming calls that have been removed
175
+ * @private
176
+ */
177
+ export const getRemovedIncomingCalls = (state) => {
178
+ return Object.values(state.incomingCallsEnded);
179
+ };
164
180
  //# sourceMappingURL=baseSelectors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"baseSelectors.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/baseSelectors.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AA4BxE;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAsB,EAAsB,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC;AAEpG;;GA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sBAAmD,CAAC;AACxG,CAAC,CAAC;AAEF,eAAe;AACf,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,KAAsB,EACtB,KAA+B,EACO,EAAE;;IACxC,OAAO,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,eAAe,CAAC,qBAAiD,CAAC;AACtG,CAAC,CAAC;AAEF,eAAe;AACf,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAC1C,KAAsB,EACtB,KAA+B,EACU,EAAE;;IAC3C,OAAO,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,eAAe,CAAC,yBAAwD,CAAC;AAC7G,CAAC,CAAC;AAEF,eAAe;AACf,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,KAAsB,EACtB,KAA+B,EACS,EAAE;;IAC1C,OAAO,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,eAAe,CAAC,wBAAsD,CAAC;AAC3G,CAAC,CAAC;AAEF,2DAA2D;AAC3D,eAAe;AACf,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,KAAsB,EACtB,KAA+B,EACI,EAAE;;IACrC,OAAO,MAAA,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,iBAAiB,0CAAE,gBAAgB,CAAC;AACxE,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { DominantSpeakersInfo } from '@azure/communication-calling';\n\nimport { ParticipantCapabilities } from '@azure/communication-calling';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\nimport { ParticipantRole } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport {\n CallClientState,\n DeviceManagerState,\n RemoteParticipantState,\n LocalVideoStreamState,\n CallErrors,\n DiagnosticsCallFeatureState,\n SpotlightCallFeatureState\n} from '@internal/calling-stateful-client';\nimport { ReactionState } from '@internal/calling-stateful-client';\nimport { CaptionsInfo } from '@internal/calling-stateful-client';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { CaptionsKind } from '@azure/communication-calling';\nimport { RaisedHandState } from '@internal/calling-stateful-client';\nimport { _SupportedCaptionLanguage, _SupportedSpokenLanguage } from '@internal/react-components';\n/* @conditional-compile-remove(teams-meeting-conference) */\nimport { ConferencePhoneInfo } from '@internal/calling-stateful-client';\n\n/**\n * Common props used to reference calling declarative client state.\n *\n * @public\n */\nexport type CallingBaseSelectorProps = {\n callId: string;\n};\n\n/**\n * @private\n */\nexport const getDeviceManager = (state: CallClientState): DeviceManagerState => state.deviceManager;\n\n/**\n * @private\n */\nexport const getRole = (state: CallClientState, props: CallingBaseSelectorProps): ParticipantRole | undefined => {\n return state.calls[props.callId]?.role;\n};\n\n/**\n * @private\n */\nexport const isHideAttendeeNamesEnabled = (state: CallClientState, props: CallingBaseSelectorProps): boolean => {\n /* @conditional-compile-remove(hide-attendee-name) */\n return state.calls[props.callId]?.hideAttendeeNames ?? false;\n return false;\n};\n\n/**\n * @private\n */\nexport const getCapabilities = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): ParticipantCapabilities | undefined => state.calls[props.callId]?.capabilitiesFeature?.capabilities;\n\n/**\n * @private\n */\nexport const getCallExists = (state: CallClientState, props: CallingBaseSelectorProps): boolean =>\n !!state.calls[props.callId];\n\n/**\n * @private\n */\nexport const getDominantSpeakers = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): undefined | DominantSpeakersInfo => state.calls[props.callId]?.dominantSpeakers;\n\n/**\n * @private\n */\nexport const getRemoteParticipants = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n):\n | {\n [keys: string]: RemoteParticipantState;\n }\n | undefined => {\n return state.calls[props.callId]?.remoteParticipants;\n};\n\n/**\n * @private\n */\nexport const getLocalParticipantRaisedHand = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): RaisedHandState | undefined => {\n return state.calls[props.callId]?.raiseHand?.localParticipantRaisedHand;\n};\n\n/**\n * @private\n */\nexport const getSpotlightCallFeature = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): SpotlightCallFeatureState | undefined => {\n return state.calls[props.callId]?.spotlight;\n};\n\n/**\n * @private\n */\nexport const getLocalParticipantReactionState = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): ReactionState | undefined => {\n return state.calls[props.callId]?.localParticipantReaction;\n};\n\n/**\n * @private\n */\nexport const getIsScreenSharingOn = (state: CallClientState, props: CallingBaseSelectorProps): boolean | undefined =>\n state.calls[props.callId]?.isScreenSharingOn;\n\n/**\n * @private\n */\nexport const getIsMuted = (state: CallClientState, props: CallingBaseSelectorProps): boolean | undefined =>\n state.calls[props.callId]?.isMuted;\n\n/**\n * @private\n */\nexport const getOptimalVideoCount = (state: CallClientState, props: CallingBaseSelectorProps): number | undefined =>\n state.calls[props.callId]?.optimalVideoCount.maxRemoteVideoStreams;\n\n/**\n * @private\n */\nexport const getLocalVideoStreams = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): LocalVideoStreamState[] | undefined => state.calls[props.callId]?.localVideoStreams;\n\n/**\n * @private\n */\nexport const getScreenShareRemoteParticipant = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): string | undefined => state.calls[props.callId]?.screenShareRemoteParticipant;\n\n/**\n * @private\n */\nexport const getDisplayName = (state: CallClientState): string | undefined => state.callAgent?.displayName;\n\n/**\n * @private\n */\nexport const getIdentifier = (state: CallClientState): string => toFlatCommunicationIdentifier(state.userId);\n\n/**\n * @private\n */\nexport const getLatestErrors = (state: CallClientState): CallErrors => state.latestErrors;\n\n/**\n * @private\n */\nexport const getDiagnostics = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): DiagnosticsCallFeatureState | undefined => state.calls[props.callId]?.diagnostics;\n\n/**\n * @private\n */\nexport const getCallState = (state: CallClientState, props: CallingBaseSelectorProps): string =>\n state.calls[props.callId]?.state;\n\n/**\n * @private\n */\nexport const getEnvironmentInfo = (\n state: CallClientState\n): undefined | /* @conditional-compile-remove(unsupported-browser) */ EnvironmentInfo => {\n /* @conditional-compile-remove(unsupported-browser) */\n return state.environmentInfo;\n return undefined;\n};\n\n/** @private */\nexport const getParticipantCount = (state: CallClientState, props: CallingBaseSelectorProps): number | undefined => {\n /* @conditional-compile-remove(total-participant-count) */\n return state.calls[props.callId]?.totalParticipantCount;\n return undefined;\n};\n\n/* @conditional-compile-remove(acs-close-captions) */\n/** @private */\nexport const getCaptionsKind = (state: CallClientState, props: CallingBaseSelectorProps): CaptionsKind => {\n return state.calls[props.callId]?.captionsFeature.captionsKind;\n};\n\n/** @private */\nexport const getCaptions = (state: CallClientState, props: CallingBaseSelectorProps): CaptionsInfo[] | undefined => {\n return state.calls[props.callId]?.captionsFeature.captions;\n};\n\n/** @private */\nexport const getCaptionsStatus = (state: CallClientState, props: CallingBaseSelectorProps): boolean | undefined => {\n return state.calls[props.callId]?.captionsFeature.isCaptionsFeatureActive;\n};\n\n/** @private */\nexport const getStartCaptionsInProgress = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): boolean | undefined => {\n return state.calls[props.callId]?.captionsFeature.startCaptionsInProgress;\n};\n\n/** @private */\nexport const getCurrentCaptionLanguage = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): _SupportedCaptionLanguage | undefined => {\n return state.calls[props.callId]?.captionsFeature.currentCaptionLanguage as _SupportedCaptionLanguage;\n};\n\n/** @private */\nexport const getCurrentSpokenLanguage = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): _SupportedSpokenLanguage | undefined => {\n return state.calls[props.callId]?.captionsFeature.currentSpokenLanguage as _SupportedSpokenLanguage;\n};\n\n/** @private */\nexport const getSupportedCaptionLanguages = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): _SupportedCaptionLanguage[] | undefined => {\n return state.calls[props.callId]?.captionsFeature.supportedCaptionLanguages as _SupportedCaptionLanguage[];\n};\n\n/** @private */\nexport const getSupportedSpokenLanguages = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): _SupportedSpokenLanguage[] | undefined => {\n return state.calls[props.callId]?.captionsFeature.supportedSpokenLanguages as _SupportedSpokenLanguage[];\n};\n\n/* @conditional-compile-remove(teams-meeting-conference) */\n/** @private */\nexport const getMeetingConferencePhones = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): ConferencePhoneInfo[] | undefined => {\n return state.calls[props.callId]?.meetingConference?.conferencePhones;\n};\n"]}
1
+ {"version":3,"file":"baseSelectors.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/baseSelectors.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AA+BxE;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAsB,EAAsB,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC;AAEpG;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAsB,EAAE,KAA+B,EAA+B,EAAE;;IAC9G,OAAO,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,IAAI,CAAC;AACzC,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,KAAsB,EAAE,KAA+B,EAAW,EAAE;;IAC7G,qDAAqD;IACrD,OAAO,MAAA,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,iBAAiB,mCAAI,KAAK,CAAC;IAC7D,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,KAAsB,EACtB,KAA+B,EACM,EAAE,eAAC,OAAA,MAAA,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,mBAAmB,0CAAE,YAAY,CAAA,EAAA,CAAC;AAEvG;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AC;AAEF,2DAA2D;AAC3D,eAAe;AACf,MAAM,CAAC,MAAM,0BAA0B,GAAG,CACxC,KAAsB,EACtB,KAA+B,EACI,EAAE;;IACrC,OAAO,MAAA,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,iBAAiB,0CAAE,gBAAgB,CAAC;AACxE,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAC9B,KAAsB,EAC8E,EAAE;IACtG,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,aAAa,CAAC,CAAC;AAC5C,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,KAAsB,EAC8E,EAAE;IACtG,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,CAAC;AACjD,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { DominantSpeakersInfo } from '@azure/communication-calling';\n\nimport { ParticipantCapabilities } from '@azure/communication-calling';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\nimport { ParticipantRole } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport {\n CallClientState,\n DeviceManagerState,\n RemoteParticipantState,\n LocalVideoStreamState,\n CallErrors,\n DiagnosticsCallFeatureState,\n SpotlightCallFeatureState,\n IncomingCallState\n} from '@internal/calling-stateful-client';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { TeamsIncomingCallState } from '@internal/calling-stateful-client';\nimport { ReactionState } from '@internal/calling-stateful-client';\nimport { CaptionsInfo } from '@internal/calling-stateful-client';\n/* @conditional-compile-remove(acs-close-captions) */\nimport { CaptionsKind } from '@azure/communication-calling';\nimport { RaisedHandState } from '@internal/calling-stateful-client';\nimport { _SupportedCaptionLanguage, _SupportedSpokenLanguage } from '@internal/react-components';\n/* @conditional-compile-remove(teams-meeting-conference) */\nimport { ConferencePhoneInfo } from '@internal/calling-stateful-client';\n\n/**\n * Common props used to reference calling declarative client state.\n *\n * @public\n */\nexport type CallingBaseSelectorProps = {\n callId: string;\n};\n\n/**\n * @private\n */\nexport const getDeviceManager = (state: CallClientState): DeviceManagerState => state.deviceManager;\n\n/**\n * @private\n */\nexport const getRole = (state: CallClientState, props: CallingBaseSelectorProps): ParticipantRole | undefined => {\n return state.calls[props.callId]?.role;\n};\n\n/**\n * @private\n */\nexport const isHideAttendeeNamesEnabled = (state: CallClientState, props: CallingBaseSelectorProps): boolean => {\n /* @conditional-compile-remove(hide-attendee-name) */\n return state.calls[props.callId]?.hideAttendeeNames ?? false;\n return false;\n};\n\n/**\n * @private\n */\nexport const getCapabilities = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): ParticipantCapabilities | undefined => state.calls[props.callId]?.capabilitiesFeature?.capabilities;\n\n/**\n * @private\n */\nexport const getCallExists = (state: CallClientState, props: CallingBaseSelectorProps): boolean =>\n !!state.calls[props.callId];\n\n/**\n * @private\n */\nexport const getDominantSpeakers = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): undefined | DominantSpeakersInfo => state.calls[props.callId]?.dominantSpeakers;\n\n/**\n * @private\n */\nexport const getRemoteParticipants = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n):\n | {\n [keys: string]: RemoteParticipantState;\n }\n | undefined => {\n return state.calls[props.callId]?.remoteParticipants;\n};\n\n/**\n * @private\n */\nexport const getLocalParticipantRaisedHand = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): RaisedHandState | undefined => {\n return state.calls[props.callId]?.raiseHand?.localParticipantRaisedHand;\n};\n\n/**\n * @private\n */\nexport const getSpotlightCallFeature = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): SpotlightCallFeatureState | undefined => {\n return state.calls[props.callId]?.spotlight;\n};\n\n/**\n * @private\n */\nexport const getLocalParticipantReactionState = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): ReactionState | undefined => {\n return state.calls[props.callId]?.localParticipantReaction;\n};\n\n/**\n * @private\n */\nexport const getIsScreenSharingOn = (state: CallClientState, props: CallingBaseSelectorProps): boolean | undefined =>\n state.calls[props.callId]?.isScreenSharingOn;\n\n/**\n * @private\n */\nexport const getIsMuted = (state: CallClientState, props: CallingBaseSelectorProps): boolean | undefined =>\n state.calls[props.callId]?.isMuted;\n\n/**\n * @private\n */\nexport const getOptimalVideoCount = (state: CallClientState, props: CallingBaseSelectorProps): number | undefined =>\n state.calls[props.callId]?.optimalVideoCount.maxRemoteVideoStreams;\n\n/**\n * @private\n */\nexport const getLocalVideoStreams = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): LocalVideoStreamState[] | undefined => state.calls[props.callId]?.localVideoStreams;\n\n/**\n * @private\n */\nexport const getScreenShareRemoteParticipant = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): string | undefined => state.calls[props.callId]?.screenShareRemoteParticipant;\n\n/**\n * @private\n */\nexport const getDisplayName = (state: CallClientState): string | undefined => state.callAgent?.displayName;\n\n/**\n * @private\n */\nexport const getIdentifier = (state: CallClientState): string => toFlatCommunicationIdentifier(state.userId);\n\n/**\n * @private\n */\nexport const getLatestErrors = (state: CallClientState): CallErrors => state.latestErrors;\n\n/**\n * @private\n */\nexport const getDiagnostics = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): DiagnosticsCallFeatureState | undefined => state.calls[props.callId]?.diagnostics;\n\n/**\n * @private\n */\nexport const getCallState = (state: CallClientState, props: CallingBaseSelectorProps): string =>\n state.calls[props.callId]?.state;\n\n/**\n * @private\n */\nexport const getEnvironmentInfo = (\n state: CallClientState\n): undefined | /* @conditional-compile-remove(unsupported-browser) */ EnvironmentInfo => {\n /* @conditional-compile-remove(unsupported-browser) */\n return state.environmentInfo;\n return undefined;\n};\n\n/** @private */\nexport const getParticipantCount = (state: CallClientState, props: CallingBaseSelectorProps): number | undefined => {\n /* @conditional-compile-remove(total-participant-count) */\n return state.calls[props.callId]?.totalParticipantCount;\n return undefined;\n};\n\n/* @conditional-compile-remove(acs-close-captions) */\n/** @private */\nexport const getCaptionsKind = (state: CallClientState, props: CallingBaseSelectorProps): CaptionsKind => {\n return state.calls[props.callId]?.captionsFeature.captionsKind;\n};\n\n/** @private */\nexport const getCaptions = (state: CallClientState, props: CallingBaseSelectorProps): CaptionsInfo[] | undefined => {\n return state.calls[props.callId]?.captionsFeature.captions;\n};\n\n/** @private */\nexport const getCaptionsStatus = (state: CallClientState, props: CallingBaseSelectorProps): boolean | undefined => {\n return state.calls[props.callId]?.captionsFeature.isCaptionsFeatureActive;\n};\n\n/** @private */\nexport const getStartCaptionsInProgress = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): boolean | undefined => {\n return state.calls[props.callId]?.captionsFeature.startCaptionsInProgress;\n};\n\n/** @private */\nexport const getCurrentCaptionLanguage = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): _SupportedCaptionLanguage | undefined => {\n return state.calls[props.callId]?.captionsFeature.currentCaptionLanguage as _SupportedCaptionLanguage;\n};\n\n/** @private */\nexport const getCurrentSpokenLanguage = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): _SupportedSpokenLanguage | undefined => {\n return state.calls[props.callId]?.captionsFeature.currentSpokenLanguage as _SupportedSpokenLanguage;\n};\n\n/** @private */\nexport const getSupportedCaptionLanguages = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): _SupportedCaptionLanguage[] | undefined => {\n return state.calls[props.callId]?.captionsFeature.supportedCaptionLanguages as _SupportedCaptionLanguage[];\n};\n\n/** @private */\nexport const getSupportedSpokenLanguages = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): _SupportedSpokenLanguage[] | undefined => {\n return state.calls[props.callId]?.captionsFeature.supportedSpokenLanguages as _SupportedSpokenLanguage[];\n};\n\n/* @conditional-compile-remove(teams-meeting-conference) */\n/** @private */\nexport const getMeetingConferencePhones = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): ConferencePhoneInfo[] | undefined => {\n return state.calls[props.callId]?.meetingConference?.conferencePhones;\n};\n\n/**\n * selector for retrieving the incoming calls from state\n * @returns the incoming calls in the call client state\n * @private\n */\nexport const getIncomingCalls = (\n state: CallClientState\n): IncomingCallState[] | /* @conditional-compile-remove(one-to-n-calling) */ TeamsIncomingCallState[] => {\n return Object.values(state.incomingCalls);\n};\n\n/**\n * selector for retrieving the incoming calls that have been removed from state\n * @returns the incoming calls that have been removed\n * @private\n */\nexport const getRemovedIncomingCalls = (\n state: CallClientState\n): IncomingCallState[] | /* @conditional-compile-remove(one-to-n-calling) */ TeamsIncomingCallState[] => {\n return Object.values(state.incomingCallsEnded);\n};\n"]}
@@ -13,6 +13,8 @@ import { VideoBackgroundEffectsDependency } from './createCommonHandlers';
13
13
  */
14
14
  export interface CallingHandlers extends CommonCallingHandlers {
15
15
  onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions) => Call | undefined;
16
+ onAcceptCall: (incomingCallId: string, useVideo?: boolean) => Promise<void>;
17
+ onRejectCall: (incomingCallId: string) => Promise<void>;
16
18
  }
17
19
  /**
18
20
  * Configuration options to include video effect background dependency.
@@ -14,6 +14,8 @@ import { isCommunicationUserIdentifier, isMicrosoftTeamsUserIdentifier, isPhoneN
14
14
  import { _toCommunicationIdentifier } from "../../../acs-ui-common/src";
15
15
  import memoizeOne from 'memoize-one';
16
16
  import { isACSCallParticipants } from '../utils/callUtils';
17
+ /* @conditional-compile-remove(one-to-n-calling) */
18
+ import { createLocalVideoStream } from '../utils/callUtils';
17
19
  import { createDefaultCommonCallingHandlers } from './createCommonHandlers';
18
20
  /**
19
21
  * Create the default implementation of {@link CallingHandlers} for teams call.
@@ -47,6 +49,21 @@ export const createDefaultCallingHandlers = memoizeOne((...args) => {
47
49
  }), onRemoveParticipant: (userId) => __awaiter(void 0, void 0, void 0, function* () {
48
50
  const participant = _toCommunicationIdentifier(userId);
49
51
  yield (call === null || call === void 0 ? void 0 : call.removeParticipant(participant));
52
+ }),
53
+ /* @conditional-compile-remove(one-to-n-calling) */
54
+ onAcceptCall: (incomingCallId, useVideo) => __awaiter(void 0, void 0, void 0, function* () {
55
+ const localVideoStream = useVideo ? yield createLocalVideoStream(callClient) : undefined;
56
+ const incomingCall = callAgent === null || callAgent === void 0 ? void 0 : callAgent.incomingCalls.find((incomingCall) => incomingCall.id === incomingCallId);
57
+ if (incomingCall) {
58
+ yield incomingCall.accept(localVideoStream ? { videoOptions: { localVideoStreams: [localVideoStream] } } : undefined);
59
+ }
60
+ }),
61
+ /* @conditional-compile-remove(one-to-n-calling) */
62
+ onRejectCall: (incomingCallId) => __awaiter(void 0, void 0, void 0, function* () {
63
+ const incomingCall = callAgent === null || callAgent === void 0 ? void 0 : callAgent.incomingCalls.find((incomingCall) => incomingCall.id === incomingCallId);
64
+ if (incomingCall) {
65
+ yield incomingCall.reject();
66
+ }
50
67
  }) });
51
68
  });
52
69
  //# sourceMappingURL=createHandlers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createHandlers.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/handlers/createHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAKlC,6CAA6C;AAC7C,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,0BAA0B,EAAE,mCAAgC;AAErE,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,kCAAkC,EAAyB,MAAM,wBAAwB,CAAC;AAsCnG;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAiC,UAAU,CAAC,CAAC,GAAG,IAAI,EAAE,EAAE;IAC/F,MAAM,CAAC,UAAU,EAAE,SAAS,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC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c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Call, CallAgent, StartCallOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport {\n isCommunicationUserIdentifier,\n isMicrosoftTeamsUserIdentifier,\n isPhoneNumberIdentifier\n} from '@azure/communication-common';\nimport { CommunicationIdentifier } from '@azure/communication-common';\n\nimport { _toCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { StatefulCallClient, StatefulDeviceManager } from '@internal/calling-stateful-client';\nimport memoizeOne from 'memoize-one';\nimport { isACSCallParticipants } from '../utils/callUtils';\nimport { createDefaultCommonCallingHandlers, CommonCallingHandlers } from './createCommonHandlers';\n\nimport { VideoBackgroundEffectsDependency } from './createCommonHandlers';\n\n/**\n * Object containing all the handlers required for calling components.\n *\n * Calling related components from this package are able to pick out relevant handlers from this object.\n * See {@link useHandlers} and {@link usePropsFor}.\n *\n * @public\n */\nexport interface CallingHandlers extends CommonCallingHandlers {\n onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions) => Call | undefined;\n}\n\n/**\n * Configuration options to include video effect background dependency.\n * @public\n */\nexport type CallingHandlersOptions = {\n onResolveVideoBackgroundEffectsDependency?: () => Promise<VideoBackgroundEffectsDependency>;\n};\n\n/**\n * Type of {@link createDefaultCallingHandlers}.\n *\n * @public\n */\nexport type CreateDefaultCallingHandlers = (\n callClient: StatefulCallClient,\n callAgent: CallAgent | undefined,\n deviceManager: StatefulDeviceManager | undefined,\n call: Call | undefined,\n\n options?: CallingHandlersOptions\n) => CallingHandlers;\n\n/**\n * Create the default implementation of {@link CallingHandlers} for teams call.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const createDefaultCallingHandlers: CreateDefaultCallingHandlers = memoizeOne((...args) => {\n const [callClient, callAgent, deviceManager, call, options] = args;\n return {\n ...createDefaultCommonCallingHandlers(callClient, deviceManager, call, options),\n // FIXME: onStartCall API should use string, not the underlying SDK types.\n onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions): Call | undefined => {\n /* @conditional-compile-remove(teams-adhoc-call) */\n return callAgent?.startCall(participants, options);\n if (!isACSCallParticipants(participants)) {\n throw new Error('TeamsUserIdentifier in Teams call is not supported!');\n }\n return callAgent?.startCall(participants, options);\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant: async (\n userId: string | CommunicationIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n if (isPhoneNumberIdentifier(participant)) {\n call?.addParticipant(participant, options);\n } else if (isCommunicationUserIdentifier(participant) || isMicrosoftTeamsUserIdentifier(participant)) {\n call?.addParticipant(participant);\n }\n },\n onRemoveParticipant: async (\n userId: string | /* @conditional-compile-remove(PSTN-calls) */ CommunicationIdentifier\n ): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n await call?.removeParticipant(participant);\n }\n };\n});\n\n/**\n * Handlers only for calling components\n * @internal\n */\nexport interface _ComponentCallingHandlers {\n /** VideoGallery callback prop to start local spotlight */\n onStartLocalSpotlight: () => Promise<void>;\n /** VideoGallery callback prop to stop local spotlight */\n onStopLocalSpotlight: () => Promise<void>;\n /** VideoGallery callback prop to start remote spotlight */\n onStartRemoteSpotlight: (userIds: string[]) => Promise<void>;\n /** VideoGallery callback prop to stop remote spotlight */\n onStopRemoteSpotlight: (userIds: string[]) => Promise<void>;\n}\n"]}
1
+ {"version":3,"file":"createHandlers.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/handlers/createHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAOlC,6CAA6C;AAC7C,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,0BAA0B,EAAE,mCAAgC;AAIrE,OAAO,U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CAAA,IACD;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Call, CallAgent, StartCallOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { IncomingCallCommon } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport {\n isCommunicationUserIdentifier,\n isMicrosoftTeamsUserIdentifier,\n isPhoneNumberIdentifier\n} from '@azure/communication-common';\nimport { CommunicationIdentifier } from '@azure/communication-common';\n\nimport { _toCommunicationIdentifier } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { DeclarativeCallAgent } from '@internal/calling-stateful-client';\nimport { StatefulCallClient, StatefulDeviceManager } from '@internal/calling-stateful-client';\nimport memoizeOne from 'memoize-one';\nimport { isACSCallParticipants } from '../utils/callUtils';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { createLocalVideoStream } from '../utils/callUtils';\nimport { createDefaultCommonCallingHandlers, CommonCallingHandlers } from './createCommonHandlers';\n\nimport { VideoBackgroundEffectsDependency } from './createCommonHandlers';\n\n/**\n * Object containing all the handlers required for calling components.\n *\n * Calling related components from this package are able to pick out relevant handlers from this object.\n * See {@link useHandlers} and {@link usePropsFor}.\n *\n * @public\n */\nexport interface CallingHandlers extends CommonCallingHandlers {\n onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions) => Call | undefined;\n /* @conditional-compile-remove(one-to-n-calling) */\n onAcceptCall: (incomingCallId: string, useVideo?: boolean) => Promise<void>;\n /* @conditional-compile-remove(one-to-n-calling) */\n onRejectCall: (incomingCallId: string) => Promise<void>;\n}\n\n/**\n * Configuration options to include video effect background dependency.\n * @public\n */\nexport type CallingHandlersOptions = {\n onResolveVideoBackgroundEffectsDependency?: () => Promise<VideoBackgroundEffectsDependency>;\n};\n\n/**\n * Type of {@link createDefaultCallingHandlers}.\n *\n * @public\n */\nexport type CreateDefaultCallingHandlers = (\n callClient: StatefulCallClient,\n callAgent: CallAgent | undefined,\n deviceManager: StatefulDeviceManager | undefined,\n call: Call | undefined,\n\n options?: CallingHandlersOptions\n) => CallingHandlers;\n\n/**\n * Create the default implementation of {@link CallingHandlers} for teams call.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const createDefaultCallingHandlers: CreateDefaultCallingHandlers = memoizeOne((...args) => {\n const [callClient, callAgent, deviceManager, call, options] = args;\n return {\n ...createDefaultCommonCallingHandlers(callClient, deviceManager, call, options),\n // FIXME: onStartCall API should use string, not the underlying SDK types.\n onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions): Call | undefined => {\n /* @conditional-compile-remove(teams-adhoc-call) */\n return callAgent?.startCall(participants, options);\n if (!isACSCallParticipants(participants)) {\n throw new Error('TeamsUserIdentifier in Teams call is not supported!');\n }\n return callAgent?.startCall(participants, options);\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant: async (\n userId: string | CommunicationIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n if (isPhoneNumberIdentifier(participant)) {\n call?.addParticipant(participant, options);\n } else if (isCommunicationUserIdentifier(participant) || isMicrosoftTeamsUserIdentifier(participant)) {\n call?.addParticipant(participant);\n }\n },\n onRemoveParticipant: async (\n userId: string | /* @conditional-compile-remove(PSTN-calls) */ CommunicationIdentifier\n ): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n await call?.removeParticipant(participant);\n },\n /* @conditional-compile-remove(one-to-n-calling) */\n onAcceptCall: async (incomingCallId: string, useVideo?: boolean): Promise<void> => {\n const localVideoStream = useVideo ? await createLocalVideoStream(callClient) : undefined;\n const incomingCall = (callAgent as DeclarativeCallAgent)?.incomingCalls.find(\n (incomingCall: IncomingCallCommon) => incomingCall.id === incomingCallId\n );\n if (incomingCall) {\n await incomingCall.accept(\n localVideoStream ? { videoOptions: { localVideoStreams: [localVideoStream] } } : undefined\n );\n }\n },\n /* @conditional-compile-remove(one-to-n-calling) */\n onRejectCall: async (incomingCallId: string): Promise<void> => {\n const incomingCall = (callAgent as DeclarativeCallAgent)?.incomingCalls.find(\n (incomingCall: IncomingCallCommon) => incomingCall.id === incomingCallId\n );\n if (incomingCall) {\n await incomingCall.reject();\n }\n }\n };\n});\n\n/**\n * Handlers only for calling components\n * @internal\n */\nexport interface _ComponentCallingHandlers {\n /** VideoGallery callback prop to start local spotlight */\n onStartLocalSpotlight: () => Promise<void>;\n /** VideoGallery callback prop to stop local spotlight */\n onStopLocalSpotlight: () => Promise<void>;\n /** VideoGallery callback prop to start remote spotlight */\n onStartRemoteSpotlight: (userIds: string[]) => Promise<void>;\n /** VideoGallery callback prop to stop remote spotlight */\n onStopRemoteSpotlight: (userIds: string[]) => Promise<void>;\n}\n"]}
@@ -15,6 +15,8 @@ import { CommonCallingHandlers, VideoBackgroundEffectsDependency } from './creat
15
15
  */
16
16
  export interface TeamsCallingHandlers extends CommonCallingHandlers {
17
17
  onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions) => undefined | /* @conditional-compile-remove(teams-identity-support) */ TeamsCall;
18
+ onAcceptCall: (incomingCallId: string, useVideo?: boolean) => Promise<void>;
19
+ onRejectCall: (incomingCallId: string) => Promise<void>;
18
20
  }
19
21
  /**
20
22
  * Create the default implementation of {@link TeamsCallingHandlers} for teams call.
@@ -15,6 +15,8 @@ import { isPhoneNumberIdentifier } from '@azure/communication-common';
15
15
  import { _toCommunicationIdentifier } from "../../../acs-ui-common/src";
16
16
  import memoizeOne from 'memoize-one';
17
17
  import { isTeamsCallParticipants } from '../utils/callUtils';
18
+ /* @conditional-compile-remove(one-to-n-calling) */
19
+ import { createLocalVideoStream } from '../utils/callUtils';
18
20
  import { createDefaultCommonCallingHandlers } from './createCommonHandlers';
19
21
  /**
20
22
  * Create the default implementation of {@link TeamsCallingHandlers} for teams call.
@@ -67,6 +69,21 @@ export const createDefaultTeamsCallingHandlers = memoizeOne((callClient, callAge
67
69
  }
68
70
  /* @conditional-compile-remove(teams-identity-support) */
69
71
  yield (call === null || call === void 0 ? void 0 : call.removeParticipant(participant));
72
+ }),
73
+ /* @conditional-compile-remove(one-to-n-calling) */
74
+ onAcceptCall: (incomingCallId, useVideo) => __awaiter(void 0, void 0, void 0, function* () {
75
+ const localVideoStream = useVideo ? yield createLocalVideoStream(callClient) : undefined;
76
+ const incomingCall = callAgent === null || callAgent === void 0 ? void 0 : callAgent.incomingCalls.find((incomingCall) => incomingCall.id === incomingCallId);
77
+ if (incomingCall) {
78
+ yield incomingCall.accept(localVideoStream ? { videoOptions: { localVideoStreams: [localVideoStream] } } : undefined);
79
+ }
80
+ }),
81
+ /* @conditional-compile-remove(one-to-n-calling) */
82
+ onRejectCall: (incomingCallId) => __awaiter(void 0, void 0, void 0, function* () {
83
+ const incomingCall = callAgent === null || callAgent === void 0 ? void 0 : callAgent.incomingCalls.find((incomingCall) => incomingCall.id === incomingCallId);
84
+ if (incomingCall) {
85
+ yield incomingCall.reject();
86
+ }
70
87
  }) });
71
88
  });
72
89
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"createTeamsCallHandlers.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/handlers/createTeamsCallHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAOlC,OAAO,EAEL,6BAA6B,EAC7B,6BAA6B,EAC9B,MAAM,6BAA6B,CAAC;AACrC,6CAA6C;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAU,0BAA0B,EAAE,mCAAgC;AAE7E,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EACL,kCAAkC,EAGnC,MAAM,wBAAwB,CAAC;AAgBhC;;;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AAE,CAAC;QAC9B,MAAM,IAAI,KAAK,CAAC,kDAAkD,CAAC,CAAC;IACtE,CAAC;SAAM,CAAC;QACN,OAAO,SAAS,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAQ,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { StartCallOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { TeamsCall, TeamsCallAgent, TeamsCallAgentOptions } from '@azure/communication-calling';\nimport {\n CommunicationIdentifier,\n isCommunicationUserIdentifier,\n isMicrosoftTeamsAppIdentifier\n} from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { isPhoneNumberIdentifier } from '@azure/communication-common';\nimport { Common, _toCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { StatefulCallClient, StatefulDeviceManager } from '@internal/calling-stateful-client';\nimport memoizeOne from 'memoize-one';\nimport { ReactElement } from 'react';\nimport { isTeamsCallParticipants } from '../utils/callUtils';\nimport {\n createDefaultCommonCallingHandlers,\n CommonCallingHandlers,\n VideoBackgroundEffectsDependency\n} from './createCommonHandlers';\n/**\n * Object containing all the teams call handlers required for calling components.\n *\n * Calling related components from this package are able to pick out relevant handlers from this object.\n * See {@link useHandlers} and {@link usePropsFor}.\n *\n * @public\n */\nexport interface TeamsCallingHandlers extends CommonCallingHandlers {\n onStartCall: (\n participants: CommunicationIdentifier[],\n options?: StartCallOptions\n ) => undefined | /* @conditional-compile-remove(teams-identity-support) */ TeamsCall;\n}\n\n/**\n * Create the default implementation of {@link TeamsCallingHandlers} for teams call.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const createDefaultTeamsCallingHandlers = memoizeOne(\n (\n callClient: StatefulCallClient,\n callAgent?: TeamsCallAgent,\n deviceManager?: StatefulDeviceManager,\n call?: TeamsCall,\n options?: {\n onResolveVideoBackgroundEffectsDependency?: () => Promise<VideoBackgroundEffectsDependency>;\n }\n ): TeamsCallingHandlers => {\n return {\n ...createDefaultCommonCallingHandlers(callClient, deviceManager, call, options),\n onStartCall: (participants, options) => {\n /* @conditional-compile-remove(teams-identity-support-beta) */\n const threadId = options?.threadId;\n if (!isTeamsCallParticipants(participants)) {\n throw new Error('CommunicationIdentifier in Teams call is not supported!');\n }\n if (callAgent) {\n /* @conditional-compile-remove(teams-identity-support-beta) */\n return callAgent.startCall(participants, threadId ? { threadId, ...options } : undefined);\n /* @conditional-compile-remove(teams-identity-support) */\n // Remove when teams identity in stable support multiple participants\n return teamsSingleParticipantTrampoline(callAgent as TeamsCallAgent, participants, options);\n }\n\n return undefined;\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant: async (\n userId: string | CommunicationIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n /* @conditional-compile-remove(teams-identity-support) */\n const threadId = options?.threadId;\n if (isCommunicationUserIdentifier(participant)) {\n throw new Error('CommunicationIdentifier in Teams call is not supported!');\n }\n\n if (isMicrosoftTeamsAppIdentifier(participant)) {\n throw new Error('Adding Microsoft Teams app identifier is not supported!');\n }\n /* @conditional-compile-remove(teams-identity-support) */\n if (isPhoneNumberIdentifier(participant)) {\n call?.addParticipant(participant, threadId ? { threadId } : undefined);\n }\n /* @conditional-compile-remove(teams-identity-support) */\n call?.addParticipant(participant);\n },\n onRemoveParticipant: async (\n userId: string | /* @conditional-compile-remove(PSTN-calls) */ CommunicationIdentifier\n ): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n if (isCommunicationUserIdentifier(participant)) {\n throw new Error('CommunicationIdentifier in Teams call is not supported!');\n }\n\n if (isMicrosoftTeamsAppIdentifier(participant)) {\n throw new Error('Removing Microsoft Teams app identifier is not supported!');\n }\n /* @conditional-compile-remove(teams-identity-support) */\n await call?.removeParticipant(participant);\n }\n };\n }\n);\n\n/**\n * Create a set of default handlers for given component. Memoization is applied to the result. Multiple invocations with\n * the same arguments will return the same handler instances. DeclarativeCallAgent, DeclarativeDeviceManager, and\n * DeclarativeCall may be undefined. If undefined, their associated handlers will not be created and returned.\n *\n * @param callClient - StatefulCallClient returned from\n * {@link @azure/communication-react#createStatefulCallClient}.\n * @param callAgent - Instance of {@link @azure/communication-calling#TeamsCallClient}.\n * @param deviceManager - Instance of {@link @azure/communication-calling#DeviceManager}.\n * @param call - Instance of {@link @azure/communication-calling#TeamsCall}.\n * @param _ - React component that you want to generate handlers for.\n *\n * @public\n */\nexport const createTeamsCallingHandlersForComponent = <Props>(\n callClient: StatefulCallClient,\n callAgent: undefined | /* @conditional-compile-remove(teams-identity-support) */ TeamsCallAgent,\n deviceManager: StatefulDeviceManager | undefined,\n call: undefined | /* @conditional-compile-remove(teams-identity-support) */ TeamsCall,\n _Component: (props: Props) => ReactElement | null\n): Common<TeamsCallingHandlers, Props> => {\n return createDefaultTeamsCallingHandlers(callClient, callAgent, deviceManager, call);\n};\n\n/* @conditional-compile-remove(teams-identity-support) */\nconst teamsSingleParticipantTrampoline = (\n callAgent: TeamsCallAgent,\n participants: CommunicationIdentifier[],\n options?: TeamsCallAgentOptions\n): TeamsCall => {\n if (participants.length !== 1) {\n throw new Error('Only one participant is supported in Teams call!');\n } else {\n return callAgent.startCall(participants[0] as any, options);\n }\n};\n"]}
1
+ {"version":3,"file":"createTeamsCallHandlers.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/handlers/createTeamsCallHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AASlC,OAAO,EAEL,6BAA6B,EAC7B,6BAA6B,EAC9B,MAAM,6BAA6B,CAAC;AACrC,6CAA6C;AAC7C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAU,0BAA0B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N,OAAO,SAAS,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAQ,EAAE,OAAO,CAAC,CAAC;IAC9D,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { StartCallOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { IncomingCallCommon } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { TeamsCall, TeamsCallAgent, TeamsCallAgentOptions } from '@azure/communication-calling';\nimport {\n CommunicationIdentifier,\n isCommunicationUserIdentifier,\n isMicrosoftTeamsAppIdentifier\n} from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { isPhoneNumberIdentifier } from '@azure/communication-common';\nimport { Common, _toCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { StatefulCallClient, StatefulDeviceManager } from '@internal/calling-stateful-client';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { DeclarativeTeamsCallAgent } from '@internal/calling-stateful-client';\nimport memoizeOne from 'memoize-one';\nimport { ReactElement } from 'react';\nimport { isTeamsCallParticipants } from '../utils/callUtils';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { createLocalVideoStream } from '../utils/callUtils';\nimport {\n createDefaultCommonCallingHandlers,\n CommonCallingHandlers,\n VideoBackgroundEffectsDependency\n} from './createCommonHandlers';\n/**\n * Object containing all the teams call handlers required for calling components.\n *\n * Calling related components from this package are able to pick out relevant handlers from this object.\n * See {@link useHandlers} and {@link usePropsFor}.\n *\n * @public\n */\nexport interface TeamsCallingHandlers extends CommonCallingHandlers {\n onStartCall: (\n participants: CommunicationIdentifier[],\n options?: StartCallOptions\n ) => undefined | /* @conditional-compile-remove(teams-identity-support) */ TeamsCall;\n /* @conditional-compile-remove(one-to-n-calling) */\n onAcceptCall: (incomingCallId: string, useVideo?: boolean) => Promise<void>;\n /* @conditional-compile-remove(one-to-n-calling) */\n onRejectCall: (incomingCallId: string) => Promise<void>;\n}\n\n/**\n * Create the default implementation of {@link TeamsCallingHandlers} for teams call.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const createDefaultTeamsCallingHandlers = memoizeOne(\n (\n callClient: StatefulCallClient,\n callAgent?: TeamsCallAgent,\n deviceManager?: StatefulDeviceManager,\n call?: TeamsCall,\n options?: {\n onResolveVideoBackgroundEffectsDependency?: () => Promise<VideoBackgroundEffectsDependency>;\n }\n ): TeamsCallingHandlers => {\n return {\n ...createDefaultCommonCallingHandlers(callClient, deviceManager, call, options),\n onStartCall: (participants, options) => {\n /* @conditional-compile-remove(teams-identity-support-beta) */\n const threadId = options?.threadId;\n if (!isTeamsCallParticipants(participants)) {\n throw new Error('CommunicationIdentifier in Teams call is not supported!');\n }\n if (callAgent) {\n /* @conditional-compile-remove(teams-identity-support-beta) */\n return callAgent.startCall(participants, threadId ? { threadId, ...options } : undefined);\n /* @conditional-compile-remove(teams-identity-support) */\n // Remove when teams identity in stable support multiple participants\n return teamsSingleParticipantTrampoline(callAgent as TeamsCallAgent, participants, options);\n }\n\n return undefined;\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant: async (\n userId: string | CommunicationIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n /* @conditional-compile-remove(teams-identity-support) */\n const threadId = options?.threadId;\n if (isCommunicationUserIdentifier(participant)) {\n throw new Error('CommunicationIdentifier in Teams call is not supported!');\n }\n\n if (isMicrosoftTeamsAppIdentifier(participant)) {\n throw new Error('Adding Microsoft Teams app identifier is not supported!');\n }\n /* @conditional-compile-remove(teams-identity-support) */\n if (isPhoneNumberIdentifier(participant)) {\n call?.addParticipant(participant, threadId ? { threadId } : undefined);\n }\n /* @conditional-compile-remove(teams-identity-support) */\n call?.addParticipant(participant);\n },\n onRemoveParticipant: async (\n userId: string | /* @conditional-compile-remove(PSTN-calls) */ CommunicationIdentifier\n ): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n if (isCommunicationUserIdentifier(participant)) {\n throw new Error('CommunicationIdentifier in Teams call is not supported!');\n }\n\n if (isMicrosoftTeamsAppIdentifier(participant)) {\n throw new Error('Removing Microsoft Teams app identifier is not supported!');\n }\n /* @conditional-compile-remove(teams-identity-support) */\n await call?.removeParticipant(participant);\n },\n /* @conditional-compile-remove(one-to-n-calling) */\n onAcceptCall: async (incomingCallId: string, useVideo?: boolean): Promise<void> => {\n const localVideoStream = useVideo ? await createLocalVideoStream(callClient) : undefined;\n const incomingCall = (callAgent as DeclarativeTeamsCallAgent)?.incomingCalls.find(\n (incomingCall: IncomingCallCommon) => incomingCall.id === incomingCallId\n );\n if (incomingCall) {\n await incomingCall.accept(\n localVideoStream ? { videoOptions: { localVideoStreams: [localVideoStream] } } : undefined\n );\n }\n },\n /* @conditional-compile-remove(one-to-n-calling) */\n onRejectCall: async (incomingCallId: string): Promise<void> => {\n const incomingCall = (callAgent as DeclarativeTeamsCallAgent)?.incomingCalls.find(\n (incomingCall: IncomingCallCommon) => incomingCall.id === incomingCallId\n );\n if (incomingCall) {\n await incomingCall.reject();\n }\n }\n };\n }\n);\n\n/**\n * Create a set of default handlers for given component. Memoization is applied to the result. Multiple invocations with\n * the same arguments will return the same handler instances. DeclarativeCallAgent, DeclarativeDeviceManager, and\n * DeclarativeCall may be undefined. If undefined, their associated handlers will not be created and returned.\n *\n * @param callClient - StatefulCallClient returned from\n * {@link @azure/communication-react#createStatefulCallClient}.\n * @param callAgent - Instance of {@link @azure/communication-calling#TeamsCallClient}.\n * @param deviceManager - Instance of {@link @azure/communication-calling#DeviceManager}.\n * @param call - Instance of {@link @azure/communication-calling#TeamsCall}.\n * @param _ - React component that you want to generate handlers for.\n *\n * @public\n */\nexport const createTeamsCallingHandlersForComponent = <Props>(\n callClient: StatefulCallClient,\n callAgent: undefined | /* @conditional-compile-remove(teams-identity-support) */ TeamsCallAgent,\n deviceManager: StatefulDeviceManager | undefined,\n call: undefined | /* @conditional-compile-remove(teams-identity-support) */ TeamsCall,\n _Component: (props: Props) => ReactElement | null\n): Common<TeamsCallingHandlers, Props> => {\n return createDefaultTeamsCallingHandlers(callClient, callAgent, deviceManager, call);\n};\n\n/* @conditional-compile-remove(teams-identity-support) */\nconst teamsSingleParticipantTrampoline = (\n callAgent: TeamsCallAgent,\n participants: CommunicationIdentifier[],\n options?: TeamsCallAgentOptions\n): TeamsCall => {\n if (participants.length !== 1) {\n throw new Error('Only one participant is supported in Teams call!');\n } else {\n return callAgent.startCall(participants[0] as any, options);\n }\n};\n"]}
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { CameraButton, EndCallButton, ErrorBar, MicrophoneButton, DevicesButton, ParticipantList, ScreenShareButton, VideoGallery } from "../../../react-components/src";
3
+ import { IncomingCallStack } from "../../../react-components/src";
3
4
  import { NotificationStack } from "../../../react-components/src";
4
5
  import { Dialpad } from "../../../react-components/src";
5
6
  import { HoldButton } from "../../../react-components/src";
@@ -15,6 +16,7 @@ import { ErrorBarSelector } from '../errorBarSelector';
15
16
  import { CommonCallingHandlers } from '../handlers/createCommonHandlers';
16
17
  import { _ComponentCallingHandlers } from '../handlers/createHandlers';
17
18
  import { NotificationStackSelector } from '../notificationStackSelector';
19
+ import { IncomingCallStackSelector } from '../incomingCallStackSelector';
18
20
  /**
19
21
  * Primary hook to get all hooks necessary for a calling Component.
20
22
  *
@@ -47,7 +49,7 @@ export type EmptySelector = () => Record<string, never>;
47
49
  *
48
50
  * @public
49
51
  */
50
- export type GetSelector<Component extends (props: any) => JSX.Element | undefined> = AreEqual<Component, typeof VideoGallery> extends true ? VideoGallerySelector : AreEqual<Component, typeof DevicesButton> extends true ? DevicesButtonSelector : AreEqual<Component, typeof MicrophoneButton> extends true ? MicrophoneButtonSelector : AreEqual<Component, typeof CameraButton> extends true ? CameraButtonSelector : AreEqual<Component, typeof ScreenShareButton> extends true ? ScreenShareButtonSelector : AreEqual<Component, typeof ParticipantList> extends true ? ParticipantListSelector : AreEqual<Component, typeof ParticipantsButton> extends true ? ParticipantsButtonSelector : AreEqual<Component, typeof EndCallButton> extends true ? EmptySelector : AreEqual<Component, typeof ErrorBar> extends true ? ErrorBarSelector : AreEqual<Component, typeof Dialpad> extends true ? EmptySelector : AreEqual<Component, typeof HoldButton> extends true ? HoldButtonSelector : AreEqual<Component, typeof NotificationStack> extends true ? NotificationStackSelector : undefined;
52
+ export type GetSelector<Component extends (props: any) => JSX.Element | undefined> = AreEqual<Component, typeof VideoGallery> extends true ? VideoGallerySelector : AreEqual<Component, typeof DevicesButton> extends true ? DevicesButtonSelector : AreEqual<Component, typeof MicrophoneButton> extends true ? MicrophoneButtonSelector : AreEqual<Component, typeof CameraButton> extends true ? CameraButtonSelector : AreEqual<Component, typeof ScreenShareButton> extends true ? ScreenShareButtonSelector : AreEqual<Component, typeof ParticipantList> extends true ? ParticipantListSelector : AreEqual<Component, typeof ParticipantsButton> extends true ? ParticipantsButtonSelector : AreEqual<Component, typeof EndCallButton> extends true ? EmptySelector : AreEqual<Component, typeof ErrorBar> extends true ? ErrorBarSelector : AreEqual<Component, typeof Dialpad> extends true ? EmptySelector : AreEqual<Component, typeof HoldButton> extends true ? HoldButtonSelector : AreEqual<Component, typeof NotificationStack> extends true ? NotificationStackSelector : AreEqual<Component, typeof IncomingCallStack> extends true ? IncomingCallStackSelector : undefined;
51
53
  /**
52
54
  * Get the selector for a specified component.
53
55
  *
@@ -1,6 +1,8 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  import { CameraButton, EndCallButton, ErrorBar, MicrophoneButton, DevicesButton, ParticipantList, ScreenShareButton, VideoGallery } from "../../../react-components/src";
4
+ /* @conditional-compile-remove(one-to-n-calling) */
5
+ import { IncomingCallStack } from "../../../react-components/src";
4
6
  /* @conditional-compile-remove(notifications) */
5
7
  import { NotificationStack } from "../../../react-components/src";
6
8
  import { Dialpad } from "../../../react-components/src";
@@ -22,6 +24,8 @@ import { reactionButtonSelector } from '../callControlSelectors';
22
24
  import { ReactionButton } from "../../../react-components/src";
23
25
  /* @conditional-compile-remove(notifications) */
24
26
  import { notificationStackSelector } from '../notificationStackSelector';
27
+ /* @conditional-compile-remove(one-to-n-calling) */
28
+ import { incomingCallStackSelector } from '../incomingCallStackSelector';
25
29
  /**
26
30
  * Primary hook to get all hooks necessary for a calling Component.
27
31
  *
@@ -68,6 +72,10 @@ export const getSelector = (component) => {
68
72
  if (component === NotificationStack) {
69
73
  return findConditionalCompiledSelector(component);
70
74
  }
75
+ /* @conditional-compile-remove(one-to-n-calling) */
76
+ if (component === IncomingCallStack) {
77
+ return findConditionalCompiledSelector(component);
78
+ }
71
79
  return findSelector(component);
72
80
  };
73
81
  const findSelector = (component) => {
@@ -101,7 +109,7 @@ const findSelector = (component) => {
101
109
  }
102
110
  return undefined;
103
111
  };
104
- /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(notifications) */
112
+ /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(notifications) */ /* @conditional-compile-remove(one-to-n-calling) */
105
113
  const findConditionalCompiledSelector = (component) => {
106
114
  switch (component) {
107
115
  /* @conditional-compile-remove(PSTN-calls) */
@@ -112,6 +120,10 @@ const findConditionalCompiledSelector = (component) => {
112
120
  case NotificationStack:
113
121
  /* @conditional-compile-remove(notifications) */
114
122
  return notificationStackSelector;
123
+ /* @conditional-compile-remove(one-to-n-calling) */
124
+ case IncomingCallStack:
125
+ /* @conditional-compile-remove(one-to-n-calling) */
126
+ return incomingCallStackSelector;
115
127
  }
116
128
  };
117
129
  //# sourceMappingURL=usePropsFor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"usePropsFor.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/hooks/usePropsFor.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,O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YACX,OAAO,gBAAgB,CAAC;QAC1B,KAAK,eAAe;YAClB,OAAO,uBAAuB,CAAC;QACjC,KAAK,cAAc;YACjB,OAAO,sBAAsB,CAAC;IAClC,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,6CAA6C,CAAC,gDAAgD;AAC9F,MAAM,+BAA+B,GAAG,CAAC,SAAkD,EAAO,EAAE;IAClG,QAAQ,SAAS,EAAE,CAAC;QAClB,6CAA6C;QAC7C,KAAK,UAAU;YACb,6CAA6C;YAC7C,OAAO,kBAAkB,CAAC;QAC5B,gDAAgD;QAChD,KAAK,iBAAiB;YACpB,gDAAgD;YAChD,OAAO,yBAAyB,CAAC;IACrC,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n CameraButton,\n EndCallButton,\n ErrorBar,\n MicrophoneButton,\n DevicesButton,\n ParticipantList,\n ScreenShareButton,\n VideoGallery\n} from '@internal/react-components';\n/* @conditional-compile-remove(notifications) */\nimport { NotificationStack } from '@internal/react-components';\nimport { Dialpad } from '@internal/react-components';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { HoldButton } from '@internal/react-components';\nimport { RaiseHandButton } from '@internal/react-components';\nimport { raiseHandButtonSelector } from '../callControlSelectors';\nimport {\n CameraButtonSelector,\n cameraButtonSelector,\n MicrophoneButtonSelector,\n microphoneButtonSelector,\n DevicesButtonSelector,\n devicesButtonSelector,\n ScreenShareButtonSelector,\n screenShareButtonSelector\n} from '../callControlSelectors';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { holdButtonSelector, HoldButtonSelector } from '../callControlSelectors';\nimport { VideoGallerySelector, videoGallerySelector } from '../videoGallerySelector';\nimport { ParticipantListSelector, participantListSelector } from '../participantListSelector';\nimport { ParticipantsButtonSelector, participantsButtonSelector } from '../participantsButtonSelector';\nimport { useHandlers } from './useHandlers';\nimport { useSelector } from './useSelector';\nimport { Common } from '@internal/acs-ui-common';\nimport { AreEqual } from '@internal/acs-ui-common';\nimport { ParticipantsButton } from '@internal/react-components';\nimport { ErrorBarSelector, errorBarSelector } from '../errorBarSelector';\nimport { CommonCallingHandlers } from '../handlers/createCommonHandlers';\nimport { reactionButtonSelector } from '../callControlSelectors';\nimport { ReactionButton } from '@internal/react-components';\nimport { _ComponentCallingHandlers } from '../handlers/createHandlers';\n/* @conditional-compile-remove(notifications) */\nimport { notificationStackSelector, NotificationStackSelector } from '../notificationStackSelector';\n\n/**\n * Primary hook to get all hooks necessary for a calling Component.\n *\n * Most straightforward usage of calling components looks like:\n *\n * @example\n * ```\n * import { ParticipantList, usePropsFor } from '@azure/communication-react';\n *\n * const App = (): JSX.Element => {\n * // ... code to setup Providers ...\n *\n * return <ParticipantList {...usePropsFor(ParticipantList)}/>\n * }\n * ```\n *\n * @public\n */\nexport const usePropsFor = <Component extends (props: any) => JSX.Element>(\n component: Component\n): GetSelector<Component> extends (props: any) => any\n ? ReturnType<GetSelector<Component>> &\n Common<CommonCallingHandlers & _ComponentCallingHandlers, Parameters<Component>[0]>\n : undefined => {\n const selector = getSelector(component);\n const props = useSelector(selector);\n const handlers = useHandlers<Parameters<Component>[0]>(component);\n if (props !== undefined) {\n return { ...props, ...handlers } as any;\n }\n return undefined as any;\n};\n\n/**\n * A type for trivial selectors that return no data.\n *\n * Used as a default return value if {@link usePropsFor} is called for a component that requires no data.\n *\n * @public\n */\nexport type EmptySelector = () => Record<string, never>;\n\nconst emptySelector: EmptySelector = (): Record<string, never> => ({});\n\n/**\n * Specific type of the selector applicable to a given Component.\n *\n * @public\n */\nexport type GetSelector<Component extends (props: any) => JSX.Element | undefined> =\n AreEqual<Component, typeof VideoGallery> extends true\n ? VideoGallerySelector\n : AreEqual<Component, typeof DevicesButton> extends true\n ? DevicesButtonSelector\n : AreEqual<Component, typeof MicrophoneButton> extends true\n ? MicrophoneButtonSelector\n : AreEqual<Component, typeof CameraButton> extends true\n ? CameraButtonSelector\n : AreEqual<Component, typeof ScreenShareButton> extends true\n ? ScreenShareButtonSelector\n : AreEqual<Component, typeof ParticipantList> extends true\n ? ParticipantListSelector\n : AreEqual<Component, typeof ParticipantsButton> extends true\n ? ParticipantsButtonSelector\n : AreEqual<Component, typeof EndCallButton> extends true\n ? EmptySelector\n : AreEqual<Component, typeof ErrorBar> extends true\n ? ErrorBarSelector\n : AreEqual<Component, typeof Dialpad> extends true\n ? EmptySelector\n : AreEqual<Component, typeof HoldButton> extends true\n ? /* @conditional-compile-remove(PSTN-calls) */ HoldButtonSelector\n : AreEqual<Component, typeof NotificationStack> extends true\n ? /* @conditional-compile-remove(notifications) */ NotificationStackSelector\n : undefined;\n\n/**\n * Get the selector for a specified component.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport const getSelector = <Component extends (props: any) => JSX.Element | undefined>(\n component: Component\n): GetSelector<Component> => {\n /* @conditional-compile-remove(PSTN-calls) */\n if (component === HoldButton) {\n return findConditionalCompiledSelector(component);\n }\n /* @conditional-compile-remove(notifications) */\n if (component === NotificationStack) {\n return findConditionalCompiledSelector(component);\n }\n\n return findSelector(component);\n};\n\nconst findSelector = (component: (props: any) => JSX.Element | undefined): any => {\n // Dialpad only has handlers currently and doesn't require any props from the stateful layer so return the emptySelector\n if (component === Dialpad) {\n return emptySelector;\n }\n\n switch (component) {\n case VideoGallery:\n return videoGallerySelector;\n case MicrophoneButton:\n return microphoneButtonSelector;\n case CameraButton:\n return cameraButtonSelector;\n case ScreenShareButton:\n return screenShareButtonSelector;\n case DevicesButton:\n return devicesButtonSelector;\n case ParticipantList:\n return participantListSelector;\n case ParticipantsButton:\n return participantsButtonSelector;\n case EndCallButton:\n return emptySelector;\n case ErrorBar:\n return errorBarSelector;\n case RaiseHandButton:\n return raiseHandButtonSelector;\n case ReactionButton:\n return reactionButtonSelector;\n }\n return undefined;\n};\n\n/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(notifications) */\nconst findConditionalCompiledSelector = (component: (props: any) => JSX.Element | undefined): any => {\n switch (component) {\n /* @conditional-compile-remove(PSTN-calls) */\n case HoldButton:\n /* @conditional-compile-remove(PSTN-calls) */\n return holdButtonSelector;\n /* @conditional-compile-remove(notifications) */\n case NotificationStack:\n /* @conditional-compile-remove(notifications) */\n return notificationStackSelector;\n }\n};\n"]}
1
+ {"version":3,"file":"usePropsFor.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/hooks/usePropsFor.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EACL,YAAY,EACZ,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,aAAa,EACb,eAAe,EACf,iBAAiB,EACjB,YAAY,EACb,sCAAmC;AACpC,mDAAmD;AACnD,OAAO,EAAE,iBAAiB,EAAE,sCAAmC;AAC/D,gDAAgD;AAChD,OAAO,EAAE,iBAAiB,EAAE,sCAAmC;AAC/D,OAAO,EAAE,OAAO,EAAE,sCAAmC;AACrD,6CAA6C;AAC7C,OAAO,EAAE,UAAU,EAAE,sCAAmC;AACxD,OAAO,EAAE,eAAe,EAAE,sCAAmC;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAEL,oBAAoB,EAEpB,wBAAwB,EAExB,qBAAqB,EAErB,yBAAyB,EAC1B,MAAM,yBAAyB,CAAC;AACjC,6CAA6C;AAC7C,OAAO,EAAE,kBAAkB,EAAsB,MAAM,yBAAyB,CAAC;AACjF,OAAO,EAAwB,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACrF,OAAO,EAA2B,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC9F,OAAO,EAA8B,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AACvG,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C,OAA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raButton,\n EndCallButton,\n ErrorBar,\n MicrophoneButton,\n DevicesButton,\n ParticipantList,\n ScreenShareButton,\n VideoGallery\n} from '@internal/react-components';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { IncomingCallStack } from '@internal/react-components';\n/* @conditional-compile-remove(notifications) */\nimport { NotificationStack } from '@internal/react-components';\nimport { Dialpad } from '@internal/react-components';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { HoldButton } from '@internal/react-components';\nimport { RaiseHandButton } from '@internal/react-components';\nimport { raiseHandButtonSelector } from '../callControlSelectors';\nimport {\n CameraButtonSelector,\n cameraButtonSelector,\n MicrophoneButtonSelector,\n microphoneButtonSelector,\n DevicesButtonSelector,\n devicesButtonSelector,\n ScreenShareButtonSelector,\n screenShareButtonSelector\n} from '../callControlSelectors';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { holdButtonSelector, HoldButtonSelector } from '../callControlSelectors';\nimport { VideoGallerySelector, videoGallerySelector } from '../videoGallerySelector';\nimport { ParticipantListSelector, participantListSelector } from '../participantListSelector';\nimport { ParticipantsButtonSelector, participantsButtonSelector } from '../participantsButtonSelector';\nimport { useHandlers } from './useHandlers';\nimport { useSelector } from './useSelector';\nimport { Common } from '@internal/acs-ui-common';\nimport { AreEqual } from '@internal/acs-ui-common';\nimport { ParticipantsButton } from '@internal/react-components';\nimport { ErrorBarSelector, errorBarSelector } from '../errorBarSelector';\nimport { CommonCallingHandlers } from '../handlers/createCommonHandlers';\nimport { reactionButtonSelector } from '../callControlSelectors';\nimport { ReactionButton } from '@internal/react-components';\nimport { _ComponentCallingHandlers } from '../handlers/createHandlers';\n/* @conditional-compile-remove(notifications) */\nimport { notificationStackSelector, NotificationStackSelector } from '../notificationStackSelector';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { incomingCallStackSelector, IncomingCallStackSelector } from '../incomingCallStackSelector';\n\n/**\n * Primary hook to get all hooks necessary for a calling Component.\n *\n * Most straightforward usage of calling components looks like:\n *\n * @example\n * ```\n * import { ParticipantList, usePropsFor } from '@azure/communication-react';\n *\n * const App = (): JSX.Element => {\n * // ... code to setup Providers ...\n *\n * return <ParticipantList {...usePropsFor(ParticipantList)}/>\n * }\n * ```\n *\n * @public\n */\nexport const usePropsFor = <Component extends (props: any) => JSX.Element>(\n component: Component\n): GetSelector<Component> extends (props: any) => any\n ? ReturnType<GetSelector<Component>> &\n Common<CommonCallingHandlers & _ComponentCallingHandlers, Parameters<Component>[0]>\n : undefined => {\n const selector = getSelector(component);\n const props = useSelector(selector);\n const handlers = useHandlers<Parameters<Component>[0]>(component);\n if (props !== undefined) {\n return { ...props, ...handlers } as any;\n }\n return undefined as any;\n};\n\n/**\n * A type for trivial selectors that return no data.\n *\n * Used as a default return value if {@link usePropsFor} is called for a component that requires no data.\n *\n * @public\n */\nexport type EmptySelector = () => Record<string, never>;\n\nconst emptySelector: EmptySelector = (): Record<string, never> => ({});\n\n/**\n * Specific type of the selector applicable to a given Component.\n *\n * @public\n */\nexport type GetSelector<Component extends (props: any) => JSX.Element | undefined> =\n AreEqual<Component, typeof VideoGallery> extends true\n ? VideoGallerySelector\n : AreEqual<Component, typeof DevicesButton> extends true\n ? DevicesButtonSelector\n : AreEqual<Component, typeof MicrophoneButton> extends true\n ? MicrophoneButtonSelector\n : AreEqual<Component, typeof CameraButton> extends true\n ? CameraButtonSelector\n : AreEqual<Component, typeof ScreenShareButton> extends true\n ? ScreenShareButtonSelector\n : AreEqual<Component, typeof ParticipantList> extends true\n ? ParticipantListSelector\n : AreEqual<Component, typeof ParticipantsButton> extends true\n ? ParticipantsButtonSelector\n : AreEqual<Component, typeof EndCallButton> extends true\n ? EmptySelector\n : AreEqual<Component, typeof ErrorBar> extends true\n ? ErrorBarSelector\n : AreEqual<Component, typeof Dialpad> extends true\n ? EmptySelector\n : AreEqual<Component, typeof HoldButton> extends true\n ? /* @conditional-compile-remove(PSTN-calls) */ HoldButtonSelector\n : AreEqual<Component, typeof NotificationStack> extends true\n ? /* @conditional-compile-remove(notifications) */ NotificationStackSelector\n : AreEqual<Component, typeof IncomingCallStack> extends true\n ? /* @conditional-compile-remove(one-to-n-calling) */ IncomingCallStackSelector\n : undefined;\n\n/**\n * Get the selector for a specified component.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types\nexport const getSelector = <Component extends (props: any) => JSX.Element | undefined>(\n component: Component\n): GetSelector<Component> => {\n /* @conditional-compile-remove(PSTN-calls) */\n if (component === HoldButton) {\n return findConditionalCompiledSelector(component);\n }\n /* @conditional-compile-remove(notifications) */\n if (component === NotificationStack) {\n return findConditionalCompiledSelector(component);\n }\n /* @conditional-compile-remove(one-to-n-calling) */\n if (component === IncomingCallStack) {\n return findConditionalCompiledSelector(component);\n }\n\n return findSelector(component);\n};\n\nconst findSelector = (component: (props: any) => JSX.Element | undefined): any => {\n // Dialpad only has handlers currently and doesn't require any props from the stateful layer so return the emptySelector\n if (component === Dialpad) {\n return emptySelector;\n }\n\n switch (component) {\n case VideoGallery:\n return videoGallerySelector;\n case MicrophoneButton:\n return microphoneButtonSelector;\n case CameraButton:\n return cameraButtonSelector;\n case ScreenShareButton:\n return screenShareButtonSelector;\n case DevicesButton:\n return devicesButtonSelector;\n case ParticipantList:\n return participantListSelector;\n case ParticipantsButton:\n return participantsButtonSelector;\n case EndCallButton:\n return emptySelector;\n case ErrorBar:\n return errorBarSelector;\n case RaiseHandButton:\n return raiseHandButtonSelector;\n case ReactionButton:\n return reactionButtonSelector;\n }\n return undefined;\n};\n\n/* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(notifications) */ /* @conditional-compile-remove(one-to-n-calling) */\nconst findConditionalCompiledSelector = (component: (props: any) => JSX.Element | undefined): any => {\n switch (component) {\n /* @conditional-compile-remove(PSTN-calls) */\n case HoldButton:\n /* @conditional-compile-remove(PSTN-calls) */\n return holdButtonSelector;\n /* @conditional-compile-remove(notifications) */\n case NotificationStack:\n /* @conditional-compile-remove(notifications) */\n return notificationStackSelector;\n /* @conditional-compile-remove(one-to-n-calling) */\n case IncomingCallStack:\n /* @conditional-compile-remove(one-to-n-calling) */\n return incomingCallStackSelector;\n }\n};\n"]}
@@ -0,0 +1,16 @@
1
+ import { CallClientState } from "../../calling-stateful-client/src";
2
+ import { ActiveIncomingCall } from "../../react-components/src";
3
+ /**
4
+ * Selector to get the active and removed incoming calls.
5
+ * @beta
6
+ */
7
+ export type IncomingCallStackSelector = (state: CallClientState) => {
8
+ activeIncomingCalls: ActiveIncomingCall[];
9
+ removedIncomingCalls: ActiveIncomingCall[];
10
+ };
11
+ /**
12
+ * Select the active and removed incoming calls from the stateful client for the IncomingCallNotificationStackComponent.
13
+ * @beta
14
+ */
15
+ export declare const incomingCallStackSelector: IncomingCallStackSelector;
16
+ //# sourceMappingURL=incomingCallStackSelector.d.ts.map
@@ -0,0 +1,33 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { getDeviceManager, getIncomingCalls, getRemovedIncomingCalls } from './baseSelectors';
4
+ import { createSelector } from 'reselect';
5
+ import { isPhoneNumberIdentifier } from '@azure/communication-common';
6
+ /**
7
+ * Select the active and removed incoming calls from the stateful client for the IncomingCallNotificationStackComponent.
8
+ * @beta
9
+ */
10
+ export const incomingCallStackSelector = createSelector([getIncomingCalls, getRemovedIncomingCalls, getDeviceManager], (incomingCalls, removedIncomingCalls, deviceManager) => {
11
+ // Convert incoming call state to active incoming call
12
+ const componentIncomingCalls = incomingCalls.map((incomingCall) => {
13
+ return Object.assign(Object.assign({}, incomingCall), { callerInfo: {
14
+ displayName: incomingCall.callerInfo.displayName || 'Unknown Caller'
15
+ }, videoAvailable: (incomingCall.callerInfo.identifier && isPhoneNumberIdentifier(incomingCall.callerInfo.identifier)) ||
16
+ (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.cameras.length) === 0
17
+ ? false
18
+ : true });
19
+ });
20
+ const componentRemovedIncomingCalls = removedIncomingCalls.map((incomingCall) => {
21
+ return Object.assign(Object.assign({}, incomingCall), { callerInfo: {
22
+ displayName: incomingCall.callerInfo.displayName || 'Unknown Caller'
23
+ }, videoAvailable: (incomingCall.callerInfo.identifier && isPhoneNumberIdentifier(incomingCall.callerInfo.identifier)) ||
24
+ (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.cameras.length) === 0
25
+ ? false
26
+ : true });
27
+ });
28
+ return {
29
+ activeIncomingCalls: componentIncomingCalls,
30
+ removedIncomingCalls: componentRemovedIncomingCalls
31
+ };
32
+ });
33
+ //# sourceMappingURL=incomingCallStackSelector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"incomingCallStackSelector.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/incomingCallStackSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAWtE;;;GAGG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAA8B,cAAc,CAChF,CAAC,gBAAgB,EAAE,uBAAuB,EAAE,gBAAgB,CAAC,EAC7D,CACE,aAAa,EACb,oBAAoB,EACpB,aAAa,EAIb,EAAE;IACF,sDAAsD;IACtD,MAAM,sBAAsB,GAAG,aAAa,CAAC,GAAG,CAC9C,CACE,YAA4G,EAC5G,EAAE;QACF,uCACK,YAAY,KACf,UAAU,EAAE;gBACV,WAAW,EAAE,YAAY,CAAC,UAAU,CAAC,WAAW,IAAI,gBAAgB;aACrE,EACD,cAAc,EACZ,CAAC,YAAY,CAAC,UAAU,CAAC,UAAU,IAAI,uBAAuB,CAAC,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;gBACnG,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,OAAO,CAAC,MAAM,MAAK,CAAC;gBACjC,CAAC,CAAC,KAAK;gBACP,CAAC,CAAC,IAAI,IACV;IACJ,CAAC,CACF,CAAC;IACF,MAAM,6BAA6B,GAAG,oBAAoB,CAAC,GAAG,CAC5D,CACE,YAA4G,EAC5G,EAAE;QACF,uCACK,YAAY,KACf,UAAU,EAAE;gBACV,WAAW,EAAE,YAAY,CAAC,UAAU,CAAC,WAAW,IAAI,gBAAgB;aACrE,EACD,cAAc,EACZ,CAAC,YAAY,CAAC,UAAU,CAAC,UAAU,IAAI,uBAAuB,CAAC,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;gBACnG,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,OAAO,CAAC,MAAM,MAAK,CAAC;gBACjC,CAAC,CAAC,KAAK;gBACP,CAAC,CAAC,IAAI,IACV;IACJ,CAAC,CACF,CAAC;IACF,OAAO;QACL,mBAAmB,EAAE,sBAAsB;QAC3C,oBAAoB,EAAE,6BAA6B;KACpD,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CallClientState, IncomingCallState } from '@internal/calling-stateful-client';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { TeamsIncomingCallState } from '@internal/calling-stateful-client';\nimport { getDeviceManager, getIncomingCalls, getRemovedIncomingCalls } from './baseSelectors';\nimport { createSelector } from 'reselect';\nimport { ActiveIncomingCall } from '@internal/react-components';\nimport { isPhoneNumberIdentifier } from '@azure/communication-common';\n\n/**\n * Selector to get the active and removed incoming calls.\n * @beta\n */\nexport type IncomingCallStackSelector = (state: CallClientState) => {\n activeIncomingCalls: ActiveIncomingCall[];\n removedIncomingCalls: ActiveIncomingCall[];\n};\n\n/**\n * Select the active and removed incoming calls from the stateful client for the IncomingCallNotificationStackComponent.\n * @beta\n */\nexport const incomingCallStackSelector: IncomingCallStackSelector = createSelector(\n [getIncomingCalls, getRemovedIncomingCalls, getDeviceManager],\n (\n incomingCalls,\n removedIncomingCalls,\n deviceManager\n ): {\n activeIncomingCalls: ActiveIncomingCall[];\n removedIncomingCalls: ActiveIncomingCall[];\n } => {\n // Convert incoming call state to active incoming call\n const componentIncomingCalls = incomingCalls.map(\n (\n incomingCall: IncomingCallState | /* @conditional-compile-remove(one-to-n-calling) */ TeamsIncomingCallState\n ) => {\n return {\n ...incomingCall,\n callerInfo: {\n displayName: incomingCall.callerInfo.displayName || 'Unknown Caller'\n },\n videoAvailable:\n (incomingCall.callerInfo.identifier && isPhoneNumberIdentifier(incomingCall.callerInfo.identifier)) ||\n deviceManager?.cameras.length === 0\n ? false\n : true\n };\n }\n );\n const componentRemovedIncomingCalls = removedIncomingCalls.map(\n (\n incomingCall: IncomingCallState | /* @conditional-compile-remove(one-to-n-calling) */ TeamsIncomingCallState\n ) => {\n return {\n ...incomingCall,\n callerInfo: {\n displayName: incomingCall.callerInfo.displayName || 'Unknown Caller'\n },\n videoAvailable:\n (incomingCall.callerInfo.identifier && isPhoneNumberIdentifier(incomingCall.callerInfo.identifier)) ||\n deviceManager?.cameras.length === 0\n ? false\n : true\n };\n }\n );\n return {\n activeIncomingCalls: componentIncomingCalls,\n removedIncomingCalls: componentRemovedIncomingCalls\n };\n }\n);\n"]}