@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
@@ -2,5 +2,5 @@
2
2
  // Copyright (c) Microsoft Corporation.
3
3
  // Licensed under the MIT license.
4
4
  // GENERATED FILE. DO NOT EDIT MANUALLY.
5
- module.exports = '1.5.1-beta.1';
5
+ module.exports = '1.5.1-beta.3';
6
6
  //# sourceMappingURL=telemetryVersion.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,cAAc,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.5.1-beta.1';\n"]}
1
+ {"version":3,"file":"telemetryVersion.js","sourceRoot":"","sources":["../../../../../acs-ui-common/src/telemetryVersion.js"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;AAElC,wCAAwC;AAExC,MAAM,CAAC,OAAO,GAAG,cAAc,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n// GENERATED FILE. DO NOT EDIT MANUALLY.\n\nmodule.exports = '1.5.1-beta.3';\n"]}
@@ -2,6 +2,7 @@ import { DominantSpeakersInfo } from '@azure/communication-calling';
2
2
  import { EnvironmentInfo } from '@azure/communication-calling';
3
3
  import { ParticipantRole } from '@azure/communication-calling';
4
4
  import { CallClientState, DeviceManagerState, RemoteParticipantState, LocalVideoStreamState, CallErrors, DiagnosticsCallFeatureState } from "../../calling-stateful-client/src";
5
+ import { CaptionsInfo } from "../../calling-stateful-client/src";
5
6
  /**
6
7
  * Common props used to reference calling declarative client state.
7
8
  *
@@ -74,4 +75,16 @@ export declare const getCallState: (state: CallClientState, props: CallingBaseSe
74
75
  export declare const getEnvironmentInfo: (state: CallClientState) => undefined | /* @conditional-compile-remove(unsupported-browser) */ EnvironmentInfo;
75
76
  /** @private */
76
77
  export declare const getParticipantCount: (state: CallClientState, props: CallingBaseSelectorProps) => number | undefined;
78
+ /** @private */
79
+ export declare const getCaptions: (state: CallClientState, props: CallingBaseSelectorProps) => CaptionsInfo[] | undefined;
80
+ /** @private */
81
+ export declare const getCaptionsStatus: (state: CallClientState, props: CallingBaseSelectorProps) => boolean | undefined;
82
+ /** @private */
83
+ export declare const getCurrentCaptionLanguage: (state: CallClientState, props: CallingBaseSelectorProps) => string | undefined;
84
+ /** @private */
85
+ export declare const getCurrentSpokenLanguage: (state: CallClientState, props: CallingBaseSelectorProps) => string | undefined;
86
+ /** @private */
87
+ export declare const getSupportedCaptionLanguages: (state: CallClientState, props: CallingBaseSelectorProps) => string[] | undefined;
88
+ /** @private */
89
+ export declare const getSupportedSpokenLanguages: (state: CallClientState, props: CallingBaseSelectorProps) => string[] | undefined;
77
90
  //# sourceMappingURL=baseSelectors.d.ts.map
@@ -75,4 +75,40 @@ export const getParticipantCount = (state, props) => {
75
75
  return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.totalParticipantCount;
76
76
  return undefined;
77
77
  };
78
+ /* @conditional-compile-remove(close-captions) */
79
+ /** @private */
80
+ export const getCaptions = (state, props) => {
81
+ var _a;
82
+ return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.captionsFeature.captions;
83
+ };
84
+ /* @conditional-compile-remove(close-captions) */
85
+ /** @private */
86
+ export const getCaptionsStatus = (state, props) => {
87
+ var _a;
88
+ return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.captionsFeature.isCaptionsFeatureActive;
89
+ };
90
+ /* @conditional-compile-remove(close-captions) */
91
+ /** @private */
92
+ export const getCurrentCaptionLanguage = (state, props) => {
93
+ var _a;
94
+ return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.captionsFeature.currentCaptionLanguage;
95
+ };
96
+ /* @conditional-compile-remove(close-captions) */
97
+ /** @private */
98
+ export const getCurrentSpokenLanguage = (state, props) => {
99
+ var _a;
100
+ return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.captionsFeature.currentSpokenLanguage;
101
+ };
102
+ /* @conditional-compile-remove(close-captions) */
103
+ /** @private */
104
+ export const getSupportedCaptionLanguages = (state, props) => {
105
+ var _a;
106
+ return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.captionsFeature.supportedCaptionLanguages;
107
+ };
108
+ /* @conditional-compile-remove(close-captions) */
109
+ /** @private */
110
+ export const getSupportedSpokenLanguages = (state, props) => {
111
+ var _a;
112
+ return (_a = state.calls[props.callId]) === null || _a === void 0 ? void 0 : _a.captionsFeature.supportedSpokenLanguages;
113
+ };
78
114
  //# sourceMappingURL=baseSelectors.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"baseSelectors.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/baseSelectors.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAmBxE;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAsB,EAAsB,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC;AAEpG,wCAAwC;AACxC;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAsB,EAAE,KAA+B,EAA+B,EAAE,WAC9G,OAAA,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,IAAI,CAAA,EAAA,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAsB,EAAE,KAA+B,EAAW,EAAE,CAChG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAE9B;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,KAAsB,EACtB,KAA+B,EACG,EAAE,WAAC,OAAA,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,gBAAgB,CAAA,EAAA,CAAC;AAEnF;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CACnC,KAAsB,EACtB,KAA+B,EAKn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AY,CAAC;AAE1F;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAC5B,KAAsB,EACtB,KAA+B,EACU,EAAE,WAAC,OAAA,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,WAAW,CAAA,EAAA,CAAC;AAErF,6CAA6C;AAC7C;;GAEG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,KAAsB,EAAE,KAA+B,EAAU,EAAE,WAC9F,OAAA,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,KAAK,CAAA,EAAA,CAAC;AAEnC;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,KAAsB,EAC8D,EAAE;IACtF,sDAAsD;IACtD,OAAO,KAAK,CAAC,eAAe,CAAC;IAC7B,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,eAAe;AACf,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAsB,EAAE,KAA+B,EAAsB,EAAE;;IACjH,0DAA0D;IAC1D,OAAO,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,qBAAqB,CAAC;IACxD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { DominantSpeakersInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(rooms) */\nimport { ParticipantRole } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport {\n CallClientState,\n DeviceManagerState,\n RemoteParticipantState,\n LocalVideoStreamState,\n CallErrors,\n DiagnosticsCallFeatureState\n} from '@internal/calling-stateful-client';\n\n/**\n * Common props used to reference calling declarative client state.\n *\n * @public\n */\nexport type CallingBaseSelectorProps = {\n callId: string;\n};\n\n/**\n * @private\n */\nexport const getDeviceManager = (state: CallClientState): DeviceManagerState => state.deviceManager;\n\n/* @conditional-compile-remove(rooms) */\n/**\n * @private\n */\nexport const getRole = (state: CallClientState, props: CallingBaseSelectorProps): ParticipantRole | undefined =>\n state.calls[props.callId]?.role;\n\n/**\n * @private\n */\nexport const getCallExists = (state: CallClientState, props: CallingBaseSelectorProps): boolean =>\n !!state.calls[props.callId];\n\n/**\n * @private\n */\nexport const getDominantSpeakers = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): undefined | DominantSpeakersInfo => state.calls[props.callId]?.dominantSpeakers;\n\n/**\n * @private\n */\nexport const getRemoteParticipants = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n):\n | {\n [keys: string]: RemoteParticipantState;\n }\n | undefined => {\n return state.calls[props.callId]?.remoteParticipants;\n};\n\n/**\n * @private\n */\nexport const getIsScreenSharingOn = (state: CallClientState, props: CallingBaseSelectorProps): boolean | undefined =>\n state.calls[props.callId]?.isScreenSharingOn;\n\n/**\n * @private\n */\nexport const getIsMuted = (state: CallClientState, props: CallingBaseSelectorProps): boolean | undefined =>\n state.calls[props.callId]?.isMuted;\n\n/**\n * @private\n */\nexport const getLocalVideoStreams = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): LocalVideoStreamState[] | undefined => state.calls[props.callId]?.localVideoStreams;\n\n/**\n * @private\n */\nexport const getScreenShareRemoteParticipant = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): string | undefined => state.calls[props.callId]?.screenShareRemoteParticipant;\n\n/**\n * @private\n */\nexport const getDisplayName = (state: CallClientState): string | undefined => state.callAgent?.displayName;\n\n/**\n * @private\n */\nexport const getIdentifier = (state: CallClientState): string => toFlatCommunicationIdentifier(state.userId);\n\n/**\n * @private\n */\nexport const getLatestErrors = (state: CallClientState): CallErrors => state.latestErrors;\n\n/**\n * @private\n */\nexport const getDiagnostics = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): DiagnosticsCallFeatureState | undefined => state.calls[props.callId]?.diagnostics;\n\n/* @conditional-compile-remove(PSTN-calls) */\n/**\n * @private\n */\nexport const getCallState = (state: CallClientState, props: CallingBaseSelectorProps): string =>\n state.calls[props.callId]?.state;\n\n/**\n * @private\n */\nexport const getEnvironmentInfo = (\n state: CallClientState\n): undefined | /* @conditional-compile-remove(unsupported-browser) */ EnvironmentInfo => {\n /* @conditional-compile-remove(unsupported-browser) */\n return state.environmentInfo;\n return undefined;\n};\n\n/** @private */\nexport const getParticipantCount = (state: CallClientState, props: CallingBaseSelectorProps): number | undefined => {\n /* @conditional-compile-remove(total-participant-count) */\n return state.calls[props.callId]?.totalParticipantCount;\n return undefined;\n};\n\"../../acs-ui-common/src\"\"../../calling-stateful-client/src\""]}
1
+ {"version":3,"file":"baseSelectors.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/baseSelectors.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAqBxE;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAAsB,EAAsB,EAAE,CAAC,KAAK,CAAC,aAAa,CAAC;AAEpG,wCAAwC;AACxC;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAsB,EAAE,KAA+B,EAA+B,EAAE,WAC9G,OAAA,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,IAAI,CAAA,EAAA,CAAC;AAElC;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAsB,EAAE,KAA+B,EAAW,EAAE,CAChG,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;AAE9B;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CACjC,KAAsB,EACtB,KAA+B,EACG,EAAE,WAAC,OAAA,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,gBAAgB,C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H,OAAO,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,eAAe,CAAC,uBAAuB,CAAC;AAC5E,CAAC,CAAC;AAEF,iDAAiD;AACjD,eAAe;AACf,MAAM,CAAC,MAAM,yBAAyB,GAAG,CACvC,KAAsB,EACtB,KAA+B,EACX,EAAE;;IACtB,OAAO,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,eAAe,CAAC,sBAAsB,CAAC;AAC3E,CAAC,CAAC;AAEF,iDAAiD;AACjD,eAAe;AACf,MAAM,CAAC,MAAM,wBAAwB,GAAG,CACtC,KAAsB,EACtB,KAA+B,EACX,EAAE;;IACtB,OAAO,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,eAAe,CAAC,qBAAqB,CAAC;AAC1E,CAAC,CAAC;AAEF,iDAAiD;AACjD,eAAe;AACf,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAC1C,KAAsB,EACtB,KAA+B,EACT,EAAE;;IACxB,OAAO,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,eAAe,CAAC,yBAAyB,CAAC;AAC9E,CAAC,CAAC;AAEF,iDAAiD;AACjD,eAAe;AACf,MAAM,CAAC,MAAM,2BAA2B,GAAG,CACzC,KAAsB,EACtB,KAA+B,EACT,EAAE;;IACxB,OAAO,MAAA,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,0CAAE,eAAe,CAAC,wBAAwB,CAAC;AAC7E,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { DominantSpeakersInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(rooms) */\nimport { ParticipantRole } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport {\n CallClientState,\n DeviceManagerState,\n RemoteParticipantState,\n LocalVideoStreamState,\n CallErrors,\n DiagnosticsCallFeatureState\n} from '@internal/calling-stateful-client';\n/* @conditional-compile-remove(close-captions) */\nimport { CaptionsInfo } from '@internal/calling-stateful-client';\n\n/**\n * Common props used to reference calling declarative client state.\n *\n * @public\n */\nexport type CallingBaseSelectorProps = {\n callId: string;\n};\n\n/**\n * @private\n */\nexport const getDeviceManager = (state: CallClientState): DeviceManagerState => state.deviceManager;\n\n/* @conditional-compile-remove(rooms) */\n/**\n * @private\n */\nexport const getRole = (state: CallClientState, props: CallingBaseSelectorProps): ParticipantRole | undefined =>\n state.calls[props.callId]?.role;\n\n/**\n * @private\n */\nexport const getCallExists = (state: CallClientState, props: CallingBaseSelectorProps): boolean =>\n !!state.calls[props.callId];\n\n/**\n * @private\n */\nexport const getDominantSpeakers = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): undefined | DominantSpeakersInfo => state.calls[props.callId]?.dominantSpeakers;\n\n/**\n * @private\n */\nexport const getRemoteParticipants = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n):\n | {\n [keys: string]: RemoteParticipantState;\n }\n | undefined => {\n return state.calls[props.callId]?.remoteParticipants;\n};\n\n/**\n * @private\n */\nexport const getIsScreenSharingOn = (state: CallClientState, props: CallingBaseSelectorProps): boolean | undefined =>\n state.calls[props.callId]?.isScreenSharingOn;\n\n/**\n * @private\n */\nexport const getIsMuted = (state: CallClientState, props: CallingBaseSelectorProps): boolean | undefined =>\n state.calls[props.callId]?.isMuted;\n\n/**\n * @private\n */\nexport const getLocalVideoStreams = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): LocalVideoStreamState[] | undefined => state.calls[props.callId]?.localVideoStreams;\n\n/**\n * @private\n */\nexport const getScreenShareRemoteParticipant = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): string | undefined => state.calls[props.callId]?.screenShareRemoteParticipant;\n\n/**\n * @private\n */\nexport const getDisplayName = (state: CallClientState): string | undefined => state.callAgent?.displayName;\n\n/**\n * @private\n */\nexport const getIdentifier = (state: CallClientState): string => toFlatCommunicationIdentifier(state.userId);\n\n/**\n * @private\n */\nexport const getLatestErrors = (state: CallClientState): CallErrors => state.latestErrors;\n\n/**\n * @private\n */\nexport const getDiagnostics = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): DiagnosticsCallFeatureState | undefined => state.calls[props.callId]?.diagnostics;\n\n/* @conditional-compile-remove(PSTN-calls) */\n/**\n * @private\n */\nexport const getCallState = (state: CallClientState, props: CallingBaseSelectorProps): string =>\n state.calls[props.callId]?.state;\n\n/**\n * @private\n */\nexport const getEnvironmentInfo = (\n state: CallClientState\n): undefined | /* @conditional-compile-remove(unsupported-browser) */ EnvironmentInfo => {\n /* @conditional-compile-remove(unsupported-browser) */\n return state.environmentInfo;\n return undefined;\n};\n\n/** @private */\nexport const getParticipantCount = (state: CallClientState, props: CallingBaseSelectorProps): number | undefined => {\n /* @conditional-compile-remove(total-participant-count) */\n return state.calls[props.callId]?.totalParticipantCount;\n return undefined;\n};\n\n/* @conditional-compile-remove(close-captions) */\n/** @private */\nexport const getCaptions = (state: CallClientState, props: CallingBaseSelectorProps): CaptionsInfo[] | undefined => {\n return state.calls[props.callId]?.captionsFeature.captions;\n};\n\n/* @conditional-compile-remove(close-captions) */\n/** @private */\nexport const getCaptionsStatus = (state: CallClientState, props: CallingBaseSelectorProps): boolean | undefined => {\n return state.calls[props.callId]?.captionsFeature.isCaptionsFeatureActive;\n};\n\n/* @conditional-compile-remove(close-captions) */\n/** @private */\nexport const getCurrentCaptionLanguage = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): string | undefined => {\n return state.calls[props.callId]?.captionsFeature.currentCaptionLanguage;\n};\n\n/* @conditional-compile-remove(close-captions) */\n/** @private */\nexport const getCurrentSpokenLanguage = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): string | undefined => {\n return state.calls[props.callId]?.captionsFeature.currentSpokenLanguage;\n};\n\n/* @conditional-compile-remove(close-captions) */\n/** @private */\nexport const getSupportedCaptionLanguages = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): string[] | undefined => {\n return state.calls[props.callId]?.captionsFeature.supportedCaptionLanguages;\n};\n\n/* @conditional-compile-remove(close-captions) */\n/** @private */\nexport const getSupportedSpokenLanguages = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n): string[] | undefined => {\n return state.calls[props.callId]?.captionsFeature.supportedSpokenLanguages;\n};\n\"../../acs-ui-common/src\"\"../../calling-stateful-client/src\""]}
@@ -0,0 +1,49 @@
1
+ import { CallClientState } from "../../calling-stateful-client/src";
2
+ import { CallingBaseSelectorProps } from './baseSelectors';
3
+ import { _CaptionsInfo } from "../../react-components/src";
4
+ /**
5
+ * Selector type for the {@link StartCaptionsButton} component.
6
+ * @internal
7
+ */
8
+ export declare type _StartCaptionsButtonSelector = (state: CallClientState, props: CallingBaseSelectorProps) => {
9
+ checked: boolean;
10
+ currentCaptionLanguage: string;
11
+ currentSpokenLanguage: string;
12
+ };
13
+ /**
14
+ * Selector for {@link StartCaptionsButton} component.
15
+ *
16
+ * @internal
17
+ */
18
+ export declare const _startCaptionsButtonSelector: _StartCaptionsButtonSelector;
19
+ /**
20
+ * Selector type for components for Changing spoken language
21
+ * @internal
22
+ */
23
+ export declare type _ChangeSpokenLanguageSelector = (state: CallClientState, props: CallingBaseSelectorProps) => {
24
+ supportedSpokenLanguages: string[];
25
+ currentSpokenLanguage: string;
26
+ isCaptionsFeatureActive: boolean;
27
+ };
28
+ /**
29
+ * Selector for {@link ChangeSpokenLanguageButton} component.
30
+ *
31
+ * @internal
32
+ */
33
+ export declare const _changeSpokenLanguageSelector: _ChangeSpokenLanguageSelector;
34
+ /**
35
+ * Selector type for the {@link CaptionsBanner} component.
36
+ * @internal
37
+ */
38
+ export declare type _CaptionsBannerSelector = (state: CallClientState, props: CallingBaseSelectorProps) => {
39
+ captions: _CaptionsInfo[];
40
+ isCaptionsOn: boolean;
41
+ };
42
+ /**
43
+ * Selector for {@link CaptionsBanner} component.
44
+ *
45
+ * @internal
46
+ */
47
+ export declare const _captionsBannerSelector: _CaptionsBannerSelector;
48
+ export {};
49
+ //# sourceMappingURL=captionsSelector.d.ts.map
@@ -0,0 +1,53 @@
1
+ /* @conditional-compile-remove(close-captions) */
2
+ import { getCaptions, getCaptionsStatus, getCurrentCaptionLanguage, getCurrentSpokenLanguage, getSupportedSpokenLanguages } from './baseSelectors';
3
+ /* @conditional-compile-remove(close-captions) */
4
+ import * as reselect from 'reselect';
5
+ /* @conditional-compile-remove(close-captions) */
6
+ import { toFlatCommunicationIdentifier } from "../../acs-ui-common/src";
7
+ /* @conditional-compile-remove(close-captions) */
8
+ /**
9
+ * Selector for {@link StartCaptionsButton} component.
10
+ *
11
+ * @internal
12
+ */
13
+ export const _startCaptionsButtonSelector = reselect.createSelector([getCaptionsStatus, getCurrentCaptionLanguage, getCurrentSpokenLanguage], (isCaptionsFeatureActive, currentCaptionLanguage, currentSpokenLanguage) => {
14
+ return {
15
+ checked: isCaptionsFeatureActive !== null && isCaptionsFeatureActive !== void 0 ? isCaptionsFeatureActive : false,
16
+ currentCaptionLanguage: currentCaptionLanguage !== null && currentCaptionLanguage !== void 0 ? currentCaptionLanguage : 'en-us',
17
+ currentSpokenLanguage: currentSpokenLanguage !== null && currentSpokenLanguage !== void 0 ? currentSpokenLanguage : 'en-us'
18
+ };
19
+ });
20
+ /* @conditional-compile-remove(close-captions) */
21
+ /**
22
+ * Selector for {@link ChangeSpokenLanguageButton} component.
23
+ *
24
+ * @internal
25
+ */
26
+ export const _changeSpokenLanguageSelector = reselect.createSelector([getSupportedSpokenLanguages, getCurrentSpokenLanguage, getCaptionsStatus], (supportedSpokenLanguages, currentSpokenLanguage, isCaptionsFeatureActive) => {
27
+ return {
28
+ supportedSpokenLanguages: supportedSpokenLanguages !== null && supportedSpokenLanguages !== void 0 ? supportedSpokenLanguages : ['en-us'],
29
+ currentSpokenLanguage: currentSpokenLanguage !== null && currentSpokenLanguage !== void 0 ? currentSpokenLanguage : 'en-us',
30
+ isCaptionsFeatureActive: isCaptionsFeatureActive !== null && isCaptionsFeatureActive !== void 0 ? isCaptionsFeatureActive : false
31
+ };
32
+ });
33
+ /* @conditional-compile-remove(close-captions) */
34
+ /**
35
+ * Selector for {@link CaptionsBanner} component.
36
+ *
37
+ * @internal
38
+ */
39
+ export const _captionsBannerSelector = reselect.createSelector([getCaptions, getCaptionsStatus], (captions, isCaptionsFeatureActive) => {
40
+ const captionsInfo = captions === null || captions === void 0 ? void 0 : captions.map((c) => {
41
+ var _a, _b;
42
+ return {
43
+ displayName: (_a = c.speaker.displayName) !== null && _a !== void 0 ? _a : 'Unnamed Participant',
44
+ captionText: (_b = c.captionText) !== null && _b !== void 0 ? _b : '',
45
+ userId: c.speaker.identifier ? toFlatCommunicationIdentifier(c.speaker.identifier) : ''
46
+ };
47
+ });
48
+ return {
49
+ captions: captionsInfo !== null && captionsInfo !== void 0 ? captionsInfo : [],
50
+ isCaptionsOn: isCaptionsFeatureActive !== null && isCaptionsFeatureActive !== void 0 ? isCaptionsFeatureActive : false
51
+ };
52
+ });
53
+ //# sourceMappingURL=captionsSelector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"captionsSelector.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/captionsSelector.ts"],"names":[],"mappings":"AAMA,iDAAiD;AACjD,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,yBAAyB,EACzB,wBAAwB,EACxB,2BAA2B,EAC5B,MAAM,iBAAiB,CAAC;AACzB,iDAAiD;AACjD,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,iDAAiD;AACjD,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAkBxE,iDAAiD;AACjD;;;;GAIG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAiC,QAAQ,CAAC,cAAc,CAC/F,CAAC,iBAAiB,EAAE,yBAAyB,EAAE,wBAAwB,C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E,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,6BAA6B,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE;SACxF,CAAC;IACJ,CAAC,CAAC,CAAC;IACH,OAAO;QACL,QAAQ,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,EAAE;QAC5B,YAAY,EAAE,uBAAuB,aAAvB,uBAAuB,cAAvB,uBAAuB,GAAI,KAAK;KAC/C,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n/* @conditional-compile-remove(close-captions) */\nimport { CallClientState } from '@internal/calling-stateful-client';\n/* @conditional-compile-remove(close-captions) */\nimport { CallingBaseSelectorProps } from './baseSelectors';\n/* @conditional-compile-remove(close-captions) */\nimport {\n getCaptions,\n getCaptionsStatus,\n getCurrentCaptionLanguage,\n getCurrentSpokenLanguage,\n getSupportedSpokenLanguages\n} from './baseSelectors';\n/* @conditional-compile-remove(close-captions) */\nimport * as reselect from 'reselect';\n/* @conditional-compile-remove(close-captions) */\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(close-captions) */\nimport { _CaptionsInfo } from '@internal/react-components';\n\n/* @conditional-compile-remove(close-captions) */\n/**\n * Selector type for the {@link StartCaptionsButton} component.\n * @internal\n */\nexport type _StartCaptionsButtonSelector = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n) => {\n checked: boolean;\n currentCaptionLanguage: string;\n currentSpokenLanguage: string;\n};\n\n/* @conditional-compile-remove(close-captions) */\n/**\n * Selector for {@link StartCaptionsButton} component.\n *\n * @internal\n */\nexport const _startCaptionsButtonSelector: _StartCaptionsButtonSelector = reselect.createSelector(\n [getCaptionsStatus, getCurrentCaptionLanguage, getCurrentSpokenLanguage],\n (isCaptionsFeatureActive, currentCaptionLanguage, currentSpokenLanguage) => {\n return {\n checked: isCaptionsFeatureActive ?? false,\n currentCaptionLanguage: currentCaptionLanguage ?? 'en-us',\n currentSpokenLanguage: currentSpokenLanguage ?? 'en-us'\n };\n }\n);\n/* @conditional-compile-remove(close-captions) */\n/**\n * Selector type for components for Changing spoken language\n * @internal\n */\nexport type _ChangeSpokenLanguageSelector = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n) => {\n supportedSpokenLanguages: string[];\n currentSpokenLanguage: string;\n isCaptionsFeatureActive: boolean;\n};\n\n/* @conditional-compile-remove(close-captions) */\n/**\n * Selector for {@link ChangeSpokenLanguageButton} component.\n *\n * @internal\n */\nexport const _changeSpokenLanguageSelector: _ChangeSpokenLanguageSelector = reselect.createSelector(\n [getSupportedSpokenLanguages, getCurrentSpokenLanguage, getCaptionsStatus],\n (supportedSpokenLanguages, currentSpokenLanguage, isCaptionsFeatureActive) => {\n return {\n supportedSpokenLanguages: supportedSpokenLanguages ?? ['en-us'],\n currentSpokenLanguage: currentSpokenLanguage ?? 'en-us',\n isCaptionsFeatureActive: isCaptionsFeatureActive ?? false\n };\n }\n);\n/* @conditional-compile-remove(close-captions) */\n/**\n * Selector type for the {@link CaptionsBanner} component.\n * @internal\n */\nexport type _CaptionsBannerSelector = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n) => {\n captions: _CaptionsInfo[];\n isCaptionsOn: boolean;\n};\n\n/* @conditional-compile-remove(close-captions) */\n/**\n * Selector for {@link CaptionsBanner} component.\n *\n * @internal\n */\nexport const _captionsBannerSelector: _CaptionsBannerSelector = reselect.createSelector(\n [getCaptions, getCaptionsStatus],\n (captions, isCaptionsFeatureActive) => {\n const captionsInfo = captions?.map((c) => {\n return {\n displayName: c.speaker.displayName ?? 'Unnamed Participant',\n captionText: c.captionText ?? '',\n userId: c.speaker.identifier ? toFlatCommunicationIdentifier(c.speaker.identifier) : ''\n };\n });\n return {\n captions: captionsInfo ?? [],\n isCaptionsOn: isCaptionsFeatureActive ?? false\n };\n }\n);\n\n// This is a placeholder to bypass CC of \"close-captions\", remove when move the feature to stable\nexport {};\n\"../../calling-stateful-client/src\"\"../../acs-ui-common/src\"\"../../react-components/src\""]}
@@ -88,7 +88,7 @@ export const errorBarSelector = createSelector([getLatestErrors, getDiagnostics,
88
88
  }
89
89
  else {
90
90
  if (((_l = diagnostics === null || diagnostics === void 0 ? void 0 : diagnostics.media.latest.cameraFreeze) === null || _l === void 0 ? void 0 : _l.value) === true) {
91
- activeErrorMessages.push({ type: 'callCameraAlreadyInUse' });
91
+ activeErrorMessages.push({ type: 'cameraFrozenForRemoteParticipants' });
92
92
  }
93
93
  }
94
94
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"errorBarSelector.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/errorBarSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAEL,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAajE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAqB,cAAc,CAC9D,CAAC,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,EACvE,CACE,YAAwB,EACxB,WAAW,EACX,aAAa,EACb,eAAe,EACgC,EAAE;;IACjD,kHAAkH;IAClH,8CAA8C;IAC9C,wEAAwE;IACxE,iCAAiC;IACjC,EAAE;IACF,iHAAiH;IACjH,8BAA8B;IAC9B,MAAM,mBAAmB,GAAyB,EAAE,CAAC;IAErD,MAAM,QAAQ,GAAG,GAAY,EAAE;QAC7B,2DAA2D;QAC3D,OAAO,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,WAAW,CAAC,OAAO,MAAK,QAAQ,CAAC;QACzD,OAAO,4CAA4C,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CA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gBAAgB,EAChB,oCAAoC,CACrC,CAAC;KACH;SAAM;QACL,0BAA0B,CAAC,mBAAmB,EAAE,YAAY,EAAE,gBAAgB,EAAE,yBAAyB,CAAC,CAAC;KAC5G;IAED,8FAA8F;IAC9F,mBAAmB,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC;IAC1C,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,CAAC;AACtD,CAAC,CACF,CAAC;AAEF,MAAM,0BAA0B,GAAG,CACjC,mBAAyC,EACzC,YAAwB,EACxB,MAAuB,EACvB,eAA0B,EACpB,EAAE;IACR,IAAI,YAAY,CAAC,MAAM,CAAC,KAAK,SAAS,EAAE;QACtC,OAAO;KACR;IACD,mBAAmB,CAAC,IAAI,CAAC;QACvB,IAAI,EAAE,eAAe;QACrB,SAAS,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,SAAS;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n CallingBaseSelectorProps,\n getDeviceManager,\n getDiagnostics,\n getLatestErrors,\n getEnvironmentInfo\n} from './baseSelectors';\nimport { ActiveErrorMessage, ErrorType } from '@internal/react-components';\nimport { createSelector } from 'reselect';\nimport { CallClientState, CallErrors, CallErrorTarget } from '@internal/calling-stateful-client';\nimport { DiagnosticQuality } from '@azure/communication-calling';\n/**\n * Selector type for {@link ErrorBar} component.\n *\n * @public\n */\nexport type ErrorBarSelector = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n) => {\n activeErrorMessages: ActiveErrorMessage[];\n};\n\n/**\n * Select the first 3 active errors from the state for the `ErrorBar` component.\n *\n * In case there are many errors, only the first three errors are returned to avoid\n * filling up the UI with too many errors.\n *\n * Invariants:\n * - `ErrorType` is never repeated in the returned errors.\n * - Errors are returned in a fixed order by `ErrorType`.\n *\n * @public\n */\nexport const errorBarSelector: ErrorBarSelector = createSelector(\n [getLatestErrors, getDiagnostics, getDeviceManager, getEnvironmentInfo],\n (\n latestErrors: CallErrors,\n diagnostics,\n deviceManager,\n environmentInfo\n ): { activeErrorMessages: ActiveErrorMessage[] } => {\n // The order in which the errors are returned is significant: The `ErrorBar` shows errors on the UI in that order.\n // There are several options for the ordering:\n // - Sorted by when the errors happened (latest first / oldest first).\n // - Stable sort by error type.\n //\n // We chose to stable sort by error type: We intend to show only a small number of errors on the UI and we do not\n // have timestamps for errors.\n const activeErrorMessages: ActiveErrorMessage[] = [];\n\n const isSafari = (): boolean => {\n /* @conditional-compile-remove(calling-environment-info) */\n return environmentInfo?.environment.browser === 'safari';\n return /^((?!chrome|android|crios|fxios).)*safari/i.test(navigator.userAgent);\n };\n\n const isMacOS = (): boolean => {\n /* @conditional-compile-remove(calling-environment-info) */\n return environmentInfo?.environment.platform === 'mac';\n return false;\n };\n\n // Errors reported via diagnostics are more reliable than from API method failures, so process those first.\n if (\n diagnostics?.network.latest.networkReceiveQuality?.value === DiagnosticQuality.Bad ||\n diagnostics?.network.latest.networkReceiveQuality?.value === DiagnosticQuality.Poor\n ) {\n activeErrorMessages.push({ type: 'callNetworkQualityLow' });\n }\n if (diagnostics?.media.latest.noSpeakerDevicesEnumerated?.value === true) {\n activeErrorMessages.push({ type: 'callNoSpeakerFound' });\n }\n if (diagnostics?.media.latest.noMicrophoneDevicesEnumerated?.value === true) {\n activeErrorMessages.push({ type: 'callNoMicrophoneFound' });\n }\n if (deviceManager.deviceAccess?.audio === false && isSafari()) {\n activeErrorMessages.push({ type: 'callMicrophoneAccessDeniedSafari' });\n }\n if (deviceManager.deviceAccess?.audio === false && !isSafari()) {\n activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });\n }\n\n if (diagnostics?.media.latest.microphonePermissionDenied?.value === true && isMacOS()) {\n activeErrorMessages.push({ type: 'callMacOsMicrophoneAccessDenied' });\n } else if (diagnostics?.media.latest.microphonePermissionDenied?.value === true) {\n activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });\n }\n\n const microphoneMuteUnexpectedlyDiagnostic =\n diagnostics?.media.latest.microphoneMuteUnexpectedly || diagnostics?.media.latest.microphoneNotFunctioning;\n if (microphoneMuteUnexpectedlyDiagnostic) {\n if (microphoneMuteUnexpectedlyDiagnostic.value === DiagnosticQuality.Bad) {\n // Inform the user that microphone stopped working and inform them to start microphone again\n activeErrorMessages.push({ type: 'callMicrophoneMutedBySystem' });\n } else if (microphoneMuteUnexpectedlyDiagnostic.value === DiagnosticQuality.Good) {\n // Inform the user that microphone recovered\n activeErrorMessages.push({ type: 'callMicrophoneUnmutedBySystem' });\n }\n }\n\n const cameraStoppedUnexpectedlyDiagnostic = diagnostics?.media.latest.cameraStoppedUnexpectedly;\n if (cameraStoppedUnexpectedlyDiagnostic) {\n if (cameraStoppedUnexpectedlyDiagnostic.value === DiagnosticQuality.Bad) {\n // Inform the user that camera stopped working and inform them to start video again\n activeErrorMessages.push({ type: 'callVideoStoppedBySystem' });\n } else if (cameraStoppedUnexpectedlyDiagnostic.value === DiagnosticQuality.Good) {\n // Inform the user that camera recovered\n activeErrorMessages.push({ type: 'callVideoRecoveredBySystem' });\n }\n }\n if (deviceManager.deviceAccess?.video === false && isSafari()) {\n activeErrorMessages.push({ type: 'callCameraAccessDeniedSafari' });\n } else if (deviceManager.deviceAccess?.video === false) {\n activeErrorMessages.push({ type: 'callCameraAccessDenied' });\n } else {\n if (diagnostics?.media.latest.cameraFreeze?.value === true) {\n activeErrorMessages.push({ type: 'callCameraAlreadyInUse' });\n }\n }\n\n /**\n * show the Mac specific strings if the platform is detected as mac\n */\n if (diagnostics?.media.latest.cameraPermissionDenied?.value === true && isMacOS()) {\n activeErrorMessages.push({ type: 'callMacOsCameraAccessDenied' });\n }\n\n /**\n * This UFD only works on mac still so we should only see it fire on mac.\n */\n if (diagnostics?.media.latest.screenshareRecordingDisabled?.value === true && isMacOS()) {\n activeErrorMessages.push({ type: 'callMacOsScreenShareAccessDenied' });\n } else if (diagnostics?.media.latest.screenshareRecordingDisabled?.value === true) {\n activeErrorMessages.push({ type: 'startScreenSharingGeneric' });\n }\n\n // Prefer to show errors with privacy implications.\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.stopVideo', 'stopVideoGeneric');\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.mute', 'muteGeneric');\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.stopScreenSharing', 'stopScreenShareGeneric');\n\n if (\n latestErrors['Call.startVideo']?.message === 'Call.startVideo: Video operation failure SourceUnavailableError'\n ) {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'callCameraAlreadyInUse');\n } else if (\n latestErrors['Call.startVideo']?.message === 'Call.startVideo: Video operation failure permissionDeniedError'\n ) {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'callCameraAccessDenied');\n } else {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'startVideoGeneric');\n }\n\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.unmute', 'unmuteGeneric');\n\n if (latestErrors['CallAgent.join']?.message === 'CallAgent.join: Invalid meeting link') {\n appendActiveErrorIfDefined(\n activeErrorMessages,\n latestErrors,\n 'CallAgent.join',\n 'failedToJoinCallInvalidMeetingLink'\n );\n } else {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'CallAgent.join', 'failedToJoinCallGeneric');\n }\n\n // We only return the first few errors to avoid filling up the UI with too many `MessageBar`s.\n activeErrorMessages.splice(maxErrorCount);\n return { activeErrorMessages: activeErrorMessages };\n }\n);\n\nconst appendActiveErrorIfDefined = (\n activeErrorMessages: ActiveErrorMessage[],\n latestErrors: CallErrors,\n target: CallErrorTarget,\n activeErrorType: ErrorType\n): void => {\n if (latestErrors[target] === undefined) {\n return;\n }\n activeErrorMessages.push({\n type: activeErrorType,\n timestamp: latestErrors[target].timestamp\n });\n};\n\nconst maxErrorCount = 3;\n\"../../react-components/src\"\"../../calling-stateful-client/src\""]}
1
+ {"version":3,"file":"errorBarSelector.js","sourceRoot":"","sources":["../../../../../calling-component-bindings/src/errorBarSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAEL,gBAAgB,EAChB,cAAc,EACd,eAAe,EACf,kBAAkB,EACnB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAajE;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAqB,cAAc,CAC9D,CAAC,eAAe,EAAE,cAAc,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,EACvE,CACE,YAAwB,EACxB,WAAW,EACX,aAAa,EACb,eAAe,EACgC,EAAE;;IACjD,kHAAkH;IAClH,8CAA8C;IAC9C,wEAAwE;IACxE,iCAAiC;IACjC,EAAE;IACF,iHAAiH;IACjH,8BAA8B;IAC9B,MAAM,mBAAmB,GAAyB,EAAE,CAAC;IAErD,MAAM,QAAQ,GAAG,GAAY,EAAE;QAC7B,2DAA2D;QAC3D,OAAO,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,WAAW,CAAC,OAAO,MAAK,QAAQ,CAAC;QACzD,OAAO,4CAA4C,CAAC,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;IAChF,CAAC,CAAC;IAEF,MAAM,OAAO,GAAG,GAAY,EAAE;QAC5B,2DAA2D;QAC3D,OAAO,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,WAAW,CAAC,QAAQ,MAAK,KAAK,CAAC;QACvD,OAAO,KAAK,CAAC;IACf,CAAC,CAAC;IAEF,2GAA2G;IAC3G,IACE,CAAA,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,CAAC,MAAM,CAAC,qBAAqB,0CAA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,EACxB,MAAuB,EACvB,eAA0B,EACpB,EAAE;IACR,IAAI,YAAY,CAAC,MAAM,CAAC,KAAK,SAAS,EAAE;QACtC,OAAO;KACR;IACD,mBAAmB,CAAC,IAAI,CAAC;QACvB,IAAI,EAAE,eAAe;QACrB,SAAS,EAAE,YAAY,CAAC,MAAM,CAAC,CAAC,SAAS;KAC1C,CAAC,CAAC;AACL,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n CallingBaseSelectorProps,\n getDeviceManager,\n getDiagnostics,\n getLatestErrors,\n getEnvironmentInfo\n} from './baseSelectors';\nimport { ActiveErrorMessage, ErrorType } from '@internal/react-components';\nimport { createSelector } from 'reselect';\nimport { CallClientState, CallErrors, CallErrorTarget } from '@internal/calling-stateful-client';\nimport { DiagnosticQuality } from '@azure/communication-calling';\n/**\n * Selector type for {@link ErrorBar} component.\n *\n * @public\n */\nexport type ErrorBarSelector = (\n state: CallClientState,\n props: CallingBaseSelectorProps\n) => {\n activeErrorMessages: ActiveErrorMessage[];\n};\n\n/**\n * Select the first 3 active errors from the state for the `ErrorBar` component.\n *\n * In case there are many errors, only the first three errors are returned to avoid\n * filling up the UI with too many errors.\n *\n * Invariants:\n * - `ErrorType` is never repeated in the returned errors.\n * - Errors are returned in a fixed order by `ErrorType`.\n *\n * @public\n */\nexport const errorBarSelector: ErrorBarSelector = createSelector(\n [getLatestErrors, getDiagnostics, getDeviceManager, getEnvironmentInfo],\n (\n latestErrors: CallErrors,\n diagnostics,\n deviceManager,\n environmentInfo\n ): { activeErrorMessages: ActiveErrorMessage[] } => {\n // The order in which the errors are returned is significant: The `ErrorBar` shows errors on the UI in that order.\n // There are several options for the ordering:\n // - Sorted by when the errors happened (latest first / oldest first).\n // - Stable sort by error type.\n //\n // We chose to stable sort by error type: We intend to show only a small number of errors on the UI and we do not\n // have timestamps for errors.\n const activeErrorMessages: ActiveErrorMessage[] = [];\n\n const isSafari = (): boolean => {\n /* @conditional-compile-remove(calling-environment-info) */\n return environmentInfo?.environment.browser === 'safari';\n return /^((?!chrome|android|crios|fxios).)*safari/i.test(navigator.userAgent);\n };\n\n const isMacOS = (): boolean => {\n /* @conditional-compile-remove(calling-environment-info) */\n return environmentInfo?.environment.platform === 'mac';\n return false;\n };\n\n // Errors reported via diagnostics are more reliable than from API method failures, so process those first.\n if (\n diagnostics?.network.latest.networkReceiveQuality?.value === DiagnosticQuality.Bad ||\n diagnostics?.network.latest.networkReceiveQuality?.value === DiagnosticQuality.Poor\n ) {\n activeErrorMessages.push({ type: 'callNetworkQualityLow' });\n }\n if (diagnostics?.media.latest.noSpeakerDevicesEnumerated?.value === true) {\n activeErrorMessages.push({ type: 'callNoSpeakerFound' });\n }\n if (diagnostics?.media.latest.noMicrophoneDevicesEnumerated?.value === true) {\n activeErrorMessages.push({ type: 'callNoMicrophoneFound' });\n }\n if (deviceManager.deviceAccess?.audio === false && isSafari()) {\n activeErrorMessages.push({ type: 'callMicrophoneAccessDeniedSafari' });\n }\n if (deviceManager.deviceAccess?.audio === false && !isSafari()) {\n activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });\n }\n\n if (diagnostics?.media.latest.microphonePermissionDenied?.value === true && isMacOS()) {\n activeErrorMessages.push({ type: 'callMacOsMicrophoneAccessDenied' });\n } else if (diagnostics?.media.latest.microphonePermissionDenied?.value === true) {\n activeErrorMessages.push({ type: 'callMicrophoneAccessDenied' });\n }\n\n const microphoneMuteUnexpectedlyDiagnostic =\n diagnostics?.media.latest.microphoneMuteUnexpectedly || diagnostics?.media.latest.microphoneNotFunctioning;\n if (microphoneMuteUnexpectedlyDiagnostic) {\n if (microphoneMuteUnexpectedlyDiagnostic.value === DiagnosticQuality.Bad) {\n // Inform the user that microphone stopped working and inform them to start microphone again\n activeErrorMessages.push({ type: 'callMicrophoneMutedBySystem' });\n } else if (microphoneMuteUnexpectedlyDiagnostic.value === DiagnosticQuality.Good) {\n // Inform the user that microphone recovered\n activeErrorMessages.push({ type: 'callMicrophoneUnmutedBySystem' });\n }\n }\n\n const cameraStoppedUnexpectedlyDiagnostic = diagnostics?.media.latest.cameraStoppedUnexpectedly;\n if (cameraStoppedUnexpectedlyDiagnostic) {\n if (cameraStoppedUnexpectedlyDiagnostic.value === DiagnosticQuality.Bad) {\n // Inform the user that camera stopped working and inform them to start video again\n activeErrorMessages.push({ type: 'callVideoStoppedBySystem' });\n } else if (cameraStoppedUnexpectedlyDiagnostic.value === DiagnosticQuality.Good) {\n // Inform the user that camera recovered\n activeErrorMessages.push({ type: 'callVideoRecoveredBySystem' });\n }\n }\n if (deviceManager.deviceAccess?.video === false && isSafari()) {\n activeErrorMessages.push({ type: 'callCameraAccessDeniedSafari' });\n } else if (deviceManager.deviceAccess?.video === false) {\n activeErrorMessages.push({ type: 'callCameraAccessDenied' });\n } else {\n if (diagnostics?.media.latest.cameraFreeze?.value === true) {\n activeErrorMessages.push({ type: 'cameraFrozenForRemoteParticipants' });\n }\n }\n\n /**\n * show the Mac specific strings if the platform is detected as mac\n */\n if (diagnostics?.media.latest.cameraPermissionDenied?.value === true && isMacOS()) {\n activeErrorMessages.push({ type: 'callMacOsCameraAccessDenied' });\n }\n\n /**\n * This UFD only works on mac still so we should only see it fire on mac.\n */\n if (diagnostics?.media.latest.screenshareRecordingDisabled?.value === true && isMacOS()) {\n activeErrorMessages.push({ type: 'callMacOsScreenShareAccessDenied' });\n } else if (diagnostics?.media.latest.screenshareRecordingDisabled?.value === true) {\n activeErrorMessages.push({ type: 'startScreenSharingGeneric' });\n }\n\n // Prefer to show errors with privacy implications.\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.stopVideo', 'stopVideoGeneric');\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.mute', 'muteGeneric');\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.stopScreenSharing', 'stopScreenShareGeneric');\n\n if (\n latestErrors['Call.startVideo']?.message === 'Call.startVideo: Video operation failure SourceUnavailableError'\n ) {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'callCameraAlreadyInUse');\n } else if (\n latestErrors['Call.startVideo']?.message === 'Call.startVideo: Video operation failure permissionDeniedError'\n ) {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'callCameraAccessDenied');\n } else {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.startVideo', 'startVideoGeneric');\n }\n\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'Call.unmute', 'unmuteGeneric');\n\n if (latestErrors['CallAgent.join']?.message === 'CallAgent.join: Invalid meeting link') {\n appendActiveErrorIfDefined(\n activeErrorMessages,\n latestErrors,\n 'CallAgent.join',\n 'failedToJoinCallInvalidMeetingLink'\n );\n } else {\n appendActiveErrorIfDefined(activeErrorMessages, latestErrors, 'CallAgent.join', 'failedToJoinCallGeneric');\n }\n\n // We only return the first few errors to avoid filling up the UI with too many `MessageBar`s.\n activeErrorMessages.splice(maxErrorCount);\n return { activeErrorMessages: activeErrorMessages };\n }\n);\n\nconst appendActiveErrorIfDefined = (\n activeErrorMessages: ActiveErrorMessage[],\n latestErrors: CallErrors,\n target: CallErrorTarget,\n activeErrorType: ErrorType\n): void => {\n if (latestErrors[target] === undefined) {\n return;\n }\n activeErrorMessages.push({\n type: activeErrorType,\n timestamp: latestErrors[target].timestamp\n });\n};\n\nconst maxErrorCount = 3;\n\"../../react-components/src\"\"../../calling-stateful-client/src\""]}
@@ -37,7 +37,19 @@ export interface CommonCallingHandlers {
37
37
  onRemoveParticipant(participant: CommunicationIdentifier): Promise<void>;
38
38
  askDevicePermission: (constrain: PermissionConstraints) => Promise<void>;
39
39
  onStartCall: (participants: (CommunicationUserIdentifier | PhoneNumberIdentifier | UnknownIdentifier)[], options?: StartCallOptions) => void;
40
+ onStartCaptions: (options?: CaptionsOptions) => Promise<void>;
41
+ onStopCaptions: () => Promise<void>;
42
+ onSetSpokenLanguage: (language: string) => Promise<void>;
43
+ onSetCaptionLanguage: (language: string) => Promise<void>;
40
44
  }
