@azure/communication-react 1.8.0-beta.1 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (499) hide show
  1. package/dist/communication-react.d.ts +166 -2272
  2. package/dist/dist-cjs/communication-react/index.js +7671 -13703
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  6. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +6 -2
  7. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +6 -9
  8. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  9. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.d.ts +0 -12
  10. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js +14 -18
  11. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js.map +1 -1
  12. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js +0 -4
  13. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js.map +1 -1
  14. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +3 -13
  15. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +1 -17
  16. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  17. package/dist/dist-esm/calling-component-bindings/src/handlers/createDefaultCallingHandlersForComponent.js +0 -10
  18. package/dist/dist-esm/calling-component-bindings/src/handlers/createDefaultCallingHandlersForComponent.js.map +1 -1
  19. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.d.ts +1 -1
  20. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +1 -15
  21. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
  22. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.d.ts +1 -4
  23. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js +0 -17
  24. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js.map +1 -1
  25. package/dist/dist-esm/calling-component-bindings/src/index.d.ts +0 -6
  26. package/dist/dist-esm/calling-component-bindings/src/index.js +0 -8
  27. package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
  28. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.d.ts +0 -1
  29. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +2 -18
  30. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
  31. package/dist/dist-esm/calling-component-bindings/src/providers/CallAgentProvider.d.ts +3 -4
  32. package/dist/dist-esm/calling-component-bindings/src/providers/CallAgentProvider.js.map +1 -1
  33. package/dist/dist-esm/calling-component-bindings/src/providers/CallProvider.d.ts +2 -14
  34. package/dist/dist-esm/calling-component-bindings/src/providers/CallProvider.js +1 -20
  35. package/dist/dist-esm/calling-component-bindings/src/providers/CallProvider.js.map +1 -1
  36. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.d.ts +0 -7
  37. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js +0 -12
  38. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js.map +1 -1
  39. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.d.ts +0 -4
  40. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js +0 -11
  41. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js.map +1 -1
  42. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.d.ts +1 -2
  43. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +1 -8
  44. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
  45. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +2 -8
  46. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
  47. package/dist/dist-esm/calling-stateful-client/src/BetaToStableTypes.d.ts +5 -6
  48. package/dist/dist-esm/calling-stateful-client/src/BetaToStableTypes.js.map +1 -1
  49. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.d.ts +1 -15
  50. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.js.map +1 -1
  51. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.d.ts +1 -2
  52. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js +0 -5
  53. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js.map +1 -1
  54. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +25 -63
  55. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  56. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +3 -8
  57. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +14 -63
  58. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  59. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js +0 -41
  60. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -1
  61. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +1 -1
  62. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +9 -11
  63. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  64. package/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.d.ts +16 -0
  65. package/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.js +24 -0
  66. package/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.js.map +1 -0
  67. package/dist/dist-esm/calling-stateful-client/src/Converter.js +1 -13
  68. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  69. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.d.ts +1 -1
  70. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js.map +1 -1
  71. package/dist/dist-esm/calling-stateful-client/src/ParticipantSubscriber.d.ts +0 -1
  72. package/dist/dist-esm/calling-stateful-client/src/ParticipantSubscriber.js +0 -8
  73. package/dist/dist-esm/calling-stateful-client/src/ParticipantSubscriber.js.map +1 -1
  74. package/dist/dist-esm/calling-stateful-client/src/RemoteVideoStreamSubscriber.d.ts +0 -1
  75. package/dist/dist-esm/calling-stateful-client/src/RemoteVideoStreamSubscriber.js +0 -8
  76. package/dist/dist-esm/calling-stateful-client/src/RemoteVideoStreamSubscriber.js.map +1 -1
  77. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.d.ts +1 -25
  78. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +2 -33
  79. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
  80. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.d.ts +2 -2
  81. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js +0 -8
  82. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js.map +1 -1
  83. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +1 -3
  84. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  85. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.d.ts +1 -4
  86. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
  87. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +6 -119
  88. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  89. package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js +3 -3
  90. package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js.map +1 -1
  91. package/dist/dist-esm/chat-stateful-client/src/ChatClientState.d.ts +1 -1
  92. package/dist/dist-esm/chat-stateful-client/src/ChatClientState.js.map +1 -1
  93. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js +1 -3
  94. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js.map +1 -1
  95. package/dist/dist-esm/chat-stateful-client/src/convertChatMessage.js +1 -4
  96. package/dist/dist-esm/chat-stateful-client/src/convertChatMessage.js.map +1 -1
  97. package/dist/dist-esm/chat-stateful-client/src/types/ChatMessageWithStatus.d.ts +0 -1
  98. package/dist/dist-esm/chat-stateful-client/src/types/ChatMessageWithStatus.js.map +1 -1
  99. package/dist/dist-esm/communication-react/src/index.d.ts +0 -27
  100. package/dist/dist-esm/communication-react/src/index.js +0 -14
  101. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  102. package/dist/dist-esm/react-components/src/components/CameraButton.d.ts +1 -1
  103. package/dist/dist-esm/react-components/src/components/CameraButton.js +3 -3
  104. package/dist/dist-esm/react-components/src/components/CameraButton.js.map +1 -1
  105. package/dist/dist-esm/react-components/src/components/CaptionsSettingsModal.js +11 -3
  106. package/dist/dist-esm/react-components/src/components/CaptionsSettingsModal.js.map +1 -1
  107. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.d.ts +1 -17
  108. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js +2 -6
  109. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +1 -1
  110. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.d.ts +0 -2
  111. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js +1 -6
  112. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js.map +1 -1
  113. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.d.ts +1 -17
  114. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js +3 -20
  115. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +1 -1
  116. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +0 -14
  117. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +2 -80
  118. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  119. package/dist/dist-esm/react-components/src/components/DevicesButton.d.ts +4 -4
  120. package/dist/dist-esm/react-components/src/components/DevicesButton.js +1 -1
  121. package/dist/dist-esm/react-components/src/components/DevicesButton.js.map +1 -1
  122. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +0 -6
  123. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
  124. package/dist/dist-esm/react-components/src/components/FileDownloadCards.d.ts +1 -29
  125. package/dist/dist-esm/react-components/src/components/FileDownloadCards.js +2 -24
  126. package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +1 -1
  127. package/dist/dist-esm/react-components/src/components/InputBoxComponent.d.ts +0 -2
  128. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +0 -18
  129. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
  130. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +2 -46
  131. package/dist/dist-esm/react-components/src/components/MessageThread.js +9 -55
  132. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  133. package/dist/dist-esm/react-components/src/components/ParticipantItem.d.ts +0 -13
  134. package/dist/dist-esm/react-components/src/components/ParticipantItem.js +0 -3
  135. package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
  136. package/dist/dist-esm/react-components/src/components/ParticipantList.d.ts +0 -15
  137. package/dist/dist-esm/react-components/src/components/ParticipantList.js +5 -23
  138. package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
  139. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +1 -3
  140. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
  141. package/dist/dist-esm/react-components/src/components/SendBox.d.ts +0 -41
  142. package/dist/dist-esm/react-components/src/components/SendBox.js +3 -31
  143. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  144. package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js +0 -2
  145. package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js.map +1 -1
  146. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js +0 -2
  147. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js.map +1 -1
  148. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js +0 -24
  149. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js.map +1 -1
  150. package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js +0 -2
  151. package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js.map +1 -1
  152. package/dist/dist-esm/react-components/src/components/VerticalGallery.js +4 -17
  153. package/dist/dist-esm/react-components/src/components/VerticalGallery.js.map +1 -1
  154. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +4 -16
  155. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
  156. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.d.ts +0 -5
  157. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +6 -28
  158. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
  159. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.d.ts +0 -6
  160. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.js.map +1 -1
  161. package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.d.ts +0 -5
  162. package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js +3 -24
  163. package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.js.map +1 -1
  164. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +3 -15
  165. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
  166. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +3 -30
  167. package/dist/dist-esm/react-components/src/components/VideoGallery.js +8 -21
  168. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  169. package/dist/dist-esm/react-components/src/components/VideoTile.d.ts +0 -7
  170. package/dist/dist-esm/react-components/src/components/VideoTile.js +1 -7
  171. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  172. package/dist/dist-esm/react-components/src/components/index.d.ts +2 -19
  173. package/dist/dist-esm/react-components/src/components/index.js +1 -11
  174. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  175. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +0 -5
  176. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +0 -28
  177. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  178. package/dist/dist-esm/react-components/src/components/utils/common.js +0 -4
  179. package/dist/dist-esm/react-components/src/components/utils/common.js.map +1 -1
  180. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.d.ts +1 -2
  181. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.js.map +1 -1
  182. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.d.ts +0 -8
  183. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js +1 -9
  184. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js.map +1 -1
  185. package/dist/dist-esm/react-components/src/index.d.ts +0 -1
  186. package/dist/dist-esm/react-components/src/index.js.map +1 -1
  187. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +0 -65
  188. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
  189. package/dist/dist-esm/react-components/src/theming/icons.d.ts +0 -17
  190. package/dist/dist-esm/react-components/src/theming/icons.js +0 -112
  191. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  192. package/dist/dist-esm/react-components/src/theming/themes.d.ts +1 -1
  193. package/dist/dist-esm/react-components/src/theming/themes.js.map +1 -1
  194. package/dist/dist-esm/react-components/src/types/CaptionsAvailableLanguageStrings.d.ts +2 -2
  195. package/dist/dist-esm/react-components/src/types/CaptionsAvailableLanguageStrings.js.map +1 -1
  196. package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +1 -27
  197. package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
  198. package/dist/dist-esm/react-components/src/types/OnRender.d.ts +0 -8
  199. package/dist/dist-esm/react-components/src/types/OnRender.js.map +1 -1
  200. package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.d.ts +0 -6
  201. package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.js +0 -2
  202. package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.js.map +1 -1
  203. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +2 -98
  204. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +15 -80
  205. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  206. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +3 -142
  207. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  208. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +13 -78
  209. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +25 -286
  210. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  211. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +22 -136
  212. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js +1 -1
  213. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  214. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.d.ts +1 -2
  215. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.js +1 -7
  216. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.js.map +1 -1
  217. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +2 -6
  218. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js +0 -2
  219. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  220. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.d.ts +2 -2
  221. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +15 -65
  222. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  223. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.d.ts +0 -1
  224. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +105 -123
  225. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  226. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.d.ts +88 -0
  227. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js +103 -0
  228. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js.map +1 -0
  229. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.d.ts +0 -2
  230. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js +0 -27
  231. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js.map +1 -1
  232. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js +2 -20
  233. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js.map +1 -1
  234. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.d.ts +0 -2
  235. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js +0 -27
  236. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js.map +1 -1
  237. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.d.ts +1 -2
  238. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +8 -35
  239. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
  240. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.d.ts +0 -2
  241. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +7 -40
  242. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  243. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.d.ts +1 -1
  244. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js +10 -7
  245. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js.map +1 -1
  246. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js +2 -36
  247. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js.map +1 -1
  248. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js +9 -6
  249. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js.map +1 -1
  250. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js +1 -8
  251. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js.map +1 -1
  252. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js +2 -6
  253. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js.map +1 -1
  254. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +6 -23
  255. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  256. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +3 -7
  257. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js +0 -2
  258. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  259. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.d.ts +2 -0
  260. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +2 -4
  261. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  262. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.d.ts +2 -7
  263. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +6 -97
  264. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  265. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.d.ts +2 -0
  266. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js +0 -2
  267. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js.map +1 -1
  268. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +5 -9
  269. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +9 -11
  270. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  271. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/capabilitiesChangedInfoAndRoleSelector.d.ts +12 -0
  272. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/capabilitiesChangedInfoAndRoleSelector.js +17 -0
  273. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/capabilitiesChangedInfoAndRoleSelector.js.map +1 -0
  274. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js +0 -4
  275. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js.map +1 -1
  276. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CapabilityChangedNotificationTracking.d.ts +9 -0
  277. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CapabilityChangedNotificationTracking.js +4 -0
  278. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CapabilityChangedNotificationTracking.js.map +1 -0
  279. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/TrackCapabilityChangedNotifications.d.ts +33 -0
  280. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/TrackCapabilityChangedNotifications.js +101 -0
  281. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/TrackCapabilityChangedNotifications.js.map +1 -0
  282. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +3 -15
  283. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +1 -88
  284. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  285. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +1 -61
  286. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +5 -30
  287. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  288. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.d.ts +0 -32
  289. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.js.map +1 -1
  290. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +8 -30
  291. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +4 -111
  292. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  293. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +8 -69
  294. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  295. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +2 -10
  296. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +0 -40
  297. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  298. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.d.ts +0 -13
  299. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +1 -37
  300. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
  301. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/index.d.ts +0 -1
  302. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/index.js.map +1 -1
  303. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +0 -24
  304. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +1 -11
  305. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  306. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts +0 -20
  307. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js +0 -4
  308. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
  309. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +3 -43
  310. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  311. package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.d.ts +0 -4
  312. package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.js.map +1 -1
  313. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +2 -28
  314. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +4 -126
  315. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  316. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.d.ts +0 -28
  317. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js +1 -159
  318. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js.map +1 -1
  319. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts +2 -17
  320. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
  321. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapterProvider.js +0 -2
  322. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapterProvider.js.map +1 -1
  323. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadButton.js +1 -8
  324. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadButton.js.map +1 -1
  325. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.d.ts +0 -4
  326. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
  327. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.d.ts +1 -5
  328. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js +0 -11
  329. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js.map +1 -1
  330. package/dist/dist-esm/react-composites/src/composites/common/AvatarPersona.d.ts +0 -5
  331. package/dist/dist-esm/react-composites/src/composites/common/AvatarPersona.js +2 -3
  332. package/dist/dist-esm/react-composites/src/composites/common/AvatarPersona.js.map +1 -1
  333. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.d.ts +1 -2
  334. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +6 -13
  335. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  336. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.d.ts +0 -2
  337. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +1 -70
  338. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
  339. package/dist/dist-esm/react-composites/src/composites/common/Drawer/CaptionSettingsDrawer.js +5 -1
  340. package/dist/dist-esm/react-composites/src/composites/common/Drawer/CaptionSettingsDrawer.js.map +1 -1
  341. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +4 -66
  342. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
  343. package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.d.ts +0 -1
  344. package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.js.map +1 -1
  345. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js +3 -20
  346. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js.map +1 -1
  347. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js +1 -3
  348. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js.map +1 -1
  349. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +2 -17
  350. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
  351. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +7 -30
  352. package/dist/dist-esm/react-composites/src/composites/common/icons.js +6 -14
  353. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  354. package/dist/dist-esm/react-composites/src/composites/common/resolveVideoEffectDependency.d.ts +1 -1
  355. package/dist/dist-esm/react-composites/src/composites/common/resolveVideoEffectDependency.js +1 -1
  356. package/dist/dist-esm/react-composites/src/composites/common/resolveVideoEffectDependency.js.map +1 -1
  357. package/dist/dist-esm/react-composites/src/composites/common/resolveVideoEffectDependencyLazy.d.ts +1 -1
  358. package/dist/dist-esm/react-composites/src/composites/common/resolveVideoEffectDependencyLazy.js +1 -1
  359. package/dist/dist-esm/react-composites/src/composites/common/resolveVideoEffectDependencyLazy.js.map +1 -1
  360. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.d.ts +4 -21
  361. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.js.map +1 -1
  362. package/dist/dist-esm/react-composites/src/composites/index.d.ts +0 -2
  363. package/dist/dist-esm/react-composites/src/composites/index.js.map +1 -1
  364. package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json +15 -1
  365. package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +15 -1
  366. package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +15 -1
  367. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +15 -1
  368. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +15 -1
  369. package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +15 -1
  370. package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json +15 -1
  371. package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +15 -1
  372. package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/strings.json +15 -1
  373. package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +15 -1
  374. package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +15 -1
  375. package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +15 -1
  376. package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/strings.json +15 -1
  377. package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +15 -1
  378. package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/strings.json +15 -1
  379. package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +15 -1
  380. package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +15 -1
  381. package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/strings.json +15 -1
  382. package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +15 -1
  383. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +15 -1
  384. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +15 -1
  385. package/package.json +15 -15
  386. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.d.ts +0 -45
  387. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js +0 -95
  388. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map +0 -1
  389. package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.d.ts +0 -19
  390. package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.js +0 -89
  391. package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.js.map +0 -1
  392. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.d.ts +0 -23
  393. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js +0 -49
  394. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js.map +0 -1
  395. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.d.ts +0 -9
  396. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js +0 -15
  397. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js.map +0 -1
  398. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.d.ts +0 -68
  399. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js +0 -43
  400. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js.map +0 -1
  401. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.d.ts +0 -74
  402. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js +0 -75
  403. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js.map +0 -1
  404. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.d.ts +0 -104
  405. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js +0 -68
  406. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js.map +0 -1
  407. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.d.ts +0 -85
  408. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js +0 -39
  409. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js.map +0 -1
  410. package/dist/dist-esm/react-components/src/components/HoldButton.d.ts +0 -48
  411. package/dist/dist-esm/react-components/src/components/HoldButton.js +0 -25
  412. package/dist/dist-esm/react-components/src/components/HoldButton.js.map +0 -1
  413. package/dist/dist-esm/react-components/src/components/MentionPopover.d.ts +0 -121
  414. package/dist/dist-esm/react-components/src/components/MentionPopover.js +0 -117
  415. package/dist/dist-esm/react-components/src/components/MentionPopover.js.map +0 -1
  416. package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.d.ts +0 -35
  417. package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.js +0 -33
  418. package/dist/dist-esm/react-components/src/components/ResponsiveVerticalGallery.js.map +0 -1
  419. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.d.ts +0 -41
  420. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +0 -573
  421. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +0 -1
  422. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.d.ts +0 -152
  423. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js +0 -816
  424. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js.map +0 -1
  425. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.d.ts +0 -58
  426. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js +0 -144
  427. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js.map +0 -1
  428. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.d.ts +0 -31
  429. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js +0 -71
  430. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js.map +0 -1
  431. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.d.ts +0 -38
  432. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js +0 -92
  433. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js.map +0 -1
  434. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.d.ts +0 -26
  435. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js +0 -67
  436. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js.map +0 -1
  437. package/dist/dist-esm/react-components/src/components/utils/merge.d.ts +0 -7
  438. package/dist/dist-esm/react-components/src/components/utils/merge.js +0 -16
  439. package/dist/dist-esm/react-components/src/components/utils/merge.js.map +0 -1
  440. package/dist/dist-esm/react-components/src/theming/icons.styles.d.ts +0 -6
  441. package/dist/dist-esm/react-components/src/theming/icons.styles.js +0 -25
  442. package/dist/dist-esm/react-components/src/theming/icons.styles.js.map +0 -1
  443. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.d.ts +0 -47
  444. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js +0 -218
  445. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js.map +0 -1
  446. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/HoldPane.d.ts +0 -11
  447. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/HoldPane.js +0 -93
  448. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/HoldPane.js.map +0 -1
  449. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/People.d.ts +0 -7
  450. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/People.js +0 -26
  451. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/People.js.map +0 -1
  452. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.d.ts +0 -21
  453. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js +0 -28
  454. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js.map +0 -1
  455. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.d.ts +0 -13
  456. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js +0 -113
  457. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js.map +0 -1
  458. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.d.ts +0 -14
  459. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js +0 -54
  460. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js.map +0 -1
  461. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/HoldPane.styles.d.ts +0 -32
  462. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/HoldPane.styles.js +0 -81
  463. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/HoldPane.styles.js.map +0 -1
  464. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/TransferPage.styles.d.ts +0 -37
  465. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/TransferPage.styles.js +0 -73
  466. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/TransferPage.styles.js.map +0 -1
  467. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.d.ts +0 -17
  468. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js +0 -18
  469. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js.map +0 -1
  470. package/dist/dist-esm/react-composites/src/composites/ChatComposite/FileDownloadErrorBar.d.ts +0 -14
  471. package/dist/dist-esm/react-composites/src/composites/ChatComposite/FileDownloadErrorBar.js +0 -23
  472. package/dist/dist-esm/react-composites/src/composites/ChatComposite/FileDownloadErrorBar.js.map +0 -1
  473. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useSelector.d.ts +0 -6
  474. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useSelector.js +0 -11
  475. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useSelector.js.map +0 -1
  476. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.d.ts +0 -12
  477. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js +0 -13
  478. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js.map +0 -1
  479. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/fileUploadsSelector.d.ts +0 -23
  480. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/fileUploadsSelector.js +0 -14
  481. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/fileUploadsSelector.js.map +0 -1
  482. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.d.ts +0 -21
  483. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.js +0 -107
  484. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.js.map +0 -1
  485. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.styles.d.ts +0 -17
  486. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.styles.js +0 -32
  487. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.styles.js.map +0 -1
  488. package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.d.ts +0 -21
  489. package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.js +0 -74
  490. package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.js.map +0 -1
  491. package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.styles.d.ts +0 -15
  492. package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.styles.js +0 -61
  493. package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.styles.js.map +0 -1
  494. package/dist/dist-esm/react-composites/src/composites/common/SendDtmfDialpad.d.ts +0 -16
  495. package/dist/dist-esm/react-composites/src/composites/common/SendDtmfDialpad.js +0 -50
  496. package/dist/dist-esm/react-composites/src/composites/common/SendDtmfDialpad.js.map +0 -1
  497. package/dist/dist-esm/react-composites/src/composites/common/SendDtmfDialpad.styles.d.ts +0 -11
  498. package/dist/dist-esm/react-composites/src/composites/common/SendDtmfDialpad.styles.js +0 -40
  499. package/dist/dist-esm/react-composites/src/composites/common/SendDtmfDialpad.styles.js.map +0 -1
