@azure/communication-react 1.7.0-beta.1 → 1.7.0-beta.2

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 (264) hide show
  1. package/dist/communication-react.d.ts +61 -26
  2. package/dist/dist-cjs/communication-react/index.js +424 -227
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/areEqual.d.ts +0 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  6. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  7. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js +10 -0
  8. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map +1 -1
  9. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.d.ts +0 -1
  10. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +11 -2
  11. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
  12. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js +1 -1
  13. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js.map +1 -1
  14. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +2 -1
  15. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
  16. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js +6 -2
  17. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js.map +1 -1
  18. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +2 -1
  19. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  20. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  21. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.d.ts +0 -1
  22. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js +18 -2
  23. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js.map +1 -1
  24. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.d.ts +5 -0
  25. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +37 -15
  26. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  27. package/dist/dist-esm/communication-react/src/index.d.ts +1 -1
  28. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  29. package/dist/dist-esm/communication-react/src/mergedHooks.d.ts +0 -1
  30. package/dist/dist-esm/northstar-wrapper/src/index.js +1 -1
  31. package/dist/dist-esm/react-components/src/components/Announcer/Announcer.d.ts +0 -1
  32. package/dist/dist-esm/react-components/src/components/Announcer/LiveMessage.d.ts +0 -1
  33. package/dist/dist-esm/react-components/src/components/Announcer/MessageBlock.d.ts +0 -1
  34. package/dist/dist-esm/react-components/src/components/Announcer.d.ts +0 -1
  35. package/dist/dist-esm/react-components/src/components/CameraButton.d.ts +0 -1
  36. package/dist/dist-esm/react-components/src/components/Caption.d.ts +0 -1
  37. package/dist/dist-esm/react-components/src/components/CaptionsBanner.d.ts +6 -2
  38. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +3 -3
  39. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
  40. package/dist/dist-esm/react-components/src/components/CaptionsSettingsModal.d.ts +0 -1
  41. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageActionsFlyout.d.ts +0 -1
  42. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.d.ts +0 -1
  43. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.d.ts +0 -1
  44. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +0 -1
  45. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +5 -2
  46. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  47. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.d.ts +0 -1
  48. package/dist/dist-esm/react-components/src/components/ComplianceBanner/BannerMessage.d.ts +0 -1
  49. package/dist/dist-esm/react-components/src/components/ComplianceBanner/ComplianceBanner.d.ts +0 -1
  50. package/dist/dist-esm/react-components/src/components/ComplianceBanner/DelayedUpdateBanner.d.ts +0 -1
  51. package/dist/dist-esm/react-components/src/components/ControlBarButton.d.ts +0 -1
  52. package/dist/dist-esm/react-components/src/components/ControlButtonTooltip.d.ts +0 -1
  53. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.d.ts +0 -1
  54. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.d.ts +0 -1
  55. package/dist/dist-esm/react-components/src/components/DevicePermissions/DevicePermissionDropdown.d.ts +0 -1
  56. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.d.ts +0 -1
  57. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.d.ts +0 -1
  58. package/dist/dist-esm/react-components/src/components/DevicesButton.d.ts +0 -1
  59. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.d.ts +0 -1
  60. package/dist/dist-esm/react-components/src/components/Drawer/DrawerLightDismiss.d.ts +0 -1
  61. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenu.d.ts +0 -1
  62. package/dist/dist-esm/react-components/src/components/EndCallButton.d.ts +0 -1
  63. package/dist/dist-esm/react-components/src/components/ErrorBar.d.ts +5 -1
  64. package/dist/dist-esm/react-components/src/components/ErrorBar.js +5 -2
  65. package/dist/dist-esm/react-components/src/components/ErrorBar.js.map +1 -1
  66. package/dist/dist-esm/react-components/src/components/FileCard.d.ts +0 -1
  67. package/dist/dist-esm/react-components/src/components/FileDownloadCards.d.ts +33 -6
  68. package/dist/dist-esm/react-components/src/components/FileDownloadCards.js +18 -5
  69. package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +1 -1
  70. package/dist/dist-esm/react-components/src/components/FileUploadCards.d.ts +0 -1
  71. package/dist/dist-esm/react-components/src/components/HighContrastAwareIcon.d.ts +0 -1
  72. package/dist/dist-esm/react-components/src/components/HoldButton.d.ts +0 -1
  73. package/dist/dist-esm/react-components/src/components/LocalVideoCameraButton.d.ts +0 -1
  74. package/dist/dist-esm/react-components/src/components/MentionPopover.js +15 -16
  75. package/dist/dist-esm/react-components/src/components/MentionPopover.js.map +1 -1
  76. package/dist/dist-esm/react-components/src/components/MessageStatusIndicator.d.ts +0 -1
  77. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +0 -1
  78. package/dist/dist-esm/react-components/src/components/MessageThread.js +1 -1
  79. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  80. package/dist/dist-esm/react-components/src/components/MicrophoneButton.d.ts +0 -1
  81. package/dist/dist-esm/react-components/src/components/ParticipantItem.d.ts +1 -2
  82. package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
  83. package/dist/dist-esm/react-components/src/components/ParticipantList.d.ts +1 -2
  84. package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
  85. package/dist/dist-esm/react-components/src/components/ParticipantsButton.d.ts +1 -2
  86. package/dist/dist-esm/react-components/src/components/ParticipantsButton.js.map +1 -1
  87. package/dist/dist-esm/react-components/src/components/PictureInPictureInPicture/PictureInPictureInPicture.d.ts +0 -1
  88. package/dist/dist-esm/react-components/src/components/ScreenShareButton.d.ts +0 -1
  89. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.d.ts +0 -1
  90. package/dist/dist-esm/react-components/src/components/SendBoxErrors.d.ts +0 -1
  91. package/dist/dist-esm/react-components/src/components/StartCaptionsButton.d.ts +0 -1
  92. package/dist/dist-esm/react-components/src/components/StreamMedia.d.ts +0 -1
  93. package/dist/dist-esm/react-components/src/components/SystemMessage.d.ts +0 -1
  94. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +50 -22
  95. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +1 -1
  96. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js +45 -17
  97. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js.map +1 -1
  98. package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.d.ts +0 -1
  99. package/dist/dist-esm/react-components/src/components/TypingIndicator.d.ts +0 -1
  100. package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.d.ts +0 -1
  101. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.d.ts +0 -1
  102. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.d.ts +0 -1
  103. package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.d.ts +0 -1
  104. package/dist/dist-esm/react-components/src/components/VideoEffects/PresetVideoEffectsItems.d.ts +0 -1
  105. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.d.ts +0 -1
  106. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js +3 -2
  107. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js.map +1 -1
  108. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.d.ts +0 -1
  109. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.d.ts +0 -1
  110. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.d.ts +0 -1
  111. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.d.ts +0 -1
  112. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.d.ts +0 -1
  113. package/dist/dist-esm/react-components/src/components/VideoGallery/OverflowGallery.d.ts +0 -1
  114. package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.d.ts +0 -1
  115. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +5 -1
  116. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js.map +1 -1
  117. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +0 -1
  118. package/dist/dist-esm/react-components/src/components/styles/Captions.style.d.ts +2 -1
  119. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js +5 -1
  120. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js.map +1 -1
  121. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js +2 -1
  122. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js.map +1 -1
  123. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +5 -0
  124. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  125. package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/strings.json +2 -2
  126. package/dist/dist-esm/react-components/src/theming/icons.d.ts +0 -1
  127. package/dist/dist-esm/react-components/src/types/OnRender.d.ts +0 -1
  128. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +0 -1
  129. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +21 -7
  130. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  131. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +10 -1
  132. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  133. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  134. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.d.ts +3 -2
  135. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +13 -11
  136. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  137. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.d.ts +1 -1
  138. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +1 -1
  139. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  140. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.d.ts +0 -1
  141. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.d.ts +0 -1
  142. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.d.ts +1 -1
  143. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js +2 -2
  144. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js.map +1 -1
  145. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.d.ts +0 -1
  146. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ExpandedLocalVideoTile.d.ts +0 -1
  147. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/HoldPane.d.ts +0 -1
  148. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LobbyTile.d.ts +0 -1
  149. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.d.ts +0 -1
  150. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.d.ts +0 -1
  151. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.d.ts +0 -1
  152. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.d.ts +0 -1
  153. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +5 -2
  154. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  155. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MutedNotification.d.ts +0 -1
  156. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.d.ts +0 -1
  157. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.d.ts +0 -1
  158. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.d.ts +2 -1
  159. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js +13 -19
  160. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js.map +1 -1
  161. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/StartCallButton.d.ts +0 -1
  162. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.d.ts +0 -1
  163. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.d.ts +0 -1
  164. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.d.ts +0 -1
  165. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.d.ts +0 -1
  166. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.d.ts +0 -1
  167. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Participants.d.ts +0 -1
  168. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/People.d.ts +0 -1
  169. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.d.ts +0 -1
  170. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/usePropsFor.d.ts +0 -1
  171. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.d.ts +3 -2
  172. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +2 -4
  173. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  174. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.d.ts +3 -1
  175. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +7 -5
  176. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  177. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.d.ts +3 -1
  178. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js +2 -4
  179. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js.map +1 -1
  180. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.d.ts +3 -1
  181. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js +2 -4
  182. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js.map +1 -1
  183. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/NoticePage.d.ts +0 -1
  184. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.d.ts +0 -1
  185. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js +2 -2
  186. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js.map +1 -1
  187. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.d.ts +0 -1
  188. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/lobbySelector.d.ts +3 -0
  189. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localAndRemotePIPSelector.d.ts +3 -0
  190. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localVideoStreamSelector.d.ts +2 -0
  191. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localVideoStreamSelector.js +3 -1
  192. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localVideoStreamSelector.js.map +1 -1
  193. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/networkReconnectTileSelector.d.ts +3 -0
  194. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.d.ts +5 -1
  195. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js +14 -4
  196. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js.map +1 -1
  197. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/ErrorTracking.d.ts +9 -0
  198. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/ErrorTracking.js +4 -0
  199. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/ErrorTracking.js.map +1 -0
  200. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/TrackErrors.d.ts +21 -0
  201. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/TrackErrors.js +43 -0
  202. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/TrackErrors.js.map +1 -0
  203. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +2 -13
  204. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +0 -14
  205. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  206. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/index.d.ts +1 -0
  207. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/index.js +1 -0
  208. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/index.js.map +1 -1
  209. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +0 -1
  210. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +6 -2
  211. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  212. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButton.d.ts +0 -1
  213. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButtonWithUnreadMessagesBadge.d.ts +3 -5
  214. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButtonWithUnreadMessagesBadge.js +4 -26
  215. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButtonWithUnreadMessagesBadge.js.map +1 -1
  216. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/NotificationIcon.d.ts +0 -1
  217. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/useUnreadMessagesTracker.d.ts +7 -0
  218. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/useUnreadMessagesTracker.js +32 -0
  219. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/useUnreadMessagesTracker.js.map +1 -0
  220. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts +0 -1
  221. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatHeader.d.ts +0 -1
  222. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.d.ts +0 -1
  223. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +1 -1
  224. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  225. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.d.ts +0 -1
  226. package/dist/dist-esm/react-composites/src/composites/ChatComposite/FileDownloadErrorBar.d.ts +0 -1
  227. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadButton.d.ts +0 -1
  228. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/usePropsFor.d.ts +0 -1
  229. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.d.ts +0 -1
  230. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.d.ts +0 -1
  231. package/dist/dist-esm/react-composites/src/composites/common/AvatarPersona.d.ts +0 -1
  232. package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.d.ts +0 -1
  233. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.d.ts +0 -1
  234. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.js +1 -1
  235. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.js.map +1 -1
  236. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBannerMoreButton.d.ts +0 -1
  237. package/dist/dist-esm/react-composites/src/composites/common/CaptionsSettingsModal.d.ts +0 -1
  238. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.d.ts +1 -1
  239. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +1 -1
  240. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  241. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.d.ts +0 -1
  242. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/PeopleButton.d.ts +0 -1
  243. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.d.ts +0 -1
  244. package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.d.ts +0 -1
  245. package/dist/dist-esm/react-composites/src/composites/common/Drawer/SpokenLanguageDrawer.d.ts +0 -1
  246. package/dist/dist-esm/react-composites/src/composites/common/HiddenFocusStartPoint.d.ts +0 -1
  247. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.d.ts +0 -1
  248. package/dist/dist-esm/react-composites/src/composites/common/MoreButton.d.ts +0 -1
  249. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.d.ts +0 -1
  250. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.d.ts +0 -1
  251. package/dist/dist-esm/react-composites/src/composites/common/SendDtmfDialpad.d.ts +0 -1
  252. package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.d.ts +0 -1
  253. package/dist/dist-esm/react-composites/src/composites/common/TabHeader.d.ts +0 -1
  254. package/dist/dist-esm/react-composites/src/composites/common/TabHeader.js +2 -2
  255. package/dist/dist-esm/react-composites/src/composites/common/TabHeader.js.map +1 -1
  256. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.d.ts +4 -5
  257. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +22 -12
  258. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  259. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +0 -1
  260. package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +2 -2
  261. package/package.json +21 -22
  262. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/videoBackgroundErrorsSelector.d.ts +0 -7
  263. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/videoBackgroundErrorsSelector.js +0 -14
  264. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/videoBackgroundErrorsSelector.js.map +0 -1
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IContextualMenuItem, IStyle, PersonaPresence } from '@fluentui/react';
3
2
  import { BaseCustomStyles, OnRenderAvatarCallback } from '../types';
