@azure/communication-react 1.5.1-beta.1 → 1.5.1-beta.3

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 (446) hide show
  1. package/CHANGELOG.beta.md +123 -1
  2. package/CHANGELOG.json +1068 -0
  3. package/README.md +1 -1
  4. package/dist/communication-react.d.ts +602 -170
  5. package/dist/dist-cjs/communication-react/index.js +6134 -3678
  6. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  7. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  8. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  9. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +13 -0
  10. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +36 -0
  11. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  12. package/dist/dist-esm/calling-component-bindings/src/captionsSelector.d.ts +49 -0
  13. package/dist/dist-esm/calling-component-bindings/src/captionsSelector.js +53 -0
  14. package/dist/dist-esm/calling-component-bindings/src/captionsSelector.js.map +1 -0
  15. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js +1 -1
  16. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js.map +1 -1
  17. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +12 -0
  18. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +27 -1
  19. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  20. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +3 -1
  21. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
  22. package/dist/dist-esm/calling-component-bindings/src/index.d.ts +3 -0
  23. package/dist/dist-esm/calling-component-bindings/src/index.js +2 -0
  24. package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
  25. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +68 -1
  26. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  27. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +19 -0
  28. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +95 -0
  29. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  30. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js +57 -0
  31. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -1
  32. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +2 -0
  33. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +19 -0
  34. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  35. package/dist/dist-esm/calling-stateful-client/src/CaptionsSubscriber.d.ts +18 -0
  36. package/dist/dist-esm/calling-stateful-client/src/CaptionsSubscriber.js +38 -0
  37. package/dist/dist-esm/calling-stateful-client/src/CaptionsSubscriber.js.map +1 -0
  38. package/dist/dist-esm/calling-stateful-client/src/Converter.d.ts +6 -0
  39. package/dist/dist-esm/calling-stateful-client/src/Converter.js +18 -1
  40. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  41. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.d.ts +4 -1
  42. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js +5 -1
  43. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js.map +1 -1
  44. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.d.ts +3 -0
  45. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js +5 -0
  46. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js.map +1 -1
  47. package/dist/dist-esm/calling-stateful-client/src/Logger.d.ts +16 -29
  48. package/dist/dist-esm/calling-stateful-client/src/Logger.js +16 -29
  49. package/dist/dist-esm/calling-stateful-client/src/Logger.js.map +1 -1
  50. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +1 -1
  51. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
  52. package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js +137 -370
  53. package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js.map +1 -1
  54. package/dist/dist-esm/calling-stateful-client/src/StreamUtilsLogging.d.ts +17 -0
  55. package/dist/dist-esm/calling-stateful-client/src/StreamUtilsLogging.js +198 -0
  56. package/dist/dist-esm/calling-stateful-client/src/StreamUtilsLogging.js.map +1 -0
  57. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.d.ts +7 -0
  58. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js +10 -0
  59. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js.map +1 -1
  60. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +1 -0
  61. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  62. package/dist/dist-esm/calling-stateful-client/src/index.d.ts +1 -0
  63. package/dist/dist-esm/calling-stateful-client/src/index.js +2 -0
  64. package/dist/dist-esm/calling-stateful-client/src/index.js.map +1 -1
  65. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +59 -5
  66. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  67. package/dist/dist-esm/chat-component-bindings/src/utils/constants.d.ts +4 -0
  68. package/dist/dist-esm/chat-component-bindings/src/utils/constants.js +4 -0
  69. package/dist/dist-esm/chat-component-bindings/src/utils/constants.js.map +1 -1
  70. package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js +32 -26
  71. package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js.map +1 -1
  72. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js +15 -3
  73. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js.map +1 -1
  74. package/dist/dist-esm/chat-stateful-client/src/convertChatMessage.js +6 -1
  75. package/dist/dist-esm/chat-stateful-client/src/convertChatMessage.js.map +1 -1
  76. package/dist/dist-esm/chat-stateful-client/src/types/ChatMessageWithStatus.d.ts +1 -0
  77. package/dist/dist-esm/chat-stateful-client/src/types/ChatMessageWithStatus.js.map +1 -1
  78. package/dist/dist-esm/communication-react/src/index.d.ts +9 -2
  79. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  80. package/dist/dist-esm/react-components/src/components/CameraButton.d.ts +12 -0
  81. package/dist/dist-esm/react-components/src/components/CameraButton.js +24 -1
  82. package/dist/dist-esm/react-components/src/components/CameraButton.js.map +1 -1
  83. package/dist/dist-esm/react-components/src/components/Caption.d.ts +21 -0
  84. package/dist/dist-esm/react-components/src/components/Caption.js +33 -0
  85. package/dist/dist-esm/react-components/src/components/Caption.js.map +1 -0
  86. package/dist/dist-esm/react-components/src/components/CaptionsBanner.d.ts +31 -0
  87. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +49 -0
  88. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -0
  89. package/dist/dist-esm/react-components/src/components/CaptionsSettingsModal.d.ts +37 -0
  90. package/dist/dist-esm/react-components/src/components/CaptionsSettingsModal.js +88 -0
  91. package/dist/dist-esm/react-components/src/components/CaptionsSettingsModal.js.map +1 -0
  92. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.d.ts +22 -2
  93. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js +19 -16
  94. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +1 -1
  95. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.d.ts +1 -1
  96. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js +4 -2
  97. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js.map +1 -1
  98. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.d.ts +11 -1
  99. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js +38 -20
  100. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +1 -1
  101. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +14 -2
  102. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +96 -11
  103. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  104. package/dist/dist-esm/react-components/src/components/ControlBarButton.js +1 -1
  105. package/dist/dist-esm/react-components/src/components/ControlBarButton.js.map +1 -1
  106. package/dist/dist-esm/react-components/src/components/DevicesButton.d.ts +1 -1
  107. package/dist/dist-esm/react-components/src/components/DevicesButton.js +79 -55
  108. package/dist/dist-esm/react-components/src/components/DevicesButton.js.map +1 -1
  109. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.d.ts +2 -0
  110. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.js +1 -0
  111. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenuItem.js.map +1 -1
  112. package/dist/dist-esm/react-components/src/components/ErrorBar.d.ts +4 -0
  113. package/dist/dist-esm/react-components/src/components/ErrorBar.js.map +1 -1
  114. package/dist/dist-esm/react-components/src/components/FileDownloadCards.d.ts +13 -0
  115. package/dist/dist-esm/react-components/src/components/FileDownloadCards.js +5 -1
  116. package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +1 -1
  117. package/dist/dist-esm/react-components/src/components/GridLayout.js +1 -1
  118. package/dist/dist-esm/react-components/src/components/GridLayout.js.map +1 -1
  119. package/dist/dist-esm/react-components/src/components/HorizontalGallery.d.ts +4 -0
  120. package/dist/dist-esm/react-components/src/components/HorizontalGallery.js +29 -24
  121. package/dist/dist-esm/react-components/src/components/HorizontalGallery.js.map +1 -1
  122. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +38 -6
  123. package/dist/dist-esm/react-components/src/components/MessageThread.js +110 -51
  124. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  125. package/dist/dist-esm/react-components/src/components/MicrophoneButton.d.ts +12 -0
  126. package/dist/dist-esm/react-components/src/components/MicrophoneButton.js +29 -1
  127. package/dist/dist-esm/react-components/src/components/MicrophoneButton.js.map +1 -1
  128. package/dist/dist-esm/react-components/src/components/ModalClone/ModalClone.js +1 -1
  129. package/dist/dist-esm/react-components/src/components/ModalClone/ModalClone.js.map +1 -1
  130. package/dist/dist-esm/react-components/src/components/ParticipantItem.js +1 -1
  131. package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
  132. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +1 -1
  133. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
  134. package/dist/dist-esm/react-components/src/components/ResponsiveHorizontalGallery.d.ts +4 -2
  135. package/dist/dist-esm/react-components/src/components/ResponsiveHorizontalGallery.js +6 -42
  136. package/dist/dist-esm/react-components/src/components/ResponsiveHorizontalGallery.js.map +1 -1
  137. package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.d.ts +35 -0
  138. package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.js +32 -0
  139. package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.js.map +1 -0
  140. package/dist/dist-esm/react-components/src/components/ScreenShareButton.js +10 -2
  141. package/dist/dist-esm/react-components/src/components/ScreenShareButton.js.map +1 -1
  142. package/dist/dist-esm/react-components/src/components/SendBox.js +5 -2
  143. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  144. package/dist/dist-esm/react-components/src/components/StartCaptionsButton.d.ts +70 -0
  145. package/dist/dist-esm/react-components/src/components/StartCaptionsButton.js +52 -0
  146. package/dist/dist-esm/react-components/src/components/StartCaptionsButton.js.map +1 -0
  147. package/dist/dist-esm/react-components/src/components/VerticalGallery.d.ts +67 -0
  148. package/dist/dist-esm/react-components/src/components/VerticalGallery.js +113 -0
  149. package/dist/dist-esm/react-components/src/components/VerticalGallery.js.map +1 -0
  150. package/dist/dist-esm/react-components/src/components/VideoEffects/PresetVideoEffectsItems.d.ts +21 -0
  151. package/dist/dist-esm/react-components/src/components/VideoEffects/PresetVideoEffectsItems.js +65 -0
  152. package/dist/dist-esm/react-components/src/components/VideoEffects/PresetVideoEffectsItems.js.map +1 -0
  153. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.d.ts +75 -0
  154. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js +44 -0
  155. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js.map +1 -0
  156. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.d.ts +88 -0
  157. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js +80 -0
  158. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js.map +1 -0
  159. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.d.ts +1 -1
  160. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +55 -19
  161. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
  162. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.d.ts +10 -3
  163. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js +12 -10
  164. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js.map +1 -1
  165. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.d.ts +1 -1
  166. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +81 -24
  167. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
  168. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.d.ts +11 -1
  169. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.js.map +1 -1
  170. package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.d.ts +21 -0
  171. package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js +63 -0
  172. package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js.map +1 -0
  173. package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.d.ts +2 -1
  174. package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.js +8 -2
  175. package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.js.map +1 -1
  176. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.d.ts +32 -7
  177. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js +28 -12
  178. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js.map +1 -1
  179. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.js +2 -2
  180. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.js.map +1 -1
  181. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.d.ts +4 -1
  182. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.js +8 -7
  183. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.js.map +1 -1
  184. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.d.ts +64 -0
  185. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.js +79 -0
  186. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.js.map +1 -0
  187. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/OverflowGalleryUtils.d.ts +25 -0
  188. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/OverflowGalleryUtils.js +94 -0
  189. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/OverflowGalleryUtils.js.map +1 -0
  190. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.d.ts +4 -4
  191. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +58 -49
  192. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
  193. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +25 -0
  194. package/dist/dist-esm/react-components/src/components/VideoGallery.js +32 -4
  195. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  196. package/dist/dist-esm/react-components/src/components/VideoTile.js +9 -12
  197. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  198. package/dist/dist-esm/react-components/src/components/index.d.ts +12 -1
  199. package/dist/dist-esm/react-components/src/components/index.js +11 -0
  200. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  201. package/dist/dist-esm/react-components/src/components/styles/Captions.style.d.ts +33 -0
  202. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js +60 -0
  203. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js.map +1 -0
  204. package/dist/dist-esm/react-components/src/components/styles/CaptionsSettingsModal.styles.d.ts +34 -0
  205. package/dist/dist-esm/react-components/src/components/styles/CaptionsSettingsModal.styles.js +86 -0
  206. package/dist/dist-esm/react-components/src/components/styles/CaptionsSettingsModal.styles.js.map +1 -0
  207. package/dist/dist-esm/react-components/src/components/styles/Common.style.d.ts +14 -0
  208. package/dist/dist-esm/react-components/src/components/styles/Common.style.js +16 -0
  209. package/dist/dist-esm/react-components/src/components/styles/Common.style.js.map +1 -0
  210. package/dist/dist-esm/react-components/src/components/styles/HorizontalGallery.styles.js +1 -0
  211. package/dist/dist-esm/react-components/src/components/styles/HorizontalGallery.styles.js.map +1 -1
  212. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +7 -2
  213. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +58 -2
  214. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  215. package/dist/dist-esm/react-components/src/components/styles/VerticalGallery.styles.d.ts +32 -0
  216. package/dist/dist-esm/react-components/src/components/styles/VerticalGallery.styles.js +66 -0
  217. package/dist/dist-esm/react-components/src/components/styles/VerticalGallery.styles.js.map +1 -0
  218. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js +1 -0
  219. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js.map +1 -1
  220. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.d.ts +6 -4
  221. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.js +1 -1
  222. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.js.map +1 -1
  223. package/dist/dist-esm/react-components/src/components/utils/overFlowGalleriesUtils.d.ts +11 -0
  224. package/dist/dist-esm/react-components/src/components/utils/overFlowGalleriesUtils.js +22 -0
  225. package/dist/dist-esm/react-components/src/components/utils/overFlowGalleriesUtils.js.map +1 -0
  226. package/dist/dist-esm/react-components/src/components/utils/responsive.d.ts +6 -0
  227. package/dist/dist-esm/react-components/src/components/utils/responsive.js +7 -0
  228. package/dist/dist-esm/react-components/src/components/utils/responsive.js.map +1 -1
  229. package/dist/dist-esm/react-components/src/components/utils.d.ts +9 -0
  230. package/dist/dist-esm/react-components/src/components/utils.js +24 -0
  231. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  232. package/dist/dist-esm/react-components/src/gallery/dominantSpeaker.js +6 -14
  233. package/dist/dist-esm/react-components/src/gallery/dominantSpeaker.js.map +1 -1
  234. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.d.ts +10 -4
  235. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js +7 -2
  236. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js.map +1 -1
  237. package/dist/dist-esm/react-components/src/index.d.ts +2 -0
  238. package/dist/dist-esm/react-components/src/index.js.map +1 -1
  239. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +5 -0
  240. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
  241. package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +17 -4
  242. package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +17 -4
  243. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +18 -4
  244. package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +17 -4
  245. package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +17 -4
  246. package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +17 -4
  247. package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +17 -4
  248. package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +17 -4
  249. package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +17 -4
  250. package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +17 -4
  251. package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +17 -4
  252. package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +17 -4
  253. package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +17 -4
  254. package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +17 -4
  255. package/dist/dist-esm/react-components/src/permissions/PermissionsProvider.d.ts +1 -1
  256. package/dist/dist-esm/react-components/src/permissions/PermissionsProvider.js.map +1 -1
  257. package/dist/dist-esm/react-components/src/theming/icons.d.ts +11 -0
  258. package/dist/dist-esm/react-components/src/theming/icons.js +33 -7
  259. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  260. package/dist/dist-esm/react-components/src/types/CaptionsAvailableLanguageStrings.d.ts +48 -0
  261. package/dist/dist-esm/react-components/src/types/CaptionsAvailableLanguageStrings.js +4 -0
  262. package/dist/dist-esm/react-components/src/types/CaptionsAvailableLanguageStrings.js.map +1 -0
  263. package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +21 -1
  264. package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
  265. package/dist/dist-esm/react-components/src/types/index.d.ts +1 -0
  266. package/dist/dist-esm/react-components/src/types/index.js +1 -0
  267. package/dist/dist-esm/react-components/src/types/index.js.map +1 -1
  268. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +2 -9
  269. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  270. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +65 -0
  271. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  272. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +13 -0
  273. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +69 -7
  274. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  275. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +53 -0
  276. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  277. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +1 -0
  278. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  279. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +103 -21
  280. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  281. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +2 -2
  282. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  283. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.js +3 -3
  284. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.js.map +1 -1
  285. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +21 -3
  286. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  287. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js +1 -1
  288. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js.map +1 -1
  289. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.d.ts +1 -1
  290. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js.map +1 -1
  291. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.d.ts +9 -8
  292. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.js +4 -32
  293. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.js.map +1 -1
  294. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.d.ts +1 -1
  295. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js.map +1 -1
  296. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.d.ts +1 -1
  297. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.js.map +1 -1
  298. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.d.ts +1 -1
  299. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js.map +1 -1
  300. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Participants.d.ts +1 -1
  301. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Participants.js.map +1 -1
  302. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.d.ts +1 -1
  303. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js.map +1 -1
  304. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +16 -0
  305. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  306. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +3 -2
  307. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  308. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +1 -1
  309. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  310. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +17 -0
  311. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +41 -0
  312. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  313. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.d.ts +5 -1
  314. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js +20 -0
  315. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js.map +1 -1
  316. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallControls.styles.js.map +1 -1
  317. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LobbyTile.styles.js +4 -4
  318. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LobbyTile.styles.js.map +1 -1
  319. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalPreview.styles.d.ts +20 -0
  320. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalPreview.styles.js +21 -1
  321. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalPreview.styles.js.map +1 -1
  322. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CallControlOptions.d.ts +5 -87
  323. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CallControlOptions.js.map +1 -1
  324. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.d.ts +1 -1
  325. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js +3 -3
  326. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js.map +1 -1
  327. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  328. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +15 -75
  329. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +12 -6
  330. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  331. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.d.ts +12 -0
  332. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.js.map +1 -1
  333. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +17 -1
  334. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +66 -6
  335. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  336. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +30 -1
  337. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  338. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +5 -0
  339. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +24 -0
  340. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  341. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.d.ts +4 -0
  342. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +6 -0
  343. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
  344. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.js +4 -0
  345. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.js.map +1 -1
  346. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/index.d.ts +1 -1
  347. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/index.js.map +1 -1
  348. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.d.ts +1 -1
  349. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js +5 -3
  350. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js.map +1 -1
  351. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +27 -2
  352. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  353. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +19 -2
  354. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +68 -6
  355. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  356. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts +4 -0
  357. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
  358. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.d.ts +1 -0
  359. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
  360. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.d.ts +6 -0
  361. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.js +60 -0
  362. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.js.map +1 -0
  363. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBannerMoreButton.d.ts +12 -0
  364. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBannerMoreButton.js +107 -0
  365. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBannerMoreButton.js.map +1 -0
  366. package/dist/dist-esm/react-composites/src/composites/common/CaptionsSettingsModal.d.ts +7 -0
  367. package/dist/dist-esm/react-composites/src/composites/common/CaptionsSettingsModal.js +38 -0
  368. package/dist/dist-esm/react-composites/src/composites/common/CaptionsSettingsModal.js.map +1 -0
  369. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.d.ts +30 -0
  370. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +286 -0
  371. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -0
  372. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.d.ts +83 -0
  373. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.js +81 -0
  374. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.js.map +1 -0
  375. package/dist/dist-esm/react-composites/src/composites/{CallWithChatComposite/components → common/ControlBar}/DesktopMoreButton.d.ts +4 -0
  376. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +193 -0
  377. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -0
  378. package/dist/dist-esm/react-composites/src/composites/{CallWithChatComposite → common/ControlBar}/PeopleButton.d.ts +1 -1
  379. package/dist/dist-esm/react-composites/src/composites/{CallWithChatComposite → common/ControlBar}/PeopleButton.js +3 -3
  380. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/PeopleButton.js.map +1 -0
  381. package/dist/dist-esm/react-composites/src/composites/{CallWithChatComposite/components → common/Drawer}/MoreDrawer.d.ts +15 -2
  382. package/dist/dist-esm/react-composites/src/composites/{CallWithChatComposite/components → common/Drawer}/MoreDrawer.js +113 -9
  383. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -0
  384. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.styles.d.ts +6 -0
  385. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.styles.js +24 -0
  386. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.styles.js.map +1 -0
  387. package/dist/dist-esm/react-composites/src/composites/{CallWithChatComposite → common/Drawer}/PreparedMoreDrawer.d.ts +3 -2
  388. package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.js +26 -0
  389. package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.js.map +1 -0
  390. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.d.ts +20 -0
  391. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.js +55 -0
  392. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.js.map +1 -0
  393. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.styles.d.ts +7 -0
  394. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.styles.js +25 -0
  395. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.styles.js.map +1 -0
  396. package/dist/dist-esm/react-composites/src/composites/common/MoreButton.js +1 -1
  397. package/dist/dist-esm/react-composites/src/composites/common/MoreButton.js.map +1 -1
  398. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js +1 -1
  399. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js.map +1 -1
  400. package/dist/dist-esm/react-composites/src/composites/common/constants.d.ts +9 -0
  401. package/dist/dist-esm/react-composites/src/composites/common/constants.js +11 -0
  402. package/dist/dist-esm/react-composites/src/composites/common/constants.js.map +1 -0
  403. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +13 -1
  404. package/dist/dist-esm/react-composites/src/composites/common/icons.js +8 -14
  405. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  406. package/dist/dist-esm/react-composites/src/composites/common/styles/Composite.styles.d.ts +7 -0
  407. package/dist/dist-esm/react-composites/src/composites/common/styles/Composite.styles.js +9 -0
  408. package/dist/dist-esm/react-composites/src/composites/common/styles/Composite.styles.js.map +1 -0
  409. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.d.ts +165 -0
  410. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.js +4 -0
  411. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.js.map +1 -0
  412. package/dist/dist-esm/react-composites/src/composites/common/utils.d.ts +4 -0
  413. package/dist/dist-esm/react-composites/src/composites/common/utils.js +4 -0
  414. package/dist/dist-esm/react-composites/src/composites/common/utils.js.map +1 -1
  415. package/dist/dist-esm/react-composites/src/composites/index.d.ts +3 -0
  416. package/dist/dist-esm/react-composites/src/composites/index.js.map +1 -1
  417. package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +66 -1
  418. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +66 -1
  419. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +66 -1
  420. package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +66 -1
  421. package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +66 -1
  422. package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +66 -1
  423. package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +66 -1
  424. package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +66 -1
  425. package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +66 -1
  426. package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +66 -1
  427. package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +66 -1
  428. package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +66 -1
  429. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +66 -1
  430. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +66 -1
  431. package/package.json +15 -16
  432. package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.d.ts +0 -14
  433. package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.js +0 -19
  434. package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.js.map +0 -1
  435. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.d.ts +0 -27
  436. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js +0 -190
  437. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js.map +0 -1
  438. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.d.ts +0 -67
  439. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.js +0 -75
  440. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.js.map +0 -1
  441. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/PeopleButton.js.map +0 -1
  442. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/PreparedMoreDrawer.js +0 -22
  443. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/PreparedMoreDrawer.js.map +0 -1
  444. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/DesktopMoreButton.js +0 -65
  445. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/DesktopMoreButton.js.map +0 -1
  446. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js.map +0 -1