@@ -1,17 +1,11 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
3
  import React from 'react';
4
- /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
5
- import { useEffect } from 'react';
6
4
  import { _formatString } from "../../../../acs-ui-common/src";
7
5
  import { Parser, ProcessNodeDefinitions, IsValidNodeDefinitions } from 'html-to-react';
8
6
  import Linkify from 'react-linkify';
9
7
  import { Link } from '@fluentui/react';
10
- /* @conditional-compile-remove(data-loss-prevention) */
11
- import { FontIcon, Stack } from '@fluentui/react';
12
8
  import LiveMessage from '../Announcer/LiveMessage';
13
- /* @conditional-compile-remove(mention) */
14
- import { defaultOnMentionRender } from './MentionRenderer';
15
9
  import DOMPurify from 'dompurify';
16
10
  /** @private */
17
11
  export const ChatMessageContent = (props) => {
@@ -33,15 +27,6 @@ const MessageContentWithLiveAria = (props) => {
33
27
  props.content);
34
28
  };
35
29
  const MessageContentAsRichTextHTML = (props) => {
36
- /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
37
- useEffect(() => {
38
- var _a;
39
- (_a = props.message.attachedFilesMetadata) === null || _a === void 0 ? void 0 : _a.map(fileMetadata => {
40
- if (props.onFetchAttachment && props.attachmentsMap && fileMetadata.attachmentType === 'inlineImage' && props.attachmentsMap[fileMetadata.id] === undefined) {
41
- props.onFetchAttachment(fileMetadata);
42
- }
43
- });
44
- }, [props]);
45
30
  return React.createElement(MessageContentWithLiveAria, { message: props.message, liveMessage: generateLiveMessage(props), ariaLabel: messageContentAriaText(props), content: processHtmlToReact(props) });
46
31
  };
47
32
  const MessageContentAsText = (props) => {
@@ -49,23 +34,6 @@ const MessageContentAsText = (props) => {
49
34
  return React.createElement(Link, { target: "_blank", href: decoratedHref, key: key }, decoratedText);
50
35
  } }, props.message.content) });
51
36
  };
52
- /* @conditional-compile-remove(data-loss-prevention) */
53
- /**
54
- * @private
55
- */
56
- export const BlockedMessageContent = (props) => {
57
- var _a;
58
- const Icon = React.createElement(FontIcon, { iconName: 'DataLossPreventionProhibited' });
59
- const blockedMessage = props.message.warningText === undefined ? props.strings.blockedWarningText : props.message.warningText;
60
- const blockedMessageLink = props.message.link;
61
- const blockedMessageLinkText = blockedMessageLink ? (_a = props.message.linkText) !== null && _a !== void 0 ? _a : props.strings.blockedWarningLinkText : '';
62
- const liveAuthor = props.message.mine || props.message.senderDisplayName === undefined ? '' : props.message.senderDisplayName;
63
- const liveBlockedWarningText = `${liveAuthor} ${blockedMessage} ${blockedMessageLinkText}`;
64
- return React.createElement(MessageContentWithLiveAria, { message: props.message, liveMessage: liveBlockedWarningText, ariaLabel: liveBlockedWarningText, content: React.createElement(Stack, { horizontal: true, wrap: true },
65
- Icon,
66
- blockedMessage && React.createElement("p", null, blockedMessage),
67
- blockedMessageLink && React.createElement(Link, { target: '_blank', href: blockedMessageLink }, blockedMessageLinkText)) });
68
- };
69
37
  // https://stackoverflow.com/questions/28899298/extract-the-text-out-of-html-string-using-javascript