45
+ /**
46
+ * options bag to start captions
47
+ *
48
+ * @beta
49
+ */
50
+ export declare type CaptionsOptions = {
51
+ spokenLanguage: string;
52
+ };
41
53
  /**
42
54
  * @private
43
55
  */
@@ -13,6 +13,8 @@ import { LocalVideoStream } from '@azure/communication-calling';
13
13
  import { toFlatCommunicationIdentifier } from "../../../acs-ui-common/src";
14
14
  import memoizeOne from 'memoize-one';
15
15
  import { disposeAllLocalPreviewViews, _isInCall, _isInLobbyOrConnecting, _isPreviewOn } from '../utils/callUtils';
16
+ /* @conditional-compile-remove(close-captions) */
17
+ import { Features } from '@azure/communication-calling';
16
18
  /**
17
19
  * @private
18
20
  */
@@ -240,6 +242,22 @@ export const createDefaultCommonCallingHandlers = memoizeOne((callClient, device
240
242
  yield (deviceManager === null || deviceManager === void 0 ? void 0 : deviceManager.askDevicePermission(constrain));
241
243
  }
242
244
  });
245
+ /* @conditional-compile-remove(close-captions) */
246
+ const onStartCaptions = (options) => __awaiter(void 0, void 0, void 0, function* () {
247
+ yield (call === null || call === void 0 ? void 0 : call.feature(Features.TeamsCaptions).startCaptions(options));
248
+ });
249
+ /* @conditional-compile-remove(close-captions) */
250
+ const onStopCaptions = () => __awaiter(void 0, void 0, void 0, function* () {
251
+ yield (call === null || call === void 0 ? void 0 : call.feature(Features.TeamsCaptions).stopCaptions());
252
+ });
253
+ /* @conditional-compile-remove(close-captions) */
254
+ const onSetSpokenLanguage = (language) => __awaiter(void 0, void 0, void 0, function* () {
255
+ yield (call === null || call === void 0 ? void 0 : call.feature(Features.TeamsCaptions).setSpokenLanguage(language));
256
+ });
257
+ /* @conditional-compile-remove(close-captions) */
258
+ const onSetCaptionLanguage = (language) => __awaiter(void 0, void 0, void 0, function* () {
259
+ yield (call === null || call === void 0 ? void 0 : call.feature(Features.TeamsCaptions).setCaptionLanguage(language));
260
+ });
243
261
  return {
244
262
  onHangUp,
245
263
  /* @conditional-compile-remove(PSTN-calls) */
@@ -263,7 +281,15 @@ export const createDefaultCommonCallingHandlers = memoizeOne((callClient, device
263
281
  onStartCall: notImplemented,
264
282
  /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */ onSendDtmfTone,
265
283
  /* @conditional-compile-remove(call-readiness) */
266
- askDevicePermission
284
+ askDevicePermission,
285
+ /* @conditional-compile-remove(close-captions) */
286
+ onStartCaptions,
287
+ /* @conditional-compile-remove(close-captions) */
288
+ onStopCaptions,
289
+ /* @conditional-compile-remove(close-captions) */
290
+ onSetCaptionLanguage,
291
+ /* @conditional-compile-remove(close-captions) */
292
+ onSetSpokenLanguage
267
293
  };
268
294
  });