@@ -11,6 +11,7 @@ export function convertSdkLocalStreamToDeclarativeLocalStream(stream) {
11
11
  source: stream.source,
12
12
  mediaStreamType: stream.mediaStreamType,
13
13
  view: undefined
14
+ // TODO [video-background-effects]: Add video effects state when it is added to the SDK
14
15
  };
15
16
  }
16
17
  /**
@@ -82,7 +83,16 @@ export function convertSdkCallToDeclarativeCall(call) {
82
83
  startTime: new Date(),
83
84
  endTime: undefined,
84
85
  /* @conditional-compile-remove(rooms) */
85
- role: call.role
86
+ role: call.role,
87
+ /* @conditional-compile-remove(close-captions) */
88
+ captionsFeature: {
89
+ captions: [],
90
+ supportedSpokenLanguages: [],
91
+ supportedCaptionLanguages: [],
92
+ currentCaptionLanguage: '',
93
+ currentSpokenLanguage: '',
94
+ isCaptionsFeatureActive: false
95
+ }
86
96
  };
87
97
  }
88
98
  /**
@@ -106,4 +116,11 @@ export function convertFromSDKToDeclarativeVideoStreamRendererView(view) {
106
116
  target: view.target
107
117
  };
108
118
  }
119
+ /* @conditional-compile-remove(close-captions) */
120
+ /**
121
+ * @private
122
+ */
123
+ export function convertFromSDKToCaptionInfoState(caption) {
124
+ return Object.assign({}, caption);
125
+ }
109
126
  //# sourceMappingURL=Converter.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Converter.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/Converter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AASxE,yDAAyD;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C;;GAEG;AACH,MAAM,UAAU,6CAA6C,CAC3D,MAA2B;IAE3B,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,IAAI,EAAE,SAAS;KAChB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,+CAA+C,CAC7D,MAA4B;IAE5B,OAAO;QACL,EAAE,EAAE,MAAM,CAAC,EAAE;QACb,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,i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EAAE;gBACL,MAAM,EAAE,EAAE;aACX;SACF;QACD,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;QACzC,iBAAiB,EAAE,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,6CAA6C,CAAC;QAC5F,kBAAkB,EAAE,6BAA6B;QACjD,uBAAuB,EAAE,EAAE;QAC3B,SAAS,EAAE,EAAE,iBAAiB,EAAE,KAAK,EAAE;QACvC,aAAa,EAAE,EAAE,qBAAqB,EAAE,KAAK,EAAE;QAC/C,4BAA4B,EAAE,SAAS;QACvC,SAAS,EAAE,IAAI,IAAI,EAAE;QACrB,OAAO,EAAE,SAAS;QAClB,wCAAwC;QACxC,IAAI,EAAE,IAAI,CAAC,IAAI;KAChB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,+CAA+C,CAAC,IAAwB;IACtF,OAAO;QACL,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,SAAS,EAAE,IAAI,IAAI,EAAE;QACrB,OAAO,EAAE,SAAS;KACnB,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,kDAAkD,CAChE,IAA6B;IAE7B,OAAO;QACL,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;KACpB,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n RemoteParticipant as SdkRemoteParticipant,\n RemoteVideoStream as SdkRemoteVideoStream,\n LocalVideoStream as SdkLocalVideoStream,\n VideoStreamRendererView\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { CallKind } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport {\n CallState,\n RemoteParticipantState as DeclarativeRemoteParticipant,\n RemoteVideoStreamState as DeclarativeRemoteVideoStream,\n LocalVideoStreamState as DeclarativeLocalVideoStream,\n IncomingCallState as DeclarativeIncomingCall,\n VideoStreamRendererViewState as DeclarativeVideoStreamRendererView\n} from './CallClientState';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { _isACSCall } from './TypeGuards';\nimport { CallCommon, IncomingCallCommon } from './BetaToStableTypes';\n\n/**\n * @private\n */\nexport function convertSdkLocalStreamToDeclarativeLocalStream(\n stream: SdkLocalVideoStream\n): DeclarativeLocalVideoStream {\n return {\n source: stream.source,\n mediaStreamType: stream.mediaStreamType,\n view: undefined\n };\n}\n\n/**\n * @private\n */\nexport function convertSdkRemoteStreamToDeclarativeRemoteStream(\n stream: SdkRemoteVideoStream\n): DeclarativeRemoteVideoStream {\n return {\n id: stream.id,\n mediaStreamType: stream.mediaStreamType,\n isAvailable: stream.isAvailable,\n /* @conditional-compile-remove(video-stream-is-receiving-flag) */\n isReceiving: stream.isReceiving,\n view: undefined\n };\n}\n\n/**\n * @private\n */\nexport function convertSdkParticipantToDeclarativeParticipant(\n participant: SdkRemoteParticipant\n): DeclarativeRemoteParticipant {\n const declarativeVideoStreams = {};\n for (const videoStream of participant.videoStreams) {\n declarativeVideoStreams[videoStream.id] = convertSdkRemoteStreamToDeclarativeRemoteStream(videoStream);\n }\n return {\n identifier: participant.identifier,\n displayName: participant.displayName,\n state: participant.state,\n callEndReason: participant.callEndReason,\n videoStreams: declarativeVideoStreams,\n isMuted: participant.isMuted,\n isSpeaking: participant.isSpeaking\n };\n}\n\n/**\n * @private\n *\n * Note at the time of writing only one LocalVideoStream is supported by the SDK.\n */\nexport function convertSdkCallToDeclarativeCall(call: CallCommon): CallState {\n const declarativeRemoteParticipants = {};\n call.remoteParticipants.forEach((participant: SdkRemoteParticipant) => {\n declarativeRemoteParticipants[toFlatCommunicationIdentifier(participant.identifier)] =\n convertSdkParticipantToDeclarativeParticipant(participant);\n });\n return {\n id: call.id,\n /* @conditional-compile-remove(teams-identity-support) */\n kind: _isACSCall(call) ? ('Call' as CallKind) : ('TeamsCall' as CallKind),\n callerInfo: call.callerInfo,\n state: call.state,\n callEndReason: call.callEndReason,\n diagnostics: {\n network: {\n latest: {}\n },\n media: {\n latest: {}\n }\n },\n direction: call.direction,\n isMuted: call.isMuted,\n isScreenSharingOn: call.isScreenSharingOn,\n localVideoStreams: call.localVideoStreams.map(convertSdkLocalStreamToDeclarativeLocalStream),\n remoteParticipants: declarativeRemoteParticipants,\n remoteParticipantsEnded: {},\n recording: { isRecordingActive: false },\n transcription: { isTranscriptionActive: false },\n screenShareRemoteParticipant: undefined,\n startTime: new Date(),\n endTime: undefined,\n /* @conditional-compile-remove(rooms) */\n role: call.role\n };\n}\n\n/**\n * @private\n */\nexport function convertSdkIncomingCallToDeclarativeIncomingCall(call: IncomingCallCommon): DeclarativeIncomingCall {\n return {\n id: call.id,\n callerInfo: call.callerInfo,\n startTime: new Date(),\n endTime: undefined\n };\n}\n\n/**\n * @private\n */\nexport function convertFromSDKToDeclarativeVideoStreamRendererView(\n view: VideoStreamRendererView\n): DeclarativeVideoStreamRendererView {\n return {\n scalingMode: view.scalingMode,\n isMirrored: view.isMirrored,\n target: view.target\n };\n}\n\"../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"Converter.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/Converter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAYlC,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAYxE,yDAAyD;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAG1C;;GAEG;AACH,MAAM,UAAU,6CAA6C,CAC3D,MAA2B;IAE3B,OAAO;QACL,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,eAAe,EAAE,MAAM,CAAC,eAAe;QACvC,IAAI,EAAE,SAAS;QACf,uFAAuF;KACxF,CAAC;AACJ,C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CAAC,WAAW;QAC7B,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;KACpB,CAAC;AACJ,CAAC;AAED,iDAAiD;AACjD;;GAEG;AACH,MAAM,UAAU,gCAAgC,CAAC,OAA0B;IACzE,yBACK,OAAO,EACV;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n RemoteParticipant as SdkRemoteParticipant,\n RemoteVideoStream as SdkRemoteVideoStream,\n LocalVideoStream as SdkLocalVideoStream,\n VideoStreamRendererView\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(close-captions) */\nimport { TeamsCaptionsInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { CallKind } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport {\n CallState,\n RemoteParticipantState as DeclarativeRemoteParticipant,\n RemoteVideoStreamState as DeclarativeRemoteVideoStream,\n LocalVideoStreamState as DeclarativeLocalVideoStream,\n IncomingCallState as DeclarativeIncomingCall,\n VideoStreamRendererViewState as DeclarativeVideoStreamRendererView\n} from './CallClientState';\n/* @conditional-compile-remove(close-captions) */\nimport { CaptionsInfo } from './CallClientState';\n\n/* @conditional-compile-remove(teams-identity-support) */\nimport { _isACSCall } from './TypeGuards';\nimport { CallCommon, IncomingCallCommon } from './BetaToStableTypes';\n\n/**\n * @private\n */\nexport function convertSdkLocalStreamToDeclarativeLocalStream(\n stream: SdkLocalVideoStream\n): DeclarativeLocalVideoStream {\n return {\n source: stream.source,\n mediaStreamType: stream.mediaStreamType,\n view: undefined\n // TODO [video-background-effects]: Add video effects state when it is added to the SDK\n };\n}\n\n/**\n * @private\n */\nexport function convertSdkRemoteStreamToDeclarativeRemoteStream(\n stream: SdkRemoteVideoStream\n): DeclarativeRemoteVideoStream {\n return {\n id: stream.id,\n mediaStreamType: stream.mediaStreamType,\n isAvailable: stream.isAvailable,\n /* @conditional-compile-remove(video-stream-is-receiving-flag) */\n isReceiving: stream.isReceiving,\n view: undefined\n };\n}\n\n/**\n * @private\n */\nexport function convertSdkParticipantToDeclarativeParticipant(\n participant: SdkRemoteParticipant\n): DeclarativeRemoteParticipant {\n const declarativeVideoStreams = {};\n for (const videoStream of participant.videoStreams) {\n declarativeVideoStreams[videoStream.id] = convertSdkRemoteStreamToDeclarativeRemoteStream(videoStream);\n }\n return {\n identifier: participant.identifier,\n displayName: participant.displayName,\n state: participant.state,\n callEndReason: participant.callEndReason,\n videoStreams: declarativeVideoStreams,\n isMuted: participant.isMuted,\n isSpeaking: participant.isSpeaking\n };\n}\n\n/**\n * @private\n *\n * Note at the time of writing only one LocalVideoStream is supported by the SDK.\n */\nexport function convertSdkCallToDeclarativeCall(call: CallCommon): CallState {\n const declarativeRemoteParticipants = {};\n call.remoteParticipants.forEach((participant: SdkRemoteParticipant) => {\n declarativeRemoteParticipants[toFlatCommunicationIdentifier(participant.identifier)] =\n convertSdkParticipantToDeclarativeParticipant(participant);\n });\n return {\n id: call.id,\n /* @conditional-compile-remove(teams-identity-support) */\n kind: _isACSCall(call) ? ('Call' as CallKind) : ('TeamsCall' as CallKind),\n callerInfo: call.callerInfo,\n state: call.state,\n callEndReason: call.callEndReason,\n diagnostics: {\n network: {\n latest: {}\n },\n media: {\n latest: {}\n }\n },\n direction: call.direction,\n isMuted: call.isMuted,\n isScreenSharingOn: call.isScreenSharingOn,\n localVideoStreams: call.localVideoStreams.map(convertSdkLocalStreamToDeclarativeLocalStream),\n remoteParticipants: declarativeRemoteParticipants,\n remoteParticipantsEnded: {},\n recording: { isRecordingActive: false },\n transcription: { isTranscriptionActive: false },\n screenShareRemoteParticipant: undefined,\n startTime: new Date(),\n endTime: undefined,\n /* @conditional-compile-remove(rooms) */\n role: call.role,\n /* @conditional-compile-remove(close-captions) */\n captionsFeature: {\n captions: [],\n supportedSpokenLanguages: [],\n supportedCaptionLanguages: [],\n currentCaptionLanguage: '',\n currentSpokenLanguage: '',\n isCaptionsFeatureActive: false\n }\n };\n}\n\n/**\n * @private\n */\nexport function convertSdkIncomingCallToDeclarativeIncomingCall(call: IncomingCallCommon): DeclarativeIncomingCall {\n return {\n id: call.id,\n callerInfo: call.callerInfo,\n startTime: new Date(),\n endTime: undefined\n };\n}\n\n/**\n * @private\n */\nexport function convertFromSDKToDeclarativeVideoStreamRendererView(\n view: VideoStreamRendererView\n): DeclarativeVideoStreamRendererView {\n return {\n scalingMode: view.scalingMode,\n isMirrored: view.isMirrored,\n target: view.target\n };\n}\n\n/* @conditional-compile-remove(close-captions) */\n/**\n * @private\n */\nexport function convertFromSDKToCaptionInfoState(caption: TeamsCaptionsInfo): CaptionsInfo {\n return {\n ...caption\n };\n}\n\"../../acs-ui-common/src\""]}