70
38
  const extractContent = (s) => {
71
39
  const span = document.createElement('span');
@@ -93,59 +61,13 @@ const messageContentAriaText = (props) => {
93
61
  };
94
62
  const processNodeDefinitions = ProcessNodeDefinitions();
95
63
  const htmlToReactParser = Parser();
96
- /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
97
- const processInlineImage = (props) => ({
98
- // Custom <img> processing
99
- shouldProcessNode: (node) => {
100
- var _a;
101
- function isImageNode(file) {
102
- return file.attachmentType === 'inlineImage' && file.id === node.attribs.id;
103
- }
104
- // Process img node with id in attachments list
105
- return node.name && node.name === 'img' && node.attribs && node.attribs.id && ((_a = props.message.attachedFilesMetadata) === null || _a === void 0 ? void 0 : _a.find(isImageNode));
106
- },
107
- processNode: (node, children, index) => {
108
- node.attribs = Object.assign(Object.assign({}, node.attribs), { 'aria-label': node.attribs.name });
109
- // logic to check id in map/list
110
- if (props.attachmentsMap && node.attribs.id in props.attachmentsMap) {
111
- node.attribs = Object.assign(Object.assign({}, node.attribs), { src: props.attachmentsMap[node.attribs.id] });
112
- }
113
- return processNodeDefinitions.processDefaultNode(node, children, index);
114
- }
115
- });
116
- /* @conditional-compile-remove(mention) */
117
- const processMention = (props) => ({
118
- shouldProcessNode: node => {
119
- var _a;
120
- if ((_a = props.mentionDisplayOptions) === null || _a === void 0 ? void 0 : _a.onRenderMention) {
121
- // Override the handling of the <msft-mention> tag in the HTML if there's a custom renderer
122
- return node.name === 'msft-mention';
123
- }
124
- return false;
125
- },
126
- processNode: node => {
127
- var _a, _b, _c;
128
- if ((_a = props.mentionDisplayOptions) === null || _a === void 0 ? void 0 : _a.onRenderMention) {
129
- const { id } = node.attribs;
130
- const mention = {
131
- id: id,
132
- displayText: (_c = (_b = node.children[0]) === null || _b === void 0 ? void 0 : _b.data) !== null && _c !== void 0 ? _c : ''
133
- };
134
- return props.mentionDisplayOptions.onRenderMention(mention, defaultOnMentionRender);
135
- }
136
- return processNodeDefinitions.processDefaultNode;
137
- }
138
- });
139
64
  const processHtmlToReact = (props) => {
140
65
  var _a;
141
- const steps = [
142
- processInlineImage(props),
143
- processMention(props), {
66
+ const steps = [{
144
67
  // Process everything else in the default way
145
68
  shouldProcessNode: IsValidNodeDefinitions.alwaysValid,
146
69
  processNode: processNodeDefinitions.processDefaultNode
147
- }
148
- ];
70
+ }];
149
71
  return htmlToReactParser.parseWithInstructions((_a = props.message.content) !== null && _a !== void 0 ? _a : '', IsValidNodeDefinitions.alwaysValid, steps);
150
72
  };
151
73
  //# sourceMappingURL=ChatMessageContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatMessageContent.js","sourceRoot":"","sources":["../../../../../../preprocess-dist/react-components/src/components/ChatMessage/ChatMessageContent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,uEAAuE;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAClC,OAAO,EAAE,aAAa,EAAE,sCAAgC;AACxD,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,sBAAsB,EAA6B,MAAM,eAAe,CAAC;AAClH,OAAO,OAAO,MAAM,eAAe,CAAC;AAIpC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAIvC,uDAAuD;AACvD,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAIlD,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,0CAA0C;AAC1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAC3D,OAAO,SAAS,MAAM,WAAW,CAAC;AAwBlC,eAAe;AACf,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAA8B,EAAe,EAAE;IAChF,QAAQ,KAAK,CAAC,OAA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CAAI,EAAE;aAC1C,CAAC;YACF,OAAO,KAAK,CAAC,qBAAqB,CAAC,eAAe,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC;SACrF;QACD,OAAO,sBAAsB,CAAC,kBAAkB,CAAC;IACnD,CAAC;CACF,CAAC,CAAC;AACH,MAAM,kBAAkB,GAAG,CAAC,KAA8B,EAAe,EAAE;;IACzE,MAAM,KAAK,GAAgC;QAC3C,kBAAkB,CAAC,KAAK,CAAC;QACzB,cAAc,CAAC,KAAK,CAAC,EAAE;YACrB,6CAA6C;YAC7C,iBAAiB,EAAE,sBAAsB,CAAC,WAAW;YACrD,WAAW,EAAE,sBAAsB,CAAC,kBAAkB;SACvD;KAAC,CAAC;IACH,OAAO,iBAAiB,CAAC,qBAAqB,CAAC,MAAA,KAAK,CAAC,OAAO,CAAC,OAAO,mCAAI,EAAE,EAAE,sBAAsB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;AACzH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React from 'react';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { useEffect } from 'react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { Parser, ProcessNodeDefinitions, IsValidNodeDefinitions, ProcessingInstructionType } from 'html-to-react';\nimport Linkify from 'react-linkify';\nimport { ChatMessage } from '../../types/ChatMessage';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../../types/ChatMessage';\nimport { Link } from '@fluentui/react';\n/* @conditional-compile-remove(mention) */\nimport { MentionDisplayOptions, Mention } from '../MentionPopover';\n\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { FontIcon, Stack } from '@fluentui/react';\nimport { MessageThreadStrings } from '../MessageThread';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { FileMetadata } from '../FileDownloadCards';\nimport LiveMessage from '../Announcer/LiveMessage';\n/* @conditional-compile-remove(mention) */\nimport { defaultOnMentionRender } from './MentionRenderer';\nimport DOMPurify from 'dompurify';\ntype ChatMessageContentProps = {\n message: ChatMessage;\n strings: MessageThreadStrings;\n /* @conditional-compile-remove(mention) */\n mentionDisplayOptions?: MentionDisplayOptions;\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n attachmentsMap?: Record<string, string>;\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n onFetchAttachment?: (attachment: FileMetadata) => Promise<void>;\n};\n\n/* @conditional-compile-remove(data-loss-prevention) */\ntype BlockedMessageContentProps = {\n message: BlockedMessage;\n strings: MessageThreadStrings;\n};\ntype MessageContentWithLiveAriaProps = {\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */BlockedMessage;\n liveMessage: string;\n ariaLabel?: string;\n content: JSX.Element;\n};\n\n/** @private */\nexport const ChatMessageContent = (props: ChatMessageContentProps): JSX.Element => {\n switch (props.message.contentType) {\n case 'text':\n return MessageContentAsText(props);\n case 'html':\n return MessageContentAsRichTextHTML(props);\n case 'richtext/html':\n return MessageContentAsRichTextHTML(props);\n default:\n console.warn('unknown message content type');\n return <></>;\n }\n};\nconst MessageContentWithLiveAria = (props: MessageContentWithLiveAriaProps): JSX.Element => {\n return <div data-ui-status={props.message.status} role=\"text\" aria-label={props.ariaLabel}>\n <LiveMessage message={props.liveMessage} ariaLive=\"polite\" />\n {props.content}\n </div>;\n};\nconst MessageContentAsRichTextHTML = (props: ChatMessageContentProps): JSX.Element => {\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n useEffect(() => {\n props.message.attachedFilesMetadata?.map(fileMetadata => {\n if (props.onFetchAttachment && props.attachmentsMap && fileMetadata.attachmentType === 'inlineImage' && props.attachmentsMap[fileMetadata.id] === undefined) {\n props.onFetchAttachment(fileMetadata);\n }\n });\n }, [props]);\n return <MessageContentWithLiveAria message={props.message} liveMessage={generateLiveMessage(props)} ariaLabel={messageContentAriaText(props)} content={processHtmlToReact(props)} />;\n};\nconst MessageContentAsText = (props: ChatMessageContentProps): JSX.Element => {\n return <MessageContentWithLiveAria message={props.message} liveMessage={generateLiveMessage(props)} ariaLabel={messageContentAriaText(props)} content={<Linkify componentDecorator={(decoratedHref: string, decoratedText: string, key: number) => {\n return <Link target=\"_blank\" href={decoratedHref} key={key}>\n {decoratedText}\n </Link>;\n }}>\n {props.message.content}\n </Linkify>} />;\n};\n\n/* @conditional-compile-remove(data-loss-prevention) */\n/**\n * @private\n */\nexport const BlockedMessageContent = (props: BlockedMessageContentProps): JSX.Element => {\n const Icon: JSX.Element = <FontIcon iconName={'DataLossPreventionProhibited'} />;\n const blockedMessage = props.message.warningText === undefined ? props.strings.blockedWarningText : props.message.warningText;\n const blockedMessageLink = props.message.link;\n const blockedMessageLinkText = blockedMessageLink ? props.message.linkText ?? props.strings.blockedWarningLinkText : '';\n const liveAuthor = props.message.mine || props.message.senderDisplayName === undefined ? '' : props.message.senderDisplayName;\n const liveBlockedWarningText = `${liveAuthor} ${blockedMessage} ${blockedMessageLinkText}`;\n return <MessageContentWithLiveAria message={props.message} liveMessage={liveBlockedWarningText} ariaLabel={liveBlockedWarningText} content={<Stack horizontal wrap>\n {Icon}\n {blockedMessage && <p>{blockedMessage}</p>}\n {blockedMessageLink && <Link target={'_blank'} href={blockedMessageLink}>\n {blockedMessageLinkText}\n </Link>}\n </Stack>} />;\n};\n\n// https://stackoverflow.com/questions/28899298/extract-the-text-out-of-html-string-using-javascript\nconst extractContent = (s: string): string => {\n const span = document.createElement('span');\n span.innerHTML = s;\n return span.textContent || span.innerText;\n};\nconst generateLiveMessage = (props: ChatMessageContentProps): string => {\n const liveAuthor = _formatString(props.strings.liveAuthorIntro, {\n author: `${props.message.senderDisplayName}`\n });\n return `${props.message.editedOn ? props.strings.editedTag : ''} ${props.message.mine ? '' : liveAuthor} ${extractContent(props.message.content || '')} `;\n};\nconst messageContentAriaText = (props: ChatMessageContentProps): string | undefined => {\n // Strip all html tags from the content for aria.\n\n return props.message.content ? props.message.mine ? _formatString(props.strings.messageContentMineAriaText, {\n message: DOMPurify.sanitize(props.message.content, {\n ALLOWED_TAGS: []\n })\n }) : _formatString(props.strings.messageContentAriaText, {\n author: `${props.message.senderDisplayName}`,\n message: DOMPurify.sanitize(props.message.content, {\n ALLOWED_TAGS: []\n })\n }) : undefined;\n};\nconst processNodeDefinitions = ProcessNodeDefinitions();\nconst htmlToReactParser = Parser();\n\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nconst processInlineImage = (props: ChatMessageContentProps): ProcessingInstructionType => ({\n // Custom <img> processing\n shouldProcessNode: (node): boolean => {\n function isImageNode(file: FileMetadata): boolean {\n return file.attachmentType === 'inlineImage' && file.id === node.attribs.id;\n }\n\n // Process img node with id in attachments list\n return node.name && node.name === 'img' && node.attribs && node.attribs.id && props.message.attachedFilesMetadata?.find(isImageNode);\n },\n processNode: (node, children, index): JSX.Element => {\n node.attribs = {\n ...node.attribs,\n 'aria-label': node.attribs.name\n };\n // logic to check id in map/list\n if (props.attachmentsMap && node.attribs.id in props.attachmentsMap) {\n node.attribs = {\n ...node.attribs,\n src: props.attachmentsMap[node.attribs.id]\n };\n }\n return processNodeDefinitions.processDefaultNode(node, children, index);\n }\n});\n\n/* @conditional-compile-remove(mention) */\nconst processMention = (props: ChatMessageContentProps): ProcessingInstructionType => ({\n shouldProcessNode: node => {\n if (props.mentionDisplayOptions?.onRenderMention) {\n // Override the handling of the <msft-mention> tag in the HTML if there's a custom renderer\n return node.name === 'msft-mention';\n }\n return false;\n },\n processNode: node => {\n if (props.mentionDisplayOptions?.onRenderMention) {\n const {\n id\n } = node.attribs;\n const mention: Mention = {\n id: id,\n displayText: node.children[0]?.data ?? ''\n };\n return props.mentionDisplayOptions.onRenderMention(mention, defaultOnMentionRender);\n }\n return processNodeDefinitions.processDefaultNode;\n }\n});\nconst processHtmlToReact = (props: ChatMessageContentProps): JSX.Element => {\n const steps: ProcessingInstructionType[] = [/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n processInlineImage(props), /* @conditional-compile-remove(mention) */\n processMention(props), {\n // Process everything else in the default way\n shouldProcessNode: IsValidNodeDefinitions.alwaysValid,\n processNode: processNodeDefinitions.processDefaultNode\n }];\n return htmlToReactParser.parseWithInstructions(props.message.content ?? '', IsValidNodeDefinitions.alwaysValid, steps);\n};\"../../../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"ChatMessageContent.js","sourceRoot":"","sources":["../../../../../../preprocess-dist/react-components/src/components/ChatMessage/ChatMessageContent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,sCAAgC;AACxD,OAAO,EAAE,MAAM,EAAE,sBAAsB,EAAE,sBAAsB,EAA6B,MAAM,eAAe,CAAC;AAClH,OAAO,OAAO,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,SAAS,MAAM,WAAW,CAAC;AAYlC,eAAe;AACf,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAA8B,EAAe,EAAE;IAChF,QAAQ,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE;QACjC,KAAK,MAAM;YACT,OAAO,oBAAoB,CAAC,KAAK,CAAC,CAAC;QACrC,KAAK,MAAM;YACT,OAAO,4BAA4B,CAAC,KAAK,CAAC,CAAC;QAC7C,KAAK,eAAe;YAClB,OAAO,4BAA4B,CAAC,KAAK,CAAC,CAAC;QAC7C;YACE,OAAO,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;YAC7C,OAAO,yCAAK,CAAC;KAChB;AACH,CAAC,CAAC;AACF,MAAM,0BAA0B,GAAG,CAAC,KAAsC,EAAe,EAAE;IACzF,OAAO,+CAAqB,KAAK,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,EAAC,MAAM,gBAAa,KAAK,CAAC,SAAS;QAC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AG,CAAC,KAA8B,EAAe,EAAE;;IACzE,MAAM,KAAK,GAAgC,CAAC;YAC1C,6CAA6C;YAC7C,iBAAiB,EAAE,sBAAsB,CAAC,WAAW;YACrD,WAAW,EAAE,sBAAsB,CAAC,kBAAkB;SACvD,CAAC,CAAC;IACH,OAAO,iBAAiB,CAAC,qBAAqB,CAAC,MAAA,KAAK,CAAC,OAAO,CAAC,OAAO,mCAAI,EAAE,EAAE,sBAAsB,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;AACzH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React from 'react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { Parser, ProcessNodeDefinitions, IsValidNodeDefinitions, ProcessingInstructionType } from 'html-to-react';\nimport Linkify from 'react-linkify';\nimport { ChatMessage } from '../../types/ChatMessage';\nimport { Link } from '@fluentui/react';\nimport { MessageThreadStrings } from '../MessageThread';\nimport LiveMessage from '../Announcer/LiveMessage';\nimport DOMPurify from 'dompurify';\ntype ChatMessageContentProps = {\n message: ChatMessage;\n strings: MessageThreadStrings;\n};\ntype MessageContentWithLiveAriaProps = {\n message: ChatMessage;\n liveMessage: string;\n ariaLabel?: string;\n content: JSX.Element;\n};\n\n/** @private */\nexport const ChatMessageContent = (props: ChatMessageContentProps): JSX.Element => {\n switch (props.message.contentType) {\n case 'text':\n return MessageContentAsText(props);\n case 'html':\n return MessageContentAsRichTextHTML(props);\n case 'richtext/html':\n return MessageContentAsRichTextHTML(props);\n default:\n console.warn('unknown message content type');\n return <></>;\n }\n};\nconst MessageContentWithLiveAria = (props: MessageContentWithLiveAriaProps): JSX.Element => {\n return <div data-ui-status={props.message.status} role=\"text\" aria-label={props.ariaLabel}>\n <LiveMessage message={props.liveMessage} ariaLive=\"polite\" />\n {props.content}\n </div>;\n};\nconst MessageContentAsRichTextHTML = (props: ChatMessageContentProps): JSX.Element => {\n return <MessageContentWithLiveAria message={props.message} liveMessage={generateLiveMessage(props)} ariaLabel={messageContentAriaText(props)} content={processHtmlToReact(props)} />;\n};\nconst MessageContentAsText = (props: ChatMessageContentProps): JSX.Element => {\n return <MessageContentWithLiveAria message={props.message} liveMessage={generateLiveMessage(props)} ariaLabel={messageContentAriaText(props)} content={<Linkify componentDecorator={(decoratedHref: string, decoratedText: string, key: number) => {\n return <Link target=\"_blank\" href={decoratedHref} key={key}>\n {decoratedText}\n </Link>;\n }}>\n {props.message.content}\n </Linkify>} />;\n};\n// https://stackoverflow.com/questions/28899298/extract-the-text-out-of-html-string-using-javascript\nconst extractContent = (s: string): string => {\n const span = document.createElement('span');\n span.innerHTML = s;\n return span.textContent || span.innerText;\n};\nconst generateLiveMessage = (props: ChatMessageContentProps): string => {\n const liveAuthor = _formatString(props.strings.liveAuthorIntro, {\n author: `${props.message.senderDisplayName}`\n });\n return `${props.message.editedOn ? props.strings.editedTag : ''} ${props.message.mine ? '' : liveAuthor} ${extractContent(props.message.content || '')} `;\n};\nconst messageContentAriaText = (props: ChatMessageContentProps): string | undefined => {\n // Strip all html tags from the content for aria.\n\n return props.message.content ? props.message.mine ? _formatString(props.strings.messageContentMineAriaText, {\n message: DOMPurify.sanitize(props.message.content, {\n ALLOWED_TAGS: []\n })\n }) : _formatString(props.strings.messageContentAriaText, {\n author: `${props.message.senderDisplayName}`,\n message: DOMPurify.sanitize(props.message.content, {\n ALLOWED_TAGS: []\n })\n }) : undefined;\n};\nconst processNodeDefinitions = ProcessNodeDefinitions();\nconst htmlToReactParser = Parser();\nconst processHtmlToReact = (props: ChatMessageContentProps): JSX.Element => {\n const steps: ProcessingInstructionType[] = [{\n // Process everything else in the default way\n shouldProcessNode: IsValidNodeDefinitions.alwaysValid,\n processNode: processNodeDefinitions.processDefaultNode\n }];\n return htmlToReactParser.parseWithInstructions(props.message.content ?? '', IsValidNodeDefinitions.alwaysValid, steps);\n};\"../../../../acs-ui-common/src\""]}
@@ -131,7 +131,7 @@ export interface DevicesButtonProps extends ControlBarButtonProps {
131
131
  /**
132
132
  * Subset props for various buttons that show device selection menus.
133
133
  *
134
- * @private
134
+ * @internal
135
135
  */
136
136
  export interface DeviceMenuProps {
137
137
  microphones?: OptionsDevice[];
@@ -148,7 +148,7 @@ export interface DeviceMenuProps {
148
148
  /**
149
149
  * Subset of strings for various buttons that show device selection menus.
150
150
  *
151
- * @private
151
+ * @internal
152
152
  */
153
153
  export interface DeviceMenuStrings {
154
154
  /**
@@ -195,7 +195,7 @@ export interface DeviceMenuStrings {
195
195
  /**
196
196
  * Styles for flyouts used by various buttons for device selection flyouts.
197
197
  *
198
- * @private
198
+ * @internal
199
199
  */
200
200
  export interface DeviceMenuStyles extends IContextualMenuStyles {
201
201
  menuItemStyles?: IContextualMenuItemStyles;
@@ -204,7 +204,7 @@ export interface DeviceMenuStyles extends IContextualMenuStyles {
204
204
  * Generates default {@link IContextualMenuProps} for buttons that
205
205
  * show a drop-down to select devices to use.
206
206
  *
207
- * @private
207
+ * @internal
208
208
  */
209
209
  export declare const generateDefaultDeviceMenuProps: (props: DeviceMenuProps, strings: DeviceMenuStrings, primaryActionItem?: IContextualMenuItem | undefined, isSelectCamAllowed?: boolean, isSelectMicAllowed?: boolean) => {
210
210
  items: IContextualMenuItem[];
@@ -11,7 +11,7 @@ import { _preventDismissOnEvent as preventDismissOnEvent } from "../../../acs-ui
11
11
  * Generates default {@link IContextualMenuProps} for buttons that
12
12
  * show a drop-down to select devices to use.
13
13
  *
14
- * @private
14
+ * @internal
15
15
  */
16
16
  export const generateDefaultDeviceMenuProps = (props, strings, primaryActionItem, isSelectCamAllowed = true, isSelectMicAllowed = true) => {
17
17
  var _a, _b;
@@ -1 +1 @@
1
- {"version":3,"file":"DevicesButton.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/DevicesButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,sBAAsB,EAA+F,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7J,OAAO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AgB,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;QACvC,yCAAyC;QACzC,OAAO,SAAS,CAAC;KAClB;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAyB,EAAe,EAAE;;IACtE,MAAM,EACJ,YAAY,EACb,GAAG,KAAK,CAAC;IACV,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC;IACxD,MAAM,OAAO,mCACR,aAAa,GACb,KAAK,CAAC,OAAO,CACjB,CAAC;IACF,MAAM,iBAAiB,GAAG,MAAA,KAAK,CAAC,SAAS,mCAAI,8BAA8B,iCACtE,KAAK,KACR,MAAM,EAAE,MAAA,KAAK,CAAC,MAAM,0CAAE,UAAU,KAC/B,OAAO,CAAC,CAAC;IACZ,MAAM,mBAAmB,GAAG,GAAgB,EAAE;QAC5C,OAAO,oBAAC,sBAAsB,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAC,sBAAsB,GAAG,CAAC;IAC9F,CAAC,CAAC;IACF,OAAO,oBAAC,gBAAgB,oBAAK,KAAK,IAAE,SAAS,EAAE,iBAAiB,EAAE,aAAa,EAAE;YAC/E,MAAM,EAAE,IAAI;SACb,EAAE,YAAY,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,mBAAmB,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAA,KAAK,CAAC,QAAQ,mCAAI,oBAAoB,IAAI,CAAC;AAC/H,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ContextualMenuItemType, IContextualMenuItem, IContextualMenuItemStyles, IContextualMenuProps, IContextualMenuStyles, merge } from '@fluentui/react';\nimport React from 'react';\nimport { useLocale } from '../localization';\nimport { ControlBarButton, ControlBarButtonProps, ControlBarButtonStyles } from './ControlBarButton';\nimport { _HighContrastAwareIcon } from './HighContrastAwareIcon';\nimport { buttonFlyoutItemStyles } from './styles/ControlBar.styles';\nimport { _preventDismissOnEvent as preventDismissOnEvent } from '@internal/acs-ui-common';\n\n/**\n * Styles for the {@link DevicesButton} menu.\n *\n * @public\n */\nexport interface DevicesButtonContextualMenuStyles extends IContextualMenuStyles {\n /**\n * Styles for the items inside the {@link DevicesButton} button menu.\n */\n menuItemStyles?: IContextualMenuItemStyles;\n}\n\n/**\n * Styles for the Devices button menu items.\n *\n * @public\n */\nexport interface DevicesButtonStyles extends ControlBarButtonStyles {\n /**\n * Styles for the {@link DevicesButton} menu.\n */\n menuStyles?: Partial<DevicesButtonContextualMenuStyles>;\n}\n\n/**\n * A device, e.g. camera, microphone, or speaker, in the {@link DevicesButton} flyout.\n *\n * @public\n */\nexport interface OptionsDevice {\n /**\n * Device unique identifier\n */\n id: string;\n /**\n * Device name\n */\n name: string;\n}\n\n/**\n * Strings of {@link DevicesButton} that can be overridden.\n *\n * @public\n */\nexport interface DevicesButtonStrings {\n /**\n * Label of button\n */\n label: string;\n /**\n * Button tooltip content.\n */\n tooltipContent?: string;\n /**\n * Title of camera menu\n */\n cameraMenuTitle: string;\n /**\n * Title of microphone menu\n */\n microphoneMenuTitle: string;\n /**\n * Title of speaker menu\n */\n speakerMenuTitle: string;\n /**\n * Tooltip of camera menu\n */\n cameraMenuTooltip: string;\n /**\n * Tooltip of microphone menu\n */\n microphoneMenuTooltip: string;\n /**\n * Tooltip of speaker menu\n */\n speakerMenuTooltip: string;\n}\n\n/**\n * Props for {@link DevicesButton}.\n *\n * @public\n */\nexport interface DevicesButtonProps extends ControlBarButtonProps {\n /**\n * Available microphones for selection\n */\n microphones?: OptionsDevice[];\n /**\n * Available speakers for selection\n */\n speakers?: OptionsDevice[];\n /**\n * Available cameras for selection\n */\n cameras?: OptionsDevice[];\n /**\n * Microphone that is shown as currently selected\n */\n selectedMicrophone?: OptionsDevice;\n /**\n * Speaker that is shown as currently selected\n */\n selectedSpeaker?: OptionsDevice;\n /**\n * Camera that is shown as currently selected\n */\n selectedCamera?: OptionsDevice;\n /**\n * Callback when a camera is selected\n */\n onSelectCamera?: (device: OptionsDevice) => Promise<void>;\n /**\n * Callback when a microphone is selected\n */\n onSelectMicrophone?: (device: OptionsDevice) => Promise<void>;\n /**\n * Speaker when a speaker is selected\n */\n onSelectSpeaker?: (device: OptionsDevice) => Promise<void>;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<DevicesButtonStrings>;\n /**\n * Option to increase the touch targets of the button flyout menu items from 36px to 48px.\n * Recommended for mobile devices.\n */\n styles?: DevicesButtonStyles;\n}\n\n/**\n * Subset props for various buttons that show device selection menus.\n *\n * @private\n */\nexport interface DeviceMenuProps {\n microphones?: OptionsDevice[];\n speakers?: OptionsDevice[];\n cameras?: OptionsDevice[];\n selectedMicrophone?: OptionsDevice;\n selectedSpeaker?: OptionsDevice;\n selectedCamera?: OptionsDevice;\n onSelectCamera?: (device: OptionsDevice) => Promise<void>;\n onSelectMicrophone?: (device: OptionsDevice) => Promise<void>;\n onSelectSpeaker?: (device: OptionsDevice) => Promise<void>;\n styles?: Partial<DeviceMenuStyles>;\n}\n\n/**\n * Subset of strings for various buttons that show device selection menus.\n *\n * @private\n */\nexport interface DeviceMenuStrings {\n /**\n * Title for Camera section in the contextual menu\n */\n cameraMenuTitle?: string;\n /**\n * Title for Audio Device section in the contextual menu\n *\n * @remark Used in place of microphoneMenuTitle when speakers can be enumerated\n */\n audioDeviceMenuTitle?: string;\n /**\n * Title for Microphone section in the contextual menu\n *\n * @remark Used when speakers can be enumerated\n */\n microphoneMenuTitle?: string;\n /**\n * Title for Speaker section in the contextual menu\n */\n speakerMenuTitle?: string;\n /**\n * Tooltip label for Camera section in the contextual menu\n */\n cameraMenuTooltip?: string;\n /**\n * Tooltip label for Audio Device section in the contextual menu\n *\n * @remark Used in place of microphoneMenuTooltip when speakers can be enumerated\n */\n audioDeviceMenuTooltip?: string;\n /**\n * Tooltip label for Microphone section in the contextual menu\n *\n * @remark Used when speakers can be enumerated\n */\n microphoneMenuTooltip?: string;\n /**\n * Tooltip label for Speaker section in the contextual menu\n */\n speakerMenuTooltip?: string;\n}\n\n/**\n * Styles for flyouts used by various buttons for device selection flyouts.\n *\n * @private\n */\nexport interface DeviceMenuStyles extends IContextualMenuStyles {\n menuItemStyles?: IContextualMenuItemStyles;\n}\n\n/**\n * Generates default {@link IContextualMenuProps} for buttons that\n * show a drop-down to select devices to use.\n *\n * @private\n */\nexport const generateDefaultDeviceMenuProps = (props: DeviceMenuProps, strings: DeviceMenuStrings, primaryActionItem?: IContextualMenuItem, isSelectCamAllowed = true, isSelectMicAllowed = true): {\n items: IContextualMenuItem[];\n} | undefined => {\n const {\n microphones,\n speakers,\n cameras,\n selectedMicrophone,\n selectedSpeaker,\n selectedCamera,\n onSelectCamera,\n onSelectMicrophone,\n onSelectSpeaker\n } = props;\n const defaultMenuProps: IContextualMenuProps = {\n items: [],\n styles: props.styles,\n calloutProps: {\n styles: {\n root: {\n // Confine the menu to the parents bounds.\n // More info: https://github.com/microsoft/fluentui/issues/18835\n // NB: 95% to keep some space for margin, drop shadow etc around the Callout.\n maxWidth: '95%'\n }\n },\n preventDismissOnEvent\n }\n };\n const menuItemStyles = merge(buttonFlyoutItemStyles, props.styles?.menuItemStyles ?? {});\n if (cameras && selectedCamera && onSelectCamera && isSelectCamAllowed) {\n defaultMenuProps.items.push({\n key: 'cameras',\n itemType: ContextualMenuItemType.Section,\n sectionProps: {\n title: strings.cameraMenuTitle,\n items: [{\n key: 'sectionCamera',\n title: strings.cameraMenuTooltip,\n subMenuProps: {\n calloutProps: {\n preventDismissOnEvent\n },\n items: cameras.map(camera => ({\n key: camera.id,\n text: camera.name,\n title: camera.name,\n iconProps: {\n iconName: 'ContextMenuCameraIcon',\n styles: {\n root: {\n lineHeight: 0\n }\n }\n },\n itemProps: {\n styles: menuItemStyles\n },\n canCheck: true,\n isChecked: camera.id === selectedCamera?.id,\n onClick: () => {\n if (camera.id !== selectedCamera?.id) {\n onSelectCamera(camera);\n }\n }\n }))\n },\n text: selectedCamera.name\n }]\n }\n });\n if (primaryActionItem) {\n defaultMenuProps.items.push(primaryActionItem);\n }\n }\n if (microphones && selectedMicrophone && onSelectMicrophone && isSelectMicAllowed) {\n // Set props as Microphone if speakers can be enumerated else set as Audio Device\n const speakersAvailable = speakers && speakers.length > 0;\n const key = speakersAvailable ? 'sectionMicrophone' : 'sectionAudioDevice';\n const title = speakersAvailable ? strings.microphoneMenuTooltip : strings.audioDeviceMenuTooltip;\n defaultMenuProps.items.push({\n key: 'microphones',\n itemType: ContextualMenuItemType.Section,\n sectionProps: {\n title: strings.microphoneMenuTitle,\n items: [{\n key: key,\n title: title,\n subMenuProps: {\n calloutProps: {\n preventDismissOnEvent\n },\n items: microphones.map(microphone => ({\n key: microphone.id,\n text: microphone.name,\n title: microphone.name,\n itemProps: {\n styles: menuItemStyles\n },\n iconProps: {\n iconName: 'ContextMenuMicIcon',\n styles: {\n root: {\n lineHeight: 0\n }\n }\n },\n canCheck: true,\n isChecked: microphone.id === selectedMicrophone?.id,\n onClick: () => {\n if (microphone.id !== selectedMicrophone?.id) {\n onSelectMicrophone(microphone);\n }\n }\n }))\n },\n text: selectedMicrophone.name\n }]\n }\n });\n }\n if (speakers && selectedSpeaker && onSelectSpeaker) {\n defaultMenuProps.items.push({\n key: 'speakers',\n itemType: ContextualMenuItemType.Section,\n sectionProps: {\n title: strings.speakerMenuTitle,\n items: [{\n key: 'sectionSpeaker',\n subMenuProps: {\n calloutProps: {\n preventDismissOnEvent\n },\n items: speakers.map(speaker => ({\n key: speaker.id,\n text: speaker.name,\n title: speaker.name,\n itemProps: {\n styles: menuItemStyles\n },\n iconProps: {\n iconName: 'ContextMenuSpeakerIcon',\n styles: {\n root: {\n lineHeight: 0\n }\n }\n },\n canCheck: true,\n isChecked: speaker.id === selectedSpeaker?.id,\n onClick: () => {\n if (speaker.id !== selectedSpeaker?.id) {\n onSelectSpeaker(speaker);\n }\n }\n }))\n },\n text: selectedSpeaker.name\n }]\n }\n });\n }\n if (microphones && selectedMicrophone && onSelectMicrophone && isSelectMicAllowed && primaryActionItem) {\n defaultMenuProps.items.push(primaryActionItem);\n }\n if (defaultMenuProps.items.length === 0) {\n // Avoids creating an empty context menu.\n return undefined;\n }\n return defaultMenuProps;\n};\n\n/**\n * A button to open a menu that controls device options.\n *\n * Can be used with {@link ControlBar}.\n *\n * @public\n */\nexport const DevicesButton = (props: DevicesButtonProps): JSX.Element => {\n const {\n onRenderIcon\n } = props;\n const localeStrings = useLocale().strings.devicesButton;\n const strings = {\n ...localeStrings,\n ...props.strings\n };\n const devicesButtonMenu = props.menuProps ?? generateDefaultDeviceMenuProps({\n ...props,\n styles: props.styles?.menuStyles\n }, strings);\n const onRenderOptionsIcon = (): JSX.Element => {\n return <_HighContrastAwareIcon disabled={props.disabled} iconName=\"ControlButtonOptions\" />;\n };\n return <ControlBarButton {...props} menuProps={devicesButtonMenu} menuIconProps={{\n hidden: true\n }} onRenderIcon={onRenderIcon ?? onRenderOptionsIcon} strings={strings} labelKey={props.labelKey ?? 'devicesButtonLabel'} />;\n};\"../../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"DevicesButton.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/DevicesButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,sBAAsB,EAA+F,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7J,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAiD,MAAM,oBAAoB,CAAC;AACrG,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AACpE,OAAO,EAAE,sBAAsB,IAAI,qBAAqB,EAAE,m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AAS,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC;IACxD,MAAM,OAAO,mCACR,aAAa,GACb,KAAK,CAAC,OAAO,CACjB,CAAC;IACF,MAAM,iBAAiB,GAAG,MAAA,KAAK,CAAC,SAAS,mCAAI,8BAA8B,iCACtE,KAAK,KACR,MAAM,EAAE,MAAA,KAAK,CAAC,MAAM,0CAAE,UAAU,KAC/B,OAAO,CAAC,CAAC;IACZ,MAAM,mBAAmB,GAAG,GAAgB,EAAE;QAC5C,OAAO,oBAAC,sBAAsB,IAAC,QAAQ,EAAE,KAAK,CAAC,QAAQ,EAAE,QAAQ,EAAC,sBAAsB,GAAG,CAAC;IAC9F,CAAC,CAAC;IACF,OAAO,oBAAC,gBAAgB,oBAAK,KAAK,IAAE,SAAS,EAAE,iBAAiB,EAAE,aAAa,EAAE;YAC/E,MAAM,EAAE,IAAI;SACb,EAAE,YAAY,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,mBAAmB,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAA,KAAK,CAAC,QAAQ,mCAAI,oBAAoB,IAAI,CAAC;AAC/H,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ContextualMenuItemType, IContextualMenuItem, IContextualMenuItemStyles, IContextualMenuProps, IContextualMenuStyles, merge } from '@fluentui/react';\nimport React from 'react';\nimport { useLocale } from '../localization';\nimport { ControlBarButton, ControlBarButtonProps, ControlBarButtonStyles } from './ControlBarButton';\nimport { _HighContrastAwareIcon } from './HighContrastAwareIcon';\nimport { buttonFlyoutItemStyles } from './styles/ControlBar.styles';\nimport { _preventDismissOnEvent as preventDismissOnEvent } from '@internal/acs-ui-common';\n\n/**\n * Styles for the {@link DevicesButton} menu.\n *\n * @public\n */\nexport interface DevicesButtonContextualMenuStyles extends IContextualMenuStyles {\n /**\n * Styles for the items inside the {@link DevicesButton} button menu.\n */\n menuItemStyles?: IContextualMenuItemStyles;\n}\n\n/**\n * Styles for the Devices button menu items.\n *\n * @public\n */\nexport interface DevicesButtonStyles extends ControlBarButtonStyles {\n /**\n * Styles for the {@link DevicesButton} menu.\n */\n menuStyles?: Partial<DevicesButtonContextualMenuStyles>;\n}\n\n/**\n * A device, e.g. camera, microphone, or speaker, in the {@link DevicesButton} flyout.\n *\n * @public\n */\nexport interface OptionsDevice {\n /**\n * Device unique identifier\n */\n id: string;\n /**\n * Device name\n */\n name: string;\n}\n\n/**\n * Strings of {@link DevicesButton} that can be overridden.\n *\n * @public\n */\nexport interface DevicesButtonStrings {\n /**\n * Label of button\n */\n label: string;\n /**\n * Button tooltip content.\n */\n tooltipContent?: string;\n /**\n * Title of camera menu\n */\n cameraMenuTitle: string;\n /**\n * Title of microphone menu\n */\n microphoneMenuTitle: string;\n /**\n * Title of speaker menu\n */\n speakerMenuTitle: string;\n /**\n * Tooltip of camera menu\n */\n cameraMenuTooltip: string;\n /**\n * Tooltip of microphone menu\n */\n microphoneMenuTooltip: string;\n /**\n * Tooltip of speaker menu\n */\n speakerMenuTooltip: string;\n}\n\n/**\n * Props for {@link DevicesButton}.\n *\n * @public\n */\nexport interface DevicesButtonProps extends ControlBarButtonProps {\n /**\n * Available microphones for selection\n */\n microphones?: OptionsDevice[];\n /**\n * Available speakers for selection\n */\n speakers?: OptionsDevice[];\n /**\n * Available cameras for selection\n */\n cameras?: OptionsDevice[];\n /**\n * Microphone that is shown as currently selected\n */\n selectedMicrophone?: OptionsDevice;\n /**\n * Speaker that is shown as currently selected\n */\n selectedSpeaker?: OptionsDevice;\n /**\n * Camera that is shown as currently selected\n */\n selectedCamera?: OptionsDevice;\n /**\n * Callback when a camera is selected\n */\n onSelectCamera?: (device: OptionsDevice) => Promise<void>;\n /**\n * Callback when a microphone is selected\n */\n onSelectMicrophone?: (device: OptionsDevice) => Promise<void>;\n /**\n * Speaker when a speaker is selected\n */\n onSelectSpeaker?: (device: OptionsDevice) => Promise<void>;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<DevicesButtonStrings>;\n /**\n * Option to increase the touch targets of the button flyout menu items from 36px to 48px.\n * Recommended for mobile devices.\n */\n styles?: DevicesButtonStyles;\n}\n\n/**\n * Subset props for various buttons that show device selection menus.\n *\n * @internal\n */\nexport interface DeviceMenuProps {\n microphones?: OptionsDevice[];\n speakers?: OptionsDevice[];\n cameras?: OptionsDevice[];\n selectedMicrophone?: OptionsDevice;\n selectedSpeaker?: OptionsDevice;\n selectedCamera?: OptionsDevice;\n onSelectCamera?: (device: OptionsDevice) => Promise<void>;\n onSelectMicrophone?: (device: OptionsDevice) => Promise<void>;\n onSelectSpeaker?: (device: OptionsDevice) => Promise<void>;\n styles?: Partial<DeviceMenuStyles>;\n}\n\n/**\n * Subset of strings for various buttons that show device selection menus.\n *\n * @internal\n */\nexport interface DeviceMenuStrings {\n /**\n * Title for Camera section in the contextual menu\n */\n cameraMenuTitle?: string;\n /**\n * Title for Audio Device section in the contextual menu\n *\n * @remark Used in place of microphoneMenuTitle when speakers can be enumerated\n */\n audioDeviceMenuTitle?: string;\n /**\n * Title for Microphone section in the contextual menu\n *\n * @remark Used when speakers can be enumerated\n */\n microphoneMenuTitle?: string;\n /**\n * Title for Speaker section in the contextual menu\n */\n speakerMenuTitle?: string;\n /**\n * Tooltip label for Camera section in the contextual menu\n */\n cameraMenuTooltip?: string;\n /**\n * Tooltip label for Audio Device section in the contextual menu\n *\n * @remark Used in place of microphoneMenuTooltip when speakers can be enumerated\n */\n audioDeviceMenuTooltip?: string;\n /**\n * Tooltip label for Microphone section in the contextual menu\n *\n * @remark Used when speakers can be enumerated\n */\n microphoneMenuTooltip?: string;\n /**\n * Tooltip label for Speaker section in the contextual menu\n */\n speakerMenuTooltip?: string;\n}\n\n/**\n * Styles for flyouts used by various buttons for device selection flyouts.\n *\n * @internal\n */\nexport interface DeviceMenuStyles extends IContextualMenuStyles {\n menuItemStyles?: IContextualMenuItemStyles;\n}\n\n/**\n * Generates default {@link IContextualMenuProps} for buttons that\n * show a drop-down to select devices to use.\n *\n * @internal\n */\nexport const generateDefaultDeviceMenuProps = (props: DeviceMenuProps, strings: DeviceMenuStrings, primaryActionItem?: IContextualMenuItem, isSelectCamAllowed = true, isSelectMicAllowed = true): {\n items: IContextualMenuItem[];\n} | undefined => {\n const {\n microphones,\n speakers,\n cameras,\n selectedMicrophone,\n selectedSpeaker,\n selectedCamera,\n onSelectCamera,\n onSelectMicrophone,\n onSelectSpeaker\n } = props;\n const defaultMenuProps: IContextualMenuProps = {\n items: [],\n styles: props.styles,\n calloutProps: {\n styles: {\n root: {\n // Confine the menu to the parents bounds.\n // More info: https://github.com/microsoft/fluentui/issues/18835\n // NB: 95% to keep some space for margin, drop shadow etc around the Callout.\n maxWidth: '95%'\n }\n },\n preventDismissOnEvent\n }\n };\n const menuItemStyles = merge(buttonFlyoutItemStyles, props.styles?.menuItemStyles ?? {});\n if (cameras && selectedCamera && onSelectCamera && isSelectCamAllowed) {\n defaultMenuProps.items.push({\n key: 'cameras',\n itemType: ContextualMenuItemType.Section,\n sectionProps: {\n title: strings.cameraMenuTitle,\n items: [{\n key: 'sectionCamera',\n title: strings.cameraMenuTooltip,\n subMenuProps: {\n calloutProps: {\n preventDismissOnEvent\n },\n items: cameras.map(camera => ({\n key: camera.id,\n text: camera.name,\n title: camera.name,\n iconProps: {\n iconName: 'ContextMenuCameraIcon',\n styles: {\n root: {\n lineHeight: 0\n }\n }\n },\n itemProps: {\n styles: menuItemStyles\n },\n canCheck: true,\n isChecked: camera.id === selectedCamera?.id,\n onClick: () => {\n if (camera.id !== selectedCamera?.id) {\n onSelectCamera(camera);\n }\n }\n }))\n },\n text: selectedCamera.name\n }]\n }\n });\n if (primaryActionItem) {\n defaultMenuProps.items.push(primaryActionItem);\n }\n }\n if (microphones && selectedMicrophone && onSelectMicrophone && isSelectMicAllowed) {\n // Set props as Microphone if speakers can be enumerated else set as Audio Device\n const speakersAvailable = speakers && speakers.length > 0;\n const key = speakersAvailable ? 'sectionMicrophone' : 'sectionAudioDevice';\n const title = speakersAvailable ? strings.microphoneMenuTooltip : strings.audioDeviceMenuTooltip;\n defaultMenuProps.items.push({\n key: 'microphones',\n itemType: ContextualMenuItemType.Section,\n sectionProps: {\n title: strings.microphoneMenuTitle,\n items: [{\n key: key,\n title: title,\n subMenuProps: {\n calloutProps: {\n preventDismissOnEvent\n },\n items: microphones.map(microphone => ({\n key: microphone.id,\n text: microphone.name,\n title: microphone.name,\n itemProps: {\n styles: menuItemStyles\n },\n iconProps: {\n iconName: 'ContextMenuMicIcon',\n styles: {\n root: {\n lineHeight: 0\n }\n }\n },\n canCheck: true,\n isChecked: microphone.id === selectedMicrophone?.id,\n onClick: () => {\n if (microphone.id !== selectedMicrophone?.id) {\n onSelectMicrophone(microphone);\n }\n }\n }))\n },\n text: selectedMicrophone.name\n }]\n }\n });\n }\n if (speakers && selectedSpeaker && onSelectSpeaker) {\n defaultMenuProps.items.push({\n key: 'speakers',\n itemType: ContextualMenuItemType.Section,\n sectionProps: {\n title: strings.speakerMenuTitle,\n items: [{\n key: 'sectionSpeaker',\n subMenuProps: {\n calloutProps: {\n preventDismissOnEvent\n },\n items: speakers.map(speaker => ({\n key: speaker.id,\n text: speaker.name,\n title: speaker.name,\n itemProps: {\n styles: menuItemStyles\n },\n iconProps: {\n iconName: 'ContextMenuSpeakerIcon',\n styles: {\n root: {\n lineHeight: 0\n }\n }\n },\n canCheck: true,\n isChecked: speaker.id === selectedSpeaker?.id,\n onClick: () => {\n if (speaker.id !== selectedSpeaker?.id) {\n onSelectSpeaker(speaker);\n }\n }\n }))\n },\n text: selectedSpeaker.name\n }]\n }\n });\n }\n if (microphones && selectedMicrophone && onSelectMicrophone && isSelectMicAllowed && primaryActionItem) {\n defaultMenuProps.items.push(primaryActionItem);\n }\n if (defaultMenuProps.items.length === 0) {\n // Avoids creating an empty context menu.\n return undefined;\n }\n return defaultMenuProps;\n};\n\n/**\n * A button to open a menu that controls device options.\n *\n * Can be used with {@link ControlBar}.\n *\n * @public\n */\nexport const DevicesButton = (props: DevicesButtonProps): JSX.Element => {\n const {\n onRenderIcon\n } = props;\n const localeStrings = useLocale().strings.devicesButton;\n const strings = {\n ...localeStrings,\n ...props.strings\n };\n const devicesButtonMenu = props.menuProps ?? generateDefaultDeviceMenuProps({\n ...props,\n styles: props.styles?.menuStyles\n }, strings);\n const onRenderOptionsIcon = (): JSX.Element => {\n return <_HighContrastAwareIcon disabled={props.disabled} iconName=\"ControlButtonOptions\" />;\n };\n return <ControlBarButton {...props} menuProps={devicesButtonMenu} menuIconProps={{\n hidden: true\n }} onRenderIcon={onRenderIcon ?? onRenderOptionsIcon} strings={strings} labelKey={props.labelKey ?? 'devicesButtonLabel'} />;\n};\"../../../acs-ui-common/src\""]}
@@ -13,8 +13,6 @@ import React, { useEffect } from 'react';
13
13
  import { IconButton } from '@fluentui/react';
14
14
  import { concatStyleSets, DefaultButton, FocusZone, mergeStyles, Stack, Text, TextField, useTheme } from '@fluentui/react';
15
15
  import { useState } from 'react';
16
- /* @conditional-compile-remove(dialpad) */
17
- import { useLocale } from '../../localization';
18
16
  import { buttonStyles, containerStyles, iconButtonStyles, digitStyles, letterStyles, textFieldStyles } from '../styles/Dialpad.styles';
19
17
  import { formatPhoneNumber } from '../utils/formatPhoneNumber';
20
18
  import useLongPress from '../utils/useLongPress';
@@ -165,11 +163,7 @@ const DialpadContainer = (props) => {
165
163
  * @beta
166
164
  */
167
165
  export const Dialpad = (props) => {
168
- /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */
169
- const localeStrings = useLocale().strings.dialpad;
170
166
  const dialpadLocaleStringsTrampoline = () => {
171
- /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */
172
- return localeStrings;
173
167
  // Even though the component strings type doesn't have `DialpadStrings` in stable build,
174
168
  // the string values exist. So unsafe cast for stable build.
175
169
  return '';
@@ -1 +1 @@
1
- {"version":3,"file":"Dialpad.js","sourceRoot":"","sources":["../../../../../../preprocess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AK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC,CACzL,CAAC;QACf,CAAC,CAAC,CACU,CACR,CAAC;AACX,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAmB,EAAe,EAAE;IAC1D,0CAA0C,CAAC,6CAA6C;IACxF,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC;IAClD,MAAM,8BAA8B,GAAG,GAAmB,EAAE;QAC1D,0CAA0C,CAAC,6CAA6C;QACxF,OAAO,aAAa,CAAC;QACrB,wFAAwF;QACxF,4DAA4D;QAC5D,OAAS,EAAiC,CAAC;IAC7C,CAAC,CAAC;IACF,MAAM,OAAO,mCACR,8BAA8B,EAAE,GAChC,KAAK,CAAC,OAAO,CACjB,CAAC;IACF,OAAO,oBAAC,gBAAgB,kBAAC,OAAO,EAAE,OAAO,IAAM,KAAK,EAAI,CAAC;AAC3D,CAAC,CAAC;AACF,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE;IAC9C,sFAAsF;IACtF,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AACxC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useEffect } from 'react';\nimport { IStyle, IButtonStyles, ITextFieldStyles } from '@fluentui/react';\nimport { IconButton } from '@fluentui/react';\nimport { concatStyleSets, DefaultButton, FocusZone, mergeStyles, Stack, Text, TextField, useTheme } from '@fluentui/react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { useState } from 'react';\n/* @conditional-compile-remove(dialpad) */\nimport { useLocale } from '../../localization';\nimport { buttonStyles, containerStyles, iconButtonStyles, digitStyles, letterStyles, textFieldStyles } from '../styles/Dialpad.styles';\nimport { formatPhoneNumber } from '../utils/formatPhoneNumber';\nimport useLongPress from '../utils/useLongPress';\n\n/**\n * Strings of {@link Dialpad} that can be overridden.\n *\n * @beta\n */\nexport interface DialpadStrings {\n placeholderText: string;\n deleteButtonAriaLabel?: string;\n}\n\n/**\n * Styles for {@link Dialpad} component.\n *\n * @beta\n */\nexport interface DialpadStyles {\n root?: IStyle;\n button?: IButtonStyles;\n textField?: Partial<ITextFieldStyles>;\n digit?: IStyle;\n letter?: IStyle;\n deleteIcon?: IButtonStyles;\n}\n\n/**\n * DTMF tone for PSTN calls.\n *\n * @beta\n */\nexport type DtmfTone = 'A' | 'B' | 'C' | 'D' | 'Flash' | 'Num0' | 'Num1' | 'Num2' | 'Num3' | 'Num4' | 'Num5' | 'Num6' | 'Num7' | 'Num8' | 'Num9' | 'Pound' | 'Star';\n\n/**\n * Props for {@link Dialpad} component.\n *\n * @beta\n */\nexport interface DialpadProps {\n strings?: DialpadStrings;\n /** function to send dtmf tones on button click */\n onSendDtmfTone?: (dtmfTone: DtmfTone) => Promise<void>;\n /** Callback for dialpad button behavior*/\n onClickDialpadButton?: (buttonValue: string, buttonIndex: number) => void;\n /** set dialpad textfield content */\n textFieldValue?: string;\n /** on change function for text field, provides an unformatted plain text*/\n onChange?: (input: string) => void;\n /** boolean input to determine when to show/hide delete button, default true */\n showDeleteButton?: boolean;\n /** boolean input to determine if dialpad is in mobile view, default false */\n isMobile?: boolean;\n styles?: DialpadStyles;\n}\ntype DialpadButtonContent = {\n /** Number displayed on each dialpad button */\n digit: string;\n /** Letters displayed on each dialpad button */\n letter?: string;\n};\nconst dialPadButtonsDefault: DialpadButtonContent[][] = [[{\n digit: '1'\n}, {\n digit: '2',\n letter: 'ABC'\n}, {\n digit: '3',\n letter: 'DEF'\n}], [{\n digit: '4',\n letter: 'GHI'\n}, {\n digit: '5',\n letter: 'JKL'\n}, {\n digit: '6',\n letter: 'MNO'\n}], [{\n digit: '7',\n letter: 'PQRS'\n}, {\n digit: '8',\n letter: 'TUV'\n}, {\n digit: '9',\n letter: 'WXYZ'\n}], [{\n digit: '*'\n}, {\n digit: '0',\n letter: '+'\n}, {\n digit: '#'\n}]];\nconst DtmfTones: DtmfTone[] = ['Num1', 'Num2', 'Num3', 'Num4', 'Num5', 'Num6', 'Num7', 'Num8', 'Num9', 'Star', 'Num0', 'Pound'];\nconst DialpadButton = (props: {\n digit: string;\n letter?: string;\n styles?: DialpadStyles;\n index: number;\n onClick: (input: string, index: number) => void;\n onLongPress: (input: string, index: number) => void;\n isMobile?: boolean;\n}): JSX.Element => {\n const theme = useTheme();\n const {\n digit,\n index,\n onClick,\n onLongPress,\n isMobile = false\n } = props;\n const useLongPressProps = React.useMemo(() => ({\n onClick: async () => {\n onClick(digit, index);\n },\n onLongPress: async () => {\n onLongPress(digit, index);\n },\n touchEventsOnly: isMobile\n }), [digit, index, isMobile, onClick, onLongPress]);\n const longPressHandlers = useLongPress(useLongPressProps);\n return <DefaultButton data-test-id={`dialpad-button-${props.index}`} styles={concatStyleSets(buttonStyles(theme), props.styles?.button)} {...longPressHandlers}>\n <Stack>\n <Text className={mergeStyles(digitStyles(theme), props.styles?.digit)}>{props.digit}</Text>\n\n <Text className={mergeStyles(letterStyles(theme), props.styles?.letter)}>{props.letter ?? ' '}</Text>\n </Stack>\n </DefaultButton>;\n};\nconst DialpadContainer = (props: {\n strings: DialpadStrings;\n onSendDtmfTone?: (dtmfTone: DtmfTone) => Promise<void>;\n /** Callback for dialpad button behavior */\n onClickDialpadButton?: (buttonValue: string, buttonIndex: number) => void;\n /** Pass in custom content to dialpad textfield */\n textFieldValue?: string;\n /** on change function for text field, provides an unformatted plain text */\n onChange?: (input: string) => void;\n /** boolean input to determine when to show/hide delete button, default true */\n showDeleteButton?: boolean;\n /** boolean input to determine if dialpad is in mobile view, default false */\n isMobile?: boolean;\n styles?: DialpadStyles;\n}): JSX.Element => {\n const theme = useTheme();\n const {\n onSendDtmfTone,\n onClickDialpadButton,\n textFieldValue,\n onChange,\n showDeleteButton = true,\n isMobile = false\n } = props;\n const [plainTextValue, setPlainTextValue] = useState(textFieldValue ?? '');\n useEffect(() => {\n if (onChange) {\n onChange(plainTextValue);\n }\n }, [plainTextValue, onChange]);\n useEffect(() => {\n setText(textFieldValue ?? '');\n }, [textFieldValue]);\n const onClickDialpad = (input: string, index: number): void => {\n setText(plainTextValue + input);\n if (onSendDtmfTone) {\n onSendDtmfTone(DtmfTones[index]);\n }\n if (onClickDialpadButton) {\n onClickDialpadButton(input, index);\n }\n };\n const onLongPressDialpad = (input: string, index: number): void => {\n if (input === '0' && index === 10) {\n setText(plainTextValue + '+');\n } else {\n setText(plainTextValue + input);\n }\n if (onSendDtmfTone) {\n onSendDtmfTone(DtmfTones[index]);\n }\n if (onClickDialpadButton) {\n onClickDialpadButton(input, index);\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const setText = (input: string): void => {\n // remove non-valid characters from input: letters,special characters excluding +, *,#\n const plainInput = sanitizeInput(input);\n setPlainTextValue(plainInput);\n };\n const deleteNumbers = (): void => {\n const modifiedInput = plainTextValue.substring(0, plainTextValue.length - 1);\n setText(modifiedInput);\n };\n return <div className={mergeStyles(containerStyles(theme), props.styles?.root)} data-test-id=\"dialpadContainer\" data-ui-id=\"dialpadContainer\">\n <TextField styles={concatStyleSets(textFieldStyles(theme), props.styles?.textField)} value={textFieldValue ? textFieldValue : formatPhoneNumber(plainTextValue)}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange={(e: any) => {\n setText(e.target.value);\n }}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onClick={(e: any) => {\n const input = e.target;\n const end = input.value.length;\n\n // Move focus to end of input field\n input.setSelectionRange(end, end);\n input.focus();\n }} placeholder={props.strings.placeholderText} data-test-id=\"dialpad-input\" onRenderSuffix={(): JSX.Element => <>\n {showDeleteButton && plainTextValue.length !== 0 && <IconButton ariaLabel={props.strings.deleteButtonAriaLabel} onClick={deleteNumbers} styles={concatStyleSets(iconButtonStyles(theme), props.styles?.deleteIcon)} iconProps={{\n iconName: 'DialpadBackspace'\n }} />}\n </>} />\n <FocusZone>\n {dialPadButtonsDefault.map((rows, rowIndex) => {\n return <Stack horizontal key={`row_${rowIndex}`} horizontalAlign=\"stretch\">\n {rows.map((button, columnIndex) => <DialpadButton key={`button_${columnIndex}`}\n /* row index = 0\n columnIndex: (0,1,2) => (0,1,2)\n row index = 1\n columnIndex: (0,1,2)=> (3,4,5)\n row index = 2\n columnIndex: (0,1,2)=> (6,7,8)\n row index = 3\n columnIndex: (0,1,2)=> (9,10,11)\n columnIndex + rowIndex*rows.length calculates the corresponding index for each button\n dialpad index:\n 0 1 2\n 3 4 5\n 6 7 8\n 9 10 11\n then use this index to locate the corresponding dtmf tones\n DtmfTones[index]\n */ index={columnIndex + rowIndex * rows.length} digit={button.digit} letter={button.letter} styles={props.styles} onClick={onClickDialpad} onLongPress={onLongPressDialpad} isMobile={isMobile} />)}\n </Stack>;\n })}\n </FocusZone>\n </div>;\n};\n\n/**\n * A component to allow users to enter phone number through clicking on dialpad/using keyboard\n * It will return empty component for stable builds\n *\n * @beta\n */\nexport const Dialpad = (props: DialpadProps): JSX.Element => {\n /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */\n const localeStrings = useLocale().strings.dialpad;\n const dialpadLocaleStringsTrampoline = (): DialpadStrings => {\n /* @conditional-compile-remove(dialpad) */ /* @conditional-compile-remove(PSTN-calls) */\n return localeStrings;\n // Even though the component strings type doesn't have `DialpadStrings` in stable build,\n // the string values exist. So unsafe cast for stable build.\n return (('' as unknown) as DialpadStrings);\n };\n const strings = {\n ...dialpadLocaleStringsTrampoline(),\n ...props.strings\n };\n return <DialpadContainer strings={strings} {...props} />;\n};\nconst sanitizeInput = (input: string): string => {\n // remove non-valid characters from input: letters,special characters excluding +, *,#\n return input.replace(/[^\\d*#+]/g, '');\n};\"../../../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"Dialpad.js","sourceRoot":"","sources":["../../../../../../preprocess-dist/react-components/src/components/Dialpad/Dialpad.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEzC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,SAAS,EAAE,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAE3H,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,0BAA0B,CAAC;AACvI,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,YAAY,MAAM,uBAAuB,CAAC;AA4DjD,MAAM,qBAAqB,GAA6B,CAAC,CAAC;YACxD,KAAK,EAAE,GAAG;SACX,EAAE;YACD,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,KAAK;SACd,EAAE;YACD,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,KAAK;SACd,CAAC,EAAE,CAAC;YACH,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,KAAK;SACd,EAAE;YACD,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,KAAK;SACd,EAAE;YACD,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,KAAK;SACd,CAAC,EAAE,CAAC;YACH,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,MAAM;SACf,EAAE;YACD,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,KAAK;SACd,EAAE;YACD,KAAK,EAAE,GAAG;YACV,MAAM,EAAE,MAAM;SACf,CAAC,EAAE,CAAC;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AE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,kBAAkB,EAAE,QAAQ,EAAE,QAAQ,GAAI,CAAC,CACzL,CAAC;QACf,CAAC,CAAC,CACU,CACR,CAAC;AACX,CAAC,CAAC;AAEF;;;;;GAKG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAmB,EAAe,EAAE;IAC1D,MAAM,8BAA8B,GAAG,GAAmB,EAAE;QAC1D,wFAAwF;QACxF,4DAA4D;QAC5D,OAAS,EAAiC,CAAC;IAC7C,CAAC,CAAC;IACF,MAAM,OAAO,mCACR,8BAA8B,EAAE,GAChC,KAAK,CAAC,OAAO,CACjB,CAAC;IACF,OAAO,oBAAC,gBAAgB,kBAAC,OAAO,EAAE,OAAO,IAAM,KAAK,EAAI,CAAC;AAC3D,CAAC,CAAC;AACF,MAAM,aAAa,GAAG,CAAC,KAAa,EAAU,EAAE;IAC9C,sFAAsF;IACtF,OAAO,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,EAAE,CAAC,CAAC;AACxC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useEffect } from 'react';\nimport { IStyle, IButtonStyles, ITextFieldStyles } from '@fluentui/react';\nimport { IconButton } from '@fluentui/react';\nimport { concatStyleSets, DefaultButton, FocusZone, mergeStyles, Stack, Text, TextField, useTheme } from '@fluentui/react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { useState } from 'react';\nimport { buttonStyles, containerStyles, iconButtonStyles, digitStyles, letterStyles, textFieldStyles } from '../styles/Dialpad.styles';\nimport { formatPhoneNumber } from '../utils/formatPhoneNumber';\nimport useLongPress from '../utils/useLongPress';\n\n/**\n * Strings of {@link Dialpad} that can be overridden.\n *\n * @beta\n */\nexport interface DialpadStrings {\n placeholderText: string;\n deleteButtonAriaLabel?: string;\n}\n\n/**\n * Styles for {@link Dialpad} component.\n *\n * @beta\n */\nexport interface DialpadStyles {\n root?: IStyle;\n button?: IButtonStyles;\n textField?: Partial<ITextFieldStyles>;\n digit?: IStyle;\n letter?: IStyle;\n deleteIcon?: IButtonStyles;\n}\n\n/**\n * DTMF tone for PSTN calls.\n *\n * @beta\n */\nexport type DtmfTone = 'A' | 'B' | 'C' | 'D' | 'Flash' | 'Num0' | 'Num1' | 'Num2' | 'Num3' | 'Num4' | 'Num5' | 'Num6' | 'Num7' | 'Num8' | 'Num9' | 'Pound' | 'Star';\n\n/**\n * Props for {@link Dialpad} component.\n *\n * @beta\n */\nexport interface DialpadProps {\n strings?: DialpadStrings;\n /** function to send dtmf tones on button click */\n onSendDtmfTone?: (dtmfTone: DtmfTone) => Promise<void>;\n /** Callback for dialpad button behavior*/\n onClickDialpadButton?: (buttonValue: string, buttonIndex: number) => void;\n /** set dialpad textfield content */\n textFieldValue?: string;\n /** on change function for text field, provides an unformatted plain text*/\n onChange?: (input: string) => void;\n /** boolean input to determine when to show/hide delete button, default true */\n showDeleteButton?: boolean;\n /** boolean input to determine if dialpad is in mobile view, default false */\n isMobile?: boolean;\n styles?: DialpadStyles;\n}\ntype DialpadButtonContent = {\n /** Number displayed on each dialpad button */\n digit: string;\n /** Letters displayed on each dialpad button */\n letter?: string;\n};\nconst dialPadButtonsDefault: DialpadButtonContent[][] = [[{\n digit: '1'\n}, {\n digit: '2',\n letter: 'ABC'\n}, {\n digit: '3',\n letter: 'DEF'\n}], [{\n digit: '4',\n letter: 'GHI'\n}, {\n digit: '5',\n letter: 'JKL'\n}, {\n digit: '6',\n letter: 'MNO'\n}], [{\n digit: '7',\n letter: 'PQRS'\n}, {\n digit: '8',\n letter: 'TUV'\n}, {\n digit: '9',\n letter: 'WXYZ'\n}], [{\n digit: '*'\n}, {\n digit: '0',\n letter: '+'\n}, {\n digit: '#'\n}]];\nconst DtmfTones: DtmfTone[] = ['Num1', 'Num2', 'Num3', 'Num4', 'Num5', 'Num6', 'Num7', 'Num8', 'Num9', 'Star', 'Num0', 'Pound'];\nconst DialpadButton = (props: {\n digit: string;\n letter?: string;\n styles?: DialpadStyles;\n index: number;\n onClick: (input: string, index: number) => void;\n onLongPress: (input: string, index: number) => void;\n isMobile?: boolean;\n}): JSX.Element => {\n const theme = useTheme();\n const {\n digit,\n index,\n onClick,\n onLongPress,\n isMobile = false\n } = props;\n const useLongPressProps = React.useMemo(() => ({\n onClick: async () => {\n onClick(digit, index);\n },\n onLongPress: async () => {\n onLongPress(digit, index);\n },\n touchEventsOnly: isMobile\n }), [digit, index, isMobile, onClick, onLongPress]);\n const longPressHandlers = useLongPress(useLongPressProps);\n return <DefaultButton data-test-id={`dialpad-button-${props.index}`} styles={concatStyleSets(buttonStyles(theme), props.styles?.button)} {...longPressHandlers}>\n <Stack>\n <Text className={mergeStyles(digitStyles(theme), props.styles?.digit)}>{props.digit}</Text>\n\n <Text className={mergeStyles(letterStyles(theme), props.styles?.letter)}>{props.letter ?? ' '}</Text>\n </Stack>\n </DefaultButton>;\n};\nconst DialpadContainer = (props: {\n strings: DialpadStrings;\n onSendDtmfTone?: (dtmfTone: DtmfTone) => Promise<void>;\n /** Callback for dialpad button behavior */\n onClickDialpadButton?: (buttonValue: string, buttonIndex: number) => void;\n /** Pass in custom content to dialpad textfield */\n textFieldValue?: string;\n /** on change function for text field, provides an unformatted plain text */\n onChange?: (input: string) => void;\n /** boolean input to determine when to show/hide delete button, default true */\n showDeleteButton?: boolean;\n /** boolean input to determine if dialpad is in mobile view, default false */\n isMobile?: boolean;\n styles?: DialpadStyles;\n}): JSX.Element => {\n const theme = useTheme();\n const {\n onSendDtmfTone,\n onClickDialpadButton,\n textFieldValue,\n onChange,\n showDeleteButton = true,\n isMobile = false\n } = props;\n const [plainTextValue, setPlainTextValue] = useState(textFieldValue ?? '');\n useEffect(() => {\n if (onChange) {\n onChange(plainTextValue);\n }\n }, [plainTextValue, onChange]);\n useEffect(() => {\n setText(textFieldValue ?? '');\n }, [textFieldValue]);\n const onClickDialpad = (input: string, index: number): void => {\n setText(plainTextValue + input);\n if (onSendDtmfTone) {\n onSendDtmfTone(DtmfTones[index]);\n }\n if (onClickDialpadButton) {\n onClickDialpadButton(input, index);\n }\n };\n const onLongPressDialpad = (input: string, index: number): void => {\n if (input === '0' && index === 10) {\n setText(plainTextValue + '+');\n } else {\n setText(plainTextValue + input);\n }\n if (onSendDtmfTone) {\n onSendDtmfTone(DtmfTones[index]);\n }\n if (onClickDialpadButton) {\n onClickDialpadButton(input, index);\n }\n };\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const setText = (input: string): void => {\n // remove non-valid characters from input: letters,special characters excluding +, *,#\n const plainInput = sanitizeInput(input);\n setPlainTextValue(plainInput);\n };\n const deleteNumbers = (): void => {\n const modifiedInput = plainTextValue.substring(0, plainTextValue.length - 1);\n setText(modifiedInput);\n };\n return <div className={mergeStyles(containerStyles(theme), props.styles?.root)} data-test-id=\"dialpadContainer\" data-ui-id=\"dialpadContainer\">\n <TextField styles={concatStyleSets(textFieldStyles(theme), props.styles?.textField)} value={textFieldValue ? textFieldValue : formatPhoneNumber(plainTextValue)}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onChange={(e: any) => {\n setText(e.target.value);\n }}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onClick={(e: any) => {\n const input = e.target;\n const end = input.value.length;\n\n // Move focus to end of input field\n input.setSelectionRange(end, end);\n input.focus();\n }} placeholder={props.strings.placeholderText} data-test-id=\"dialpad-input\" onRenderSuffix={(): JSX.Element => <>\n {showDeleteButton && plainTextValue.length !== 0 && <IconButton ariaLabel={props.strings.deleteButtonAriaLabel} onClick={deleteNumbers} styles={concatStyleSets(iconButtonStyles(theme), props.styles?.deleteIcon)} iconProps={{\n iconName: 'DialpadBackspace'\n }} />}\n </>} />\n <FocusZone>\n {dialPadButtonsDefault.map((rows, rowIndex) => {\n return <Stack horizontal key={`row_${rowIndex}`} horizontalAlign=\"stretch\">\n {rows.map((button, columnIndex) => <DialpadButton key={`button_${columnIndex}`}\n /* row index = 0\n columnIndex: (0,1,2) => (0,1,2)\n row index = 1\n columnIndex: (0,1,2)=> (3,4,5)\n row index = 2\n columnIndex: (0,1,2)=> (6,7,8)\n row index = 3\n columnIndex: (0,1,2)=> (9,10,11)\n columnIndex + rowIndex*rows.length calculates the corresponding index for each button\n dialpad index:\n 0 1 2\n 3 4 5\n 6 7 8\n 9 10 11\n then use this index to locate the corresponding dtmf tones\n DtmfTones[index]\n */ index={columnIndex + rowIndex * rows.length} digit={button.digit} letter={button.letter} styles={props.styles} onClick={onClickDialpad} onLongPress={onLongPressDialpad} isMobile={isMobile} />)}\n </Stack>;\n })}\n </FocusZone>\n </div>;\n};\n\n/**\n * A component to allow users to enter phone number through clicking on dialpad/using keyboard\n * It will return empty component for stable builds\n *\n * @beta\n */\nexport const Dialpad = (props: DialpadProps): JSX.Element => {\n const dialpadLocaleStringsTrampoline = (): DialpadStrings => {\n // Even though the component strings type doesn't have `DialpadStrings` in stable build,\n // the string values exist. So unsafe cast for stable build.\n return (('' as unknown) as DialpadStrings);\n };\n const strings = {\n ...dialpadLocaleStringsTrampoline(),\n ...props.strings\n };\n return <DialpadContainer strings={strings} {...props} />;\n};\nconst sanitizeInput = (input: string): string => {\n // remove non-valid characters from input: letters,special characters excluding +, *,#\n return input.replace(/[^\\d*#+]/g, '');\n};\"../../../../acs-ui-common/src\""]}
@@ -1,7 +1,3 @@
1
- /**
2
- * @beta
3
- */
4
- export declare type FileMetadataAttachmentType = 'fileSharing' | /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ 'inlineImage' | 'unknown';
5
1
  /**
6
2
  * Base interface that all Meta Data should extend.
7
3
  * Typically used for ACS to ACS file transfers.
@@ -22,14 +18,6 @@ export interface BaseFileMetadata {
22
18
  * Download URL for the file.
23
19
  */
24
20
  url: string;
25
- /**
26
- * Unique ID of the file.
27
- */
28
- id: string;
29
- /**
30
- * Attachment Type
31
- */
32
- attachmentType: FileMetadataAttachmentType;
33
21
  }
34
22
  /**
35
23
  * Meta Data containing basic information about the uploaded file.
@@ -37,28 +25,12 @@ export interface BaseFileMetadata {
37
25
  * @beta
38
26
  */
39
27
  export interface FileSharingMetadata extends BaseFileMetadata {
40
- attachmentType: 'fileSharing';
41
- payload?: Record<string, string>;
42
- }
43
- /**
44
- * Meta Data containing data for images.
45
- * @beta
46
- */
47
- export interface ImageFileMetadata extends BaseFileMetadata {
48
- attachmentType: 'inlineImage';
49
- previewUrl?: string;
50
28
  }
51
29
  /**
52
30
  * Meta Data containing information about the uploaded file.
53
31
  * @beta
54
32
  */
55
- export declare type FileMetadata = FileSharingMetadata | /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ ImageFileMetadata;
56
- /**
57
- * @beta
58
- */
59
- export interface AttachmentDownloadResult {
60
- blobUrl: string;
61
- }
33
+ export declare type FileMetadata = FileSharingMetadata;
62
34
  /**
63
35
  * Strings of _FileDownloadCards that can be overridden.
64
36
  *
@@ -12,8 +12,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
12
12
  import { Icon, IconButton, Spinner, SpinnerSize } from '@fluentui/react';
13
13
  import React, { useCallback, useState } from 'react';
14
14
  import { useMemo } from 'react';
15
- /* @conditional-compile-remove(file-sharing) */
16
- import { useLocale } from '../localization';
17
15
  import { _FileCard } from './FileCard';
18
16
  import { _FileCardGroup } from './FileCardGroup';
19
17
  import { iconButtonClassName } from './styles/IconButton.styles';
@@ -37,24 +35,11 @@ export const _FileDownloadCards = (props) => {
37
35
  return (_b = (_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile) !== null && _b !== void 0 ? _b : localeStrings.downloadFile;
38
36
  }, [(_a = props.strings) === null || _a === void 0 ? void 0 : _a.downloadFile, localeStrings.downloadFile]);
39
37
  const isFileSharingAttachment = useCallback((attachment) => {
40
- /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
41
- return attachment.attachmentType === 'fileSharing';
42
38
  return false;
43
39
  }, []);
44
- /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
45
- const isShowDownloadIcon = useCallback((attachment) => {
46
- var _a;
47
- /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
48
- return attachment.attachmentType === 'fileSharing' && ((_a = attachment.payload) === null || _a === void 0 ? void 0 : _a.teamsFileAttachment) !== 'true';
49
- return true;
50
- }, []);
51
40
  const fileCardGroupDescription = useMemo(() => () => {
52
41
  var _a, _b;
53
42
  const fileGroupLocaleString = (_b = (_a = props.strings) === null || _a === void 0 ? void 0 : _a.fileCardGroupMessage) !== null && _b !== void 0 ? _b : localeStrings.fileCardGroupMessage;
54
- /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
55
- return _formatString(fileGroupLocaleString, {
56
- fileCount: `${fileMetadata.filter(isFileSharingAttachment).length}`
57
- });
58
43
  return _formatString(fileGroupLocaleString, {
59
44
  fileCount: `${fileMetadata.length}`
60
45
  });
@@ -80,30 +65,23 @@ export const _FileDownloadCards = (props) => {
80
65
  }
81
66
  }
82
67
  }), [props]);
83
- if (!fileMetadata || fileMetadata.length === 0 || /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ !fileMetadata.some(isFileSharingAttachment)) {
68
+ if (!fileMetadata || fileMetadata.length === 0) {
84
69
  return React.createElement(React.Fragment, null);
85
70
  }
86
71
  return React.createElement("div", { style: fileDownloadCardsStyle, "data-ui-id": "file-download-card-group" },
87
72
  React.createElement(_FileCardGroup, { ariaLabel: fileCardGroupDescription() }, fileMetadata && fileMetadata.filter(attachment => {
88
- /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
89
- return isFileSharingAttachment(attachment);
90
73
  return true;
91
- }).map(file => React.createElement(_FileCard, { fileName: file.name, key: file.name, fileExtension: file.extension, actionIcon: showSpinner ? React.createElement(Spinner, { size: SpinnerSize.medium, "aria-live": 'polite', role: 'status' }) : true && /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
92
- isShowDownloadIcon(file) ? React.createElement(IconButton, { className: iconButtonClassName, ariaLabel: downloadFileButtonString() },
74
+ }).map(file => React.createElement(_FileCard, { fileName: file.name, key: file.name, fileExtension: file.extension, actionIcon: showSpinner ? React.createElement(Spinner, { size: SpinnerSize.medium, "aria-live": 'polite', role: 'status' }) : true ? React.createElement(IconButton, { className: iconButtonClassName, ariaLabel: downloadFileButtonString() },
93
75
  React.createElement(DownloadIconTrampoline, null)) : undefined, actionHandler: () => fileDownloadHandler(userId, file) }))));
94
76
  };
95
77
  /**
96
78
  * @private
97
79
  */
98
80
  const DownloadIconTrampoline = () => {
99
- // @conditional-compile-remove(file-sharing)
100
- return React.createElement(Icon, { "data-ui-id": "file-download-card-download-icon", iconName: "DownloadFile", style: actionIconStyle });
101
81
  // Return _some_ available icon, as the real icon is beta-only.
102
82
  return React.createElement(Icon, { iconName: "EditBoxCancel", style: actionIconStyle });
103
83
  };
104
84
  const useLocaleStringsTrampoline = () => {
105
- /* @conditional-compile-remove(file-sharing) @conditional-compile-remove(teams-inline-images-and-file-sharing)*/
106
- return useLocale().strings.messageThread;
107
85
  return {
108
86
  downloadFile: '',
109
87
  fileCardGroupMessage: ''
@@ -1 +1 @@
1
- {"version":3,"file":"FileDownloadCards.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/FileDownloadCards.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,+CAA+C;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,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BAAC,IAAI,kBAAY,kCAAkC,EAAC,QAAQ,EAAC,cAAc,EAAC,KAAK,EAAE,eAAe,GAAI,CAAC;IAC9G,+DAA+D;IAC/D,OAAO,oBAAC,IAAI,IAAC,QAAQ,EAAC,eAAe,EAAC,KAAK,EAAE,eAAe,GAAI,CAAC;AACnE,CAAC,CAAC;AACF,MAAM,0BAA0B,GAAG,GAA8B,EAAE;IACjE,gHAAgH;IAChH,OAAO,SAAS,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC;IACzC,OAAO;QACL,YAAY,EAAE,EAAE;QAChB,oBAAoB,EAAE,EAAE;KACzB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { Icon, IconButton, Spinner, SpinnerSize } from '@fluentui/react';\nimport React, { useCallback, useState } from 'react';\nimport { useMemo } from 'react';\n/* @conditional-compile-remove(file-sharing) */\nimport { useLocale } from '../localization';\nimport { _FileCard } from './FileCard';\nimport { _FileCardGroup } from './FileCardGroup';\nimport { iconButtonClassName } from './styles/IconButton.styles';\nimport { _formatString } from '@internal/acs-ui-common';\n\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n/**\n * @beta\n */\nexport type FileMetadataAttachmentType = 'fileSharing' | /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */'inlineImage' | 'unknown';\n\n/**\n * Base interface that all Meta Data should extend.\n * Typically used for ACS to ACS file transfers.\n * @beta\n */\nexport interface BaseFileMetadata {\n /**\n * File name to be displayed.\n */\n name: string;\n /**\n * Extension is used for rendering the file icon.\n * An unknown extension will be rendered as a generic icon.\n * Example: `jpeg`\n */\n extension: string;\n /**\n * Download URL for the file.\n */\n url: string;\n /**\n * Unique ID of the file.\n */\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n id: string;\n /**\n * Attachment Type\n */\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n attachmentType: FileMetadataAttachmentType;\n}\n/**\n * Meta Data containing basic information about the uploaded file.\n * Typically used for ACS to ACS file transfers.\n * @beta\n */\nexport interface FileSharingMetadata extends BaseFileMetadata {\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n attachmentType: 'fileSharing';\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n /*\n * Optional dictionary of meta data asscoiated with the file.\n */\n payload?: Record<string, string>;\n}\n\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n/**\n * Meta Data containing data for images.\n * @beta\n */\nexport interface ImageFileMetadata extends BaseFileMetadata {\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n /*\n * Attachment type of the file.\n * Possible values {@link FileDownloadHandler}.\n */\n attachmentType: 'inlineImage';\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n /*\n * Preview URL for the file.\n * Used in the message bubble for inline images.\n */\n previewUrl?: string;\n}\n\n/**\n * Meta Data containing information about the uploaded file.\n * @beta\n */\nexport type FileMetadata = FileSharingMetadata | /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ImageFileMetadata;\n\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n/**\n * @beta\n */\nexport interface AttachmentDownloadResult {\n blobUrl: string;\n}\n\n/**\n * Strings of _FileDownloadCards that can be overridden.\n *\n * @internal\n */\nexport interface _FileDownloadCardsStrings {\n /** Aria label to notify user when focus is on file download button. */\n downloadFile: string;\n fileCardGroupMessage: string;\n}\n\n/**\n * @beta\n * A file download error returned via a {@link FileDownloadHandler}.\n * This error message is used to render an error message in the UI.\n */\nexport interface FileDownloadError {\n /** The error message to display in the UI */\n errorMessage: string;\n}\n\n/**\n * @beta\n *\n * A callback function for handling file downloads.\n * The function needs to return a promise that resolves to a file download URL.\n * If the promise is rejected, the {@link Error.message} will be used to display an error message to the user.\n *\n * @example\n * ```ts\n * const fileDownloadHandler: FileDownloadHandler = async (userId, fileData) => {\n * if (isUnauthorizedUser(userId)) {\n * return { errorMessage: 'You don’t have permission to download this file.' };\n * } else {\n * return new URL(fileData.url);\n * }\n * }\n *\n * const App = () => (\n * <ChatComposite\n * ...\n * fileSharing={{\n * fileDownloadHandler: fileDownloadHandler\n * }}\n * />\n * )\n *\n * ```\n * @param userId - The user ID of the user downloading the file.\n * @param fileMetadata - The {@link FileMetadata} containing file `url`, `extension` and `name`.\n */\nexport type FileDownloadHandler = (userId: string, fileMetadata: FileMetadata) => Promise<URL | FileDownloadError>;\n\n/**\n * @internal\n */\nexport interface _FileDownloadCards {\n /**\n * User id of the local participant\n */\n userId: string;\n /**\n * A chat message metadata that inculdes file metadata\n */\n fileMetadata: FileMetadata[];\n /**\n * A function of type {@link FileDownloadHandler} for handling file downloads.\n * If the function is not specified, the file's `url` will be opened in a new tab to\n * initiate the download.\n */\n downloadHandler?: FileDownloadHandler;\n /**\n * Optional callback that runs if downloadHandler returns {@link FileDownloadError}.\n */\n onDownloadErrorMessage?: (errMsg: string) => void;\n /**\n * Optional arialabel strings for file download cards\n */\n strings?: _FileDownloadCardsStrings;\n}\nconst fileDownloadCardsStyle = {\n marginTop: '0.25rem'\n};\nconst actionIconStyle = {\n height: '1rem'\n};\n\n/**\n * @internal\n */\nexport const _FileDownloadCards = (props: _FileDownloadCards): JSX.Element => {\n const {\n userId,\n fileMetadata\n } = props;\n const [showSpinner, setShowSpinner] = useState(false);\n const localeStrings = useLocaleStringsTrampoline();\n const downloadFileButtonString = useMemo(() => () => {\n return props.strings?.downloadFile ?? localeStrings.downloadFile;\n }, [props.strings?.downloadFile, localeStrings.downloadFile]);\n const isFileSharingAttachment = useCallback((attachment: FileMetadata): boolean => {\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n return attachment.attachmentType === 'fileSharing';\n return false;\n }, []);\n\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n const isShowDownloadIcon = useCallback((attachment: FileMetadata): boolean => {\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n return attachment.attachmentType === 'fileSharing' && attachment.payload?.teamsFileAttachment !== 'true';\n return true;\n }, []);\n const fileCardGroupDescription = useMemo(() => () => {\n const fileGroupLocaleString = props.strings?.fileCardGroupMessage ?? localeStrings.fileCardGroupMessage;\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n return _formatString(fileGroupLocaleString, {\n fileCount: `${fileMetadata.filter(isFileSharingAttachment).length}`\n });\n return _formatString(fileGroupLocaleString, {\n fileCount: `${fileMetadata.length}`\n });\n }, [props.strings?.fileCardGroupMessage, localeStrings.fileCardGroupMessage, fileMetadata, isFileSharingAttachment]);\n const fileDownloadHandler = useCallback(async (userId, file: FileMetadata) => {\n if (!props.downloadHandler) {\n window.open(file.url, '_blank', 'noopener,noreferrer');\n } else {\n setShowSpinner(true);\n try {\n const response = await props.downloadHandler(userId, file);\n setShowSpinner(false);\n if (response instanceof URL) {\n window.open(response.toString(), '_blank', 'noopener,noreferrer');\n } else {\n props.onDownloadErrorMessage && props.onDownloadErrorMessage(response.errorMessage);\n }\n } finally {\n setShowSpinner(false);\n }\n }\n }, [props]);\n if (!fileMetadata || fileMetadata.length === 0 || /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */!fileMetadata.some(isFileSharingAttachment)) {\n return <></>;\n }\n return <div style={fileDownloadCardsStyle} data-ui-id=\"file-download-card-group\">\n <_FileCardGroup ariaLabel={fileCardGroupDescription()}>\n {fileMetadata && fileMetadata.filter(attachment => {\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n return isFileSharingAttachment(attachment);\n return true;\n }).map(file => <_FileCard fileName={file.name} key={file.name} fileExtension={file.extension} actionIcon={showSpinner ? <Spinner size={SpinnerSize.medium} aria-live={'polite'} role={'status'} /> : true && /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n isShowDownloadIcon(file) ? <IconButton className={iconButtonClassName} ariaLabel={downloadFileButtonString()}>\n <DownloadIconTrampoline />\n </IconButton> : undefined} actionHandler={() => fileDownloadHandler(userId, file)} />)}\n </_FileCardGroup>\n </div>;\n};\n\n/**\n * @private\n */\nconst DownloadIconTrampoline = (): JSX.Element => {\n // @conditional-compile-remove(file-sharing)\n return <Icon data-ui-id=\"file-download-card-download-icon\" iconName=\"DownloadFile\" style={actionIconStyle} />;\n // Return _some_ available icon, as the real icon is beta-only.\n return <Icon iconName=\"EditBoxCancel\" style={actionIconStyle} />;\n};\nconst useLocaleStringsTrampoline = (): _FileDownloadCardsStrings => {\n /* @conditional-compile-remove(file-sharing) @conditional-compile-remove(teams-inline-images-and-file-sharing)*/\n return useLocale().strings.messageThread;\n return {\n downloadFile: '',\n fileCardGroupMessage: ''\n };\n};\"../../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"FileDownloadCards.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/FileDownloadCards.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,mCAAgC;AAuHxD,MAAM,sBAAsB,GAAG;IAC7B,SAAS,EAAE,SAAS;CACrB,CAAC;AACF,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,MAAM;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAyB,EAAe,EAAE;;IAC3E,MAAM,EACJ,MAAM,EACN,YAAY,EACb,GAAG,KAAK,CAAC;IACV,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAA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,IAAI,CAAC,GAAI,CAAC,CACnF,CACb,CAAC;AACX,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,sBAAsB,GAAG,GAAgB,EAAE;IAC/C,+DAA+D;IAC/D,OAAO,oBAAC,IAAI,IAAC,QAAQ,EAAC,eAAe,EAAC,KAAK,EAAE,eAAe,GAAI,CAAC;AACnE,CAAC,CAAC;AACF,MAAM,0BAA0B,GAAG,GAA8B,EAAE;IACjE,OAAO;QACL,YAAY,EAAE,EAAE;QAChB,oBAAoB,EAAE,EAAE;KACzB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { Icon, IconButton, Spinner, SpinnerSize } from '@fluentui/react';\nimport React, { useCallback, useState } from 'react';\nimport { useMemo } from 'react';\nimport { _FileCard } from './FileCard';\nimport { _FileCardGroup } from './FileCardGroup';\nimport { iconButtonClassName } from './styles/IconButton.styles';\nimport { _formatString } from '@internal/acs-ui-common';\n/**\n * Base interface that all Meta Data should extend.\n * Typically used for ACS to ACS file transfers.\n * @beta\n */\nexport interface BaseFileMetadata {\n /**\n * File name to be displayed.\n */\n name: string;\n /**\n * Extension is used for rendering the file icon.\n * An unknown extension will be rendered as a generic icon.\n * Example: `jpeg`\n */\n extension: string;\n /**\n * Download URL for the file.\n */\n url: string;\n /**\n * Unique ID of the file.\n */\n /**\n * Attachment Type\n */\n}\n/**\n * Meta Data containing basic information about the uploaded file.\n * Typically used for ACS to ACS file transfers.\n * @beta\n */\nexport interface FileSharingMetadata extends BaseFileMetadata {}\n/**\n * Meta Data containing information about the uploaded file.\n * @beta\n */\nexport type FileMetadata = FileSharingMetadata;\n/**\n * Strings of _FileDownloadCards that can be overridden.\n *\n * @internal\n */\nexport interface _FileDownloadCardsStrings {\n /** Aria label to notify user when focus is on file download button. */\n downloadFile: string;\n fileCardGroupMessage: string;\n}\n\n/**\n * @beta\n * A file download error returned via a {@link FileDownloadHandler}.\n * This error message is used to render an error message in the UI.\n */\nexport interface FileDownloadError {\n /** The error message to display in the UI */\n errorMessage: string;\n}\n\n/**\n * @beta\n *\n * A callback function for handling file downloads.\n * The function needs to return a promise that resolves to a file download URL.\n * If the promise is rejected, the {@link Error.message} will be used to display an error message to the user.\n *\n * @example\n * ```ts\n * const fileDownloadHandler: FileDownloadHandler = async (userId, fileData) => {\n * if (isUnauthorizedUser(userId)) {\n * return { errorMessage: 'You don’t have permission to download this file.' };\n * } else {\n * return new URL(fileData.url);\n * }\n * }\n *\n * const App = () => (\n * <ChatComposite\n * ...\n * fileSharing={{\n * fileDownloadHandler: fileDownloadHandler\n * }}\n * />\n * )\n *\n * ```\n * @param userId - The user ID of the user downloading the file.\n * @param fileMetadata - The {@link FileMetadata} containing file `url`, `extension` and `name`.\n */\nexport type FileDownloadHandler = (userId: string, fileMetadata: FileMetadata) => Promise<URL | FileDownloadError>;\n\n/**\n * @internal\n */\nexport interface _FileDownloadCards {\n /**\n * User id of the local participant\n */\n userId: string;\n /**\n * A chat message metadata that inculdes file metadata\n */\n fileMetadata: FileMetadata[];\n /**\n * A function of type {@link FileDownloadHandler} for handling file downloads.\n * If the function is not specified, the file's `url` will be opened in a new tab to\n * initiate the download.\n */\n downloadHandler?: FileDownloadHandler;\n /**\n * Optional callback that runs if downloadHandler returns {@link FileDownloadError}.\n */\n onDownloadErrorMessage?: (errMsg: string) => void;\n /**\n * Optional arialabel strings for file download cards\n */\n strings?: _FileDownloadCardsStrings;\n}\nconst fileDownloadCardsStyle = {\n marginTop: '0.25rem'\n};\nconst actionIconStyle = {\n height: '1rem'\n};\n\n/**\n * @internal\n */\nexport const _FileDownloadCards = (props: _FileDownloadCards): JSX.Element => {\n const {\n userId,\n fileMetadata\n } = props;\n const [showSpinner, setShowSpinner] = useState(false);\n const localeStrings = useLocaleStringsTrampoline();\n const downloadFileButtonString = useMemo(() => () => {\n return props.strings?.downloadFile ?? localeStrings.downloadFile;\n }, [props.strings?.downloadFile, localeStrings.downloadFile]);\n const isFileSharingAttachment = useCallback((attachment: FileMetadata): boolean => {\n return false;\n }, []);\n const fileCardGroupDescription = useMemo(() => () => {\n const fileGroupLocaleString = props.strings?.fileCardGroupMessage ?? localeStrings.fileCardGroupMessage;\n return _formatString(fileGroupLocaleString, {\n fileCount: `${fileMetadata.length}`\n });\n }, [props.strings?.fileCardGroupMessage, localeStrings.fileCardGroupMessage, fileMetadata, isFileSharingAttachment]);\n const fileDownloadHandler = useCallback(async (userId, file: FileMetadata) => {\n if (!props.downloadHandler) {\n window.open(file.url, '_blank', 'noopener,noreferrer');\n } else {\n setShowSpinner(true);\n try {\n const response = await props.downloadHandler(userId, file);\n setShowSpinner(false);\n if (response instanceof URL) {\n window.open(response.toString(), '_blank', 'noopener,noreferrer');\n } else {\n props.onDownloadErrorMessage && props.onDownloadErrorMessage(response.errorMessage);\n }\n } finally {\n setShowSpinner(false);\n }\n }\n }, [props]);\n if (!fileMetadata || fileMetadata.length === 0) {\n return <></>;\n }\n return <div style={fileDownloadCardsStyle} data-ui-id=\"file-download-card-group\">\n <_FileCardGroup ariaLabel={fileCardGroupDescription()}>\n {fileMetadata && fileMetadata.filter(attachment => {\n return true;\n }).map(file => <_FileCard fileName={file.name} key={file.name} fileExtension={file.extension} actionIcon={showSpinner ? <Spinner size={SpinnerSize.medium} aria-live={'polite'} role={'status'} /> : true ? <IconButton className={iconButtonClassName} ariaLabel={downloadFileButtonString()}>\n <DownloadIconTrampoline />\n </IconButton> : undefined} actionHandler={() => fileDownloadHandler(userId, file)} />)}\n </_FileCardGroup>\n </div>;\n};\n\n/**\n * @private\n */\nconst DownloadIconTrampoline = (): JSX.Element => {\n // Return _some_ available icon, as the real icon is beta-only.\n return <Icon iconName=\"EditBoxCancel\" style={actionIconStyle} />;\n};\nconst useLocaleStringsTrampoline = (): _FileDownloadCardsStrings => {\n return {\n downloadFile: '',\n fileCardGroupMessage: ''\n };\n};\"../../../acs-ui-common/src\""]}
@@ -1,7 +1,6 @@
1
1
  import React, { ReactNode, FormEvent } from 'react';
2
2
  import { IStyle, ITextField } from '@fluentui/react';
3
3
  import { BaseCustomStyles } from '../types';
4
- import { MentionLookupOptions } from './MentionPopover';
5
4
  /**
6
5
  * @private
7
6
  */
@@ -34,7 +33,6 @@ declare type InputBoxComponentProps = {
34
33
  disabled?: boolean;
35
34
  styles?: InputBoxStylesProps;
36
35
  autoFocus?: 'sendBoxTextField';
37
- mentionLookupOptions?: MentionLookupOptions;
38
36
  };
39
37
  /**
40
38
  * @private