269
295
  //# sourceMappingURL=createCommonHandlers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createCommonHandlers.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/handlers/createCommonHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAGL,gBAAgB,EAGjB,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EAAE,6BAA6B,EAAE,mCAAgC;AAExE,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,2BAA2B,EAAE,SAAS,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAkDlH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,UAA4B,EAAE,SAA2B,EAAW,EAAE;IACpG,OAAO,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,SAAS,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,KAAK,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;AACrF,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,UAAU,CAC1D,CACE,UAA8B,EAC9B,aAAgD,EAChD,IAA4F,EACrE,EAAE;IACzB,MAA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,wDAAwD;QACxD,mGAAmG;QACnG,MAAM,2BAA2B,CAAC,UAAU,CAAC,CAAC;IAChD,CAAC,CAAA,CAAC;IAEF,0CAA0C,CAAC,6CAA6C;IACxF,MAAM,cAAc,GAAG,CAAO,QAAkB,EAAiB,EAAE,kDAAC,OAAA,MAAM,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,QAAQ,CAAC,QAAQ,CAAC,CAAA,CAAA,GAAA,CAAC;IAEnG,MAAM,cAAc,GAAG,GAAQ,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,+DAA+D,CAAC,CAAC;IACnF,CAAC,CAAC;IAEF,iDAAiD;IACjD,MAAM,mBAAmB,GAAG,CAAO,SAAgC,EAAiB,EAAE;QACpF,IAAI,aAAa,EAAE;YACjB,MAAM,CAAA,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,mBAAmB,CAAC,SAAS,CAAC,CAAA,CAAC;SACrD;IACH,CAAC,CAAA,CAAC;IAEF,OAAO;QACL,QAAQ;QACR,6CAA6C;QAC7C,YAAY;QACZ,cAAc;QACd,kBAAkB;QAClB,eAAe;QACf,kBAAkB;QAClB,iBAAiB;QACjB,cAAc;QACd,kBAAkB;QAClB,mBAAmB;QACnB,uBAAuB;QACvB,wBAAwB;QACxB,iBAAiB;QACjB,yBAAyB;QACzB,wBAAwB;QACxB,6CAA6C;QAC7C,gBAAgB,EAAE,cAAc;QAChC,mBAAmB,EAAE,cAAc;QACnC,WAAW,EAAE,cAAc;QAC3B,0CAA0C,CAAC,6CAA6C,CAAC,cAAc;QACvG,iDAAiD;QACjD,mBAAmB;KACpB,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n AudioDeviceInfo,\n Call,\n LocalVideoStream,\n StartCallOptions,\n VideoDeviceInfo\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */\nimport { DtmfTone, AddPhoneNumberOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { TeamsCall } from '@azure/communication-calling';\n/* @conditional-compile-remove(call-readiness) */\nimport { PermissionConstraints } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { CreateViewResult, StatefulCallClient, StatefulDeviceManager } from '@internal/calling-stateful-client';\nimport memoizeOne from 'memoize-one';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\nimport { disposeAllLocalPreviewViews, _isInCall, _isInLobbyOrConnecting, _isPreviewOn } from '../utils/callUtils';\nimport { CommunicationUserIdentifier, PhoneNumberIdentifier, UnknownIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { CommunicationIdentifier } from '@azure/communication-common';\n\n/**\n * Object containing all the handlers required for calling components.\n *\n * Calling related components from this package are able to pick out relevant handlers from this object.\n * See {@link useHandlers} and {@link usePropsFor}.\n *\n * @public\n */\nexport interface CommonCallingHandlers {\n onStartLocalVideo: () => Promise<void>;\n onToggleCamera: (options?: VideoStreamOptions) => Promise<void>;\n onSelectMicrophone: (device: AudioDeviceInfo) => Promise<void>;\n onSelectSpeaker: (device: AudioDeviceInfo) => Promise<void>;\n onSelectCamera: (device: VideoDeviceInfo, options?: VideoStreamOptions) => Promise<void>;\n onToggleMicrophone: () => Promise<void>;\n onStartScreenShare: () => Promise<void>;\n onStopScreenShare: () => Promise<void>;\n onToggleScreenShare: () => Promise<void>;\n onHangUp: (forEveryone?: boolean) => Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n onToggleHold: () => Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant(participant: PhoneNumberIdentifier, options: AddPhoneNumberOptions): Promise<void>;\n onCreateLocalStreamView: (options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult>;\n onCreateRemoteStreamView: (\n userId: string,\n options?: VideoStreamOptions\n ) => Promise<void | CreateVideoStreamViewResult>;\n onDisposeRemoteStreamView: (userId: string) => Promise<void>;\n onDisposeLocalStreamView: () => Promise<void>;\n /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */\n onSendDtmfTone: (dtmfTone: DtmfTone) => Promise<void>;\n onRemoveParticipant(userId: string): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n onRemoveParticipant(participant: CommunicationIdentifier): Promise<void>;\n /* @conditional-compile-remove(call-readiness) */\n askDevicePermission: (constrain: PermissionConstraints) => Promise<void>;\n onStartCall: (\n participants: (CommunicationUserIdentifier | PhoneNumberIdentifier | UnknownIdentifier)[],\n options?: StartCallOptions\n ) => void;\n}\n\n/**\n * @private\n */\nexport const areStreamsEqual = (prevStream: LocalVideoStream, newStream: LocalVideoStream): boolean => {\n return !!prevStream && !!newStream && prevStream.source.id === newStream.source.id;\n};\n\n/**\n * Create the common implementation of {@link CallingHandlers} for all types of Call\n *\n * @private\n */\nexport const createDefaultCommonCallingHandlers = memoizeOne(\n (\n callClient: StatefulCallClient,\n deviceManager: StatefulDeviceManager | undefined,\n call: Call | /* @conditional-compile-remove(teams-identity-support) */ TeamsCall | undefined\n ): CommonCallingHandlers => {\n const onStartLocalVideo = async (): Promise<void> => {\n // Before the call object creates a stream, dispose of any local preview streams.\n // @TODO: is there any way to parent the unparented view to the call object instead\n // of disposing and creating a new stream?\n await disposeAllLocalPreviewViews(callClient);\n\n const callId = call?.id;\n let videoDeviceInfo = callClient.getState().deviceManager.selectedCamera;\n if (!videoDeviceInfo) {\n const cameras = await deviceManager?.getCameras();\n videoDeviceInfo = cameras && cameras.length > 0 ? cameras[0] : undefined;\n videoDeviceInfo && deviceManager?.selectCamera(videoDeviceInfo);\n }\n if (!callId || !videoDeviceInfo) {\n return;\n }\n const stream = new LocalVideoStream(videoDeviceInfo);\n if (call && !call.localVideoStreams.find((s) => areStreamsEqual(s, stream))) {\n await call.startVideo(stream);\n }\n };\n\n const onStopLocalVideo = async (stream: LocalVideoStream): Promise<void> => {\n const callId = call?.id;\n if (!callId) {\n return;\n }\n if (call && call.localVideoStreams.find((s) => areStreamsEqual(s, stream))) {\n await call.stopVideo(stream);\n }\n };\n\n const onToggleCamera = async (options?: VideoStreamOptions): Promise<void> => {\n const previewOn = _isPreviewOn(callClient.getState().deviceManager);\n\n if (previewOn && call && call.state === 'Connecting') {\n // This is to workaround: https://skype.visualstudio.com/SPOOL/_workitems/edit/3030558.\n // The root cause of the issue is caused by never transitioning the unparented view to the\n // call object when going from configuration page (disconnected call state) to connecting.\n //\n // Currently the only time the local video stream is moved from unparented view to the call\n // object is when we transition from connecting -> call state. If the camera was on,\n // inside the MediaGallery we trigger toggleCamera. This triggers onStartLocalVideo which\n // destroys the unparentedView and creates a new stream in the call - so all looks well.\n //\n // However, if someone turns off their camera during the lobbyOrConnecting screen, the\n // call.localVideoStreams will be empty (as the stream is currently stored in the unparented\n // views and was never transitioned to the call object) and thus we incorrectly try to create\n // a new video stream for the call object, instead of only stopping the unparented view.\n //\n // The correct fix for this is to ensure that callAgent.onStartCall is called with the\n // localvideostream as a videoOption. That will mean call.onLocalVideoStreamsUpdated will\n // be triggered when the call is in connecting state, which we can then transition the\n // local video stream to the stateful call client and get into a clean state.\n await onDisposeLocalStreamView();\n return;\n }\n\n if (call && (_isInCall(call.state) || _isInLobbyOrConnecting(call.state))) {\n const stream = call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video');\n if (stream) {\n await onStopLocalVideo(stream);\n } else {\n await onStartLocalVideo();\n }\n } else {\n const selectedCamera = callClient.getState().deviceManager.selectedCamera;\n if (selectedCamera) {\n if (previewOn) {\n await onDisposeLocalStreamView();\n } else {\n await callClient.createView(\n undefined,\n undefined,\n {\n source: selectedCamera,\n mediaStreamType: 'Video'\n },\n options\n );\n }\n }\n }\n };\n\n const onSelectMicrophone = async (device: AudioDeviceInfo): Promise<void> => {\n if (!deviceManager) {\n return;\n }\n return deviceManager.selectMicrophone(device);\n };\n\n const onSelectSpeaker = async (device: AudioDeviceInfo): Promise<void> => {\n if (!deviceManager) {\n return;\n }\n return deviceManager.selectSpeaker(device);\n };\n\n const onSelectCamera = async (device: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void> => {\n if (!deviceManager) {\n return;\n }\n if (call && _isInCall(call.state)) {\n deviceManager.selectCamera(device);\n const stream = call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video');\n return stream?.switchSource(device);\n } else {\n const previewOn = _isPreviewOn(callClient.getState().deviceManager);\n\n if (!previewOn) {\n deviceManager.selectCamera(device);\n return;\n }\n\n await onDisposeLocalStreamView();\n\n deviceManager.selectCamera(device);\n await callClient.createView(\n undefined,\n undefined,\n {\n source: device,\n mediaStreamType: 'Video'\n },\n options\n );\n }\n };\n\n const onToggleMicrophone = async (): Promise<void> => {\n if (!call || !_isInCall(call.state)) {\n throw new Error(`Please invoke onToggleMicrophone after call is started`);\n }\n return call.isMuted ? await call.unmute() : await call.mute();\n };\n\n const onStartScreenShare = async (): Promise<void> => await call?.startScreenSharing();\n\n const onStopScreenShare = async (): Promise<void> => await call?.stopScreenSharing();\n\n const onToggleScreenShare = async (): Promise<void> =>\n call?.isScreenSharingOn ? await onStopScreenShare() : await onStartScreenShare();\n\n const onHangUp = async (forEveryone?: boolean): Promise<void> =>\n await call?.hangUp({ forEveryone: forEveryone === true ? true : false });\n\n /* @conditional-compile-remove(PSTN-calls) */\n const onToggleHold = async (): Promise<void> =>\n call?.state === 'LocalHold' ? await call?.resume() : await call?.hold();\n\n const onCreateLocalStreamView = async (\n options = { scalingMode: 'Crop', isMirrored: true } as VideoStreamOptions\n ): Promise<void | CreateVideoStreamViewResult> => {\n if (!call || call.localVideoStreams.length === 0) {\n return;\n }\n\n const callState = callClient.getState().calls[call.id];\n if (!callState) {\n return;\n }\n\n const localStream = callState.localVideoStreams.find((item) => item.mediaStreamType === 'Video');\n if (!localStream) {\n return;\n }\n\n const { view } = (await callClient.createView(call.id, undefined, localStream, options)) ?? {};\n return view ? { view } : undefined;\n };\n\n const onCreateRemoteStreamView = async (\n userId: string,\n options = { scalingMode: 'Crop' } as VideoStreamOptions\n ): Promise<void | CreateVideoStreamViewResult> => {\n if (!call) {\n return;\n }\n const callState = callClient.getState().calls[call.id];\n if (!callState) {\n throw new Error(`Call Not Found: ${call.id}`);\n }\n\n const participant = Object.values(callState.remoteParticipants).find(\n (participant) => toFlatCommunicationIdentifier(participant.identifier) === userId\n );\n\n if (!participant || !participant.videoStreams) {\n return;\n }\n\n // Find the first available stream, if there is none, then get the first stream\n const remoteVideoStream =\n Object.values(participant.videoStreams).find((i) => i.mediaStreamType === 'Video' && i.isAvailable) ||\n Object.values(participant.videoStreams).find((i) => i.mediaStreamType === 'Video');\n\n const screenShareStream =\n Object.values(participant.videoStreams).find((i) => i.mediaStreamType === 'ScreenSharing' && i.isAvailable) ||\n Object.values(participant.videoStreams).find((i) => i.mediaStreamType === 'ScreenSharing');\n\n let createViewResult: CreateViewResult | undefined = undefined;\n if (remoteVideoStream && remoteVideoStream.isAvailable && !remoteVideoStream.view) {\n createViewResult = await callClient.createView(call.id, participant.identifier, remoteVideoStream, options);\n }\n\n if (screenShareStream && screenShareStream.isAvailable && !screenShareStream.view) {\n // Hardcoded `scalingMode` since it is highly unlikely that CONTOSO would ever want to use a different scaling mode for screenshare.\n // Using `Crop` would crop the contents of screenshare and `Stretch` would warp it.\n // `Fit` is the only mode that maintains the integrity of the screen being shared.\n createViewResult = await callClient.createView(call.id, participant.identifier, screenShareStream, {\n scalingMode: 'Fit'\n });\n }\n\n return createViewResult?.view ? { view: createViewResult?.view } : undefined;\n };\n\n const onDisposeRemoteStreamView = async (userId: string): Promise<void> => {\n if (!call) {\n return;\n }\n const callState = callClient.getState().calls[call.id];\n if (!callState) {\n throw new Error(`Call Not Found: ${call.id}`);\n }\n\n const participant = Object.values(callState.remoteParticipants).find(\n (participant) => toFlatCommunicationIdentifier(participant.identifier) === userId\n );\n\n if (!participant || !participant.videoStreams) {\n return;\n }\n\n const remoteVideoStream = Object.values(participant.videoStreams).find((i) => i.mediaStreamType === 'Video');\n const screenShareStream = Object.values(participant.videoStreams).find(\n (i) => i.mediaStreamType === 'ScreenSharing'\n );\n\n if (remoteVideoStream && remoteVideoStream.view) {\n callClient.disposeView(call.id, participant.identifier, remoteVideoStream);\n }\n\n if (screenShareStream && screenShareStream.view) {\n callClient.disposeView(call.id, participant.identifier, screenShareStream);\n }\n };\n\n const onDisposeLocalStreamView = async (): Promise<void> => {\n // If the user is currently in a call, dispose of the local stream view attached to that call.\n const callState = call && callClient.getState().calls[call.id];\n const localStream = callState?.localVideoStreams.find((item) => item.mediaStreamType === 'Video');\n if (call && callState && localStream) {\n callClient.disposeView(call.id, undefined, localStream);\n }\n\n // If the user is not in a call we currently assume any unparented view is a LocalPreview and stop all\n // since those are only used for LocalPreview currently.\n // TODO: we need to remember which LocalVideoStream was used for LocalPreview and dispose that one.\n await disposeAllLocalPreviewViews(callClient);\n };\n\n /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */\n const onSendDtmfTone = async (dtmfTone: DtmfTone): Promise<void> => await call?.sendDtmf(dtmfTone);\n\n const notImplemented = (): any => {\n throw new Error('Not implemented, cannot call a method from an abstract object');\n };\n\n /* @conditional-compile-remove(call-readiness) */\n const askDevicePermission = async (constrain: PermissionConstraints): Promise<void> => {\n if (deviceManager) {\n await deviceManager?.askDevicePermission(constrain);\n }\n };\n\n return {\n onHangUp,\n /* @conditional-compile-remove(PSTN-calls) */\n onToggleHold,\n onSelectCamera,\n onSelectMicrophone,\n onSelectSpeaker,\n onStartScreenShare,\n onStopScreenShare,\n onToggleCamera,\n onToggleMicrophone,\n onToggleScreenShare,\n onCreateLocalStreamView,\n onCreateRemoteStreamView,\n onStartLocalVideo,\n onDisposeRemoteStreamView,\n onDisposeLocalStreamView,\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant: notImplemented,\n onRemoveParticipant: notImplemented,\n onStartCall: notImplemented,\n /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */ onSendDtmfTone,\n /* @conditional-compile-remove(call-readiness) */\n askDevicePermission\n };\n }\n);\n\"../../../acs-ui-common/src\"\"../../../calling-stateful-client/src\"\"../../../react-components/src\""]}