@@ -1,5 +1,6 @@
1
1
  import { DeviceManager } from '@azure/communication-calling';
2
2
  import { CallContext } from './CallContext';
3
+ import { InternalCallContext } from './InternalCallContext';
3
4
  /**
4
5
  * Defines the additional methods added by the stateful on top of {@link @azure/communication-calling#DeviceManager}.
5
6
  *
@@ -19,6 +20,8 @@ export interface StatefulDeviceManager extends DeviceManager {
19
20
  *
20
21
  * @param deviceManager - DeviceManager from SDK
21
22
  * @param context - CallContext from StatefulCallClient
23
+ *
24
+ * @private
22
25
  */
23
- export declare const deviceManagerDeclaratify: (deviceManager: DeviceManager, context: CallContext) => DeviceManager;
26
+ export declare const deviceManagerDeclaratify: (deviceManager: DeviceManager, context: CallContext, internalContext: InternalCallContext) => DeviceManager;
24
27
  //# sourceMappingURL=DeviceManagerDeclarative.d.ts.map
@@ -146,8 +146,12 @@ const dedupeById = (devices) => {
146
146
  *
147
147
  * @param deviceManager - DeviceManager from SDK
148
148
  * @param context - CallContext from StatefulCallClient
149
+ *
150
+ * @private
149
151
  */
150
- export const deviceManagerDeclaratify = (deviceManager, context) => {
152
+ export const deviceManagerDeclaratify = (deviceManager, context,
153
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
154
+ internalContext) => {
151
155
  const proxyDeviceManager = new ProxyDeviceManager(deviceManager, context);
152
156
  Object.defineProperty(deviceManager, 'unsubscribe', {
153
157
  configurable: false,
@@ -1 +1 @@
1
- {"version":3,"file":"DeviceManagerDeclarative.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/DeviceManagerDeclarative.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAmBlC;;;;;;GAMG;AACH,MAAM,kBAAkB;IAItB,YAAY,aAA4B,EAAE,OAAoB;QAQtD,qBAAgB,GAAG,GAAS,EAAE;YACpC,mHAAmH;YACnH,4GAA4G;YAC5G,mDAAmD;YACnD,IAAI,CAAC,QAAQ,CAAC,2CAA2C,CAAC,IAAI,CAAC,cAAc,CAAC,2BAA2B,CAAC,CAAC;YAC3G,IAAI,CAAC,QAAQ,CAAC,kCAAkC,CAAC,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;YACzF,IAAI,CAAC,QAAQ,CAAC,+BAA+B,CAAC,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;QACrF,CAAC,CAAC;QAEM,cAAS,GAAG,GAAS,EAAE;YAC7B,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,qBAAqB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACxE,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,qBAAqB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACxE,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,2BAA2B,EAAE,IAAI,CAAC,yBAAyB,CAAC,CAAC;YACpF,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC,wBAAwB,EAAE,IAAI,CAAC,sBAAsB,CAAC,CAAC;QAChF,CAAC,CAAC;QAEF;;WAEG;QACI,gBAAW,GAAG,GAAS,EAAE;YAC9B,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;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eAAgC,EAAE,EAAE,CAAC,kBAAkB,CAAC,YAAY,CAAC,eAAe,CAAC;KAC9F,CAAC,CAAC;IACH,OAAO,IAAI,KAAK,CAAC,aAAa,EAAE,kBAAkB,CAA0B,CAAC;AAC/E,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AudioDeviceInfo, DeviceAccess, DeviceManager, VideoDeviceInfo } from '@azure/communication-calling';\nimport { CallContext } from './CallContext';\n\n/**\n * Defines the additional methods added by the stateful on top of {@link @azure/communication-calling#DeviceManager}.\n *\n * @public\n */\nexport interface StatefulDeviceManager extends DeviceManager {\n /**\n * Sets the selectedCamera in the {@link DeviceManagerState}. This is completely developer driven and is not tied in\n * any way to {@link @azure/communication-calling#DeviceManager}. It is entirely contained in\n * {@link StatefulDeviceManager}. See also {@link DeviceManagerState.selectedCamera}.\n */\n selectCamera: (VideoDeviceInfo) => void;\n}\n\n/**\n * ProxyDeviceManager proxies DeviceManager and subscribes to all events that affect device manager state. State updates\n * are set on the provided context. Also any queries for state are proxied and stored in state as well. Only one device\n * manager should exist for a given CallClient so if CallClient.getDeviceManager is called multiple times, either a\n * cached ProxyDeviceManager should be returned or the existing ProxyDeviceManager should be destructed via destructor()\n * and a new ProxyDeviceManager created.\n */\nclass ProxyDeviceManager implements ProxyHandler<DeviceManager> {\n private _deviceManager: DeviceManager;\n private _context: CallContext;\n\n constructor(deviceManager: DeviceManager, context: CallContext) {\n this._deviceManager = deviceManager;\n this._context = context;\n\n this.setDeviceManager();\n this.subscribe();\n }\n\n private setDeviceManager = (): void => {\n // isSpeakerSelectionAvailable, selectedMicrophone, and selectedSpeaker are properties on DeviceManager. Since they\n // are not functions we can't proxy them so we'll update whenever we think they may need updating such as at\n // construction time or when certain events happen.\n this._context.setDeviceManagerIsSpeakerSelectionAvailable(this._deviceManager.isSpeakerSelectionAvailable);\n this._context.setDeviceManagerSelectedMicrophone(this._deviceManager.selectedMicrophone);\n this._context.setDeviceManagerSelectedSpeaker(this._deviceManager.selectedSpeaker);\n };\n\n private subscribe = (): void => {\n this._deviceManager.on('videoDevicesUpdated', this.videoDevicesUpdated);\n this._deviceManager.on('audioDevicesUpdated', this.audioDevicesUpdated);\n this._deviceManager.on('selectedMicrophoneChanged', this.selectedMicrophoneChanged);\n this._deviceManager.on('selectedSpeakerChanged', this.selectedSpeakerChanged);\n };\n\n /**\n * This is used to unsubscribe DeclarativeDeviceManager from the DeviceManager events.\n */\n public unsubscribe = (): void => {\n this._deviceManager.off('videoDevicesUpdated', this.videoDevicesUpdated);\n this._deviceManager.off('audioDevicesUpdated', this.audioDevicesUpdated);\n this._deviceManager.off('selectedMicrophoneChanged', this.selectedMicrophoneChanged);\n this._deviceManager.off('selectedSpeakerChanged', this.selectedSpeakerChanged);\n };\n\n /**\n * Used to set a camera inside the proxy device manager.\n *\n * @param videoDeviceInfo VideoDeviceInfo\n */\n public selectCamera = (videoDeviceInfo: VideoDeviceInfo): void => {\n this._context.setDeviceManagerSelectedCamera(videoDeviceInfo);\n };\n\n private videoDevicesUpdated = async (): Promise<void> => {\n // Device Manager always has a camera with '' name if there are no real camera devices available.\n // We don't want to show that in the UI.\n const realCameras = (await this._deviceManager.getCameras()).filter((c) => !!c.name);\n this._context.setDeviceManagerCameras(dedupeById(realCameras));\n };\n\n private audioDevicesUpdated = async (): Promise<void> => {\n this._context.setDeviceManagerMicrophones(dedupeById(await this._deviceManager.getMicrophones()));\n this._context.setDeviceManagerSpeakers(dedupeById(await this._deviceManager.getSpeakers()));\n };\n\n private selectedMicrophoneChanged = (): void => {\n this._context.setDeviceManagerSelectedMicrophone(this._deviceManager.selectedMicrophone);\n };\n\n private selectedSpeakerChanged = (): void => {\n this._context.setDeviceManagerSelectedSpeaker(this._deviceManager.selectedSpeaker);\n };\n\n public get<P extends keyof DeviceManager>(target: DeviceManager, prop: P): any {\n switch (prop) {\n case 'getCameras': {\n return this._context.withAsyncErrorTeedToState((): Promise<VideoDeviceInfo[]> => {\n return target.getCameras().then((cameras: VideoDeviceInfo[]) => {\n // Device Manager always has a camera with '' name if there are no real camera devices available.\n // We don't want to show that in the UI.\n const realCameras = cameras.filter((c) => !!c.name);\n this._context.setDeviceManagerCameras(dedupeById(realCameras));\n return realCameras;\n });\n }, 'DeviceManager.getCameras');\n }\n case 'getMicrophones': {\n return this._context.withAsyncErrorTeedToState((): Promise<AudioDeviceInfo[]> => {\n return target.getMicrophones().then((microphones: AudioDeviceInfo[]) => {\n this._context.setDeviceManagerMicrophones(dedupeById(microphones));\n return microphones;\n });\n }, 'DeviceManager.getMicrophones');\n }\n case 'getSpeakers': {\n return this._context.withAsyncErrorTeedToState((): Promise<AudioDeviceInfo[]> => {\n return target.getSpeakers().then((speakers: AudioDeviceInfo[]) => {\n this._context.setDeviceManagerSpeakers(dedupeById(speakers));\n return speakers;\n });\n }, 'DeviceManager.getSpeakers');\n }\n case 'selectMicrophone': {\n return this._context.withAsyncErrorTeedToState(\n (...args: Parameters<DeviceManager['selectMicrophone']>): Promise<void> => {\n return target.selectMicrophone(...args).then(() => {\n this._context.setDeviceManagerSelectedMicrophone(target.selectedMicrophone);\n });\n },\n 'DeviceManager.selectMicrophone'\n );\n }\n case 'selectSpeaker': {\n return this._context.withAsyncErrorTeedToState(\n (...args: Parameters<DeviceManager['selectSpeaker']>): Promise<void> => {\n return target.selectSpeaker(...args).then(() => {\n this._context.setDeviceManagerSelectedSpeaker(target.selectedSpeaker);\n });\n },\n 'DeviceManager.selectSpeaker'\n );\n }\n case 'askDevicePermission': {\n return this._context.withAsyncErrorTeedToState(\n (...args: Parameters<DeviceManager['askDevicePermission']>): Promise<DeviceAccess> => {\n return target.askDevicePermission(...args).then((deviceAccess: DeviceAccess) => {\n this._context.setDeviceManagerDeviceAccess(deviceAccess);\n this.setDeviceManager();\n return deviceAccess;\n });\n },\n 'DeviceManager.askDevicePermission'\n );\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n// TODO: Remove this when SDK no longer returns duplicate audio and video devices\n/** Helper function to dedupe duplicate audio and video devices obtained from SDK */\nconst dedupeById = <T extends { id: string }>(devices: T[]): T[] => {\n const ids = new Set();\n const uniqueDevices: T[] = [];\n devices.forEach((device: T) => {\n if (!ids.has(device.id)) {\n uniqueDevices.push(device);\n ids.add(device.id);\n }\n });\n return uniqueDevices;\n};\n\n/**\n * Creates a declarative DeviceManager by proxying DeviceManager with ProxyDeviceManager. The declarative DeviceManager\n * will put state updates in the given context.\n *\n * @param deviceManager - DeviceManager from SDK\n * @param context - CallContext from StatefulCallClient\n */\nexport const deviceManagerDeclaratify = (deviceManager: DeviceManager, context: CallContext): DeviceManager => {\n const proxyDeviceManager = new ProxyDeviceManager(deviceManager, context);\n Object.defineProperty(deviceManager, 'unsubscribe', {\n configurable: false,\n value: () => proxyDeviceManager.unsubscribe()\n });\n Object.defineProperty(deviceManager, 'selectCamera', {\n configurable: false,\n value: (videoDeviceInfo: VideoDeviceInfo) => proxyDeviceManager.selectCamera(videoDeviceInfo)\n });\n return new Proxy(deviceManager, proxyDeviceManager) as StatefulDeviceManager;\n};\n"]}
1
+ {"version":3,"file":"DeviceManagerDeclarative.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/DeviceManagerDeclarative.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAoBlC;;;;;;GAMG;AACH,MAAM,kBAAkB;IAItB,YAAY,aAA4B,EAAE,OAAoB;QAQtD,qBAAgB,GAAG,GAAS,EAAE;YACpC,mHAAmH;YACnH,4GAA4G;YAC5G,mDAAmD;YACnD,IAAI,CAAC,QAAQ,CAAC,2CAA2C,CAAC,IAAI,CAAC,cAAc,CAAC,2BAA2B,CAAC,CAAC;YAC3G,IAAI,CAAC,QAAQ,CAAC,kCAAkC,CAAC,IAAI,CAAC,cAAc,CAAC,kBAAkB,CAAC,CAAC;YACzF,IAAI,CAAC,QAAQ,CAAC,+BAA+B,CAAC,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC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C3B,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;SACpB;IACH,CAAC,CAAC,CAAC;IACH,OAAO,aAAa,CAAC;AACvB,CAAC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,aAA4B,EAC5B,OAAoB;AACpB,6DAA6D;AAC7D,eAAoC,EACrB,EAAE;IACjB,MAAM,kBAAkB,GAAG,IAAI,kBAAkB,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;IAC1E,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,aAAa,EAAE;QAClD,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,WAAW,EAAE;KAC9C,CAAC,CAAC;IACH,MAAM,CAAC,cAAc,CAAC,aAAa,EAAE,cAAc,EAAE;QACnD,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,CAAC,eAAgC,EAAE,EAAE,CAAC,kBAAkB,CAAC,YAAY,CAAC,eAAe,CAAC;KAC9F,CAAC,CAAC;IACH,OAAO,IAAI,KAAK,CAAC,aAAa,EAAE,kBAAkB,CAA0B,CAAC;AAC/E,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AudioDeviceInfo, DeviceAccess, DeviceManager, VideoDeviceInfo } from '@azure/communication-calling';\nimport { CallContext } from './CallContext';\nimport { InternalCallContext } from './InternalCallContext';\n\n/**\n * Defines the additional methods added by the stateful on top of {@link @azure/communication-calling#DeviceManager}.\n *\n * @public\n */\nexport interface StatefulDeviceManager extends DeviceManager {\n /**\n * Sets the selectedCamera in the {@link DeviceManagerState}. This is completely developer driven and is not tied in\n * any way to {@link @azure/communication-calling#DeviceManager}. It is entirely contained in\n * {@link StatefulDeviceManager}. See also {@link DeviceManagerState.selectedCamera}.\n */\n selectCamera: (VideoDeviceInfo) => void;\n}\n\n/**\n * ProxyDeviceManager proxies DeviceManager and subscribes to all events that affect device manager state. State updates\n * are set on the provided context. Also any queries for state are proxied and stored in state as well. Only one device\n * manager should exist for a given CallClient so if CallClient.getDeviceManager is called multiple times, either a\n * cached ProxyDeviceManager should be returned or the existing ProxyDeviceManager should be destructed via destructor()\n * and a new ProxyDeviceManager created.\n */\nclass ProxyDeviceManager implements ProxyHandler<DeviceManager> {\n private _deviceManager: DeviceManager;\n private _context: CallContext;\n\n constructor(deviceManager: DeviceManager, context: CallContext) {\n this._deviceManager = deviceManager;\n this._context = context;\n\n this.setDeviceManager();\n this.subscribe();\n }\n\n private setDeviceManager = (): void => {\n // isSpeakerSelectionAvailable, selectedMicrophone, and selectedSpeaker are properties on DeviceManager. Since they\n // are not functions we can't proxy them so we'll update whenever we think they may need updating such as at\n // construction time or when certain events happen.\n this._context.setDeviceManagerIsSpeakerSelectionAvailable(this._deviceManager.isSpeakerSelectionAvailable);\n this._context.setDeviceManagerSelectedMicrophone(this._deviceManager.selectedMicrophone);\n this._context.setDeviceManagerSelectedSpeaker(this._deviceManager.selectedSpeaker);\n };\n\n private subscribe = (): void => {\n this._deviceManager.on('videoDevicesUpdated', this.videoDevicesUpdated);\n this._deviceManager.on('audioDevicesUpdated', this.audioDevicesUpdated);\n this._deviceManager.on('selectedMicrophoneChanged', this.selectedMicrophoneChanged);\n this._deviceManager.on('selectedSpeakerChanged', this.selectedSpeakerChanged);\n };\n\n /**\n * This is used to unsubscribe DeclarativeDeviceManager from the DeviceManager events.\n */\n public unsubscribe = (): void => {\n this._deviceManager.off('videoDevicesUpdated', this.videoDevicesUpdated);\n this._deviceManager.off('audioDevicesUpdated', this.audioDevicesUpdated);\n this._deviceManager.off('selectedMicrophoneChanged', this.selectedMicrophoneChanged);\n this._deviceManager.off('selectedSpeakerChanged', this.selectedSpeakerChanged);\n };\n\n /**\n * Used to set a camera inside the proxy device manager.\n *\n * @param videoDeviceInfo VideoDeviceInfo\n */\n public selectCamera = (videoDeviceInfo: VideoDeviceInfo): void => {\n this._context.setDeviceManagerSelectedCamera(videoDeviceInfo);\n };\n\n private videoDevicesUpdated = async (): Promise<void> => {\n // Device Manager always has a camera with '' name if there are no real camera devices available.\n // We don't want to show that in the UI.\n const realCameras = (await this._deviceManager.getCameras()).filter((c) => !!c.name);\n this._context.setDeviceManagerCameras(dedupeById(realCameras));\n };\n\n private audioDevicesUpdated = async (): Promise<void> => {\n this._context.setDeviceManagerMicrophones(dedupeById(await this._deviceManager.getMicrophones()));\n this._context.setDeviceManagerSpeakers(dedupeById(await this._deviceManager.getSpeakers()));\n };\n\n private selectedMicrophoneChanged = (): void => {\n this._context.setDeviceManagerSelectedMicrophone(this._deviceManager.selectedMicrophone);\n };\n\n private selectedSpeakerChanged = (): void => {\n this._context.setDeviceManagerSelectedSpeaker(this._deviceManager.selectedSpeaker);\n };\n\n public get<P extends keyof DeviceManager>(target: DeviceManager, prop: P): any {\n switch (prop) {\n case 'getCameras': {\n return this._context.withAsyncErrorTeedToState((): Promise<VideoDeviceInfo[]> => {\n return target.getCameras().then((cameras: VideoDeviceInfo[]) => {\n // Device Manager always has a camera with '' name if there are no real camera devices available.\n // We don't want to show that in the UI.\n const realCameras = cameras.filter((c) => !!c.name);\n this._context.setDeviceManagerCameras(dedupeById(realCameras));\n return realCameras;\n });\n }, 'DeviceManager.getCameras');\n }\n case 'getMicrophones': {\n return this._context.withAsyncErrorTeedToState((): Promise<AudioDeviceInfo[]> => {\n return target.getMicrophones().then((microphones: AudioDeviceInfo[]) => {\n this._context.setDeviceManagerMicrophones(dedupeById(microphones));\n return microphones;\n });\n }, 'DeviceManager.getMicrophones');\n }\n case 'getSpeakers': {\n return this._context.withAsyncErrorTeedToState((): Promise<AudioDeviceInfo[]> => {\n return target.getSpeakers().then((speakers: AudioDeviceInfo[]) => {\n this._context.setDeviceManagerSpeakers(dedupeById(speakers));\n return speakers;\n });\n }, 'DeviceManager.getSpeakers');\n }\n case 'selectMicrophone': {\n return this._context.withAsyncErrorTeedToState(\n (...args: Parameters<DeviceManager['selectMicrophone']>): Promise<void> => {\n return target.selectMicrophone(...args).then(() => {\n this._context.setDeviceManagerSelectedMicrophone(target.selectedMicrophone);\n });\n },\n 'DeviceManager.selectMicrophone'\n );\n }\n case 'selectSpeaker': {\n return this._context.withAsyncErrorTeedToState(\n (...args: Parameters<DeviceManager['selectSpeaker']>): Promise<void> => {\n return target.selectSpeaker(...args).then(() => {\n this._context.setDeviceManagerSelectedSpeaker(target.selectedSpeaker);\n });\n },\n 'DeviceManager.selectSpeaker'\n );\n }\n case 'askDevicePermission': {\n return this._context.withAsyncErrorTeedToState(\n (...args: Parameters<DeviceManager['askDevicePermission']>): Promise<DeviceAccess> => {\n return target.askDevicePermission(...args).then((deviceAccess: DeviceAccess) => {\n this._context.setDeviceManagerDeviceAccess(deviceAccess);\n this.setDeviceManager();\n return deviceAccess;\n });\n },\n 'DeviceManager.askDevicePermission'\n );\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n// TODO: Remove this when SDK no longer returns duplicate audio and video devices\n/** Helper function to dedupe duplicate audio and video devices obtained from SDK */\nconst dedupeById = <T extends { id: string }>(devices: T[]): T[] => {\n const ids = new Set();\n const uniqueDevices: T[] = [];\n devices.forEach((device: T) => {\n if (!ids.has(device.id)) {\n uniqueDevices.push(device);\n ids.add(device.id);\n }\n });\n return uniqueDevices;\n};\n\n/**\n * Creates a declarative DeviceManager by proxying DeviceManager with ProxyDeviceManager. The declarative DeviceManager\n * will put state updates in the given context.\n *\n * @param deviceManager - DeviceManager from SDK\n * @param context - CallContext from StatefulCallClient\n *\n * @private\n */\nexport const deviceManagerDeclaratify = (\n deviceManager: DeviceManager,\n context: CallContext,\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n internalContext: InternalCallContext\n): DeviceManager => {\n const proxyDeviceManager = new ProxyDeviceManager(deviceManager, context);\n Object.defineProperty(deviceManager, 'unsubscribe', {\n configurable: false,\n value: () => proxyDeviceManager.unsubscribe()\n });\n Object.defineProperty(deviceManager, 'selectCamera', {\n configurable: false,\n value: (videoDeviceInfo: VideoDeviceInfo) => proxyDeviceManager.selectCamera(videoDeviceInfo)\n });\n return new Proxy(deviceManager, proxyDeviceManager) as StatefulDeviceManager;\n};\n"]}
@@ -1,5 +1,6 @@
1
1
  import { LocalVideoStream, RemoteVideoStream, VideoStreamRenderer } from '@azure/communication-calling';
2
2
  import { LocalVideoStreamState } from './CallClientState';
3
+ import type { CallContext } from './CallContext';
3
4
  /**
4
5
  * Internally tracked render status. Stores the status of a video render of a stream as rendering could take a long
5
6
  * time.
@@ -47,8 +48,10 @@ export declare class InternalCallContext {
47
48
  getLocalRenderInfo(callId: string): LocalRenderInfo | undefined;
48
49
  deleteLocalRenderInfo(callId: string): void;
49
50
  getUnparentedRenderInfo(localVideoStream: LocalVideoStreamState): LocalRenderInfo | undefined;
51
+ getUnparentedRenderInfos(): LocalVideoStream[];
50
52
  setUnparentedRenderInfo(statefulStream: LocalVideoStreamState, stream: LocalVideoStream, status: RenderStatus, renderer: VideoStreamRenderer | undefined): void;
51
53
  deleteUnparentedRenderInfo(localVideoStream: LocalVideoStreamState): void;
54
+ subscribeToUnparentedViewVideoEffects(localVideoStream: LocalVideoStream, callContext: CallContext): void;
52
55
  clearCallRelatedState(): void;
53
56
  }
54
57
  //# sourceMappingURL=InternalCallContext.d.ts.map
@@ -81,12 +81,17 @@ export class InternalCallContext {
81
81
  getUnparentedRenderInfo(localVideoStream) {
82
82
  return this._unparentedRenderInfos.get(localVideoStream.source.id);
83
83
  }
84
+ getUnparentedRenderInfos() {
85
+ return [...this._unparentedRenderInfos].map(([, renderInfo]) => renderInfo.stream);
86
+ }
84
87
  setUnparentedRenderInfo(statefulStream, stream, status, renderer) {
85
88
  this._unparentedRenderInfos.set(statefulStream.source.id, { stream, status, renderer });
86
89
  }
87
90
  deleteUnparentedRenderInfo(localVideoStream) {
88
91
  this._unparentedRenderInfos.delete(localVideoStream.source.id);
89
92
  }
93
+ // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars
94
+ subscribeToUnparentedViewVideoEffects(localVideoStream, callContext) { }
90
95
  // UnparentedRenderInfos are not cleared as they are not part of the Call state.
91
96
  clearCallRelatedState() {
92
97
  this._remoteRenderInfos.clear();
@@ -1 +1 @@
1
- {"version":3,"file":"InternalCallContext.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/InternalCallContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAmChD;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAAhC;QACE,0DAA0D;QAClD,uBAAkB,GAAG,IAAI,GAAG,EAAsD,CAAC;QAE3F,6BAA6B;QACrB,sBAAiB,GAAG,IAAI,GAAG,EAA2B,CAAC;QAE/D,oFAAoF;QACpF,yFAAyF;QACjF,2BAAsB,GAAG,IAAI,GAAG,EAA2B,CAAC;QAC5D,mBAAc,GAAG,IAAI,aAAa,EAAE,CAAC;IAqH/C,CAAC;IAnHQ,SAAS,CAAC,SAAiB,EAAE,SAAiB;QACnD,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAC9D,MAAM,iBAAiB,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACjE,IAAI,iBAAiB,EAAE;YACrB,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAC1C,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;SAC3D;QAED,MAAM,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC/D,IAAI,gBAAgB,EAAE;YACpB,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACzC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS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AC,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACrE,CAAC;IAEM,uBAAuB,CAC5B,cAAqC,EACrC,MAAwB,EACxB,MAAoB,EACpB,QAAyC;QAEzC,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC1F,CAAC;IAEM,0BAA0B,CAAC,gBAAuC;QACvE,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,gFAAgF;IACzE,qBAAqB;QAC1B,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAChC,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LocalVideoStream, RemoteVideoStream, VideoStreamRenderer } from '@azure/communication-calling';\nimport { LocalVideoStreamState } from './CallClientState';\nimport { CallIdHistory } from './CallIdHistory';\n\n/**\n * Internally tracked render status. Stores the status of a video render of a stream as rendering could take a long\n * time.\n *\n * 'NotRendered' - the stream has not yet been rendered\n * 'Rendering' - the stream is currently rendering\n * 'Rendered' - the stream has been rendered\n * 'Stopping' - the stream is currently rendering but has been signaled to stop\n */\nexport type RenderStatus = 'NotRendered' | 'Rendering' | 'Rendered' | 'Stopping';\n\n/**\n * Internal container to hold common state needed to keep track of renders.\n */\nexport interface RenderInfo {\n status: RenderStatus;\n renderer: VideoStreamRenderer | undefined;\n}\n\n/**\n * Internally used to keep track of the status, renderer, and awaiting promise, associated with a LocalVideoStream.\n */\nexport interface LocalRenderInfo extends RenderInfo {\n stream: LocalVideoStream;\n}\n\n/**\n * Internally used to keep track of the status, renderer, and awaiting promise, associated with a RemoteVideoStream.\n */\nexport interface RemoteRenderInfo extends RenderInfo {\n stream: RemoteVideoStream;\n}\n\n/**\n * Contains internal data used between different Declarative components to share data.\n */\nexport class InternalCallContext {\n // <CallId, <ParticipantKey, <StreamId, RemoteRenderInfo>>\n private _remoteRenderInfos = new Map<string, Map<string, Map<number, RemoteRenderInfo>>>();\n\n // <CallId, LocalRenderInfo>.\n private _localRenderInfos = new Map<string, LocalRenderInfo>();\n\n // Used for keeping track of rendered LocalVideoStreams that are not part of a Call.\n // The key is the stream ID. We assume each stream ID to only have one owning render info\n private _unparentedRenderInfos = new Map<string, LocalRenderInfo>();\n private _callIdHistory = new CallIdHistory();\n\n public setCallId(newCallId: string, oldCallId: string): void {\n this._callIdHistory.updateCallIdHistory(newCallId, oldCallId);\n const remoteRenderInfos = this._remoteRenderInfos.get(oldCallId);\n if (remoteRenderInfos) {\n this._remoteRenderInfos.delete(oldCallId);\n this._remoteRenderInfos.set(newCallId, remoteRenderInfos);\n }\n\n const localRenderInfos = this._localRenderInfos.get(oldCallId);\n if (localRenderInfos) {\n this._localRenderInfos.delete(oldCallId);\n this._localRenderInfos.set(newCallId, localRenderInfos);\n }\n }\n\n public getCallIds(): IterableIterator<string> {\n return this._remoteRenderInfos.keys();\n }\n\n public getRemoteRenderInfoForCall(callId: string): Map<string, Map<number, RemoteRenderInfo>> | undefined {\n return this._remoteRenderInfos.get(this._callIdHistory.latestCallId(callId));\n }\n\n public getRemoteRenderInfoForParticipant(\n callId: string,\n participantKey: string,\n streamId: number\n ): RemoteRenderInfo | undefined {\n const callRenderInfos = this._remoteRenderInfos.get(this._callIdHistory.latestCallId(callId));\n if (!callRenderInfos) {\n return undefined;\n }\n const participantRenderInfos = callRenderInfos.get(participantKey);\n if (!participantRenderInfos) {\n return undefined;\n }\n return participantRenderInfos.get(streamId);\n }\n\n public setRemoteRenderInfo(\n callId: string,\n participantKey: string,\n streamId: number,\n stream: RemoteVideoStream,\n status: RenderStatus,\n renderer: VideoStreamRenderer | undefined\n ): void {\n let callRenderInfos = this._remoteRenderInfos.get(this._callIdHistory.latestCallId(callId));\n if (!callRenderInfos) {\n callRenderInfos = new Map<string, Map<number, RemoteRenderInfo>>();\n this._remoteRenderInfos.set(this._callIdHistory.latestCallId(callId), callRenderInfos);\n }\n\n let participantRenderInfos = callRenderInfos.get(participantKey);\n if (!participantRenderInfos) {\n participantRenderInfos = new Map<number, RemoteRenderInfo>();\n callRenderInfos.set(participantKey, participantRenderInfos);\n }\n\n participantRenderInfos.set(streamId, { stream, status, renderer });\n }\n\n public deleteRemoteRenderInfo(callId: string, participantKey: string, streamId: number): void {\n const callRenderInfos = this._remoteRenderInfos.get(this._callIdHistory.latestCallId(callId));\n if (!callRenderInfos) {\n return;\n }\n\n const participantRenderInfos = callRenderInfos.get(participantKey);\n if (!participantRenderInfos) {\n return;\n }\n\n participantRenderInfos.delete(streamId);\n }\n\n public setLocalRenderInfo(\n callId: string,\n stream: LocalVideoStream,\n status: RenderStatus,\n renderer: VideoStreamRenderer | undefined\n ): void {\n this._localRenderInfos.set(this._callIdHistory.latestCallId(callId), { stream, status, renderer });\n }\n\n public getLocalRenderInfo(callId: string): LocalRenderInfo | undefined {\n return this._localRenderInfos.get(this._callIdHistory.latestCallId(callId));\n }\n\n public deleteLocalRenderInfo(callId: string): void {\n this._localRenderInfos.delete(this._callIdHistory.latestCallId(callId));\n }\n\n public getUnparentedRenderInfo(localVideoStream: LocalVideoStreamState): LocalRenderInfo | undefined {\n return this._unparentedRenderInfos.get(localVideoStream.source.id);\n }\n\n public setUnparentedRenderInfo(\n statefulStream: LocalVideoStreamState,\n stream: LocalVideoStream,\n status: RenderStatus,\n renderer: VideoStreamRenderer | undefined\n ): void {\n this._unparentedRenderInfos.set(statefulStream.source.id, { stream, status, renderer });\n }\n\n public deleteUnparentedRenderInfo(localVideoStream: LocalVideoStreamState): void {\n this._unparentedRenderInfos.delete(localVideoStream.source.id);\n }\n\n // UnparentedRenderInfos are not cleared as they are not part of the Call state.\n public clearCallRelatedState(): void {\n this._remoteRenderInfos.clear();\n this._localRenderInfos.clear();\n }\n}\n"]}
1
+ {"version":3,"file":"InternalCallContext.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/InternalCallContext.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAKlC,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAmChD;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAAhC;QACE,0DAA0D;QAClD,uBAAkB,GAAG,IAAI,GAAG,EAAsD,CAAC;QAE3F,6BAA6B;QACrB,sBAAiB,GAAG,IAAI,GAAG,EAA2B,CAAC;QAE/D,oFAAoF;QACpF,yFAAyF;QACjF,2BAAsB,GAAG,IAAI,GAAG,EAA2B,CAAC;QAC5D,mBAAc,GAAG,IAAI,aAAa,EAAE,CAAC;IA4H/C,CAAC;IA1HQ,SAAS,CAAC,SAAiB,EAAE,SAAiB;QACnD,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC;QAC9D,MAAM,iBAAiB,GAAG,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QACjE,IAAI,iBAAiB,EAAE;YACrB,IAAI,CAAC,kBAAkB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YAC1C,IAAI,CAAC,kBAAkB,CAAC,GAAG,CAAC,SAAS,EAAE,iBAAiB,CAAC,CAAC;SAC3D;QAED,MAAM,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;QAC/D,IAAI,gBAAgB,EAAE;YACpB,IAAI,CAAC,iBAAiB,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;YACzC,IAAI,CAAC,iBAAiB,CAAC,GAAG,CAAC,SAAS,EAAE,gBAAgB,CAAC,CAAC;SACzD;IACH,CAAC;IAEM,UAAU;QACf,OAAO,IAAI,CAAC,kBAAkB,CAAC,IAAI,EAAE,CAAC;IACxC,CAAC;IAEM,0BAA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AG,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IACrF,CAAC;IAEM,uBAAuB,CAC5B,cAAqC,EACrC,MAAwB,EACxB,MAAoB,EACpB,QAAyC;QAEzC,IAAI,CAAC,sBAAsB,CAAC,GAAG,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC1F,CAAC;IAEM,0BAA0B,CAAC,gBAAuC;QACvE,IAAI,CAAC,sBAAsB,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACjE,CAAC;IAED,mGAAmG;IAC5F,qCAAqC,CAAC,gBAAkC,EAAE,WAAwB,IAAS,CAAC;IAEnH,gFAAgF;IACzE,qBAAqB;QAC1B,IAAI,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC;QAChC,IAAI,CAAC,iBAAiB,CAAC,KAAK,EAAE,CAAC;IACjC,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { LocalVideoStream, RemoteVideoStream, VideoStreamRenderer } from '@azure/communication-calling';\nimport { LocalVideoStreamState } from './CallClientState';\nimport type { CallContext } from './CallContext';\nimport { CallIdHistory } from './CallIdHistory';\n\n/**\n * Internally tracked render status. Stores the status of a video render of a stream as rendering could take a long\n * time.\n *\n * 'NotRendered' - the stream has not yet been rendered\n * 'Rendering' - the stream is currently rendering\n * 'Rendered' - the stream has been rendered\n * 'Stopping' - the stream is currently rendering but has been signaled to stop\n */\nexport type RenderStatus = 'NotRendered' | 'Rendering' | 'Rendered' | 'Stopping';\n\n/**\n * Internal container to hold common state needed to keep track of renders.\n */\nexport interface RenderInfo {\n status: RenderStatus;\n renderer: VideoStreamRenderer | undefined;\n}\n\n/**\n * Internally used to keep track of the status, renderer, and awaiting promise, associated with a LocalVideoStream.\n */\nexport interface LocalRenderInfo extends RenderInfo {\n stream: LocalVideoStream;\n}\n\n/**\n * Internally used to keep track of the status, renderer, and awaiting promise, associated with a RemoteVideoStream.\n */\nexport interface RemoteRenderInfo extends RenderInfo {\n stream: RemoteVideoStream;\n}\n\n/**\n * Contains internal data used between different Declarative components to share data.\n */\nexport class InternalCallContext {\n // <CallId, <ParticipantKey, <StreamId, RemoteRenderInfo>>\n private _remoteRenderInfos = new Map<string, Map<string, Map<number, RemoteRenderInfo>>>();\n\n // <CallId, LocalRenderInfo>.\n private _localRenderInfos = new Map<string, LocalRenderInfo>();\n\n // Used for keeping track of rendered LocalVideoStreams that are not part of a Call.\n // The key is the stream ID. We assume each stream ID to only have one owning render info\n private _unparentedRenderInfos = new Map<string, LocalRenderInfo>();\n private _callIdHistory = new CallIdHistory();\n\n public setCallId(newCallId: string, oldCallId: string): void {\n this._callIdHistory.updateCallIdHistory(newCallId, oldCallId);\n const remoteRenderInfos = this._remoteRenderInfos.get(oldCallId);\n if (remoteRenderInfos) {\n this._remoteRenderInfos.delete(oldCallId);\n this._remoteRenderInfos.set(newCallId, remoteRenderInfos);\n }\n\n const localRenderInfos = this._localRenderInfos.get(oldCallId);\n if (localRenderInfos) {\n this._localRenderInfos.delete(oldCallId);\n this._localRenderInfos.set(newCallId, localRenderInfos);\n }\n }\n\n public getCallIds(): IterableIterator<string> {\n return this._remoteRenderInfos.keys();\n }\n\n public getRemoteRenderInfoForCall(callId: string): Map<string, Map<number, RemoteRenderInfo>> | undefined {\n return this._remoteRenderInfos.get(this._callIdHistory.latestCallId(callId));\n }\n\n public getRemoteRenderInfoForParticipant(\n callId: string,\n participantKey: string,\n streamId: number\n ): RemoteRenderInfo | undefined {\n const callRenderInfos = this._remoteRenderInfos.get(this._callIdHistory.latestCallId(callId));\n if (!callRenderInfos) {\n return undefined;\n }\n const participantRenderInfos = callRenderInfos.get(participantKey);\n if (!participantRenderInfos) {\n return undefined;\n }\n return participantRenderInfos.get(streamId);\n }\n\n public setRemoteRenderInfo(\n callId: string,\n participantKey: string,\n streamId: number,\n stream: RemoteVideoStream,\n status: RenderStatus,\n renderer: VideoStreamRenderer | undefined\n ): void {\n let callRenderInfos = this._remoteRenderInfos.get(this._callIdHistory.latestCallId(callId));\n if (!callRenderInfos) {\n callRenderInfos = new Map<string, Map<number, RemoteRenderInfo>>();\n this._remoteRenderInfos.set(this._callIdHistory.latestCallId(callId), callRenderInfos);\n }\n\n let participantRenderInfos = callRenderInfos.get(participantKey);\n if (!participantRenderInfos) {\n participantRenderInfos = new Map<number, RemoteRenderInfo>();\n callRenderInfos.set(participantKey, participantRenderInfos);\n }\n\n participantRenderInfos.set(streamId, { stream, status, renderer });\n }\n\n public deleteRemoteRenderInfo(callId: string, participantKey: string, streamId: number): void {\n const callRenderInfos = this._remoteRenderInfos.get(this._callIdHistory.latestCallId(callId));\n if (!callRenderInfos) {\n return;\n }\n\n const participantRenderInfos = callRenderInfos.get(participantKey);\n if (!participantRenderInfos) {\n return;\n }\n\n participantRenderInfos.delete(streamId);\n }\n\n public setLocalRenderInfo(\n callId: string,\n stream: LocalVideoStream,\n status: RenderStatus,\n renderer: VideoStreamRenderer | undefined\n ): void {\n this._localRenderInfos.set(this._callIdHistory.latestCallId(callId), { stream, status, renderer });\n }\n\n public getLocalRenderInfo(callId: string): LocalRenderInfo | undefined {\n return this._localRenderInfos.get(this._callIdHistory.latestCallId(callId));\n }\n\n public deleteLocalRenderInfo(callId: string): void {\n this._localRenderInfos.delete(this._callIdHistory.latestCallId(callId));\n }\n\n public getUnparentedRenderInfo(localVideoStream: LocalVideoStreamState): LocalRenderInfo | undefined {\n return this._unparentedRenderInfos.get(localVideoStream.source.id);\n }\n\n public getUnparentedRenderInfos(): LocalVideoStream[] {\n return [...this._unparentedRenderInfos].map(([, renderInfo]) => renderInfo.stream);\n }\n\n public setUnparentedRenderInfo(\n statefulStream: LocalVideoStreamState,\n stream: LocalVideoStream,\n status: RenderStatus,\n renderer: VideoStreamRenderer | undefined\n ): void {\n this._unparentedRenderInfos.set(statefulStream.source.id, { stream, status, renderer });\n }\n\n public deleteUnparentedRenderInfo(localVideoStream: LocalVideoStreamState): void {\n this._unparentedRenderInfos.delete(localVideoStream.source.id);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-empty-function, @typescript-eslint/no-unused-vars\n public subscribeToUnparentedViewVideoEffects(localVideoStream: LocalVideoStream, callContext: CallContext): void {}\n\n // UnparentedRenderInfos are not cleared as they are not part of the Call state.\n public clearCallRelatedState(): void {\n this._remoteRenderInfos.clear();\n this._localRenderInfos.clear();\n }\n}\n"]}
@@ -6,35 +6,22 @@ export declare const callingStatefulLogger: import("@azure/logger").AzureLogger;
6
6
  * @private
7
7
  */
8
8
  export declare enum EventNames {
9
- LOCAL_VIEW_RENDER_SUCCEED = "LOCAL_VIEW_RENDER_SUCCEED",
10
- START_DISPOSE_LOCAL_STREAM = "START_DISPOSE_LOCAL_STREAM",
11
- START_DISPOSE_REMOTE_STREAM = "START_DISPOSE_REMOTE_STREAM",
12
- START_LOCAL_STREAM_RENDERING = "START_LOCAL_STREAM_RENDERING",
13
- DISPOSING_LOCAL_RENDERER = "DISPOSING_LOCAL_RENDERER",
14
- DISPOSING_REMOTE_RENDERER = "DISPOSING_REMOTE_RENDERER",
15
- CREATING_REMOTE_VIEW = "CREATING_REMOTE_VIEW",
16
- REMOTE_VIEW_RENDER_SUCCEED = "REMOTE_VIEW_RENDER_SUCCEED",
9
+ VIEW_RENDER_SUCCEED = "VIEW_RENDER_SUCCEED",
10
+ START_DISPOSE_STREAM = "START_DISPOSE_STREAM",
11
+ START_STREAM_RENDERING = "START_STREAM_RENDERING",
12
+ DISPOSING_RENDERER = "DISPOSING_RENDERER",
13
+ CREATING_VIEW = "CREATING_VIEW",
17
14
  CREATE_STREAM_INVALID_PARAMS = "CREATE_STREAM_INVALID_PARAMS",
18
- DISPOSE_STREAM_INVALID_PARAMS = "DISPOSE_LOCAL_STREAM_INVALID_PARAMS",
19
- LOCAL_STREAM_ALREADY_RENDERED = "LOCAL_STREAM_ALREADY_RENDERED",
20
- LOCAL_STREAM_ALREADY_DISPOSED = "LOCAL_STREAM_ALREADY_DISPOSED",
21
- LOCAL_STREAM_STOPPING = "LOCAL_STREAM_STOPPING",
22
- LOCAL_CREATED_STREAM_STOPPING = "LOCAL_CREATED_STREAM_STOPPING",
23
- LOCAL_STREAM_RENDERING = "LOCAL_STREAM_RENDERING",
24
- REMOTE_STREAM_ALREADY_RENDERED = "REMOTE_STREAM_ALREADY_RENDERED",
25
- REMOTE_STREAM_RENDERING = "REMOTE_STREAM_RENDERING",
26
- REMOTE_STREAM_ALREADY_DISPOSED = "REMOTE_STREAM_ALREADY_DISPOSED",
27
- REMOTE_STREAM_STOPPING = "REMOTE_STREAM_STOPPING",
28
- REMOTE_CREATED_STREAM_STOPPING = "REMOTE_CREATED_STREAM_STOPPING",
29
- LOCAL_STREAM_NOT_FOUND = "LOCAL_STREAM_NOT_FOUND",
30
- LOCAL_RENDER_INFO_NOT_FOUND = "LOCAL_RENDER_INFO_NOT_FOUND",
31
- REMOTE_STREAM_NOT_FOUND = "REMOTE_STREAM_NOT_FOUND",
32
- LOCAL_DISPOSE_INFO_NOT_FOUND = "LOCAL_DISPOSE_INFO_NOT_FOUND",
33
- REMOTE_DISPOSE_INFO_NOT_FOUND = "REMOTE_DISPOSE_INFO_NOT_FOUND",
34
- REMOTE_RENDER_INFO_NOT_FOUND = "REMOTE_RENDER_INFO_NOT_FOUND",
35
- LOCAL_RENDERER_NOT_FOUND = "LOCAL_RENDERER_NOT_FOUND",
36
- REMOTE_RENDERER_NOT_FOUND = "REMOTE_RENDERER_NOT_FOUND",
37
- CREATE_REMOTE_STREAM_FAIL = "CREATE_REMOTE_STREAM_FAIL",
38
- CREATE_LOCAL_STREAM_FAIL = "CREATE_LOCAL_STREAM_FAIL"
15
+ DISPOSE_STREAM_INVALID_PARAMS = "DISPOSE_STREAM_INVALID_PARAMS",
16
+ STREAM_ALREADY_RENDERED = "STREAM_ALREADY_RENDERED",
17
+ STREAM_ALREADY_DISPOSED = "STREAM_ALREADY_DISPOSED",
18
+ STREAM_STOPPING = "STREAM_STOPPING",
19
+ CREATED_STREAM_STOPPING = "CREATED_STREAM_STOPPING",
20
+ STREAM_RENDERING = "STREAM_RENDERING",
21
+ STREAM_NOT_FOUND = "STREAM_NOT_FOUND",
22
+ RENDER_INFO_NOT_FOUND = "RENDER_INFO_NOT_FOUND",
23
+ DISPOSE_INFO_NOT_FOUND = "DISPOSE_INFO_NOT_FOUND",
24
+ RENDERER_NOT_FOUND = "RENDERER_NOT_FOUND",
25
+ CREATE_STREAM_FAIL = "CREATE_STREAM_FAIL"
39
26
  }
40
27
  //# sourceMappingURL=Logger.d.ts.map
@@ -11,37 +11,24 @@ export const callingStatefulLogger = createClientLogger('communication-react:cal
11
11
  export var EventNames;
12
12
  (function (EventNames) {
13
13
  // Info
14
- EventNames["LOCAL_VIEW_RENDER_SUCCEED"] = "LOCAL_VIEW_RENDER_SUCCEED";
15
- EventNames["START_DISPOSE_LOCAL_STREAM"] = "START_DISPOSE_LOCAL_STREAM";
16
- EventNames["START_DISPOSE_REMOTE_STREAM"] = "START_DISPOSE_REMOTE_STREAM";
17
- EventNames["START_LOCAL_STREAM_RENDERING"] = "START_LOCAL_STREAM_RENDERING";
18
- EventNames["DISPOSING_LOCAL_RENDERER"] = "DISPOSING_LOCAL_RENDERER";
19
- EventNames["DISPOSING_REMOTE_RENDERER"] = "DISPOSING_REMOTE_RENDERER";
20
- EventNames["CREATING_REMOTE_VIEW"] = "CREATING_REMOTE_VIEW";
21
- EventNames["REMOTE_VIEW_RENDER_SUCCEED"] = "REMOTE_VIEW_RENDER_SUCCEED";
14
+ EventNames["VIEW_RENDER_SUCCEED"] = "VIEW_RENDER_SUCCEED";
15
+ EventNames["START_DISPOSE_STREAM"] = "START_DISPOSE_STREAM";
16
+ EventNames["START_STREAM_RENDERING"] = "START_STREAM_RENDERING";
17
+ EventNames["DISPOSING_RENDERER"] = "DISPOSING_RENDERER";
18
+ EventNames["CREATING_VIEW"] = "CREATING_VIEW";
22
19
  // Warning
23
20
  EventNames["CREATE_STREAM_INVALID_PARAMS"] = "CREATE_STREAM_INVALID_PARAMS";
24
- EventNames["DISPOSE_STREAM_INVALID_PARAMS"] = "DISPOSE_LOCAL_STREAM_INVALID_PARAMS";
25
- EventNames["LOCAL_STREAM_ALREADY_RENDERED"] = "LOCAL_STREAM_ALREADY_RENDERED";
26
- EventNames["LOCAL_STREAM_ALREADY_DISPOSED"] = "LOCAL_STREAM_ALREADY_DISPOSED";
27
- EventNames["LOCAL_STREAM_STOPPING"] = "LOCAL_STREAM_STOPPING";
28
- EventNames["LOCAL_CREATED_STREAM_STOPPING"] = "LOCAL_CREATED_STREAM_STOPPING";
29
- EventNames["LOCAL_STREAM_RENDERING"] = "LOCAL_STREAM_RENDERING";
30
- EventNames["REMOTE_STREAM_ALREADY_RENDERED"] = "REMOTE_STREAM_ALREADY_RENDERED";
31
- EventNames["REMOTE_STREAM_RENDERING"] = "REMOTE_STREAM_RENDERING";
32
- EventNames["REMOTE_STREAM_ALREADY_DISPOSED"] = "REMOTE_STREAM_ALREADY_DISPOSED";
33
- EventNames["REMOTE_STREAM_STOPPING"] = "REMOTE_STREAM_STOPPING";
34
- EventNames["REMOTE_CREATED_STREAM_STOPPING"] = "REMOTE_CREATED_STREAM_STOPPING";
21
+ EventNames["DISPOSE_STREAM_INVALID_PARAMS"] = "DISPOSE_STREAM_INVALID_PARAMS";
22
+ EventNames["STREAM_ALREADY_RENDERED"] = "STREAM_ALREADY_RENDERED";
23
+ EventNames["STREAM_ALREADY_DISPOSED"] = "STREAM_ALREADY_DISPOSED";
24
+ EventNames["STREAM_STOPPING"] = "STREAM_STOPPING";
25
+ EventNames["CREATED_STREAM_STOPPING"] = "CREATED_STREAM_STOPPING";
26
+ EventNames["STREAM_RENDERING"] = "STREAM_RENDERING";
35
27
  // Error
36
- EventNames["LOCAL_STREAM_NOT_FOUND"] = "LOCAL_STREAM_NOT_FOUND";
37
- EventNames["LOCAL_RENDER_INFO_NOT_FOUND"] = "LOCAL_RENDER_INFO_NOT_FOUND";
38
- EventNames["REMOTE_STREAM_NOT_FOUND"] = "REMOTE_STREAM_NOT_FOUND";
39
- EventNames["LOCAL_DISPOSE_INFO_NOT_FOUND"] = "LOCAL_DISPOSE_INFO_NOT_FOUND";
40
- EventNames["REMOTE_DISPOSE_INFO_NOT_FOUND"] = "REMOTE_DISPOSE_INFO_NOT_FOUND";
41
- EventNames["REMOTE_RENDER_INFO_NOT_FOUND"] = "REMOTE_RENDER_INFO_NOT_FOUND";
42
- EventNames["LOCAL_RENDERER_NOT_FOUND"] = "LOCAL_RENDERER_NOT_FOUND";
43
- EventNames["REMOTE_RENDERER_NOT_FOUND"] = "REMOTE_RENDERER_NOT_FOUND";
44
- EventNames["CREATE_REMOTE_STREAM_FAIL"] = "CREATE_REMOTE_STREAM_FAIL";
45
- EventNames["CREATE_LOCAL_STREAM_FAIL"] = "CREATE_LOCAL_STREAM_FAIL";
28
+ EventNames["STREAM_NOT_FOUND"] = "STREAM_NOT_FOUND";
29
+ EventNames["RENDER_INFO_NOT_FOUND"] = "RENDER_INFO_NOT_FOUND";
30
+ EventNames["DISPOSE_INFO_NOT_FOUND"] = "DISPOSE_INFO_NOT_FOUND";
31
+ EventNames["RENDERER_NOT_FOUND"] = "RENDERER_NOT_FOUND";
32
+ EventNames["CREATE_STREAM_FAIL"] = "CREATE_STREAM_FAIL";
46
33
  })(EventNames || (EventNames = {}));
47
34
  //# sourceMappingURL=Logger.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/Logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC,sCAAsC,CAAC,CAAC;AAEhG;;GAEG;AACH,MAAM,CAAN,IAAY,UAmCX;AAnCD,WAAY,UAAU;IACpB,OAAO;IACP,qEAAuD,CAAA;IACvD,uEAAyD,CAAA;IACzD,yEAA2D,CAAA;IAC3D,2EAA6D,CAAA;IAC7D,mEAAqD,CAAA;IACrD,qEAAuD,CAAA;IACvD,2DAA6C,CAAA;IAC7C,uEAAyD,CAAA;IACzD,UAAU;IACV,2EAA6D,CAAA;IAC7D,mFAAqE,CAAA;IACrE,6EAA+D,CAAA;IAC/D,6EAA+D,CAAA;IAC/D,6DAA+C,CAAA;IAC/C,6EAA+D,CAAA;IAC/D,+DAAiD,CAAA;IACjD,+EAAiE,CAAA;IACjE,iEAAmD,CAAA;IACnD,+EAAiE,CAAA;IACjE,+DAAiD,CAAA;IACjD,+EAAiE,CAAA;IACjE,QAAQ;IACR,+DAAiD,CAAA;IACjD,yEAA2D,CAAA;IAC3D,iEAAmD,CAAA;IACnD,2EAA6D,CAAA;IAC7D,6EAA+D,CAAA;IAC/D,2EAA6D,CAAA;IAC7D,mEAAqD,CAAA;IACrD,qEAAuD,CAAA;IAEvD,qEAAuD,CAAA;IACvD,mEAAqD,CAAA;AACvD,CAAC,EAnCW,UAAU,KAAV,UAAU,QAmCrB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { createClientLogger } from '@azure/logger';\n\n/**\n * @private\n */\nexport const callingStatefulLogger = createClientLogger('communication-react:calling-stateful');\n\n/**\n * @private\n */\nexport enum EventNames {\n // Info\n LOCAL_VIEW_RENDER_SUCCEED = 'LOCAL_VIEW_RENDER_SUCCEED',\n START_DISPOSE_LOCAL_STREAM = 'START_DISPOSE_LOCAL_STREAM',\n START_DISPOSE_REMOTE_STREAM = 'START_DISPOSE_REMOTE_STREAM',\n START_LOCAL_STREAM_RENDERING = 'START_LOCAL_STREAM_RENDERING',\n DISPOSING_LOCAL_RENDERER = 'DISPOSING_LOCAL_RENDERER',\n DISPOSING_REMOTE_RENDERER = 'DISPOSING_REMOTE_RENDERER',\n CREATING_REMOTE_VIEW = 'CREATING_REMOTE_VIEW',\n REMOTE_VIEW_RENDER_SUCCEED = 'REMOTE_VIEW_RENDER_SUCCEED',\n // Warning\n CREATE_STREAM_INVALID_PARAMS = 'CREATE_STREAM_INVALID_PARAMS',\n DISPOSE_STREAM_INVALID_PARAMS = 'DISPOSE_LOCAL_STREAM_INVALID_PARAMS',\n LOCAL_STREAM_ALREADY_RENDERED = 'LOCAL_STREAM_ALREADY_RENDERED',\n LOCAL_STREAM_ALREADY_DISPOSED = 'LOCAL_STREAM_ALREADY_DISPOSED',\n LOCAL_STREAM_STOPPING = 'LOCAL_STREAM_STOPPING',\n LOCAL_CREATED_STREAM_STOPPING = 'LOCAL_CREATED_STREAM_STOPPING',\n LOCAL_STREAM_RENDERING = 'LOCAL_STREAM_RENDERING',\n REMOTE_STREAM_ALREADY_RENDERED = 'REMOTE_STREAM_ALREADY_RENDERED',\n REMOTE_STREAM_RENDERING = 'REMOTE_STREAM_RENDERING',\n REMOTE_STREAM_ALREADY_DISPOSED = 'REMOTE_STREAM_ALREADY_DISPOSED',\n REMOTE_STREAM_STOPPING = 'REMOTE_STREAM_STOPPING',\n REMOTE_CREATED_STREAM_STOPPING = 'REMOTE_CREATED_STREAM_STOPPING',\n // Error\n LOCAL_STREAM_NOT_FOUND = 'LOCAL_STREAM_NOT_FOUND',\n LOCAL_RENDER_INFO_NOT_FOUND = 'LOCAL_RENDER_INFO_NOT_FOUND',\n REMOTE_STREAM_NOT_FOUND = 'REMOTE_STREAM_NOT_FOUND',\n LOCAL_DISPOSE_INFO_NOT_FOUND = 'LOCAL_DISPOSE_INFO_NOT_FOUND',\n REMOTE_DISPOSE_INFO_NOT_FOUND = 'REMOTE_DISPOSE_INFO_NOT_FOUND',\n REMOTE_RENDER_INFO_NOT_FOUND = 'REMOTE_RENDER_INFO_NOT_FOUND',\n LOCAL_RENDERER_NOT_FOUND = 'LOCAL_RENDERER_NOT_FOUND',\n REMOTE_RENDERER_NOT_FOUND = 'REMOTE_RENDERER_NOT_FOUND',\n\n CREATE_REMOTE_STREAM_FAIL = 'CREATE_REMOTE_STREAM_FAIL',\n CREATE_LOCAL_STREAM_FAIL = 'CREATE_LOCAL_STREAM_FAIL'\n}\n"]}
1
+ {"version":3,"file":"Logger.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/Logger.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,kBAAkB,CAAC,sCAAsC,CAAC,CAAC;AAEhG;;GAEG;AACH,MAAM,CAAN,IAAY,UAsBX;AAtBD,WAAY,UAAU;IACpB,OAAO;IACP,yDAA2C,CAAA;IAC3C,2DAA6C,CAAA;IAC7C,+DAAiD,CAAA;IACjD,uDAAyC,CAAA;IACzC,6CAA+B,CAAA;IAC/B,UAAU;IACV,2EAA6D,CAAA;IAC7D,6EAA+D,CAAA;IAC/D,iEAAmD,CAAA;IACnD,iEAAmD,CAAA;IACnD,iDAAmC,CAAA;IACnC,iEAAmD,CAAA;IACnD,mDAAqC,CAAA;IACrC,QAAQ;IACR,mDAAqC,CAAA;IACrC,6DAA+C,CAAA;IAC/C,+DAAiD,CAAA;IACjD,uDAAyC,CAAA;IAEzC,uDAAyC,CAAA;AAC3C,CAAC,EAtBW,UAAU,KAAV,UAAU,QAsBrB","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { createClientLogger } from '@azure/logger';\n\n/**\n * @private\n */\nexport const callingStatefulLogger = createClientLogger('communication-react:calling-stateful');\n\n/**\n * @private\n */\nexport enum EventNames {\n // Info\n VIEW_RENDER_SUCCEED = 'VIEW_RENDER_SUCCEED',\n START_DISPOSE_STREAM = 'START_DISPOSE_STREAM',\n START_STREAM_RENDERING = 'START_STREAM_RENDERING',\n DISPOSING_RENDERER = 'DISPOSING_RENDERER',\n CREATING_VIEW = 'CREATING_VIEW',\n // Warning\n CREATE_STREAM_INVALID_PARAMS = 'CREATE_STREAM_INVALID_PARAMS',\n DISPOSE_STREAM_INVALID_PARAMS = 'DISPOSE_STREAM_INVALID_PARAMS',\n STREAM_ALREADY_RENDERED = 'STREAM_ALREADY_RENDERED',\n STREAM_ALREADY_DISPOSED = 'STREAM_ALREADY_DISPOSED',\n STREAM_STOPPING = 'STREAM_STOPPING',\n CREATED_STREAM_STOPPING = 'CREATED_STREAM_STOPPING',\n STREAM_RENDERING = 'STREAM_RENDERING',\n // Error\n STREAM_NOT_FOUND = 'STREAM_NOT_FOUND',\n RENDER_INFO_NOT_FOUND = 'RENDER_INFO_NOT_FOUND',\n DISPOSE_INFO_NOT_FOUND = 'DISPOSE_INFO_NOT_FOUND',\n RENDERER_NOT_FOUND = 'RENDERER_NOT_FOUND',\n\n CREATE_STREAM_FAIL = 'CREATE_STREAM_FAIL'\n}\n"]}
@@ -80,7 +80,7 @@ class ProxyCallClient {
80
80
  else {
81
81
  this._sdkDeviceManager = deviceManager;
82
82
  }
83
- this._deviceManager = deviceManagerDeclaratify(deviceManager, this._context);
83
+ this._deviceManager = deviceManagerDeclaratify(deviceManager, this._context, this._internalContext);
84
84
  return this._deviceManager;
85
85
  }), 'CallClient.getDeviceManager');
86
86
  }