4
3
  import { ParticipantState } from '../types';
@@ -76,7 +75,7 @@ export interface ParticipantItemProps {
76
75
  * Optional callback when component is clicked
77
76
  */
78
77
  onClick?: (props?: ParticipantItemProps) => void;
79
- /** prop to determine if we should show tooltip for participants or not */
78
+ /** Optional value to determine if the tooltip should be shown for participants or not */
80
79
  showParticipantOverflowTooltip?: boolean;
81
80
  /**
82
81
  * Optional value to determine and display a participants connection status.
@@ -1 +1 @@
1
- {"version":3,"file":"ParticipantItem.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/ParticipantItem.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,IAAI,EAA+B,WAAW,EAAE,OAAO,EAAmB,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACtK,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,4BAA4B,EAAE,MAAM,iCAAiC,CAAC;AACpN,OAAO,EAAE,sBAAs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ACjC,UAAU;YACX,oBAAC,cAAc,IAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,CAAC,eAAe,EAAE,SAAS,EAAE,mBAAmB,EAAE,YAAY,EAAE;oBACtO,qBAAqB;iBACtB,GAAI,CACE,CACD,CACJ,CAAC;AACX,CAAC,CAAC;AACF,MAAM,gCAAgC,GAAG,CAAC,KAA2B,EAAE,OAA+B,EAAsB,EAAE;IAC5H,mDAAmD;IACnD,6CAA6C;IAC7C,OAAO,KAAK,CAAC,gBAAgB,KAAK,YAAY,IAAI,KAAK,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,uBAAuB,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1M,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ContextualMenu, DirectionalHint, Icon, IContextualMenuItem, IStyle, mergeStyles, Persona, PersonaPresence, PersonaSize, Stack, Text } from '@fluentui/react';\nimport React, { useMemo, useRef, useState } from 'react';\nimport { useIdentifiers } from '../identifiers';\nimport { useLocale } from '../localization';\nimport { useTheme } from '../theming';\nimport { BaseCustomStyles, OnRenderAvatarCallback } from '../types';\nimport { iconContainerStyle, iconStyles, meContainerStyle, menuButtonContainerStyle, participantItemContainerStyle, participantStateMaxWidth, participantStateStringStyles } from './styles/ParticipantItem.styles';\nimport { _preventDismissOnEvent as preventDismissOnEvent } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(one-to-n-calling) */\n/* @conditional-compile-remove(PSTN-calls) */\nimport { ParticipantState } from '../types';\nimport { useId } from '@fluentui/react-hooks';\n\n/**\n * Fluent styles for {@link ParticipantItem}.\n *\n * @public\n */\nexport interface ParticipantItemStyles extends BaseCustomStyles {\n /** Styles for the avatar. */\n avatar?: IStyle;\n /** Styles for the (You) string. */\n me?: IStyle;\n /** Styles for the container of the icon. */\n iconContainer?: IStyle;\n /** Styles for the menu. */\n menu?: IStyle;\n}\n\n/**\n * Strings of {@link ParticipantItem} that can be overridden.\n *\n * @public\n */\nexport interface ParticipantItemStrings {\n /** String shown when participant is me */\n isMeText: string;\n /** String shown when hovering over menu button */\n menuTitle: string;\n /** Label for the remove button in participant menu */\n removeButtonLabel: string;\n /** Label for the sharing icon in participant state stack */\n sharingIconLabel: string;\n /** Label for the muted icon in participant state stack */\n mutedIconLabel: string;\n /** placeholder text for participants who does not have a display name*/\n displayNamePlaceholder?: string;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /** String shown when `participantState` is `Ringing` */\n participantStateRinging?: string;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /** String shown when `participantState` is `Hold` */\n participantStateHold?: string;\n}\n\n/**\n * Props for {@link ParticipantItem}.\n *\n * @public\n */\nexport interface ParticipantItemProps {\n /** Unique User ID of the participant. This `userId` is available in the `onRenderAvatar` callback function */\n userId?: string;\n /** Name of participant. */\n displayName?: string;\n /** Optional indicator to show participant is the user. */\n me?: boolean;\n /** Optional callback returning a JSX element to override avatar. */\n onRenderAvatar?: OnRenderAvatarCallback;\n /** Optional array of IContextualMenuItem for contextual menu. */\n menuItems?: IContextualMenuItem[];\n /** Optional callback returning a JSX element rendered on the right portion of the ParticipantItem. Intended for adding icons. */\n onRenderIcon?: (props?: ParticipantItemProps) => JSX.Element | null;\n /** Optional PersonaPresence to show participant presence. This will not have an effect if property avatar is assigned. */\n presence?: PersonaPresence;\n /**\n * Allows users to pass in an object contains custom CSS styles.\n * @Example\n * ```\n * <ParticipantItem styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: ParticipantItemStyles;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<ParticipantItemStrings>;\n /**\n * Optional callback when component is clicked\n */\n onClick?: (props?: ParticipantItemProps) => void;\n /** prop to determine if we should show tooltip for participants or not */\n showParticipantOverflowTooltip?: boolean;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Optional value to determine and display a participants connection status.\n * For example, `Connecting`, `Ringing` etc.\n * The actual text that is displayed is determined by the localized string\n * corresponding to the provided participant state.\n * For example, `strings.participantStateConnecting` will be used if `participantState` is `Connecting`.\n */\n participantState?: ParticipantState;\n /**\n * Optional aria property that prefixes the ParticipantItems aria content\n * Takes in a unique id value of the element you would like to be read before the ParticipantItem.\n */\n ariaLabelledBy?: string;\n}\n\n/**\n * Component to render a calling or chat participant.\n *\n * Displays the participant's avatar, displayName and status as well as optional icons and context menu.\n *\n * @public\n */\nexport const ParticipantItem = (props: ParticipantItemProps): JSX.Element => {\n const {\n userId,\n displayName,\n onRenderAvatar,\n menuItems,\n onRenderIcon,\n presence,\n styles,\n me,\n onClick,\n showParticipantOverflowTooltip\n } = props;\n const [itemHovered, setItemHovered] = useState<boolean>(false);\n const [itemFocused, setItemFocused] = useState<boolean>(false);\n const [menuHidden, setMenuHidden] = useState<boolean>(true);\n const containerRef = useRef<HTMLDivElement>(null);\n const theme = useTheme();\n const localeStrings = useLocale().strings.participantItem;\n const ids = useIdentifiers();\n const uniqueId = useId();\n const strings = {\n ...localeStrings,\n ...props.strings\n };\n\n // For 'me' show empty name so avatar will get 'Person' icon, when there is no name\n const meAvatarText = displayName?.trim() || '';\n const avatarOptions = {\n text: me ? meAvatarText : displayName?.trim() || strings.displayNamePlaceholder,\n size: PersonaSize.size32,\n presence: presence,\n initialsTextColor: 'white',\n showOverflowTooltip: showParticipantOverflowTooltip,\n showUnknownPersonaCoin: !me && (!displayName?.trim() || displayName === strings.displayNamePlaceholder)\n };\n const avatar = onRenderAvatar ? onRenderAvatar(userId ?? '', avatarOptions) : <Persona className={mergeStyles({\n // Prevents persona text from being vertically truncated if a global line height is less than 1.15.\n lineHeight: '1.15rem'\n }, styles?.avatar)} {...avatarOptions} />;\n const meTextStyle = useMemo(() => mergeStyles(meContainerStyle, {\n color: theme.palette.neutralSecondary\n }, styles?.me), [theme.palette.neutralSecondary, styles?.me]);\n const contextualMenuStyle = useMemo(() => mergeStyles({\n background: theme.palette.neutralLighterAlt\n }, styles?.menu), [theme.palette.neutralLighterAlt, styles?.menu]);\n const infoContainerStyle = useMemo(() => mergeStyles(iconContainerStyle, {\n color: theme.palette.neutralTertiary\n }, styles?.iconContainer), [theme.palette.neutralTertiary, styles?.iconContainer]);\n const menuButton = useMemo(() => <Stack horizontal={true} horizontalAlign=\"end\" className={mergeStyles(menuButtonContainerStyle)} title={strings.menuTitle} data-ui-id={ids.participantItemMenuButton}>\n <Icon iconName={itemHovered || itemFocused || !menuHidden ? 'ParticipantItemOptionsHovered' : 'ParticipantItemOptions'} className={iconStyles} />\n </Stack>, [strings.menuTitle, ids.participantItemMenuButton, itemHovered, itemFocused, menuHidden]);\n const onDismissMenu = (): void => {\n setItemHovered(false);\n setItemFocused(false);\n setMenuHidden(true);\n };\n const participantStateString = participantStateStringTrampoline(props, strings);\n return <div ref={containerRef} role={'menuitem'} data-is-focusable={true} data-ui-id=\"participant-item\" className={mergeStyles(participantItemContainerStyle({\n localparticipant: me,\n clickable: !!menuItems && menuItems.length > 0\n }), styles?.root)} onMouseEnter={() => setItemHovered(true)} onMouseLeave={() => setItemHovered(false)} onFocus={() => setItemFocused(true)} onBlur={() => setItemFocused(false)} onClick={() => {\n if (!participantStateString) {\n setItemHovered(true);\n setMenuHidden(false);\n onClick?.(props);\n }\n }} tabIndex={0}>\n <Stack horizontal className={mergeStyles({\n width: `calc(100% - ${!me && participantStateString ? participantStateMaxWidth : menuButtonContainerStyle.width})`,\n alignItems: 'center'\n })} id={uniqueId} aria-labelledby={`${props.ariaLabelledBy} ${uniqueId}`}>\n {avatar}\n {me && <Text className={meTextStyle}>{strings.isMeText}</Text>}\n <Stack horizontal className={mergeStyles(infoContainerStyle)}>\n {onRenderIcon && onRenderIcon(props)}\n </Stack>\n </Stack>\n {/* When the participantStateString has a value, we don't show the menu */}\n {!me && participantStateString ? <Text data-ui-id=\"participant-item-state-string\" className={mergeStyles(participantStateStringStyles)}>\n {participantStateString}\n </Text> : <div>\n {menuItems && menuItems.length > 0 && <>\n {menuButton}\n <ContextualMenu items={menuItems} hidden={menuHidden} target={containerRef} onItemClick={onDismissMenu} onDismiss={onDismissMenu} directionalHint={DirectionalHint.bottomRightEdge} className={contextualMenuStyle} calloutProps={{\n preventDismissOnEvent\n }} />\n </>}\n </div>}\n </div>;\n};\nconst participantStateStringTrampoline = (props: ParticipantItemProps, strings: ParticipantItemStrings): string | undefined => {\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n return props.participantState === 'EarlyMedia' || props.participantState === 'Ringing' ? strings?.participantStateRinging : props.participantState === 'Hold' ? strings?.participantStateHold : undefined;\n return undefined;\n};\"../../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"ParticipantItem.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/ParticipantItem.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,IAAI,EAA+B,WAAW,EAAE,OAAO,EAAmB,WAAW,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACtK,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAA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AC,CAAC,CAAC,oBAAC,IAAI,kBAAY,+BAA+B,EAAC,SAAS,EAAE,WAAW,CAAC,4BAA4B,CAAC,IACjI,sBAAsB,CAClB,CAAC,CAAC,CAAC,iCACP,SAAS,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI;YACjC,UAAU;YACX,oBAAC,cAAc,IAAC,KAAK,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,aAAa,EAAE,eAAe,EAAE,eAAe,CAAC,eAAe,EAAE,SAAS,EAAE,mBAAmB,EAAE,YAAY,EAAE;oBACtO,qBAAqB;iBACtB,GAAI,CACE,CACD,CACJ,CAAC;AACX,CAAC,CAAC;AACF,MAAM,gCAAgC,GAAG,CAAC,KAA2B,EAAE,OAA+B,EAAsB,EAAE;IAC5H,mDAAmD;IACnD,6CAA6C;IAC7C,OAAO,KAAK,CAAC,gBAAgB,KAAK,YAAY,IAAI,KAAK,CAAC,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,uBAAuB,CAAC,CAAC,CAAC,KAAK,CAAC,gBAAgB,KAAK,MAAM,CAAC,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,oBAAoB,CAAC,CAAC,CAAC,SAAS,CAAC;IAC1M,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ContextualMenu, DirectionalHint, Icon, IContextualMenuItem, IStyle, mergeStyles, Persona, PersonaPresence, PersonaSize, Stack, Text } from '@fluentui/react';\nimport React, { useMemo, useRef, useState } from 'react';\nimport { useIdentifiers } from '../identifiers';\nimport { useLocale } from '../localization';\nimport { useTheme } from '../theming';\nimport { BaseCustomStyles, OnRenderAvatarCallback } from '../types';\nimport { iconContainerStyle, iconStyles, meContainerStyle, menuButtonContainerStyle, participantItemContainerStyle, participantStateMaxWidth, participantStateStringStyles } from './styles/ParticipantItem.styles';\nimport { _preventDismissOnEvent as preventDismissOnEvent } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(one-to-n-calling) */\n/* @conditional-compile-remove(PSTN-calls) */\nimport { ParticipantState } from '../types';\nimport { useId } from '@fluentui/react-hooks';\n\n/**\n * Fluent styles for {@link ParticipantItem}.\n *\n * @public\n */\nexport interface ParticipantItemStyles extends BaseCustomStyles {\n /** Styles for the avatar. */\n avatar?: IStyle;\n /** Styles for the (You) string. */\n me?: IStyle;\n /** Styles for the container of the icon. */\n iconContainer?: IStyle;\n /** Styles for the menu. */\n menu?: IStyle;\n}\n\n/**\n * Strings of {@link ParticipantItem} that can be overridden.\n *\n * @public\n */\nexport interface ParticipantItemStrings {\n /** String shown when participant is me */\n isMeText: string;\n /** String shown when hovering over menu button */\n menuTitle: string;\n /** Label for the remove button in participant menu */\n removeButtonLabel: string;\n /** Label for the sharing icon in participant state stack */\n sharingIconLabel: string;\n /** Label for the muted icon in participant state stack */\n mutedIconLabel: string;\n /** placeholder text for participants who does not have a display name*/\n displayNamePlaceholder?: string;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /** String shown when `participantState` is `Ringing` */\n participantStateRinging?: string;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /** String shown when `participantState` is `Hold` */\n participantStateHold?: string;\n}\n\n/**\n * Props for {@link ParticipantItem}.\n *\n * @public\n */\nexport interface ParticipantItemProps {\n /** Unique User ID of the participant. This `userId` is available in the `onRenderAvatar` callback function */\n userId?: string;\n /** Name of participant. */\n displayName?: string;\n /** Optional indicator to show participant is the user. */\n me?: boolean;\n /** Optional callback returning a JSX element to override avatar. */\n onRenderAvatar?: OnRenderAvatarCallback;\n /** Optional array of IContextualMenuItem for contextual menu. */\n menuItems?: IContextualMenuItem[];\n /** Optional callback returning a JSX element rendered on the right portion of the ParticipantItem. Intended for adding icons. */\n onRenderIcon?: (props?: ParticipantItemProps) => JSX.Element | null;\n /** Optional PersonaPresence to show participant presence. This will not have an effect if property avatar is assigned. */\n presence?: PersonaPresence;\n /**\n * Allows users to pass in an object contains custom CSS styles.\n * @Example\n * ```\n * <ParticipantItem styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: ParticipantItemStyles;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<ParticipantItemStrings>;\n /**\n * Optional callback when component is clicked\n */\n onClick?: (props?: ParticipantItemProps) => void;\n /** Optional value to determine if the tooltip should be shown for participants or not */\n showParticipantOverflowTooltip?: boolean;\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Optional value to determine and display a participants connection status.\n * For example, `Connecting`, `Ringing` etc.\n * The actual text that is displayed is determined by the localized string\n * corresponding to the provided participant state.\n * For example, `strings.participantStateConnecting` will be used if `participantState` is `Connecting`.\n */\n participantState?: ParticipantState;\n /**\n * Optional aria property that prefixes the ParticipantItems aria content\n * Takes in a unique id value of the element you would like to be read before the ParticipantItem.\n */\n ariaLabelledBy?: string;\n}\n\n/**\n * Component to render a calling or chat participant.\n *\n * Displays the participant's avatar, displayName and status as well as optional icons and context menu.\n *\n * @public\n */\nexport const ParticipantItem = (props: ParticipantItemProps): JSX.Element => {\n const {\n userId,\n displayName,\n onRenderAvatar,\n menuItems,\n onRenderIcon,\n presence,\n styles,\n me,\n onClick,\n showParticipantOverflowTooltip\n } = props;\n const [itemHovered, setItemHovered] = useState<boolean>(false);\n const [itemFocused, setItemFocused] = useState<boolean>(false);\n const [menuHidden, setMenuHidden] = useState<boolean>(true);\n const containerRef = useRef<HTMLDivElement>(null);\n const theme = useTheme();\n const localeStrings = useLocale().strings.participantItem;\n const ids = useIdentifiers();\n const uniqueId = useId();\n const strings = {\n ...localeStrings,\n ...props.strings\n };\n\n // For 'me' show empty name so avatar will get 'Person' icon, when there is no name\n const meAvatarText = displayName?.trim() || '';\n const avatarOptions = {\n text: me ? meAvatarText : displayName?.trim() || strings.displayNamePlaceholder,\n size: PersonaSize.size32,\n presence: presence,\n initialsTextColor: 'white',\n showOverflowTooltip: showParticipantOverflowTooltip,\n showUnknownPersonaCoin: !me && (!displayName?.trim() || displayName === strings.displayNamePlaceholder)\n };\n const avatar = onRenderAvatar ? onRenderAvatar(userId ?? '', avatarOptions) : <Persona className={mergeStyles({\n // Prevents persona text from being vertically truncated if a global line height is less than 1.15.\n lineHeight: '1.15rem'\n }, styles?.avatar)} {...avatarOptions} />;\n const meTextStyle = useMemo(() => mergeStyles(meContainerStyle, {\n color: theme.palette.neutralSecondary\n }, styles?.me), [theme.palette.neutralSecondary, styles?.me]);\n const contextualMenuStyle = useMemo(() => mergeStyles({\n background: theme.palette.neutralLighterAlt\n }, styles?.menu), [theme.palette.neutralLighterAlt, styles?.menu]);\n const infoContainerStyle = useMemo(() => mergeStyles(iconContainerStyle, {\n color: theme.palette.neutralTertiary\n }, styles?.iconContainer), [theme.palette.neutralTertiary, styles?.iconContainer]);\n const menuButton = useMemo(() => <Stack horizontal={true} horizontalAlign=\"end\" className={mergeStyles(menuButtonContainerStyle)} title={strings.menuTitle} data-ui-id={ids.participantItemMenuButton}>\n <Icon iconName={itemHovered || itemFocused || !menuHidden ? 'ParticipantItemOptionsHovered' : 'ParticipantItemOptions'} className={iconStyles} />\n </Stack>, [strings.menuTitle, ids.participantItemMenuButton, itemHovered, itemFocused, menuHidden]);\n const onDismissMenu = (): void => {\n setItemHovered(false);\n setItemFocused(false);\n setMenuHidden(true);\n };\n const participantStateString = participantStateStringTrampoline(props, strings);\n return <div ref={containerRef} role={'menuitem'} data-is-focusable={true} data-ui-id=\"participant-item\" className={mergeStyles(participantItemContainerStyle({\n localparticipant: me,\n clickable: !!menuItems && menuItems.length > 0\n }), styles?.root)} onMouseEnter={() => setItemHovered(true)} onMouseLeave={() => setItemHovered(false)} onFocus={() => setItemFocused(true)} onBlur={() => setItemFocused(false)} onClick={() => {\n if (!participantStateString) {\n setItemHovered(true);\n setMenuHidden(false);\n onClick?.(props);\n }\n }} tabIndex={0}>\n <Stack horizontal className={mergeStyles({\n width: `calc(100% - ${!me && participantStateString ? participantStateMaxWidth : menuButtonContainerStyle.width})`,\n alignItems: 'center'\n })} id={uniqueId} aria-labelledby={`${props.ariaLabelledBy} ${uniqueId}`}>\n {avatar}\n {me && <Text className={meTextStyle}>{strings.isMeText}</Text>}\n <Stack horizontal className={mergeStyles(infoContainerStyle)}>\n {onRenderIcon && onRenderIcon(props)}\n </Stack>\n </Stack>\n {/* When the participantStateString has a value, we don't show the menu */}\n {!me && participantStateString ? <Text data-ui-id=\"participant-item-state-string\" className={mergeStyles(participantStateStringStyles)}>\n {participantStateString}\n </Text> : <div>\n {menuItems && menuItems.length > 0 && <>\n {menuButton}\n <ContextualMenu items={menuItems} hidden={menuHidden} target={containerRef} onItemClick={onDismissMenu} onDismiss={onDismissMenu} directionalHint={DirectionalHint.bottomRightEdge} className={contextualMenuStyle} calloutProps={{\n preventDismissOnEvent\n }} />\n </>}\n </div>}\n </div>;\n};\nconst participantStateStringTrampoline = (props: ParticipantItemProps, strings: ParticipantItemStrings): string | undefined => {\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n return props.participantState === 'EarlyMedia' || props.participantState === 'Ringing' ? strings?.participantStateRinging : props.participantState === 'Hold' ? strings?.participantStateHold : undefined;\n return undefined;\n};\"../../../acs-ui-common/src\""]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IContextualMenuItem, IContextualMenuItemStyles } from '@fluentui/react';
3
2
  import { BaseCustomStyles, OnRenderAvatarCallback, ParticipantListParticipant } from '../types';
4
3
  import { ParticipantItemStyles } from './ParticipantItem';
@@ -54,7 +53,7 @@ export declare type ParticipantListProps = {
54
53
  onParticipantClick?: (participant?: ParticipantListParticipant) => void;
55
54
  /** Styles for the {@link ParticipantList} */
56
55
  styles?: ParticipantListStyles;
57
- /** prop to determine if we should show tooltip for participants or not */
56
+ /** Optional value to determine if the tooltip should be shown for participants or not */
58
57
  showParticipantOverflowTooltip?: boolean;
59
58
  /** Optional aria-lablledby prop that prefixes each ParticipantItem aria-label */
60
59
  participantAriaLabelledBy?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"ParticipantList.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/ParticipantList.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,IAAI,EAAkD,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACnI,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,wCAAwC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEjD,OAAO,EAAE,eAAe,EAAiD,MAAM,mBAAmB,CAAC;AACnG,OAAO,EAAE,UAAU,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AA8D7G,MAAM,0BAA0B,GAAG,CAAC,WAAuC,EAAE,OAA+B,EAAE,QAAiB,EAAE,cAAuC,EAAE,0BAA+F,EAAE,MAAkC,EAAE,kBAAuE,EAAE,8BAAwC,EAAE,yBAAkC,EAAsB,EAAE;IAC1d,MAAM,kBAAkB,GAAI,WAA8C,CAAC;IAC3E,IAAI,QAAQ,GAAgC,SAAS,CAAC;IACtD,IAAI,kBAAkB,EAAE;QACtB,IAAI,kBAAkB,CAAC,KAAK,KAAK,WAAW,EAAE;YAC5C,QAAQ,GAAG,eAAe,CAAC,MAAM,CAAC;SACnC;aAAM,IAAI,kBAAkB,CAAC,KAAK,KAAK,MAAM,EAAE;YAC9C,QAAQ,G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,0CAAE,qBAAqB,CAAC,CAAC,CAAC;IACzJ,OAAO,oBAAC,KAAK,kBAAa,GAAG,CAAC,eAAe,EAAE,SAAS,EAAE,WAAW,CAAC,oBAAoB,EAAE,MAAA,KAAK,CAAC,MAAM,0CAAE,IAAI,CAAC,IAC1G,qBAAqB,CAAC,GAAG,CAAC,CAAC,WAAuC,EAAE,EAAE,CAAC,mBAAmB,CAAC,CAAC,CAAC,mBAAmB,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,0BAA0B,CAAC,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAE,0BAA0B,EAAE,qBAAqB,EAAE,KAAK,CAAC,kBAAkB,EAAE,8BAA8B,EAAE,yBAAyB,CAAC,CAAC,CAC9U,CAAC;AACb,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Icon, IContextualMenuItem, IContextualMenuItemStyles, merge, mergeStyles, PersonaPresence, Stack } from '@fluentui/react';\nimport React, { useCallback, useMemo } from 'react';\nimport { useIdentifiers } from '../identifiers';\nimport { useLocale } from '../localization';\n/* @conditional-compile-remove(rooms) */\nimport { _usePermissions } from '../permissions';\nimport { BaseCustomStyles, CallParticipantListParticipant, OnRenderAvatarCallback, ParticipantListParticipant } from '../types';\nimport { ParticipantItem, ParticipantItemStrings, ParticipantItemStyles } from './ParticipantItem';\nimport { iconStyles, participantListItemStyle, participantListStyle } from './styles/ParticipantList.styles';\n\n/**\n * Styles for the {@link ParticipantList} {@link ParticipantItem}.\n *\n * @public\n */\nexport interface ParticipantListItemStyles extends ParticipantItemStyles {\n /** Styles applied to the sub-menu of the {@link ParticipantList} {@link ParticipantItem}. */\n participantSubMenuItemsStyles?: IContextualMenuItemStyles;\n}\n\n/**\n * Styles for the {@link ParticipantList}.\n *\n * @public\n */\nexport interface ParticipantListStyles extends BaseCustomStyles {\n /** Styles for the {@link ParticipantList} {@link ParticipantItem}. */\n participantItemStyles?: ParticipantListItemStyles;\n}\n\n/**\n * A callback for providing custom menu items for each participant in {@link ParticipantList}.\n *\n * @public\n */\nexport type ParticipantMenuItemsCallback = (participantUserId: string, userId?: string, defaultMenuItems?: IContextualMenuItem[]) => IContextualMenuItem[];\n\n/**\n * Props for {@link ParticipantList}.\n *\n * @public\n */\nexport type ParticipantListProps = {\n /** Participants in user call or chat */\n participants: ParticipantListParticipant[];\n /** User ID of user */\n myUserId?: string;\n /**\n * If set to `true`, excludes the local participant from the participant list with use of `myUserId` props (required in this case).\n *\n * @defaultValue `false`\n */\n excludeMe?: boolean;\n /** Optional callback to render each participant. If no callback is provided, each participant will be rendered with `ParticipantItem` */\n onRenderParticipant?: (participant: ParticipantListParticipant) => JSX.Element | null;\n /** Optional callback to render the avatar for each participant. This property will have no effect if `onRenderParticipant` is assigned. */\n onRenderAvatar?: OnRenderAvatarCallback;\n /** Optional callback to render the context menu for each participant */\n onRemoveParticipant?: (userId: string) => void;\n /** Optional callback to render custom menu items for each participant. */\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n /** Optional callback when rendered ParticipantItem is clicked */\n onParticipantClick?: (participant?: ParticipantListParticipant) => void;\n /** Styles for the {@link ParticipantList} */\n styles?: ParticipantListStyles;\n /** prop to determine if we should show tooltip for participants or not */\n showParticipantOverflowTooltip?: boolean;\n /** Optional aria-lablledby prop that prefixes each ParticipantItem aria-label */\n participantAriaLabelledBy?: string;\n};\nconst onRenderParticipantDefault = (participant: ParticipantListParticipant, strings: ParticipantItemStrings, myUserId?: string, onRenderAvatar?: OnRenderAvatarCallback, createParticipantMenuItems?: (participant: ParticipantListParticipant) => IContextualMenuItem[], styles?: ParticipantListItemStyles, onParticipantClick?: (participant?: ParticipantListParticipant) => void, showParticipantOverflowTooltip?: boolean, participantAriaLabelledBy?: string): JSX.Element | null => {\n const callingParticipant = (participant as CallParticipantListParticipant);\n let presence: PersonaPresence | undefined = undefined;\n if (callingParticipant) {\n if (callingParticipant.state === 'Connected') {\n presence = PersonaPresence.online;\n } else if (callingParticipant.state === 'Idle') {\n presence = PersonaPresence.away;\n }\n }\n const menuItems = createParticipantMenuItems && createParticipantMenuItems(participant);\n const onRenderIcon = callingParticipant?.isScreenSharing || callingParticipant?.isMuted ? () => <Stack horizontal={true} tokens={{\n childrenGap: '0.5rem'\n }}>\n {callingParticipant.isScreenSharing && <Icon iconName=\"ParticipantItemScreenShareStart\" className={iconStyles} ariaLabel={strings.sharingIconLabel} />}\n {callingParticipant.isMuted && <Icon iconName=\"ParticipantItemMicOff\" className={iconStyles} ariaLabel={strings.mutedIconLabel} />}\n </Stack> : () => null;\n return <ParticipantItem styles={styles} key={participant.userId} userId={participant.userId} displayName={participant.displayName} me={myUserId ? participant.userId === myUserId : false} menuItems={menuItems} presence={presence} onRenderIcon={onRenderIcon} onRenderAvatar={onRenderAvatar} onClick={() => onParticipantClick?.(participant)} showParticipantOverflowTooltip={showParticipantOverflowTooltip}\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */ participantState={callingParticipant.state} ariaLabelledBy={participantAriaLabelledBy} />;\n};\nconst getParticipantsForDefaultRender = (participants: ParticipantListParticipant[], excludeMe: boolean, myUserId: string | undefined): ParticipantListParticipant[] => {\n if (!excludeMe || !myUserId) {\n return [...participants];\n }\n const userIndex = participants.map(p => p.userId).indexOf(myUserId);\n if (userIndex === -1) {\n return [...participants];\n }\n const remoteParticipants = [...participants];\n remoteParticipants.splice(userIndex, 1);\n return remoteParticipants;\n};\n\n/**\n * Component to render all calling or chat participants.\n *\n * By default, each participant is rendered with {@link ParticipantItem}. See {@link ParticipantListProps.onRenderParticipant} to override.\n *\n * @public\n */\nexport const ParticipantList = (props: ParticipantListProps): JSX.Element => {\n const {\n excludeMe = false,\n myUserId,\n participants,\n onRemoveParticipant,\n onRenderAvatar,\n onRenderParticipant,\n onFetchParticipantMenuItems,\n showParticipantOverflowTooltip,\n participantAriaLabelledBy\n } = props;\n const ids = useIdentifiers();\n const strings = useLocale().strings.participantItem;\n const displayedParticipants: ParticipantListParticipant[] = useMemo(() => {\n return onRenderParticipant ? participants : getParticipantsForDefaultRender(participants, excludeMe, myUserId);\n }, [participants, excludeMe, myUserId, onRenderParticipant]);\n const createParticipantMenuItems = useCallback((participant: ParticipantListParticipant): IContextualMenuItem[] => {\n let menuItems: IContextualMenuItem[] = [];\n let participantIsRemovable = participant.isRemovable;\n /* @conditional-compile-remove(rooms) */\n participantIsRemovable = _usePermissions().removeParticipantButton && participantIsRemovable;\n if (participant.userId !== myUserId && onRemoveParticipant && participantIsRemovable) {\n menuItems.push({\n key: 'remove',\n text: strings.removeButtonLabel,\n onClick: () => onRemoveParticipant(participant.userId),\n itemProps: {\n styles: props.styles?.participantItemStyles?.participantSubMenuItemsStyles\n },\n 'data-ui-id': ids.participantListRemoveParticipantButton\n });\n }\n if (onFetchParticipantMenuItems) {\n menuItems = onFetchParticipantMenuItems(participant.userId, myUserId, menuItems);\n }\n return menuItems;\n }, [ids.participantListRemoveParticipantButton, myUserId, onFetchParticipantMenuItems, onRemoveParticipant, props.styles?.participantItemStyles?.participantSubMenuItemsStyles, strings.removeButtonLabel]);\n const participantItemStyles = useMemo(() => merge(participantListItemStyle, props.styles?.participantItemStyles), [props.styles?.participantItemStyles]);\n return <Stack data-ui-id={ids.participantList} className={mergeStyles(participantListStyle, props.styles?.root)}>\n {displayedParticipants.map((participant: ParticipantListParticipant) => onRenderParticipant ? onRenderParticipant(participant) : onRenderParticipantDefault(participant, strings, myUserId, onRenderAvatar, createParticipantMenuItems, participantItemStyles, props.onParticipantClick, showParticipantOverflowTooltip, participantAriaLabelledBy))}\n </Stack>;\n};"]}
1
+ {"version":3,"file":"ParticipantList.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/ParticipantList.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,IAAI,EAAkD,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,iB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,CAAC,kBAAkB,EAAE,8BAA8B,EAAE,yBAAyB,CAAC,CAAC,CAC9U,CAAC;AACb,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { Icon, IContextualMenuItem, IContextualMenuItemStyles, merge, mergeStyles, PersonaPresence, Stack } from '@fluentui/react';\nimport React, { useCallback, useMemo } from 'react';\nimport { useIdentifiers } from '../identifiers';\nimport { useLocale } from '../localization';\n/* @conditional-compile-remove(rooms) */\nimport { _usePermissions } from '../permissions';\nimport { BaseCustomStyles, CallParticipantListParticipant, OnRenderAvatarCallback, ParticipantListParticipant } from '../types';\nimport { ParticipantItem, ParticipantItemStrings, ParticipantItemStyles } from './ParticipantItem';\nimport { iconStyles, participantListItemStyle, participantListStyle } from './styles/ParticipantList.styles';\n\n/**\n * Styles for the {@link ParticipantList} {@link ParticipantItem}.\n *\n * @public\n */\nexport interface ParticipantListItemStyles extends ParticipantItemStyles {\n /** Styles applied to the sub-menu of the {@link ParticipantList} {@link ParticipantItem}. */\n participantSubMenuItemsStyles?: IContextualMenuItemStyles;\n}\n\n/**\n * Styles for the {@link ParticipantList}.\n *\n * @public\n */\nexport interface ParticipantListStyles extends BaseCustomStyles {\n /** Styles for the {@link ParticipantList} {@link ParticipantItem}. */\n participantItemStyles?: ParticipantListItemStyles;\n}\n\n/**\n * A callback for providing custom menu items for each participant in {@link ParticipantList}.\n *\n * @public\n */\nexport type ParticipantMenuItemsCallback = (participantUserId: string, userId?: string, defaultMenuItems?: IContextualMenuItem[]) => IContextualMenuItem[];\n\n/**\n * Props for {@link ParticipantList}.\n *\n * @public\n */\nexport type ParticipantListProps = {\n /** Participants in user call or chat */\n participants: ParticipantListParticipant[];\n /** User ID of user */\n myUserId?: string;\n /**\n * If set to `true`, excludes the local participant from the participant list with use of `myUserId` props (required in this case).\n *\n * @defaultValue `false`\n */\n excludeMe?: boolean;\n /** Optional callback to render each participant. If no callback is provided, each participant will be rendered with `ParticipantItem` */\n onRenderParticipant?: (participant: ParticipantListParticipant) => JSX.Element | null;\n /** Optional callback to render the avatar for each participant. This property will have no effect if `onRenderParticipant` is assigned. */\n onRenderAvatar?: OnRenderAvatarCallback;\n /** Optional callback to render the context menu for each participant */\n onRemoveParticipant?: (userId: string) => void;\n /** Optional callback to render custom menu items for each participant. */\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n /** Optional callback when rendered ParticipantItem is clicked */\n onParticipantClick?: (participant?: ParticipantListParticipant) => void;\n /** Styles for the {@link ParticipantList} */\n styles?: ParticipantListStyles;\n /** Optional value to determine if the tooltip should be shown for participants or not */\n showParticipantOverflowTooltip?: boolean;\n /** Optional aria-lablledby prop that prefixes each ParticipantItem aria-label */\n participantAriaLabelledBy?: string;\n};\nconst onRenderParticipantDefault = (participant: ParticipantListParticipant, strings: ParticipantItemStrings, myUserId?: string, onRenderAvatar?: OnRenderAvatarCallback, createParticipantMenuItems?: (participant: ParticipantListParticipant) => IContextualMenuItem[], styles?: ParticipantListItemStyles, onParticipantClick?: (participant?: ParticipantListParticipant) => void, showParticipantOverflowTooltip?: boolean, participantAriaLabelledBy?: string): JSX.Element | null => {\n const callingParticipant = (participant as CallParticipantListParticipant);\n let presence: PersonaPresence | undefined = undefined;\n if (callingParticipant) {\n if (callingParticipant.state === 'Connected') {\n presence = PersonaPresence.online;\n } else if (callingParticipant.state === 'Idle') {\n presence = PersonaPresence.away;\n }\n }\n const menuItems = createParticipantMenuItems && createParticipantMenuItems(participant);\n const onRenderIcon = callingParticipant?.isScreenSharing || callingParticipant?.isMuted ? () => <Stack horizontal={true} tokens={{\n childrenGap: '0.5rem'\n }}>\n {callingParticipant.isScreenSharing && <Icon iconName=\"ParticipantItemScreenShareStart\" className={iconStyles} ariaLabel={strings.sharingIconLabel} />}\n {callingParticipant.isMuted && <Icon iconName=\"ParticipantItemMicOff\" className={iconStyles} ariaLabel={strings.mutedIconLabel} />}\n </Stack> : () => null;\n return <ParticipantItem styles={styles} key={participant.userId} userId={participant.userId} displayName={participant.displayName} me={myUserId ? participant.userId === myUserId : false} menuItems={menuItems} presence={presence} onRenderIcon={onRenderIcon} onRenderAvatar={onRenderAvatar} onClick={() => onParticipantClick?.(participant)} showParticipantOverflowTooltip={showParticipantOverflowTooltip}\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */ participantState={callingParticipant.state} ariaLabelledBy={participantAriaLabelledBy} />;\n};\nconst getParticipantsForDefaultRender = (participants: ParticipantListParticipant[], excludeMe: boolean, myUserId: string | undefined): ParticipantListParticipant[] => {\n if (!excludeMe || !myUserId) {\n return [...participants];\n }\n const userIndex = participants.map(p => p.userId).indexOf(myUserId);\n if (userIndex === -1) {\n return [...participants];\n }\n const remoteParticipants = [...participants];\n remoteParticipants.splice(userIndex, 1);\n return remoteParticipants;\n};\n\n/**\n * Component to render all calling or chat participants.\n *\n * By default, each participant is rendered with {@link ParticipantItem}. See {@link ParticipantListProps.onRenderParticipant} to override.\n *\n * @public\n */\nexport const ParticipantList = (props: ParticipantListProps): JSX.Element => {\n const {\n excludeMe = false,\n myUserId,\n participants,\n onRemoveParticipant,\n onRenderAvatar,\n onRenderParticipant,\n onFetchParticipantMenuItems,\n showParticipantOverflowTooltip,\n participantAriaLabelledBy\n } = props;\n const ids = useIdentifiers();\n const strings = useLocale().strings.participantItem;\n const displayedParticipants: ParticipantListParticipant[] = useMemo(() => {\n return onRenderParticipant ? participants : getParticipantsForDefaultRender(participants, excludeMe, myUserId);\n }, [participants, excludeMe, myUserId, onRenderParticipant]);\n const createParticipantMenuItems = useCallback((participant: ParticipantListParticipant): IContextualMenuItem[] => {\n let menuItems: IContextualMenuItem[] = [];\n let participantIsRemovable = participant.isRemovable;\n /* @conditional-compile-remove(rooms) */\n participantIsRemovable = _usePermissions().removeParticipantButton && participantIsRemovable;\n if (participant.userId !== myUserId && onRemoveParticipant && participantIsRemovable) {\n menuItems.push({\n key: 'remove',\n text: strings.removeButtonLabel,\n onClick: () => onRemoveParticipant(participant.userId),\n itemProps: {\n styles: props.styles?.participantItemStyles?.participantSubMenuItemsStyles\n },\n 'data-ui-id': ids.participantListRemoveParticipantButton\n });\n }\n if (onFetchParticipantMenuItems) {\n menuItems = onFetchParticipantMenuItems(participant.userId, myUserId, menuItems);\n }\n return menuItems;\n }, [ids.participantListRemoveParticipantButton, myUserId, onFetchParticipantMenuItems, onRemoveParticipant, props.styles?.participantItemStyles?.participantSubMenuItemsStyles, strings.removeButtonLabel]);\n const participantItemStyles = useMemo(() => merge(participantListItemStyle, props.styles?.participantItemStyles), [props.styles?.participantItemStyles]);\n return <Stack data-ui-id={ids.participantList} className={mergeStyles(participantListStyle, props.styles?.root)}>\n {displayedParticipants.map((participant: ParticipantListParticipant) => onRenderParticipant ? onRenderParticipant(participant) : onRenderParticipantDefault(participant, strings, myUserId, onRenderAvatar, createParticipantMenuItems, participantItemStyles, props.onParticipantClick, showParticipantOverflowTooltip, participantAriaLabelledBy))}\n </Stack>;\n};"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IContextualMenuStyles, IContextualMenuItemStyles } from '@fluentui/react';
3
2
  import { ParticipantListProps, ParticipantListStyles, ParticipantMenuItemsCallback } from './ParticipantList';
4
3
  import { ControlBarButtonProps, ControlBarButtonStyles } from './ControlBarButton';
@@ -120,7 +119,7 @@ export interface ParticipantsButtonProps extends ControlBarButtonProps {
120
119
  * Optional strings to override in component
121
120
  */
122
121
  strings?: Partial<ParticipantsButtonStrings>;
123
- /** prop to determine if we should show tooltip for participants or not */
122
+ /** Optional value to determine if the tooltip should be shown for participants or not */
124
123
  showParticipantOverflowTooltip?: boolean;
125
124
  }
126
125
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ParticipantsButton.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/ParticipantsButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,sBAAsB,EAA+F,KAAK,EAAE,M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ourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ContextualMenuItemType, IContextualMenuItem, IContextualMenuProps, IContextualMenuStyles, IContextualMenuItemStyles, merge } from '@fluentui/react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport copy from 'copy-to-clipboard';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { ParticipantList, ParticipantListProps, ParticipantListStyles, ParticipantMenuItemsCallback } from './ParticipantList';\nimport { participantsButtonMenuPropsStyle } from './styles/ControlBar.styles';\nimport { useLocale } from '../localization';\nimport { ControlBarButton, ControlBarButtonProps, ControlBarButtonStyles } from './ControlBarButton';\nimport { useIdentifiers } from '../identifiers';\nimport { CommunicationParticipant } from '../types/CommunicationParticipant';\nimport { OnRenderAvatarCallback } from '../types/OnRender';\nimport { ParticipantListParticipant } from '../types';\nimport { _HighContrastAwareIcon } from './HighContrastAwareIcon';\nimport { _preventDismissOnEvent as preventDismissOnEvent } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(rooms) */\nimport { _usePermissions } from '../permissions/PermissionsProvider';\nimport { Announcer } from './Announcer';\n\n/**\n * Styles for the {@link ParticipantsButton} menu.\n *\n * @public\n */\nexport interface ParticipantsButtonContextualMenuStyles extends IContextualMenuStyles {\n /** Styles for the {@link ParticipantsButton} menu items. */\n menuItemStyles?: IContextualMenuItemStyles;\n /** Styles for the {@link ParticipantList} menu item inside the {@link ParticipantsButton} menu. */\n participantListStyles?: ParticipantListStyles;\n}\n\n/**\n * Styles Props for {@link ParticipantsButton}.\n *\n * @public\n */\nexport interface ParticipantsButtonStyles extends ControlBarButtonStyles {\n /** Styles of the {@link ParticipantsButton} menu flyout */\n menuStyles?: Partial<ParticipantsButtonContextualMenuStyles>;\n}\n\n/**\n * Strings of {@link ParticipantsButton} that can be overridden.\n *\n * @public\n */\nexport interface ParticipantsButtonStrings {\n /**\n * Label of button\n */\n label: string;\n /**\n * Button tooltip content.\n */\n tooltipContent?: string;\n /**\n * Header of menu pop up\n */\n menuHeader: string;\n /**\n * Label of menu button to show list of participants. Placeholders: [numParticipants]\n */\n participantsListButtonLabel: string;\n /**\n * Label of menu button to copy invite link\n */\n copyInviteLinkButtonLabel: string;\n /**\n * Label of menu button to mute all participants\n */\n muteAllButtonLabel: string;\n /**\n * Narrator announcement for when the invite link has been copied by the user to the clipboard\n */\n copyInviteLinkActionedAriaLabel: string;\n}\n\n/**\n * Props for {@link ParticipantsButton}.\n *\n * @public\n */\nexport interface ParticipantsButtonProps extends ControlBarButtonProps {\n /**\n * Participants in user call or chat\n */\n participants: ParticipantListParticipant[];\n /**\n * User ID of user\n */\n myUserId?: string;\n /**\n * If set to `true`, excludes the local participant from the participant list with use of `myUserId` props (required in this case).\n *\n * @defaultValue `false`\n */\n excludeMe?: boolean;\n /**\n * Callback to render each participant. If no callback is provided, each participant will be rendered with `ParticipantItem`\n */\n onRenderParticipant?: (participant: CommunicationParticipant) => JSX.Element | null;\n /**\n * Callback to render the avatar for each participant. This property will have no effect if `onRenderParticipant` is assigned.\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n /**\n * Callback to render the context menu for each participant\n */\n onRemoveParticipant?: (userId: string) => void;\n /**\n * Callback to render custom menu items for each participant.\n */\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n /**\n * Optional callback to render a custom participant list.\n */\n onRenderParticipantList?: (props: ParticipantListProps) => JSX.Element | null;\n /**\n * Allows users to pass an object containing custom CSS styles.\n * @Example\n * ```\n * <ParticipantsButton styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: ParticipantsButtonStyles;\n /**\n * URL to invite new participants to the current call\n */\n callInvitationURL?: string;\n /**\n * CallBack to mute all remote participants\n */\n onMuteAll?: () => void;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<ParticipantsButtonStrings>;\n /** prop to determine if we should show tooltip for participants or not */\n showParticipantOverflowTooltip?: boolean;\n}\n\n/**\n * A button to show a menu with calling or chat participants.\n *\n * Can be used with {@link ControlBar}.\n *\n * This button contains dropdown menu items defined through its property `menuProps`. By default, it can display the number of remote participants with the full list\n * as sub-menu and an option to mute all participants, as well as a copy-to-clipboard button to copy the call invitation URL.\n * This `menuProps` can be fully redefined and its property is of type [IContextualMenuProps](https://developer.microsoft.com/fluentui#/controls/web/contextualmenu#IContextualMenuProps).\n *\n * @public\n */\nexport const ParticipantsButton = (props: ParticipantsButtonProps): JSX.Element => {\n const {\n callInvitationURL,\n styles,\n onMuteAll,\n onRenderIcon,\n onRenderParticipantList,\n participants,\n myUserId,\n excludeMe,\n onRenderParticipant,\n onRenderAvatar,\n onRemoveParticipant,\n onFetchParticipantMenuItems,\n showParticipantOverflowTooltip\n } = props;\n const disabled = props.disabled;\n const [copyInviteLinkAnnouncerStrings, setCopyInviteLinkAnnouncerStrings] = useState<string>('');\n const onRenderPeopleIcon = (): JSX.Element => <_HighContrastAwareIcon disabled={disabled} iconName=\"ControlButtonParticipants\" />;\n const ids = useIdentifiers();\n const onMuteAllCallback = useCallback(() => {\n if (onMuteAll) {\n onMuteAll();\n }\n }, [onMuteAll]);\n const defaultParticipantList = useCallback(() => {\n return <ParticipantList participants={participants} myUserId={myUserId} excludeMe={excludeMe} onRenderParticipant={onRenderParticipant} onRenderAvatar={onRenderAvatar} onRemoveParticipant={onRemoveParticipant} onFetchParticipantMenuItems={onFetchParticipantMenuItems} styles={styles?.menuStyles?.participantListStyles} showParticipantOverflowTooltip={showParticipantOverflowTooltip} />;\n }, [excludeMe, myUserId, onRemoveParticipant, onRenderAvatar, onRenderParticipant, participants, styles?.menuStyles?.participantListStyles, onFetchParticipantMenuItems, showParticipantOverflowTooltip]);\n const onCopyCallback = useCallback(() => {\n if (callInvitationURL) {\n return copy(callInvitationURL);\n }\n return false;\n }, [callInvitationURL]);\n const localeStrings = useLocale().strings.participantsButton;\n const strings = useMemo(() => ({\n ...localeStrings,\n ...props.strings\n }), [localeStrings, props.strings]);\n const participantCount = participants.length;\n\n /**\n * sets the announcement string for when the link is copied.\n */\n const toggleAnnouncerString = useCallback(() => {\n setCopyInviteLinkAnnouncerStrings(strings.copyInviteLinkActionedAriaLabel);\n /**\n * Clears the announcer string after the user clicks the\n * copyInviteLink button allowing it to be re-announced.\n */\n setTimeout(() => {\n setCopyInviteLinkAnnouncerStrings('');\n }, 3000);\n }, [strings.copyInviteLinkActionedAriaLabel]);\n const generateDefaultParticipantsSubMenuProps = useCallback((): IContextualMenuItem[] => {\n const items: IContextualMenuItem[] = [];\n if (participantCount > 0) {\n items.push({\n key: 'participantListMenuItemKey',\n onRender: onRenderParticipantList ?? defaultParticipantList\n });\n items.push({\n key: 'participantsDivider1',\n itemType: ContextualMenuItemType.Divider\n });\n if (onMuteAll) {\n items.push({\n key: 'muteAllKey',\n text: strings.muteAllButtonLabel,\n title: strings.muteAllButtonLabel,\n styles: styles?.menuStyles?.menuItemStyles,\n iconProps: {\n iconName: 'MicOff2'\n },\n onClick: onMuteAllCallback\n });\n }\n }\n return items;\n }, [participantCount, onRenderParticipantList, defaultParticipantList, onMuteAll, strings.muteAllButtonLabel, styles?.menuStyles?.menuItemStyles, onMuteAllCallback]);\n const defaultMenuProps = useMemo((): IContextualMenuProps => {\n const menuProps: IContextualMenuProps = {\n title: strings.menuHeader,\n ariaLabel: strings.menuHeader,\n styles: merge(participantsButtonMenuPropsStyle, styles?.menuStyles),\n items: [],\n calloutProps: {\n preventDismissOnEvent\n }\n };\n if (participantCount > 0) {\n const participantIds = participants.map(p => p.userId);\n let participantCountWithoutMe = participantIds.length;\n if (excludeMe) {\n participantCountWithoutMe -= 1;\n }\n menuProps.items.push({\n key: 'participantCountKey',\n name: _formatString(strings.participantsListButtonLabel, {\n numParticipants: `${participantCountWithoutMe}`\n }),\n itemProps: {\n styles: styles?.menuStyles?.menuItemStyles\n },\n iconProps: {\n iconName: 'People'\n },\n subMenuProps: {\n items: generateDefaultParticipantsSubMenuProps(),\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 maxWidth: '100%'\n }\n },\n style: {\n maxHeight: '20rem'\n },\n // Disable dismiss on resize to work around a couple Fluent UI bugs\n // See reasoning in the props for the parent menu.\n preventDismissOnEvent\n }\n },\n 'data-ui-id': ids.participantButtonPeopleMenuItem\n });\n }\n if (callInvitationURL) {\n menuProps.items.push({\n key: 'InviteLinkKey',\n name: strings.copyInviteLinkButtonLabel,\n title: strings.copyInviteLinkButtonLabel,\n itemProps: {\n styles: styles?.menuStyles?.menuItemStyles\n },\n iconProps: {\n iconName: 'Link'\n },\n onClick: () => {\n onCopyCallback();\n toggleAnnouncerString();\n }\n });\n }\n return menuProps;\n }, [strings.menuHeader, strings.participantsListButtonLabel, strings.copyInviteLinkButtonLabel, styles?.menuStyles, participantCount, callInvitationURL, participants, excludeMe, ids.participantButtonPeopleMenuItem, generateDefaultParticipantsSubMenuProps, onCopyCallback, toggleAnnouncerString]);\n return <>\n <Announcer announcementString={copyInviteLinkAnnouncerStrings} ariaLive={'polite'} />\n <ControlBarButton {...props} disabled={disabled} menuProps={props.menuProps ?? defaultMenuProps} menuIconProps={{\n hidden: true\n }} onRenderIcon={onRenderIcon ?? onRenderPeopleIcon} strings={strings} labelKey={props.labelKey ?? 'participantsButtonLabel'} />\n </>;\n};\"../../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"ParticipantsButton.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/ParticipantsButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,sBAAsB,EAA+F,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC7J,OAAO,EAAE,aAAa,EAAE,mCAAgC;AACxD,OAAO,IAAI,MAAM,mBAAmB,CAAC;AACrC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,eAAe,EAA6E,MAAM,mBAAmB,CAAC;AAC/H,OAAO,EAAE,gC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MAAM,uBAAN,MAAM,CAAE,UAAU,0CAAE,cAAc;iBAC3C;gBACD,SAAS,EAAE;oBACT,QAAQ,EAAE,MAAM;iBACjB;gBACD,OAAO,EAAE,GAAG,EAAE;oBACZ,cAAc,EAAE,CAAC;oBACjB,qBAAqB,EAAE,CAAC;gBAC1B,CAAC;aACF,CAAC,CAAC;SACJ;QACD,OAAO,SAAS,CAAC;IACnB,CAAC,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE,OAAO,CAAC,2BAA2B,EAAE,OAAO,CAAC,yBAAyB,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,YAAY,EAAE,SAAS,EAAE,GAAG,CAAC,+BAA+B,EAAE,uCAAuC,EAAE,cAAc,EAAE,qBAAqB,CAAC,CAAC,CAAC;IACxS,OAAO;QACH,oBAAC,SAAS,IAAC,kBAAkB,EAAE,8BAA8B,EAAE,QAAQ,EAAE,QAAQ,GAAI;QACrF,oBAAC,gBAAgB,oBAAK,KAAK,IAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAA,KAAK,CAAC,SAAS,mCAAI,gBAAgB,EAAE,aAAa,EAAE;gBAChH,MAAM,EAAE,IAAI;aACb,EAAE,YAAY,EAAE,YAAY,aAAZ,YAAY,cAAZ,YAAY,GAAI,kBAAkB,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAA,KAAK,CAAC,QAAQ,mCAAI,yBAAyB,IAAI,CAC7H,CAAC;AACR,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ContextualMenuItemType, IContextualMenuItem, IContextualMenuProps, IContextualMenuStyles, IContextualMenuItemStyles, merge } from '@fluentui/react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport copy from 'copy-to-clipboard';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { ParticipantList, ParticipantListProps, ParticipantListStyles, ParticipantMenuItemsCallback } from './ParticipantList';\nimport { participantsButtonMenuPropsStyle } from './styles/ControlBar.styles';\nimport { useLocale } from '../localization';\nimport { ControlBarButton, ControlBarButtonProps, ControlBarButtonStyles } from './ControlBarButton';\nimport { useIdentifiers } from '../identifiers';\nimport { CommunicationParticipant } from '../types/CommunicationParticipant';\nimport { OnRenderAvatarCallback } from '../types/OnRender';\nimport { ParticipantListParticipant } from '../types';\nimport { _HighContrastAwareIcon } from './HighContrastAwareIcon';\nimport { _preventDismissOnEvent as preventDismissOnEvent } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(rooms) */\nimport { _usePermissions } from '../permissions/PermissionsProvider';\nimport { Announcer } from './Announcer';\n\n/**\n * Styles for the {@link ParticipantsButton} menu.\n *\n * @public\n */\nexport interface ParticipantsButtonContextualMenuStyles extends IContextualMenuStyles {\n /** Styles for the {@link ParticipantsButton} menu items. */\n menuItemStyles?: IContextualMenuItemStyles;\n /** Styles for the {@link ParticipantList} menu item inside the {@link ParticipantsButton} menu. */\n participantListStyles?: ParticipantListStyles;\n}\n\n/**\n * Styles Props for {@link ParticipantsButton}.\n *\n * @public\n */\nexport interface ParticipantsButtonStyles extends ControlBarButtonStyles {\n /** Styles of the {@link ParticipantsButton} menu flyout */\n menuStyles?: Partial<ParticipantsButtonContextualMenuStyles>;\n}\n\n/**\n * Strings of {@link ParticipantsButton} that can be overridden.\n *\n * @public\n */\nexport interface ParticipantsButtonStrings {\n /**\n * Label of button\n */\n label: string;\n /**\n * Button tooltip content.\n */\n tooltipContent?: string;\n /**\n * Header of menu pop up\n */\n menuHeader: string;\n /**\n * Label of menu button to show list of participants. Placeholders: [numParticipants]\n */\n participantsListButtonLabel: string;\n /**\n * Label of menu button to copy invite link\n */\n copyInviteLinkButtonLabel: string;\n /**\n * Label of menu button to mute all participants\n */\n muteAllButtonLabel: string;\n /**\n * Narrator announcement for when the invite link has been copied by the user to the clipboard\n */\n copyInviteLinkActionedAriaLabel: string;\n}\n\n/**\n * Props for {@link ParticipantsButton}.\n *\n * @public\n */\nexport interface ParticipantsButtonProps extends ControlBarButtonProps {\n /**\n * Participants in user call or chat\n */\n participants: ParticipantListParticipant[];\n /**\n * User ID of user\n */\n myUserId?: string;\n /**\n * If set to `true`, excludes the local participant from the participant list with use of `myUserId` props (required in this case).\n *\n * @defaultValue `false`\n */\n excludeMe?: boolean;\n /**\n * Callback to render each participant. If no callback is provided, each participant will be rendered with `ParticipantItem`\n */\n onRenderParticipant?: (participant: CommunicationParticipant) => JSX.Element | null;\n /**\n * Callback to render the avatar for each participant. This property will have no effect if `onRenderParticipant` is assigned.\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n /**\n * Callback to render the context menu for each participant\n */\n onRemoveParticipant?: (userId: string) => void;\n /**\n * Callback to render custom menu items for each participant.\n */\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n /**\n * Optional callback to render a custom participant list.\n */\n onRenderParticipantList?: (props: ParticipantListProps) => JSX.Element | null;\n /**\n * Allows users to pass an object containing custom CSS styles.\n * @Example\n * ```\n * <ParticipantsButton styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: ParticipantsButtonStyles;\n /**\n * URL to invite new participants to the current call\n */\n callInvitationURL?: string;\n /**\n * CallBack to mute all remote participants\n */\n onMuteAll?: () => void;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<ParticipantsButtonStrings>;\n /** Optional value to determine if the tooltip should be shown for participants or not */\n showParticipantOverflowTooltip?: boolean;\n}\n\n/**\n * A button to show a menu with calling or chat participants.\n *\n * Can be used with {@link ControlBar}.\n *\n * This button contains dropdown menu items defined through its property `menuProps`. By default, it can display the number of remote participants with the full list\n * as sub-menu and an option to mute all participants, as well as a copy-to-clipboard button to copy the call invitation URL.\n * This `menuProps` can be fully redefined and its property is of type [IContextualMenuProps](https://developer.microsoft.com/fluentui#/controls/web/contextualmenu#IContextualMenuProps).\n *\n * @public\n */\nexport const ParticipantsButton = (props: ParticipantsButtonProps): JSX.Element => {\n const {\n callInvitationURL,\n styles,\n onMuteAll,\n onRenderIcon,\n onRenderParticipantList,\n participants,\n myUserId,\n excludeMe,\n onRenderParticipant,\n onRenderAvatar,\n onRemoveParticipant,\n onFetchParticipantMenuItems,\n showParticipantOverflowTooltip\n } = props;\n const disabled = props.disabled;\n const [copyInviteLinkAnnouncerStrings, setCopyInviteLinkAnnouncerStrings] = useState<string>('');\n const onRenderPeopleIcon = (): JSX.Element => <_HighContrastAwareIcon disabled={disabled} iconName=\"ControlButtonParticipants\" />;\n const ids = useIdentifiers();\n const onMuteAllCallback = useCallback(() => {\n if (onMuteAll) {\n onMuteAll();\n }\n }, [onMuteAll]);\n const defaultParticipantList = useCallback(() => {\n return <ParticipantList participants={participants} myUserId={myUserId} excludeMe={excludeMe} onRenderParticipant={onRenderParticipant} onRenderAvatar={onRenderAvatar} onRemoveParticipant={onRemoveParticipant} onFetchParticipantMenuItems={onFetchParticipantMenuItems} styles={styles?.menuStyles?.participantListStyles} showParticipantOverflowTooltip={showParticipantOverflowTooltip} />;\n }, [excludeMe, myUserId, onRemoveParticipant, onRenderAvatar, onRenderParticipant, participants, styles?.menuStyles?.participantListStyles, onFetchParticipantMenuItems, showParticipantOverflowTooltip]);\n const onCopyCallback = useCallback(() => {\n if (callInvitationURL) {\n return copy(callInvitationURL);\n }\n return false;\n }, [callInvitationURL]);\n const localeStrings = useLocale().strings.participantsButton;\n const strings = useMemo(() => ({\n ...localeStrings,\n ...props.strings\n }), [localeStrings, props.strings]);\n const participantCount = participants.length;\n\n /**\n * sets the announcement string for when the link is copied.\n */\n const toggleAnnouncerString = useCallback(() => {\n setCopyInviteLinkAnnouncerStrings(strings.copyInviteLinkActionedAriaLabel);\n /**\n * Clears the announcer string after the user clicks the\n * copyInviteLink button allowing it to be re-announced.\n */\n setTimeout(() => {\n setCopyInviteLinkAnnouncerStrings('');\n }, 3000);\n }, [strings.copyInviteLinkActionedAriaLabel]);\n const generateDefaultParticipantsSubMenuProps = useCallback((): IContextualMenuItem[] => {\n const items: IContextualMenuItem[] = [];\n if (participantCount > 0) {\n items.push({\n key: 'participantListMenuItemKey',\n onRender: onRenderParticipantList ?? defaultParticipantList\n });\n items.push({\n key: 'participantsDivider1',\n itemType: ContextualMenuItemType.Divider\n });\n if (onMuteAll) {\n items.push({\n key: 'muteAllKey',\n text: strings.muteAllButtonLabel,\n title: strings.muteAllButtonLabel,\n styles: styles?.menuStyles?.menuItemStyles,\n iconProps: {\n iconName: 'MicOff2'\n },\n onClick: onMuteAllCallback\n });\n }\n }\n return items;\n }, [participantCount, onRenderParticipantList, defaultParticipantList, onMuteAll, strings.muteAllButtonLabel, styles?.menuStyles?.menuItemStyles, onMuteAllCallback]);\n const defaultMenuProps = useMemo((): IContextualMenuProps => {\n const menuProps: IContextualMenuProps = {\n title: strings.menuHeader,\n ariaLabel: strings.menuHeader,\n styles: merge(participantsButtonMenuPropsStyle, styles?.menuStyles),\n items: [],\n calloutProps: {\n preventDismissOnEvent\n }\n };\n if (participantCount > 0) {\n const participantIds = participants.map(p => p.userId);\n let participantCountWithoutMe = participantIds.length;\n if (excludeMe) {\n participantCountWithoutMe -= 1;\n }\n menuProps.items.push({\n key: 'participantCountKey',\n name: _formatString(strings.participantsListButtonLabel, {\n numParticipants: `${participantCountWithoutMe}`\n }),\n itemProps: {\n styles: styles?.menuStyles?.menuItemStyles\n },\n iconProps: {\n iconName: 'People'\n },\n subMenuProps: {\n items: generateDefaultParticipantsSubMenuProps(),\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 maxWidth: '100%'\n }\n },\n style: {\n maxHeight: '20rem'\n },\n // Disable dismiss on resize to work around a couple Fluent UI bugs\n // See reasoning in the props for the parent menu.\n preventDismissOnEvent\n }\n },\n 'data-ui-id': ids.participantButtonPeopleMenuItem\n });\n }\n if (callInvitationURL) {\n menuProps.items.push({\n key: 'InviteLinkKey',\n name: strings.copyInviteLinkButtonLabel,\n title: strings.copyInviteLinkButtonLabel,\n itemProps: {\n styles: styles?.menuStyles?.menuItemStyles\n },\n iconProps: {\n iconName: 'Link'\n },\n onClick: () => {\n onCopyCallback();\n toggleAnnouncerString();\n }\n });\n }\n return menuProps;\n }, [strings.menuHeader, strings.participantsListButtonLabel, strings.copyInviteLinkButtonLabel, styles?.menuStyles, participantCount, callInvitationURL, participants, excludeMe, ids.participantButtonPeopleMenuItem, generateDefaultParticipantsSubMenuProps, onCopyCallback, toggleAnnouncerString]);\n return <>\n <Announcer announcementString={copyInviteLinkAnnouncerStrings} ariaLive={'polite'} />\n <ControlBarButton {...props} disabled={disabled} menuProps={props.menuProps ?? defaultMenuProps} menuIconProps={{\n hidden: true\n }} onRenderIcon={onRenderIcon ?? onRenderPeopleIcon} strings={strings} labelKey={props.labelKey ?? 'participantsButtonLabel'} />\n </>;\n};\"../../../acs-ui-common/src\""]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { _PictureInPictureInPictureTileProps } from './PictureInPictureInPictureTile';
3
2
  /**
4
3
  * Strings of {@link _PictureInPictureInPicture} that can be overridden.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ControlBarButtonProps } from './ControlBarButton';
3
2
  /**
4
3
  * Strings of {@link ScreenShareButton} that can be overridden.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * @beta
4
3
  * Error to be displayed to the user in an error bar above sendbox.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { SendBoxErrorBarError } from './SendBoxErrorBar';
3
2
  /**
4
3
  * @private
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ControlBarButtonProps } from './ControlBarButton';
3
2
  /**
4
3
  * options bag to start captions
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { BaseCustomStyles } from '../types';
3
2
  /**
4
3
  * Whether the stream is loading or not.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ComponentSlotStyle } from '../types';
3
2
  /**
4
3
  * Todo: We need to add more types of system messages that we support.
@@ -36,6 +36,8 @@ export const TextFieldWithMention = (props) => {
36
36
  // Index of the current trigger character in the text field
37
37
  const [currentTriggerStartIndex, setCurrentTriggerStartIndex] = useState(-1);
38
38
  const [inputTextValue, setInputTextValue] = useState('');
39
+ // Internal value for text value prop
40
+ const [internalTextValue, setInternalTextValue] = useState('');
39
41
  const [tagsValue, setTagsValue] = useState([]);
40
42
  // Index of the previous selection start in the text field
41
43
  const [selectionStartValue, setSelectionStartValue] = useState();
@@ -58,14 +60,19 @@ export const TextFieldWithMention = (props) => {
58
60
  const updateMentionSuggestions = useCallback((suggestions) => {
59
61
  setMentionSuggestions(suggestions);
60
62
  }, [setMentionSuggestions]);
63
+ useEffect(() => {
64
+ setInternalTextValue(textValue);
65
+ // update mention suggestions before the next render cycle
66
+ updateMentionSuggestions([]);
67
+ }, [textValue, updateMentionSuggestions]);
61
68
  // Parse the text and get the plain text version to display in the input box
62
69
  useEffect(() => {
63
70
  const trigger = (mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.trigger) || DEFAULT_MENTION_TRIGGER;
64
- const parsedHTMLData = textToTagParser(textValue, trigger);
71
+ const parsedHTMLData = textToTagParser(internalTextValue, trigger);
65
72
  setInputTextValue(parsedHTMLData.plainText);
66
73
  setTagsValue(parsedHTMLData.tags);
67
74
  updateMentionSuggestions([]);
68
- }, [textValue, mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.trigger, updateMentionSuggestions]);
75
+ }, [internalTextValue, mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.trigger, updateMentionSuggestions]);
69
76
  useEffect(() => {
70
77
  var _a;
71
78
  // effect for caret index update
@@ -81,7 +88,7 @@ export const TextFieldWithMention = (props) => {
81
88
  (_a = textFieldRef === null || textFieldRef === void 0 ? void 0 : textFieldRef.current) === null || _a === void 0 ? void 0 : _a.setSelectionRange(updatedCaretIndex, updatedCaretIndex);
82
89
  setSelectionStartValue(updatedCaretIndex);
83
90
  setSelectionEndValue(updatedCaretIndex);
84
- }, [caretIndex, inputTextValue.length, textFieldRef, setSelectionStartValue, setSelectionEndValue]);
91
+ }, [caretIndex, inputTextValue, textFieldRef, setSelectionStartValue, setSelectionEndValue]);
85
92
  const onSuggestionSelected = useCallback((suggestion) => {
86
93
  var _a, _b, _c;
87
94
  let selectionEnd = ((_a = textFieldRef === null || textFieldRef === void 0 ? void 0 : textFieldRef.current) === null || _a === void 0 ? void 0 : _a.selectionEnd) || -1;
@@ -97,7 +104,7 @@ export const TextFieldWithMention = (props) => {
97
104
  const triggerText = (_b = mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.trigger) !== null && _b !== void 0 ? _b : DEFAULT_MENTION_TRIGGER;
98
105
  // update html text with updated plain text
99
106
  const updatedContent = updateHTML({
100
- htmlText: textValue,
107
+ htmlText: internalTextValue,
101
108
  oldPlainText,
102
109
  tags: tagsValue,
103
110
  startIndex: currentTriggerStartIndex,
@@ -105,6 +112,7 @@ export const TextFieldWithMention = (props) => {
105
112
  change: mention,
106
113
  mentionTrigger: triggerText
107
114
  });
115
+ setInternalTextValue(updatedContent.updatedHTML);
108
116
  const displayName = getDisplayNameForMentionSuggestion(suggestion, localeStrings);
109
117
  const newCaretIndex = currentTriggerStartIndex + displayName.length + triggerText.length;
110
118
  // move the caret in the text field to the end of the mention plain text
@@ -117,7 +125,7 @@ export const TextFieldWithMention = (props) => {
117
125
  (_c = textFieldRef === null || textFieldRef === void 0 ? void 0 : textFieldRef.current) === null || _c === void 0 ? void 0 : _c.focus();
118
126
  setActiveSuggestionIndex(undefined);
119
127
  onChange && onChange(undefined, updatedContent.updatedHTML);
120
- }, [textFieldRef, inputTextValue, currentTriggerStartIndex, mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.trigger, onChange, textValue, tagsValue, updateMentionSuggestions, localeStrings]);
128
+ }, [textFieldRef, inputTextValue, currentTriggerStartIndex, mentionLookupOptions === null || mentionLookupOptions === void 0 ? void 0 : mentionLookupOptions.trigger, onChange, internalTextValue, tagsValue, updateMentionSuggestions, localeStrings]);
121
129
  const onTextFieldKeyDown = useCallback((ev) => {
122
130
  // caretIndex should be set to undefined when the user is typing
123
131
  setCaretIndex(undefined);
@@ -233,7 +241,14 @@ export const TextFieldWithMention = (props) => {
233
241
  }, [setSelectionStartValue, setSelectionEndValue]);
234
242
  const handleOnSelect = useCallback(({ event, inputTextValue, tags, shouldHandleOnMouseDownDuringSelect, selectionStartValue, selectionEndValue, interactionStartSelection }) => {
235
243
  var _a;
236
- if (shouldHandleOnMouseDownDuringSelect) {
244
+ if (event.currentTarget.selectionStart === 0 && event.currentTarget.selectionEnd === inputTextValue.length) {
245
+ // entire text is selected, no need to change anything
246
+ setSelectionStartValue(event.currentTarget.selectionStart);
247
+ setSelectionEndValue(event.currentTarget.selectionEnd);
248
+ setInteractionStartSelection(undefined);
249
+ setShouldHandleOnMouseDownDuringSelect(false);
250
+ }
251
+ else if (shouldHandleOnMouseDownDuringSelect) {
237
252
  if (interactionStartSelection !== undefined && (interactionStartSelection.start !== event.currentTarget.selectionStart || interactionStartSelection.end !== event.currentTarget.selectionEnd)) {
238
253
  // selection was changed by mouse
239
254
  // for mouse selection only, it's possible to start selection in the middle of a word in a mention
@@ -256,15 +271,26 @@ export const TextFieldWithMention = (props) => {
256
271
  setInteractionStartSelection(undefined);
257
272
  setShouldHandleOnMouseDownDuringSelect(false);
258
273
  }
259
- else if (event.currentTarget.selectionStart !== null) {
274
+ else if (event.currentTarget.selectionStart !== null && event.currentTarget.selectionEnd !== null) {
260
275
  // on select was triggered by mouse down/up with no movement
261
276
  const mentionTag = findMentionTagForSelection(tags, event.currentTarget.selectionStart);
262
277
  if (mentionTag !== undefined && mentionTag.plainTextBeginIndex !== undefined) {
263
278
  // handle mention click by selecting the whole mention
264
279
  // if the selection is not on the bounds of the mention
265
- const mentionEndIndex = (_a = mentionTag.plainTextEndIndex) !== null && _a !== void 0 ? _a : mentionTag.plainTextBeginIndex;
266
280
  // disable selection for clicks on mention bounds
267
- if (event.currentTarget.selectionStart !== event.currentTarget.selectionEnd || event.currentTarget.selectionStart !== mentionTag.plainTextBeginIndex && event.currentTarget.selectionStart !== mentionEndIndex) {
281
+ const mentionEndIndex = (_a = mentionTag.plainTextEndIndex) !== null && _a !== void 0 ? _a : mentionTag.plainTextBeginIndex;
282
+ if (event.currentTarget.selectionStart !== event.currentTarget.selectionEnd && event.currentTarget.selectionEnd > mentionEndIndex) {
283
+ // handle triple click when the text starts from mention
284
+ if (event.currentTarget.selectionDirection === null) {
285
+ event.currentTarget.setSelectionRange(mentionTag.plainTextBeginIndex, event.currentTarget.selectionEnd);
286
+ }
287
+ else {
288
+ event.currentTarget.setSelectionRange(mentionTag.plainTextBeginIndex, event.currentTarget.selectionEnd, event.currentTarget.selectionDirection);
289
+ }
290
+ setSelectionStartValue(mentionTag.plainTextBeginIndex);
291
+ setSelectionEndValue(event.currentTarget.selectionEnd);
292
+ }
293
+ else if (event.currentTarget.selectionStart !== event.currentTarget.selectionEnd || event.currentTarget.selectionStart !== mentionTag.plainTextBeginIndex && event.currentTarget.selectionStart !== mentionEndIndex) {
268
294
  if (event.currentTarget.selectionDirection === null) {
269
295
  event.currentTarget.setSelectionRange(mentionTag.plainTextBeginIndex, mentionEndIndex);
270
296
  }
@@ -286,7 +312,6 @@ export const TextFieldWithMention = (props) => {
286
312
  setSelectionEndValue(nullToUndefined(event.currentTarget.selectionEnd));
287
313
  }
288
314
  setInteractionStartSelection(undefined);
289
- setShouldHandleOnMouseDownDuringSelect(false);
290
315
  }
291
316
  }
292
317
  else {
@@ -340,18 +365,20 @@ export const TextFieldWithMention = (props) => {
340
365
  // Update the caret position, used for positioning the suggestions popover
341
366
  const textField = event.currentTarget;
342
367
  const relativePosition = Caret.getRelativePosition(textField);
343
- const adjustOffset = Math.max(0, textField.scrollHeight - textField.clientHeight);
344
- if (relativePosition.top > adjustOffset) {
345
- relativePosition.top -= adjustOffset;
368
+ if (textField.scrollHeight > textField.clientHeight) {
369
+ relativePosition.top -= textField.scrollTop;
346
370
  }
347
371
  setCaretPosition(relativePosition);
348
372
  if (triggerPriorIndex !== undefined) {
349
373
  // trigger is found
350
- const isSpaceBeforeTrigger = newValue.substring(triggerPriorIndex - 1, triggerPriorIndex) === ' ';
374
+ const symbolBeforeTrigger = newValue.substring(triggerPriorIndex - 1, triggerPriorIndex);
375
+ const isSpaceBeforeTrigger = symbolBeforeTrigger === ' ';
376
+ // check if \r (Carriage Return), \n (Line Feed) or \r\n (End Of Line) is before the trigger
377
+ const isNewLineBeforeTrigger = /\r|\n/.exec(symbolBeforeTrigger);
351
378
  const wordAtSelection = newValue.substring(triggerPriorIndex, currentSelectionEndValue);
352
379
  let tagIndex = currentTriggerStartIndex;
353
- if (!isSpaceBeforeTrigger && triggerPriorIndex !== 0) {
354
- //no space before the trigger <- continuation of the previous word
380
+ if (!isSpaceBeforeTrigger && triggerPriorIndex !== 0 && isNewLineBeforeTrigger === null) {
381
+ // no space before the trigger, it's not a beginning of the line and no new line before <- continuation of the previous word
355
382
  tagIndex = -1;
356
383
  setCurrentTriggerStartIndex(tagIndex);
357
384
  }
@@ -395,6 +422,7 @@ export const TextFieldWithMention = (props) => {
395
422
  change,
396
423
  mentionTrigger: triggerText
397
424
  });
425
+ setInternalTextValue(updatedContent.updatedHTML);
398
426
  // update caret index if needed
399
427
  if (updatedContent.updatedSelectionIndex !== undefined) {
400
428
  setCaretIndex(updatedContent.updatedSelectionIndex);
@@ -444,7 +472,7 @@ export const TextFieldWithMention = (props) => {
444
472
  handleOnChange({
445
473
  event: e,
446
474
  tagsValue,
447
- htmlTextValue: textValue,
475
+ htmlTextValue: internalTextValue,
448
476
  inputTextValue,
449
477
  currentTriggerStartIndex,
450
478
  previousSelectionStart: nullToUndefined(selectionStartValue),
@@ -462,7 +490,9 @@ export const TextFieldWithMention = (props) => {
462
490
  if (caretIndex !== e.currentTarget.selectionStart || caretIndex !== e.currentTarget.selectionEnd) {
463
491
  e.currentTarget.setSelectionRange(caretIndex, caretIndex);
464
492
  }
465
- setCaretIndex(undefined);
493
+ // caret index should not be set to undefined here
494
+ // as it will cause issues when suggestion is selected by mouse
495
+ // caret index will be set to undefined during keyboard/mouse or touch interactions
466
496
  return;
467
497
  }
468
498
  handleOnSelect({
@@ -504,11 +534,9 @@ export const TextFieldWithMention = (props) => {
504
534
  }, onTouchEnd: () => {
505
535
  handleOnInteractionCompleted;
506
536
  }, onBlur: () => {
507
- // setup all flags to default values when text field loses focus
537
+ // setup shouldHandleOnMouseDownDuringSelect to false when text field loses focus
538
+ // as the click should be handled by text field anymore
508
539
  setShouldHandleOnMouseDownDuringSelect(false);
509
- setCaretIndex(undefined);
510
- setSelectionStartValue(undefined);
511
- setSelectionEndValue(undefined);
512
540
  }, onKeyDown: onTextFieldKeyDown, elementRef: inputBoxRef })));
513
541
  };
514
542
  /**