1
+ {"version":3,"file":"createCommonHandlers.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/handlers/createCommonHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAGL,gBAAgB,EAGjB,MAAM,8BAA8B,CAAC;AAOtC,OAAO,EAAE,6BAA6B,EAAE,mCAAgC;AAExE,OAAO,UAAU,MAAM,aAAa,CAAC;AAErC,OAAO,EAAE,2BAA2B,EAAE,SAAS,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAIlH,iDAAiD;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAgExD;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,UAA4B,EAAE,SAA2B,EAAW,EAAE;IACpG,OAAO,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,SAAS,IAAI,UAAU,CAAC,MAAM,CAAC,EAAE,KAAK,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC;AACrF,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,kCAAkC,GAAG,UAAU,CAC1D,CACE,UAA8B,EAC9B,aAAgD,EAChD,IAA4F,EACrE,EAAE;IACzB,MAAM,iBAAiB,GAAG,GAAwB,EAAE;QAClD,iFAAiF;QACjF,mFAAmF;QACnF,0CAA0C;QAC1C,MAAM,2BAA2B,CAAC,UAAU,CAAC,CAAC;QAE9C,MAAM,MAAM,GAAG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,EAAE,CAAC;QACxB,I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CAAC,CAAA,CAAC;IAC3E,CAAC,CAAA,CAAC;IAEF,OAAO;QACL,QAAQ;QACR,6CAA6C;QAC7C,YAAY;QACZ,cAAc;QACd,kBAAkB;QAClB,eAAe;QACf,kBAAkB;QAClB,iBAAiB;QACjB,cAAc;QACd,kBAAkB;QAClB,mBAAmB;QACnB,uBAAuB;QACvB,wBAAwB;QACxB,iBAAiB;QACjB,yBAAyB;QACzB,wBAAwB;QACxB,6CAA6C;QAC7C,gBAAgB,EAAE,cAAc;QAChC,mBAAmB,EAAE,cAAc;QACnC,WAAW,EAAE,cAAc;QAC3B,0CAA0C,CAAC,6CAA6C,CAAC,cAAc;QACvG,iDAAiD;QACjD,mBAAmB;QACnB,iDAAiD;QACjD,eAAe;QACf,iDAAiD;QACjD,cAAc;QACd,iDAAiD;QACjD,oBAAoB;QACpB,iDAAiD;QACjD,mBAAmB;KACpB,CAAC;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n AudioDeviceInfo,\n Call,\n LocalVideoStream,\n StartCallOptions,\n VideoDeviceInfo\n} from '@azure/communication-calling';\n/* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */\nimport { DtmfTone, AddPhoneNumberOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(teams-identity-support) */\nimport { TeamsCall } from '@azure/communication-calling';\n/* @conditional-compile-remove(call-readiness) */\nimport { PermissionConstraints } from '@azure/communication-calling';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { CreateViewResult, StatefulCallClient, StatefulDeviceManager } from '@internal/calling-stateful-client';\nimport memoizeOne from 'memoize-one';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\nimport { disposeAllLocalPreviewViews, _isInCall, _isInLobbyOrConnecting, _isPreviewOn } from '../utils/callUtils';\nimport { CommunicationUserIdentifier, PhoneNumberIdentifier, UnknownIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { CommunicationIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(close-captions) */\nimport { Features } from '@azure/communication-calling';\n\n/**\n * Object containing all the handlers required for calling components.\n *\n * Calling related components from this package are able to pick out relevant handlers from this object.\n * See {@link useHandlers} and {@link usePropsFor}.\n *\n * @public\n */\nexport interface CommonCallingHandlers {\n onStartLocalVideo: () => Promise<void>;\n onToggleCamera: (options?: VideoStreamOptions) => Promise<void>;\n onSelectMicrophone: (device: AudioDeviceInfo) => Promise<void>;\n onSelectSpeaker: (device: AudioDeviceInfo) => Promise<void>;\n onSelectCamera: (device: VideoDeviceInfo, options?: VideoStreamOptions) => Promise<void>;\n onToggleMicrophone: () => Promise<void>;\n onStartScreenShare: () => Promise<void>;\n onStopScreenShare: () => Promise<void>;\n onToggleScreenShare: () => Promise<void>;\n onHangUp: (forEveryone?: boolean) => Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n onToggleHold: () => Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant(participant: PhoneNumberIdentifier, options: AddPhoneNumberOptions): Promise<void>;\n onCreateLocalStreamView: (options?: VideoStreamOptions) => Promise<void | CreateVideoStreamViewResult>;\n onCreateRemoteStreamView: (\n userId: string,\n options?: VideoStreamOptions\n ) => Promise<void | CreateVideoStreamViewResult>;\n onDisposeRemoteStreamView: (userId: string) => Promise<void>;\n onDisposeLocalStreamView: () => Promise<void>;\n /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */\n onSendDtmfTone: (dtmfTone: DtmfTone) => Promise<void>;\n onRemoveParticipant(userId: string): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n onRemoveParticipant(participant: CommunicationIdentifier): Promise<void>;\n /* @conditional-compile-remove(call-readiness) */\n askDevicePermission: (constrain: PermissionConstraints) => Promise<void>;\n onStartCall: (\n participants: (CommunicationUserIdentifier | PhoneNumberIdentifier | UnknownIdentifier)[],\n options?: StartCallOptions\n ) => void;\n /* @conditional-compile-remove(close-captions) */\n onStartCaptions: (options?: CaptionsOptions) => Promise<void>;\n /* @conditional-compile-remove(close-captions) */\n onStopCaptions: () => Promise<void>;\n /* @conditional-compile-remove(close-captions) */\n onSetSpokenLanguage: (language: string) => Promise<void>;\n /* @conditional-compile-remove(close-captions) */\n onSetCaptionLanguage: (language: string) => Promise<void>;\n}\n\n/**\n * options bag to start captions\n *\n * @beta\n */\nexport type CaptionsOptions = {\n spokenLanguage: string;\n};\n\n/**\n * @private\n */\nexport const areStreamsEqual = (prevStream: LocalVideoStream, newStream: LocalVideoStream): boolean => {\n return !!prevStream && !!newStream && prevStream.source.id === newStream.source.id;\n};\n\n/**\n * Create the common implementation of {@link CallingHandlers} for all types of Call\n *\n * @private\n */\nexport const createDefaultCommonCallingHandlers = memoizeOne(\n (\n callClient: StatefulCallClient,\n deviceManager: StatefulDeviceManager | undefined,\n call: Call | /* @conditional-compile-remove(teams-identity-support) */ TeamsCall | undefined\n ): CommonCallingHandlers => {\n const onStartLocalVideo = async (): Promise<void> => {\n // Before the call object creates a stream, dispose of any local preview streams.\n // @TODO: is there any way to parent the unparented view to the call object instead\n // of disposing and creating a new stream?\n await disposeAllLocalPreviewViews(callClient);\n\n const callId = call?.id;\n let videoDeviceInfo = callClient.getState().deviceManager.selectedCamera;\n if (!videoDeviceInfo) {\n const cameras = await deviceManager?.getCameras();\n videoDeviceInfo = cameras && cameras.length > 0 ? cameras[0] : undefined;\n videoDeviceInfo && deviceManager?.selectCamera(videoDeviceInfo);\n }\n if (!callId || !videoDeviceInfo) {\n return;\n }\n const stream = new LocalVideoStream(videoDeviceInfo);\n if (call && !call.localVideoStreams.find((s) => areStreamsEqual(s, stream))) {\n await call.startVideo(stream);\n }\n };\n\n const onStopLocalVideo = async (stream: LocalVideoStream): Promise<void> => {\n const callId = call?.id;\n if (!callId) {\n return;\n }\n if (call && call.localVideoStreams.find((s) => areStreamsEqual(s, stream))) {\n await call.stopVideo(stream);\n }\n };\n\n const onToggleCamera = async (options?: VideoStreamOptions): Promise<void> => {\n const previewOn = _isPreviewOn(callClient.getState().deviceManager);\n\n if (previewOn && call && call.state === 'Connecting') {\n // This is to workaround: https://skype.visualstudio.com/SPOOL/_workitems/edit/3030558.\n // The root cause of the issue is caused by never transitioning the unparented view to the\n // call object when going from configuration page (disconnected call state) to connecting.\n //\n // Currently the only time the local video stream is moved from unparented view to the call\n // object is when we transition from connecting -> call state. If the camera was on,\n // inside the MediaGallery we trigger toggleCamera. This triggers onStartLocalVideo which\n // destroys the unparentedView and creates a new stream in the call - so all looks well.\n //\n // However, if someone turns off their camera during the lobbyOrConnecting screen, the\n // call.localVideoStreams will be empty (as the stream is currently stored in the unparented\n // views and was never transitioned to the call object) and thus we incorrectly try to create\n // a new video stream for the call object, instead of only stopping the unparented view.\n //\n // The correct fix for this is to ensure that callAgent.onStartCall is called with the\n // localvideostream as a videoOption. That will mean call.onLocalVideoStreamsUpdated will\n // be triggered when the call is in connecting state, which we can then transition the\n // local video stream to the stateful call client and get into a clean state.\n await onDisposeLocalStreamView();\n return;\n }\n\n if (call && (_isInCall(call.state) || _isInLobbyOrConnecting(call.state))) {\n const stream = call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video');\n if (stream) {\n await onStopLocalVideo(stream);\n } else {\n await onStartLocalVideo();\n }\n } else {\n const selectedCamera = callClient.getState().deviceManager.selectedCamera;\n if (selectedCamera) {\n if (previewOn) {\n await onDisposeLocalStreamView();\n } else {\n await callClient.createView(\n undefined,\n undefined,\n {\n source: selectedCamera,\n mediaStreamType: 'Video'\n },\n options\n );\n }\n }\n }\n };\n\n const onSelectMicrophone = async (device: AudioDeviceInfo): Promise<void> => {\n if (!deviceManager) {\n return;\n }\n return deviceManager.selectMicrophone(device);\n };\n\n const onSelectSpeaker = async (device: AudioDeviceInfo): Promise<void> => {\n if (!deviceManager) {\n return;\n }\n return deviceManager.selectSpeaker(device);\n };\n\n const onSelectCamera = async (device: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void> => {\n if (!deviceManager) {\n return;\n }\n if (call && _isInCall(call.state)) {\n deviceManager.selectCamera(device);\n const stream = call.localVideoStreams.find((stream) => stream.mediaStreamType === 'Video');\n return stream?.switchSource(device);\n } else {\n const previewOn = _isPreviewOn(callClient.getState().deviceManager);\n\n if (!previewOn) {\n deviceManager.selectCamera(device);\n return;\n }\n\n await onDisposeLocalStreamView();\n\n deviceManager.selectCamera(device);\n await callClient.createView(\n undefined,\n undefined,\n {\n source: device,\n mediaStreamType: 'Video'\n },\n options\n );\n }\n };\n\n const onToggleMicrophone = async (): Promise<void> => {\n if (!call || !_isInCall(call.state)) {\n throw new Error(`Please invoke onToggleMicrophone after call is started`);\n }\n return call.isMuted ? await call.unmute() : await call.mute();\n };\n\n const onStartScreenShare = async (): Promise<void> => await call?.startScreenSharing();\n\n const onStopScreenShare = async (): Promise<void> => await call?.stopScreenSharing();\n\n const onToggleScreenShare = async (): Promise<void> =>\n call?.isScreenSharingOn ? await onStopScreenShare() : await onStartScreenShare();\n\n const onHangUp = async (forEveryone?: boolean): Promise<void> =>\n await call?.hangUp({ forEveryone: forEveryone === true ? true : false });\n\n /* @conditional-compile-remove(PSTN-calls) */\n const onToggleHold = async (): Promise<void> =>\n call?.state === 'LocalHold' ? await call?.resume() : await call?.hold();\n\n const onCreateLocalStreamView = async (\n options = { scalingMode: 'Crop', isMirrored: true } as VideoStreamOptions\n ): Promise<void | CreateVideoStreamViewResult> => {\n if (!call || call.localVideoStreams.length === 0) {\n return;\n }\n\n const callState = callClient.getState().calls[call.id];\n if (!callState) {\n return;\n }\n\n const localStream = callState.localVideoStreams.find((item) => item.mediaStreamType === 'Video');\n if (!localStream) {\n return;\n }\n\n const { view } = (await callClient.createView(call.id, undefined, localStream, options)) ?? {};\n return view ? { view } : undefined;\n };\n\n const onCreateRemoteStreamView = async (\n userId: string,\n options = { scalingMode: 'Crop' } as VideoStreamOptions\n ): Promise<void | CreateVideoStreamViewResult> => {\n if (!call) {\n return;\n }\n const callState = callClient.getState().calls[call.id];\n if (!callState) {\n throw new Error(`Call Not Found: ${call.id}`);\n }\n\n const participant = Object.values(callState.remoteParticipants).find(\n (participant) => toFlatCommunicationIdentifier(participant.identifier) === userId\n );\n\n if (!participant || !participant.videoStreams) {\n return;\n }\n\n // Find the first available stream, if there is none, then get the first stream\n const remoteVideoStream =\n Object.values(participant.videoStreams).find((i) => i.mediaStreamType === 'Video' && i.isAvailable) ||\n Object.values(participant.videoStreams).find((i) => i.mediaStreamType === 'Video');\n\n const screenShareStream =\n Object.values(participant.videoStreams).find((i) => i.mediaStreamType === 'ScreenSharing' && i.isAvailable) ||\n Object.values(participant.videoStreams).find((i) => i.mediaStreamType === 'ScreenSharing');\n\n let createViewResult: CreateViewResult | undefined = undefined;\n if (remoteVideoStream && remoteVideoStream.isAvailable && !remoteVideoStream.view) {\n createViewResult = await callClient.createView(call.id, participant.identifier, remoteVideoStream, options);\n }\n\n if (screenShareStream && screenShareStream.isAvailable && !screenShareStream.view) {\n // Hardcoded `scalingMode` since it is highly unlikely that CONTOSO would ever want to use a different scaling mode for screenshare.\n // Using `Crop` would crop the contents of screenshare and `Stretch` would warp it.\n // `Fit` is the only mode that maintains the integrity of the screen being shared.\n createViewResult = await callClient.createView(call.id, participant.identifier, screenShareStream, {\n scalingMode: 'Fit'\n });\n }\n\n return createViewResult?.view ? { view: createViewResult?.view } : undefined;\n };\n\n const onDisposeRemoteStreamView = async (userId: string): Promise<void> => {\n if (!call) {\n return;\n }\n const callState = callClient.getState().calls[call.id];\n if (!callState) {\n throw new Error(`Call Not Found: ${call.id}`);\n }\n\n const participant = Object.values(callState.remoteParticipants).find(\n (participant) => toFlatCommunicationIdentifier(participant.identifier) === userId\n );\n\n if (!participant || !participant.videoStreams) {\n return;\n }\n\n const remoteVideoStream = Object.values(participant.videoStreams).find((i) => i.mediaStreamType === 'Video');\n const screenShareStream = Object.values(participant.videoStreams).find(\n (i) => i.mediaStreamType === 'ScreenSharing'\n );\n\n if (remoteVideoStream && remoteVideoStream.view) {\n callClient.disposeView(call.id, participant.identifier, remoteVideoStream);\n }\n\n if (screenShareStream && screenShareStream.view) {\n callClient.disposeView(call.id, participant.identifier, screenShareStream);\n }\n };\n\n const onDisposeLocalStreamView = async (): Promise<void> => {\n // If the user is currently in a call, dispose of the local stream view attached to that call.\n const callState = call && callClient.getState().calls[call.id];\n const localStream = callState?.localVideoStreams.find((item) => item.mediaStreamType === 'Video');\n if (call && callState && localStream) {\n callClient.disposeView(call.id, undefined, localStream);\n }\n\n // If the user is not in a call we currently assume any unparented view is a LocalPreview and stop all\n // since those are only used for LocalPreview currently.\n // TODO: we need to remember which LocalVideoStream was used for LocalPreview and dispose that one.\n await disposeAllLocalPreviewViews(callClient);\n };\n\n /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */\n const onSendDtmfTone = async (dtmfTone: DtmfTone): Promise<void> => await call?.sendDtmf(dtmfTone);\n\n const notImplemented = (): any => {\n throw new Error('Not implemented, cannot call a method from an abstract object');\n };\n\n /* @conditional-compile-remove(call-readiness) */\n const askDevicePermission = async (constrain: PermissionConstraints): Promise<void> => {\n if (deviceManager) {\n await deviceManager?.askDevicePermission(constrain);\n }\n };\n\n /* @conditional-compile-remove(close-captions) */\n const onStartCaptions = async (options?: CaptionsOptions): Promise<void> => {\n await call?.feature(Features.TeamsCaptions).startCaptions(options);\n };\n /* @conditional-compile-remove(close-captions) */\n const onStopCaptions = async (): Promise<void> => {\n await call?.feature(Features.TeamsCaptions).stopCaptions();\n };\n /* @conditional-compile-remove(close-captions) */\n const onSetSpokenLanguage = async (language: string): Promise<void> => {\n await call?.feature(Features.TeamsCaptions).setSpokenLanguage(language);\n };\n /* @conditional-compile-remove(close-captions) */\n const onSetCaptionLanguage = async (language: string): Promise<void> => {\n await call?.feature(Features.TeamsCaptions).setCaptionLanguage(language);\n };\n\n return {\n onHangUp,\n /* @conditional-compile-remove(PSTN-calls) */\n onToggleHold,\n onSelectCamera,\n onSelectMicrophone,\n onSelectSpeaker,\n onStartScreenShare,\n onStopScreenShare,\n onToggleCamera,\n onToggleMicrophone,\n onToggleScreenShare,\n onCreateLocalStreamView,\n onCreateRemoteStreamView,\n onStartLocalVideo,\n onDisposeRemoteStreamView,\n onDisposeLocalStreamView,\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant: notImplemented,\n onRemoveParticipant: notImplemented,\n onStartCall: notImplemented,\n /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */ onSendDtmfTone,\n /* @conditional-compile-remove(call-readiness) */\n askDevicePermission,\n /* @conditional-compile-remove(close-captions) */\n onStartCaptions,\n /* @conditional-compile-remove(close-captions) */\n onStopCaptions,\n /* @conditional-compile-remove(close-captions) */\n onSetCaptionLanguage,\n /* @conditional-compile-remove(close-captions) */\n onSetSpokenLanguage\n };\n }\n);\n\"../../../acs-ui-common/src\"\"../../../calling-stateful-client/src\"\"../../../react-components/src\""]}
@@ -27,10 +27,12 @@ export const createDefaultCallingHandlers = memoizeOne((callClient, callAgent, d
27
27
  return Object.assign(Object.assign({}, createDefaultCommonCallingHandlers(callClient, deviceManager, call)), {
28
28
  // FIXME: onStartCall API should use string, not the underlying SDK types.
29
29
  onStartCall: (participants, options) => {
30
+ /* @conditional-compile-remove(teams-adhoc-call) */
31
+ return callAgent === null || callAgent === void 0 ? void 0 : callAgent.startCall(participants, options);
30
32
  if (!isACSCallParticipants(participants)) {
31
33
  throw new Error('TeamsUserIdentifier in Teams call is not supported!');
32
34
  }
33
- return callAgent ? callAgent.startCall(participants, options) : undefined;
35
+ return callAgent === null || callAgent === void 0 ? void 0 : callAgent.startCall(participants, options);
34
36
  },
35
37
  /* @conditional-compile-remove(PSTN-calls) */
36
38
  onAddParticipant: (userId, options) => __awaiter(void 0, void 0, void 0, function* () {
@@ -1 +1 @@
1
- {"version":3,"file":"createHandlers.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/handlers/createHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAMlC,6CAA6C;AAC7C,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,0BAA0B,EAAE,mCAAgC;AAErE,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,kCAAkC,EAAyB,MAAM,wBAAwB,CAAC;AAcnG;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,UAAU,CACpD,CACE,UAA8B,EAC9B,SAAgC,EAChC,aAAgD,EAChD,IAAsB,EACL,EAAE;IACnB,uCACK,kCAAkC,CAAC,UAAU,EAAE,aAAa,EAAE,IAAI,CAAC;QACtE,0EAA0E;QAC1E,WAAW,EAAE,CAAC,YAAuC,EAAE,OAA0B,EAAoB,EAAE;YACrG,IAAI,CAAC,qBAAqB,CAAC,YAAY,CAAC,EAAE;gBACxC,MAAM,IAAI,KAAK,CAAC,qDAAqD,CAAC,CAAC;aACxE;YACD,OAAO,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC5E,CAAC;QACD,6CAA6C;QAC7C,gBAAgB,EAAE,CAChB,MAAwC,EACxC,OAA+B,EAChB,EAAE;YACjB,MAAM,WAAW,GAAG,0BAA0B,CAAC,MAAM,CAAC,CAAC;YACvD,IAAI,uBAAuB,CAAC,WAAW,CAAC,EAAE;gBACxC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,cAAc,CAAC,WAAW,EAAE,OAAO,CAAC,CAAC;aAC5C;iBAAM,IAAI,6BAA6B,CAAC,WAAW,CAAC,IAAI,8BAA8B,CAAC,WAAW,CAAC,EAAE;gBACpG,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,cAAc,CAAC,WAAW,CAAC,CAAC;aACnC;QACH,CAAC,CAAA,EACD,mBAAmB,EAAE,CACnB,MAAsF,EACvE,EAAE;YACjB,MAAM,WAAW,GAAG,0BAA0B,CAAC,MAAM,CAAC,CAAC;YACvD,MAAM,CAAA,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,iBAAiB,CAAC,WAAW,CAAC,CAAA,CAAC;QAC7C,CAAC,CAAA,IACD;AACJ,CAAC,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Call, CallAgent, StartCallOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport {\n isCommunicationUserIdentifier,\n isMicrosoftTeamsUserIdentifier,\n isPhoneNumberIdentifier\n} from '@azure/communication-common';\nimport { CommunicationIdentifier } from '@azure/communication-common';\n\nimport { _toCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { StatefulCallClient, StatefulDeviceManager } from '@internal/calling-stateful-client';\nimport memoizeOne from 'memoize-one';\nimport { isACSCallParticipants } from '../utils/callUtils';\nimport { createDefaultCommonCallingHandlers, CommonCallingHandlers } from './createCommonHandlers';\n\n/**\n * Object containing all the handlers required for calling components.\n *\n * Calling related components from this package are able to pick out relevant handlers from this object.\n * See {@link useHandlers} and {@link usePropsFor}.\n *\n * @public\n */\nexport interface CallingHandlers extends CommonCallingHandlers {\n onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions) => Call | undefined;\n}\n\n/**\n * Create the default implementation of {@link CallingHandlers} for teams call.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const createDefaultCallingHandlers = memoizeOne(\n (\n callClient: StatefulCallClient,\n callAgent: CallAgent | undefined,\n deviceManager: StatefulDeviceManager | undefined,\n call: Call | undefined\n ): CallingHandlers => {\n return {\n ...createDefaultCommonCallingHandlers(callClient, deviceManager, call),\n // FIXME: onStartCall API should use string, not the underlying SDK types.\n onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions): Call | undefined => {\n if (!isACSCallParticipants(participants)) {\n throw new Error('TeamsUserIdentifier in Teams call is not supported!');\n }\n return callAgent ? callAgent.startCall(participants, options) : undefined;\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant: async (\n userId: string | CommunicationIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n if (isPhoneNumberIdentifier(participant)) {\n call?.addParticipant(participant, options);\n } else if (isCommunicationUserIdentifier(participant) || isMicrosoftTeamsUserIdentifier(participant)) {\n call?.addParticipant(participant);\n }\n },\n onRemoveParticipant: async (\n userId: string | /* @conditional-compile-remove(PSTN-calls) */ CommunicationIdentifier\n ): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n await call?.removeParticipant(participant);\n }\n };\n }\n);\n\"../../../acs-ui-common/src\"\"../../../calling-stateful-client/src\""]}
1
+ {"version":3,"file":"createHandlers.js","sourceRoot":"","sources":["../../../../../../calling-component-bindings/src/handlers/createHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAMlC,6CAA6C;AAC7C,OAAO,EACL,6BAA6B,EAC7B,8BAA8B,EAC9B,uBAAuB,EACxB,MAAM,6BAA6B,CAAC;AAGrC,OAAO,EAAE,0BAA0B,EAAE,mCAAgC;AAErE,OAAO,UAAU,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,kCAAkC,EAAyB,MAAM,wBAAwB,CAAC;AAcnG;;;;;;;GAOG;AACH,MAAM,CA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C,CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Call, CallAgent, StartCallOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport {\n isCommunicationUserIdentifier,\n isMicrosoftTeamsUserIdentifier,\n isPhoneNumberIdentifier\n} from '@azure/communication-common';\nimport { CommunicationIdentifier } from '@azure/communication-common';\n\nimport { _toCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { StatefulCallClient, StatefulDeviceManager } from '@internal/calling-stateful-client';\nimport memoizeOne from 'memoize-one';\nimport { isACSCallParticipants } from '../utils/callUtils';\nimport { createDefaultCommonCallingHandlers, CommonCallingHandlers } from './createCommonHandlers';\n\n/**\n * Object containing all the handlers required for calling components.\n *\n * Calling related components from this package are able to pick out relevant handlers from this object.\n * See {@link useHandlers} and {@link usePropsFor}.\n *\n * @public\n */\nexport interface CallingHandlers extends CommonCallingHandlers {\n onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions) => Call | undefined;\n}\n\n/**\n * Create the default implementation of {@link CallingHandlers} for teams call.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const createDefaultCallingHandlers = memoizeOne(\n (\n callClient: StatefulCallClient,\n callAgent: CallAgent | undefined,\n deviceManager: StatefulDeviceManager | undefined,\n call: Call | undefined\n ): CallingHandlers => {\n return {\n ...createDefaultCommonCallingHandlers(callClient, deviceManager, call),\n // FIXME: onStartCall API should use string, not the underlying SDK types.\n onStartCall: (participants: CommunicationIdentifier[], options?: StartCallOptions): Call | undefined => {\n /* @conditional-compile-remove(teams-adhoc-call) */\n return callAgent?.startCall(participants, options);\n if (!isACSCallParticipants(participants)) {\n throw new Error('TeamsUserIdentifier in Teams call is not supported!');\n }\n return callAgent?.startCall(participants, options);\n },\n /* @conditional-compile-remove(PSTN-calls) */\n onAddParticipant: async (\n userId: string | CommunicationIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n if (isPhoneNumberIdentifier(participant)) {\n call?.addParticipant(participant, options);\n } else if (isCommunicationUserIdentifier(participant) || isMicrosoftTeamsUserIdentifier(participant)) {\n call?.addParticipant(participant);\n }\n },\n onRemoveParticipant: async (\n userId: string | /* @conditional-compile-remove(PSTN-calls) */ CommunicationIdentifier\n ): Promise<void> => {\n const participant = _toCommunicationIdentifier(userId);\n await call?.removeParticipant(participant);\n }\n };\n }\n);\n\"../../../acs-ui-common/src\"\"../../../calling-stateful-client/src\""]}
@@ -7,9 +7,12 @@ export type { ParticipantsButtonSelector } from './participantsButtonSelector';
7
7
  export type { VideoGallerySelector } from './videoGallerySelector';
8
8
  export type { ErrorBarSelector } from './errorBarSelector';
9
9
  export type { HoldButtonSelector } from './callControlSelectors';
10
+ export type { _StartCaptionsButtonSelector, _ChangeSpokenLanguageSelector, _CaptionsBannerSelector } from './captionsSelector';
11
+ export { _captionsBannerSelector, _startCaptionsButtonSelector, _changeSpokenLanguageSelector } from './captionsSelector';
10
12
  export type { CallingHandlers } from './handlers/createHandlers';
11
13
  export type { TeamsCallingHandlers } from './handlers/createTeamsCallHandlers';
12
14
  export type { CommonCallingHandlers } from './handlers/createCommonHandlers';
15
+ export type { CaptionsOptions } from './handlers/createCommonHandlers';
13
16
  export { useTeamsCall, useTeamsCallAgent } from './providers';
14
17
  export { CallAgentProvider, CallClientProvider, CallProvider, useCall, useCallAgent, useCallClient, useDeviceManager } from './providers';
15
18
  export type { CallAgentProviderProps, CallClientProviderProps, CallProviderProps } from './providers';
@@ -4,6 +4,8 @@ export * from './callControlSelectors';
4
4
  export { createDefaultCallingHandlers } from './handlers/createHandlers';
5
5
  /* @conditional-compile-remove(teams-identity-support) */
6
6
  export { createDefaultTeamsCallingHandlers } from './handlers/createTeamsCallHandlers';
7
+ /* @conditional-compile-remove(close-captions) */
8
+ export { _captionsBannerSelector, _startCaptionsButtonSelector, _changeSpokenLanguageSelector } from './captionsSelector';
7
9
  /* @conditional-compile-remove(teams-identity-support) */
8
10
  export { useTeamsCall, useTeamsCallAgent } from './providers';
9
11
  export { CallAgentProvider, CallClientProvider, CallProvider, useCall, useCallAgent, useCallClient, useDeviceManager } from './providers';