@@ -1 +1 @@
1
- {"version":3,"file":"StatefulCallClient.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/StatefulCallClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,UAAU,EAAuD,MAAM,8BAA8B,CAAC;AAC/G,sDAAsD;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAExD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,oBAAoB,EA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C;gBACpE,MAAM,CAAC,IAAI,GAAG,kCAAkC,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC;aAC3G;YACD,OAAO,MAAM,CAAC;QAChB,CAAC,CAAA;KACF,CAAC,CAAC;IACH,MAAM,CAAC,cAAc,CAAC,UAAU,EAAE,aAAa,EAAE;QAC/C,YAAY,EAAE,KAAK;QACnB,KAAK,EAAE,CACL,MAA0B,EAC1B,aAAkD,EAClD,MAAsD,EAChD,EAAE;YACR,MAAM,iBAAiB,GAAG,aAAa,CAAC,CAAC,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACvF,WAAW,CAAC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,CAAC,CAAC;QAC3E,CAAC;KACF,CAAC,CAAC;IAEH,OAAO,IAAI,KAAK,CAAC,UAAU,EAAE,IAAI,eAAe,CAAC,OAAO,EAAE,eAAe,CAAC,CAAuB,CAAC;AACpG,CAAC,CAAC;AAEF,MAAM,gBAAgB,GAAG,CAAC,OAA2B,EAAqB,EAAE;;IAC1E,MAAM,IAAI,GAAG,MAAA,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,0CAAE,IAAI,mCAAI,EAAE,CAAC;IAC9C,IAAI,CAAC,IAAI,CAAC,iBAAiB,EAAE,CAAC,CAAC;IAC/B,uCACK,OAAO,KACV,WAAW,kCACN,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,KACvB,IAAI,OAEN;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { deviceManagerDeclaratify } from './DeviceManagerDeclarative';\nimport { CallClient, CallClientOptions, CreateViewOptions, DeviceManager } from '@azure/communication-calling';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { Features } from '@azure/communication-calling';\nimport { CallClientState, LocalVideoStreamState, RemoteVideoStreamState } from './CallClientState';\nimport { CallContext } from './CallContext';\nimport { callAgentDeclaratify, DeclarativeCallAgent } from './CallAgentDeclarative';\nimport { InternalCallContext } from './InternalCallContext';\nimport { createView, disposeView, CreateViewResult } from './StreamUtils';\nimport { CommunicationIdentifier, CommunicationUserIdentifier, getIdentifierKind } from '@azure/communication-common';\nimport { toFlatCommunicationIdentifier, _getApplicationId } from '@internal/acs-ui-common';\nimport { callingStatefulLogger } from './Logger';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { DeclarativeTeamsCallAgent, teamsCallAgentDeclaratify } from './TeamsCallAgentDeclarative';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { MicrosoftTeamsUserIdentifier } from '@azure/communication-common';\nimport { videoStreamRendererViewDeclaratify } from './VideoStreamRendererViewDeclarative';\n\n/**\n * Defines the methods that allow CallClient {@link @azure/communication-calling#CallClient} to be used statefully.\n * The interface provides access to proxied state and also allows registering a handler for state change events. For\n * state definition see {@link CallClientState}.\n *\n * State change events are driven by:\n * - Returned data from {@link @azure/communication-calling#DeviceManager} APIs.\n * - Returned data from {@link @azure/communication-calling#CallAgent} APIs.\n * - Listeners automatically attached to various azure communication-calling objects:\n * - CallAgent 'incomingCall'\n * - CallAgent 'callsUpdated'\n * - DeviceManager 'videoDevicesUpdated'\n * - DeviceManager 'audioDevicesUpdated\n * - DeviceManager 'selectedMicrophoneChanged'\n * - DeviceManager 'selectedSpeakerChanged'\n * - Call 'stateChanged'\n * - Call 'idChanged'\n * - Call 'isMutedChanged'\n * - Call 'isScreenSharingOnChanged'\n * - Call 'remoteParticipantsUpdated'\n * - Call 'localVideoStreamsUpdated'\n * - IncomingCall 'callEnded'\n * - RemoteParticipant 'stateChanged'\n * - RemoteParticipant 'isMutedChanged'\n * - RemoteParticipant 'displayNameChanged'\n * - RemoteParticipant 'isSpeakingChanged'\n * - RemoteParticipant 'videoStreamsUpdated'\n * - RemoteVideoStream 'isAvailableChanged'\n * - TranscriptionCallFeature 'isTranscriptionActiveChanged'\n * - RecordingCallFeature 'isRecordingActiveChanged'\n *\n * @public\n */\nexport interface StatefulCallClient extends CallClient {\n /**\n * Holds all the state that we could proxy from CallClient {@link @azure/communication-calling#CallClient} as\n * CallClientState {@link CallClientState}.\n */\n getState(): CallClientState;\n /**\n * Allows a handler to be registered for 'stateChanged' events.\n *\n * @param handler - Callback to receive the state.\n */\n onStateChange(handler: (state: CallClientState) => void): void;\n /**\n * Allows unregistering for 'stateChanged' events.\n *\n * @param handler - Original callback to be unsubscribed.\n */\n offStateChange(handler: (state: CallClientState) => void): void;\n /**\n * Renders a {@link RemoteVideoStreamState} or {@link LocalVideoStreamState} and stores the resulting\n * {@link VideoStreamRendererViewState} under the relevant {@link RemoteVideoStreamState} or\n * {@link LocalVideoStreamState} or as unparented view in the state. Under the hood calls\n * {@link @azure/communication-calling#VideoStreamRenderer.createView}.\n *\n * Scenario 1: Render RemoteVideoStreamState\n * - CallId is required, participantId is required, and stream of type RemoteVideoStreamState is required\n * - Resulting {@link VideoStreamRendererViewState} is stored in the given callId and participantId in\n * {@link CallClientState}\n *\n * Scenario 2: Render LocalVideoStreamState for a call\n * - CallId is required, participantId must be undefined, and stream of type LocalVideoStreamState is required.\n * - The {@link @azure/communication-calling#Call.localVideoStreams} must already be started using\n * {@link @azure/communication-calling#Call.startVideo}.\n * - Resulting {@link VideoStreamRendererViewState} is stored in the given callId {@link CallState.localVideoStreams}\n * in {@link CallClientState}.\n *\n * - Scenario 2: Render LocalVideoStreamState not part of a call (example rendering camera for local preview)\n * - CallId must be undefined, participantId must be undefined, and stream of type LocalVideoStreamState is required.\n * - Resulting {@link VideoStreamRendererViewState} is stored in under the given LocalVideoStreamState in\n * {@link CallClientState.deviceManager.unparentedViews}\n *\n * @param callId - CallId for the given stream. Can be undefined if the stream is not part of any call.\n * @param participantId - {@link RemoteParticipant.identifier} associated with the given RemoteVideoStreamState. Could\n * be undefined if rendering LocalVideoStreamState.\n * @param stream - The LocalVideoStreamState or RemoteVideoStreamState to start rendering.\n * @param options - Options that are passed to the {@link @azure/communication-calling#VideoStreamRenderer}.\n */\n createView(\n callId: string | undefined,\n participantId: CommunicationIdentifier | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState,\n options?: CreateViewOptions\n ): Promise<CreateViewResult | undefined>;\n /**\n * Stops rendering a {@link RemoteVideoStreamState} or {@link LocalVideoStreamState} and removes the\n * {@link VideoStreamRendererView} from the relevant {@link RemoteVideoStreamState} in {@link CallClientState} or\n * {@link LocalVideoStream} in {@link CallClientState} or appropriate\n * {@link CallClientState.deviceManager.unparentedViews} Under the hood calls\n * {@link @azure/communication-calling#VideoStreamRenderer.dispose}.\n *\n * Its important to disposeView to clean up resources properly.\n *\n * Scenario 1: Dispose RemoteVideoStreamState\n * - CallId is required, participantId is required, and stream of type RemoteVideoStreamState is required\n *\n * Scenario 2: Dispose LocalVideoStreamState for a call\n * - CallId is required, participantId must be undefined, and stream of type LocalVideoStreamState is required.\n *\n * - Scenario 2: Dispose LocalVideoStreamState not part of a call\n * - CallId must be undefined, participantId must be undefined, and stream of type LocalVideoStreamState is required.\n * - LocalVideoStreamState must be the original one passed to createView.\n *\n * @param callId - CallId for the given stream. Can be undefined if the stream is not part of any call.\n * @param participantId - {@link RemoteParticipant.identifier} associated with the given RemoteVideoStreamState. Could\n * be undefined if disposing LocalVideoStreamState.\n * @param stream - The LocalVideoStreamState or RemoteVideoStreamState to dispose.\n */\n disposeView(\n callId: string | undefined,\n participantId: CommunicationIdentifier | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState\n ): void;\n\n /** @conditional-compile-remove(one-to-n-calling) */\n /**\n * The CallAgent is used to handle calls.\n * To create the CallAgent, pass a CommunicationTokenCredential object provided from SDK.\n * - The CallClient can only have one active CallAgent instance at a time.\n * - You can create a new CallClient instance to create a new CallAgent.\n * - You can dispose of a CallClient's current active CallAgent, and call the CallClient's\n * createCallAgent() method again to create a new CallAgent.\n * @param tokenCredential - The token credential. Use AzureCommunicationTokenCredential from `@azure/communication-common` to create a credential.\n * @param options - The CallAgentOptions for additional options like display name.\n * @public\n */\n createCallAgent(...args: Parameters<CallClient['createCallAgent']>): Promise<DeclarativeCallAgent>;\n}\n\n/**\n * A function to modify the state of the StatefulCallClient.\n *\n * Provided as a callback to the {@link StatefulCallClient.modifyState} method.\n *\n * The function must modify the provided state in place as much as possible.\n * Making large modifications can lead to bad performance by causing spurious rerendering of the UI.\n *\n * Consider using commonly used modifier functions exported from this package.\n */\nexport type CallStateModifier = (state: CallClientState) => void;\n\n/**\n * ProxyCallClient proxies CallClient {@link @azure/communication-calling#CallClient} and subscribes to all events that\n * affect state. ProxyCallClient keeps its own copy of the call state and when state is updated, ProxyCallClient emits\n * the event 'stateChanged'.\n */\nclass ProxyCallClient implements ProxyHandler<CallClient> {\n private _context: CallContext;\n private _internalContext: InternalCallContext;\n private _callAgent:\n | DeclarativeCallAgent\n | /* @conditional-compile-remove(teams-identity-support) */ DeclarativeTeamsCallAgent\n | undefined;\n private _deviceManager: DeviceManager | undefined;\n private _sdkDeviceManager: DeviceManager | undefined;\n\n constructor(context: CallContext, internalContext: InternalCallContext) {\n this._context = context;\n this._internalContext = internalContext;\n }\n\n public get<P extends keyof CallClient>(target: CallClient, prop: P): any {\n switch (prop) {\n case 'createCallAgent': {\n return this._context.withAsyncErrorTeedToState(\n async (...args: Parameters<CallClient['createCallAgent']>): Promise<DeclarativeCallAgent> => {\n // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous\n // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative\n // callAgent if the createCallAgent succeeds.\n const callAgent = await target.createCallAgent(...args);\n this._callAgent = callAgentDeclaratify(callAgent, this._context, this._internalContext);\n this._context.setCallAgent({\n displayName: this._callAgent.displayName\n });\n return this._callAgent;\n },\n 'CallClient.createCallAgent'\n );\n }\n case 'createTeamsCallAgent': {\n /* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState(\n async (...args: Parameters<CallClient['createTeamsCallAgent']>): Promise<DeclarativeTeamsCallAgent> => {\n // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous\n // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative\n // callAgent if the createCallAgent succeeds.\n const callAgent = await target.createTeamsCallAgent(...args);\n this._callAgent = teamsCallAgentDeclaratify(callAgent, this._context, this._internalContext);\n this._context.setCallAgent({\n displayName: undefined\n });\n return this._callAgent;\n },\n 'CallClient.createTeamsCallAgent'\n );\n return Reflect.get(target, prop);\n }\n case 'getDeviceManager': {\n return this._context.withAsyncErrorTeedToState(async () => {\n // As of writing, the SDK always returns the same instance of DeviceManager so we keep a reference of\n // DeviceManager and if it does not change we return the cached DeclarativeDeviceManager. If it does not we'll\n // throw an error that indicate we need to fix this issue as our implementation has diverged from the SDK.\n const deviceManager = await target.getDeviceManager();\n if (this._sdkDeviceManager) {\n if (this._sdkDeviceManager === deviceManager) {\n return this._deviceManager;\n } else {\n throw new Error(\n 'Multiple DeviceManager not supported. This means a incompatible version of communication-calling is ' +\n 'used OR calling declarative was not properly updated to communication-calling version.'\n );\n }\n } else {\n this._sdkDeviceManager = deviceManager;\n }\n this._deviceManager = deviceManagerDeclaratify(deviceManager, this._context);\n return this._deviceManager;\n }, 'CallClient.getDeviceManager');\n }\n case 'feature': {\n /* @conditional-compile-remove(unsupported-browser) */\n return this._context.withErrorTeedToState((...args: Parameters<CallClient['feature']>) => {\n if (args[0] === Features.DebugInfo) {\n const feature = target.feature(Features.DebugInfo);\n /**\n * add to this object if we want to proxy anything else off the DebugInfo feature object.\n */\n return {\n ...feature,\n getEnvironmentInfo: async () => {\n const environmentInfo = await feature.getEnvironmentInfo();\n this._context.setEnvironmentInfo(environmentInfo);\n return environmentInfo;\n }\n };\n }\n return Reflect.get(target, prop);\n }, 'CallClient.feature');\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n/**\n * Arguments to construct the StatefulCallClient.\n *\n * @public\n */\nexport type StatefulCallClientArgs = {\n /**\n * UserId from SDK. This is provided for developer convenience to easily access the userId from the\n * state. It is not used by StatefulCallClient.\n */\n userId:\n | CommunicationUserIdentifier\n | /* @conditional-compile-remove(teams-identity-support) */ MicrosoftTeamsUserIdentifier;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * A phone number in E.164 format that will be used to represent the callers identity. This number is required\n * to start a PSTN call.\n *\n * example: +11234567\n *\n * This is not a cached value from the headless calling client.\n */\n alternateCallerId?: string;\n};\n\n/**\n * Options to construct the StatefulCallClient with.\n *\n * @public\n */\nexport type StatefulCallClientOptions = {\n /**\n * Options to construct the {@link @axure/communication-calling#CallClient} with.\n */\n callClientOptions: CallClientOptions;\n /**\n * Sets the max listeners limit of the 'stateChange' event. Defaults to the node.js EventEmitter.defaultMaxListeners\n * if not specified.\n */\n maxStateChangeListeners?: number;\n};\n\n/**\n * Creates a StatefulCallClient {@link StatefulCallClient} by proxying CallClient\n * {@link @azure/communication-calling#CallClient} with ProxyCallClient {@link ProxyCallClient} which then allows access\n * to state in a declarative way.\n *\n * It is important to use the {@link @azure/communication-calling#DeviceManager} and\n * {@link @azure/communication-calling#CallAgent} and {@link @azure/communication-calling#Call} (and etc.) that are\n * obtained from the StatefulCallClient in order for their state changes to be proxied properly.\n *\n * @param args - {@link StatefulCallClientArgs}\n * @param options - {@link StatefulCallClientOptions}\n *\n * @public\n */\nexport const createStatefulCallClient = (\n args: StatefulCallClientArgs,\n options?: StatefulCallClientOptions\n): StatefulCallClient => {\n callingStatefulLogger.info(`Creating calling stateful client using library version: ${_getApplicationId()}`);\n return createStatefulCallClientWithDeps(\n new CallClient(withTelemetryTag(options?.callClientOptions)),\n new CallContext(\n getIdentifierKind(args.userId),\n options?.maxStateChangeListeners,\n /* @conditional-compile-remove(PSTN-calls) */ args.alternateCallerId\n ),\n new InternalCallContext()\n );\n};\n\n/**\n * Package-internal version of createStatefulCallClient that allows dependency injection.\n *\n * This function should not be exported from the package.\n */\nexport const createStatefulCallClientWithDeps = (\n callClient: CallClient,\n context: CallContext,\n internalContext: InternalCallContext\n): StatefulCallClient => {\n Object.defineProperty(callClient, 'getState', {\n configurable: false,\n value: () => context.getState()\n });\n Object.defineProperty(callClient, 'onStateChange', {\n configurable: false,\n value: (handler: (state: CallClientState) => void) => context.onStateChange(handler)\n });\n Object.defineProperty(callClient, 'offStateChange', {\n configurable: false,\n value: (handler: (state: CallClientState) => void) => context.offStateChange(handler)\n });\n Object.defineProperty(callClient, 'createView', {\n configurable: false,\n value: async (\n callId: string | undefined,\n participantId: CommunicationIdentifier | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState,\n options?: CreateViewOptions\n ): Promise<CreateViewResult | undefined> => {\n const participantIdKind = participantId ? getIdentifierKind(participantId) : undefined;\n const result = await createView(context, internalContext, callId, participantIdKind, stream, options);\n // We only need to declaratify the VideoStreamRendererView object for remote participants. Because the updateScalingMode only needs to be called on remote participant stream views.\n if ('id' in stream && callId && participantId && result) {\n const participantKey = toFlatCommunicationIdentifier(participantId);\n result.view = videoStreamRendererViewDeclaratify(result.view, context, callId, participantKey, stream.id);\n }\n return result;\n }\n });\n Object.defineProperty(callClient, 'disposeView', {\n configurable: false,\n value: (\n callId: string | undefined,\n participantId: CommunicationIdentifier | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState\n ): void => {\n const participantIdKind = participantId ? getIdentifierKind(participantId) : undefined;\n disposeView(context, internalContext, callId, participantIdKind, stream);\n }\n });\n\n return new Proxy(callClient, new ProxyCallClient(context, internalContext)) as StatefulCallClient;\n};\n\nconst withTelemetryTag = (options?: CallClientOptions): CallClientOptions => {\n const tags = options?.diagnostics?.tags ?? [];\n tags.push(_getApplicationId());\n return {\n ...options,\n diagnostics: {\n ...options?.diagnostics,\n tags\n }\n };\n};\n\"../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"StatefulCallClient.js","sourceRoot":"","sources":["../../../../../calling-stateful-client/src/StatefulCallClient.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACv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ACV,WAAW,kCACN,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,KACvB,IAAI,OAEN;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { deviceManagerDeclaratify } from './DeviceManagerDeclarative';\nimport { CallClient, CallClientOptions, CreateViewOptions, DeviceManager } from '@azure/communication-calling';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { Features } from '@azure/communication-calling';\nimport { CallClientState, LocalVideoStreamState, RemoteVideoStreamState } from './CallClientState';\nimport { CallContext } from './CallContext';\nimport { callAgentDeclaratify, DeclarativeCallAgent } from './CallAgentDeclarative';\nimport { InternalCallContext } from './InternalCallContext';\nimport { createView, disposeView, CreateViewResult } from './StreamUtils';\nimport { CommunicationIdentifier, CommunicationUserIdentifier, getIdentifierKind } from '@azure/communication-common';\nimport { toFlatCommunicationIdentifier, _getApplicationId } from '@internal/acs-ui-common';\nimport { callingStatefulLogger } from './Logger';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { DeclarativeTeamsCallAgent, teamsCallAgentDeclaratify } from './TeamsCallAgentDeclarative';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { MicrosoftTeamsUserIdentifier } from '@azure/communication-common';\nimport { videoStreamRendererViewDeclaratify } from './VideoStreamRendererViewDeclarative';\n\n/**\n * Defines the methods that allow CallClient {@link @azure/communication-calling#CallClient} to be used statefully.\n * The interface provides access to proxied state and also allows registering a handler for state change events. For\n * state definition see {@link CallClientState}.\n *\n * State change events are driven by:\n * - Returned data from {@link @azure/communication-calling#DeviceManager} APIs.\n * - Returned data from {@link @azure/communication-calling#CallAgent} APIs.\n * - Listeners automatically attached to various azure communication-calling objects:\n * - CallAgent 'incomingCall'\n * - CallAgent 'callsUpdated'\n * - DeviceManager 'videoDevicesUpdated'\n * - DeviceManager 'audioDevicesUpdated\n * - DeviceManager 'selectedMicrophoneChanged'\n * - DeviceManager 'selectedSpeakerChanged'\n * - Call 'stateChanged'\n * - Call 'idChanged'\n * - Call 'isMutedChanged'\n * - Call 'isScreenSharingOnChanged'\n * - Call 'remoteParticipantsUpdated'\n * - Call 'localVideoStreamsUpdated'\n * - IncomingCall 'callEnded'\n * - RemoteParticipant 'stateChanged'\n * - RemoteParticipant 'isMutedChanged'\n * - RemoteParticipant 'displayNameChanged'\n * - RemoteParticipant 'isSpeakingChanged'\n * - RemoteParticipant 'videoStreamsUpdated'\n * - RemoteVideoStream 'isAvailableChanged'\n * - TranscriptionCallFeature 'isTranscriptionActiveChanged'\n * - RecordingCallFeature 'isRecordingActiveChanged'\n *\n * @public\n */\nexport interface StatefulCallClient extends CallClient {\n /**\n * Holds all the state that we could proxy from CallClient {@link @azure/communication-calling#CallClient} as\n * CallClientState {@link CallClientState}.\n */\n getState(): CallClientState;\n /**\n * Allows a handler to be registered for 'stateChanged' events.\n *\n * @param handler - Callback to receive the state.\n */\n onStateChange(handler: (state: CallClientState) => void): void;\n /**\n * Allows unregistering for 'stateChanged' events.\n *\n * @param handler - Original callback to be unsubscribed.\n */\n offStateChange(handler: (state: CallClientState) => void): void;\n /**\n * Renders a {@link RemoteVideoStreamState} or {@link LocalVideoStreamState} and stores the resulting\n * {@link VideoStreamRendererViewState} under the relevant {@link RemoteVideoStreamState} or\n * {@link LocalVideoStreamState} or as unparented view in the state. Under the hood calls\n * {@link @azure/communication-calling#VideoStreamRenderer.createView}.\n *\n * Scenario 1: Render RemoteVideoStreamState\n * - CallId is required, participantId is required, and stream of type RemoteVideoStreamState is required\n * - Resulting {@link VideoStreamRendererViewState} is stored in the given callId and participantId in\n * {@link CallClientState}\n *\n * Scenario 2: Render LocalVideoStreamState for a call\n * - CallId is required, participantId must be undefined, and stream of type LocalVideoStreamState is required.\n * - The {@link @azure/communication-calling#Call.localVideoStreams} must already be started using\n * {@link @azure/communication-calling#Call.startVideo}.\n * - Resulting {@link VideoStreamRendererViewState} is stored in the given callId {@link CallState.localVideoStreams}\n * in {@link CallClientState}.\n *\n * - Scenario 2: Render LocalVideoStreamState not part of a call (example rendering camera for local preview)\n * - CallId must be undefined, participantId must be undefined, and stream of type LocalVideoStreamState is required.\n * - Resulting {@link VideoStreamRendererViewState} is stored in under the given LocalVideoStreamState in\n * {@link CallClientState.deviceManager.unparentedViews}\n *\n * @param callId - CallId for the given stream. Can be undefined if the stream is not part of any call.\n * @param participantId - {@link RemoteParticipant.identifier} associated with the given RemoteVideoStreamState. Could\n * be undefined if rendering LocalVideoStreamState.\n * @param stream - The LocalVideoStreamState or RemoteVideoStreamState to start rendering.\n * @param options - Options that are passed to the {@link @azure/communication-calling#VideoStreamRenderer}.\n */\n createView(\n callId: string | undefined,\n participantId: CommunicationIdentifier | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState,\n options?: CreateViewOptions\n ): Promise<CreateViewResult | undefined>;\n /**\n * Stops rendering a {@link RemoteVideoStreamState} or {@link LocalVideoStreamState} and removes the\n * {@link VideoStreamRendererView} from the relevant {@link RemoteVideoStreamState} in {@link CallClientState} or\n * {@link LocalVideoStream} in {@link CallClientState} or appropriate\n * {@link CallClientState.deviceManager.unparentedViews} Under the hood calls\n * {@link @azure/communication-calling#VideoStreamRenderer.dispose}.\n *\n * Its important to disposeView to clean up resources properly.\n *\n * Scenario 1: Dispose RemoteVideoStreamState\n * - CallId is required, participantId is required, and stream of type RemoteVideoStreamState is required\n *\n * Scenario 2: Dispose LocalVideoStreamState for a call\n * - CallId is required, participantId must be undefined, and stream of type LocalVideoStreamState is required.\n *\n * - Scenario 2: Dispose LocalVideoStreamState not part of a call\n * - CallId must be undefined, participantId must be undefined, and stream of type LocalVideoStreamState is required.\n * - LocalVideoStreamState must be the original one passed to createView.\n *\n * @param callId - CallId for the given stream. Can be undefined if the stream is not part of any call.\n * @param participantId - {@link RemoteParticipant.identifier} associated with the given RemoteVideoStreamState. Could\n * be undefined if disposing LocalVideoStreamState.\n * @param stream - The LocalVideoStreamState or RemoteVideoStreamState to dispose.\n */\n disposeView(\n callId: string | undefined,\n participantId: CommunicationIdentifier | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState\n ): void;\n\n /** @conditional-compile-remove(one-to-n-calling) */\n /**\n * The CallAgent is used to handle calls.\n * To create the CallAgent, pass a CommunicationTokenCredential object provided from SDK.\n * - The CallClient can only have one active CallAgent instance at a time.\n * - You can create a new CallClient instance to create a new CallAgent.\n * - You can dispose of a CallClient's current active CallAgent, and call the CallClient's\n * createCallAgent() method again to create a new CallAgent.\n * @param tokenCredential - The token credential. Use AzureCommunicationTokenCredential from `@azure/communication-common` to create a credential.\n * @param options - The CallAgentOptions for additional options like display name.\n * @public\n */\n createCallAgent(...args: Parameters<CallClient['createCallAgent']>): Promise<DeclarativeCallAgent>;\n}\n\n/**\n * A function to modify the state of the StatefulCallClient.\n *\n * Provided as a callback to the {@link StatefulCallClient.modifyState} method.\n *\n * The function must modify the provided state in place as much as possible.\n * Making large modifications can lead to bad performance by causing spurious rerendering of the UI.\n *\n * Consider using commonly used modifier functions exported from this package.\n */\nexport type CallStateModifier = (state: CallClientState) => void;\n\n/**\n * ProxyCallClient proxies CallClient {@link @azure/communication-calling#CallClient} and subscribes to all events that\n * affect state. ProxyCallClient keeps its own copy of the call state and when state is updated, ProxyCallClient emits\n * the event 'stateChanged'.\n */\nclass ProxyCallClient implements ProxyHandler<CallClient> {\n private _context: CallContext;\n private _internalContext: InternalCallContext;\n private _callAgent:\n | DeclarativeCallAgent\n | /* @conditional-compile-remove(teams-identity-support) */ DeclarativeTeamsCallAgent\n | undefined;\n private _deviceManager: DeviceManager | undefined;\n private _sdkDeviceManager: DeviceManager | undefined;\n\n constructor(context: CallContext, internalContext: InternalCallContext) {\n this._context = context;\n this._internalContext = internalContext;\n }\n\n public get<P extends keyof CallClient>(target: CallClient, prop: P): any {\n switch (prop) {\n case 'createCallAgent': {\n return this._context.withAsyncErrorTeedToState(\n async (...args: Parameters<CallClient['createCallAgent']>): Promise<DeclarativeCallAgent> => {\n // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous\n // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative\n // callAgent if the createCallAgent succeeds.\n const callAgent = await target.createCallAgent(...args);\n this._callAgent = callAgentDeclaratify(callAgent, this._context, this._internalContext);\n this._context.setCallAgent({\n displayName: this._callAgent.displayName\n });\n return this._callAgent;\n },\n 'CallClient.createCallAgent'\n );\n }\n case 'createTeamsCallAgent': {\n /* @conditional-compile-remove(teams-identity-support) */ return this._context.withAsyncErrorTeedToState(\n async (...args: Parameters<CallClient['createTeamsCallAgent']>): Promise<DeclarativeTeamsCallAgent> => {\n // createCallAgent will throw an exception if the previous callAgent was not disposed. If the previous\n // callAgent was disposed then it would have unsubscribed to events so we can just create a new declarative\n // callAgent if the createCallAgent succeeds.\n const callAgent = await target.createTeamsCallAgent(...args);\n this._callAgent = teamsCallAgentDeclaratify(callAgent, this._context, this._internalContext);\n this._context.setCallAgent({\n displayName: undefined\n });\n return this._callAgent;\n },\n 'CallClient.createTeamsCallAgent'\n );\n return Reflect.get(target, prop);\n }\n case 'getDeviceManager': {\n return this._context.withAsyncErrorTeedToState(async () => {\n // As of writing, the SDK always returns the same instance of DeviceManager so we keep a reference of\n // DeviceManager and if it does not change we return the cached DeclarativeDeviceManager. If it does not we'll\n // throw an error that indicate we need to fix this issue as our implementation has diverged from the SDK.\n const deviceManager = await target.getDeviceManager();\n if (this._sdkDeviceManager) {\n if (this._sdkDeviceManager === deviceManager) {\n return this._deviceManager;\n } else {\n throw new Error(\n 'Multiple DeviceManager not supported. This means a incompatible version of communication-calling is ' +\n 'used OR calling declarative was not properly updated to communication-calling version.'\n );\n }\n } else {\n this._sdkDeviceManager = deviceManager;\n }\n this._deviceManager = deviceManagerDeclaratify(deviceManager, this._context, this._internalContext);\n return this._deviceManager;\n }, 'CallClient.getDeviceManager');\n }\n case 'feature': {\n /* @conditional-compile-remove(unsupported-browser) */\n return this._context.withErrorTeedToState((...args: Parameters<CallClient['feature']>) => {\n if (args[0] === Features.DebugInfo) {\n const feature = target.feature(Features.DebugInfo);\n /**\n * add to this object if we want to proxy anything else off the DebugInfo feature object.\n */\n return {\n ...feature,\n getEnvironmentInfo: async () => {\n const environmentInfo = await feature.getEnvironmentInfo();\n this._context.setEnvironmentInfo(environmentInfo);\n return environmentInfo;\n }\n };\n }\n return Reflect.get(target, prop);\n }, 'CallClient.feature');\n }\n default:\n return Reflect.get(target, prop);\n }\n }\n}\n\n/**\n * Arguments to construct the StatefulCallClient.\n *\n * @public\n */\nexport type StatefulCallClientArgs = {\n /**\n * UserId from SDK. This is provided for developer convenience to easily access the userId from the\n * state. It is not used by StatefulCallClient.\n */\n userId:\n | CommunicationUserIdentifier\n | /* @conditional-compile-remove(teams-identity-support) */ MicrosoftTeamsUserIdentifier;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * A phone number in E.164 format that will be used to represent the callers identity. This number is required\n * to start a PSTN call.\n *\n * example: +11234567\n *\n * This is not a cached value from the headless calling client.\n */\n alternateCallerId?: string;\n};\n\n/**\n * Options to construct the StatefulCallClient with.\n *\n * @public\n */\nexport type StatefulCallClientOptions = {\n /**\n * Options to construct the {@link @axure/communication-calling#CallClient} with.\n */\n callClientOptions: CallClientOptions;\n /**\n * Sets the max listeners limit of the 'stateChange' event. Defaults to the node.js EventEmitter.defaultMaxListeners\n * if not specified.\n */\n maxStateChangeListeners?: number;\n};\n\n/**\n * Creates a StatefulCallClient {@link StatefulCallClient} by proxying CallClient\n * {@link @azure/communication-calling#CallClient} with ProxyCallClient {@link ProxyCallClient} which then allows access\n * to state in a declarative way.\n *\n * It is important to use the {@link @azure/communication-calling#DeviceManager} and\n * {@link @azure/communication-calling#CallAgent} and {@link @azure/communication-calling#Call} (and etc.) that are\n * obtained from the StatefulCallClient in order for their state changes to be proxied properly.\n *\n * @param args - {@link StatefulCallClientArgs}\n * @param options - {@link StatefulCallClientOptions}\n *\n * @public\n */\nexport const createStatefulCallClient = (\n args: StatefulCallClientArgs,\n options?: StatefulCallClientOptions\n): StatefulCallClient => {\n callingStatefulLogger.info(`Creating calling stateful client using library version: ${_getApplicationId()}`);\n return createStatefulCallClientWithDeps(\n new CallClient(withTelemetryTag(options?.callClientOptions)),\n new CallContext(\n getIdentifierKind(args.userId),\n options?.maxStateChangeListeners,\n /* @conditional-compile-remove(PSTN-calls) */ args.alternateCallerId\n ),\n new InternalCallContext()\n );\n};\n\n/**\n * Package-internal version of createStatefulCallClient that allows dependency injection.\n *\n * This function should not be exported from the package.\n */\nexport const createStatefulCallClientWithDeps = (\n callClient: CallClient,\n context: CallContext,\n internalContext: InternalCallContext\n): StatefulCallClient => {\n Object.defineProperty(callClient, 'getState', {\n configurable: false,\n value: () => context.getState()\n });\n Object.defineProperty(callClient, 'onStateChange', {\n configurable: false,\n value: (handler: (state: CallClientState) => void) => context.onStateChange(handler)\n });\n Object.defineProperty(callClient, 'offStateChange', {\n configurable: false,\n value: (handler: (state: CallClientState) => void) => context.offStateChange(handler)\n });\n Object.defineProperty(callClient, 'createView', {\n configurable: false,\n value: async (\n callId: string | undefined,\n participantId: CommunicationIdentifier | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState,\n options?: CreateViewOptions\n ): Promise<CreateViewResult | undefined> => {\n const participantIdKind = participantId ? getIdentifierKind(participantId) : undefined;\n const result = await createView(context, internalContext, callId, participantIdKind, stream, options);\n // We only need to declaratify the VideoStreamRendererView object for remote participants. Because the updateScalingMode only needs to be called on remote participant stream views.\n if ('id' in stream && callId && participantId && result) {\n const participantKey = toFlatCommunicationIdentifier(participantId);\n result.view = videoStreamRendererViewDeclaratify(result.view, context, callId, participantKey, stream.id);\n }\n return result;\n }\n });\n Object.defineProperty(callClient, 'disposeView', {\n configurable: false,\n value: (\n callId: string | undefined,\n participantId: CommunicationIdentifier | undefined,\n stream: LocalVideoStreamState | RemoteVideoStreamState\n ): void => {\n const participantIdKind = participantId ? getIdentifierKind(participantId) : undefined;\n disposeView(context, internalContext, callId, participantIdKind, stream);\n }\n });\n\n return new Proxy(callClient, new ProxyCallClient(context, internalContext)) as StatefulCallClient;\n};\n\nconst withTelemetryTag = (options?: CallClientOptions): CallClientOptions => {\n const tags = options?.diagnostics?.tags ?? [];\n tags.push(_getApplicationId());\n return {\n ...options,\n diagnostics: {\n ...options?.diagnostics,\n tags\n }\n };\n};\n\"../../acs-ui-common/src\""]}