@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 +1 @@
1
- {"version":3,"file":"FileDownloadCards.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/FileDownloadCards.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACzE,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,+CAA+C;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,mCAAgC;AAsIxD,MAAM,sBAAsB,GAAG;IAC7B,SAAS,EAAE,SAAS;CACrB,CAAC;AACF,MAAM,eAAe,GAAG;IACtB,MAAM,EAAE,MAAM;CACf,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,KAAyB,EAAe,EAAE;;IAC3E,MAAM,EACJ,MAAM,EACN,YAAY,EACb,GAAG,KAAK,CAAC;IACV,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,aAAa,GAAG,0BAA0B,EAAE,CAAC;IACnD,MAAM,wBAAwB,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,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AS,EAAE,wBAAwB,EAAE;gBACxW,oBAAC,sBAAsB,OAAG,CACf,CAAC,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,GAAI,CAAC,CACnF,CACb,CAAC;AACX,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,sBAAsB,GAAG,GAAgB,EAAE;IAC/C,4CAA4C;IAC5C,OAAO,oBAAC,IAAI,kBAAY,kCAAkC,EAAC,QAAQ,EAAC,cAAc,EAAC,KAAK,EAAE,eAAe,GAAI,CAAC;IAC9G,+DAA+D;IAC/D,OAAO,oBAAC,IAAI,IAAC,QAAQ,EAAC,eAAe,EAAC,KAAK,EAAE,eAAe,GAAI,CAAC;AACnE,CAAC,CAAC;AACF,MAAM,0BAA0B,GAAG,GAA8B,EAAE;IACjE,gHAAgH;IAChH,OAAO,SAAS,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC;IACzC,OAAO;QACL,YAAY,EAAE,EAAE;QAChB,oBAAoB,EAAE,EAAE;KACzB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { Icon, IconButton, Spinner, SpinnerSize } from '@fluentui/react';\nimport React, { useCallback, useState } from 'react';\nimport { useMemo } from 'react';\n/* @conditional-compile-remove(file-sharing) */\nimport { useLocale } from '../localization';\nimport { _FileCard } from './FileCard';\nimport { _FileCardGroup } from './FileCardGroup';\nimport { iconButtonClassName } from './styles/IconButton.styles';\nimport { _formatString } from '@internal/acs-ui-common';\n\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n/**\n * @beta\n */\nexport type FileMetadataAttachmentType = 'fileSharing' | /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */'teamsInlineImage' | 'unknown';\n\n/**\n * Meta Data containing information about the uploaded file.\n * @beta\n */\nexport interface FileMetadata {\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n /*\n * Attachment type of the file.\n * Possible values {@link FileDownloadHandler}.\n */\n attachmentType: FileMetadataAttachmentType;\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n /*\n * Unique ID of the file.\n */\n id: string;\n /**\n * File name to be displayed.\n */\n name: string;\n /**\n * Extension is used for rendering the file icon.\n * An unknown extension will be rendered as a generic icon.\n * Example: `jpeg`\n */\n extension: string;\n /**\n * Download URL for the file.\n */\n url: string;\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n /*\n * Preview URL for the file.\n * Used in the message bubble for inline images.\n */\n previewUrl?: string;\n}\n\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n/**\n * @beta\n */\nexport interface AttachmentDownloadResult {\n blobUrl: string;\n}\n\n/**\n * Strings of _FileDownloadCards that can be overridden.\n *\n * @internal\n */\nexport interface _FileDownloadCardsStrings {\n /** Aria label to notify user when focus is on file download button. */\n downloadFile: string;\n fileCardGroupMessage: string;\n}\n\n/**\n * @beta\n * A file download error returned via a {@link FileDownloadHandler}.\n * This error message is used to render an error message in the UI.\n */\nexport interface FileDownloadError {\n /** The error message to display in the UI */\n errorMessage: string;\n}\n\n/**\n * @beta\n *\n * A callback function for handling file downloads.\n * The function needs to return a promise that resolves to a file download URL.\n * If the promise is rejected, the {@link Error.message} will be used to display an error message to the user.\n *\n * @example\n * ```ts\n * const fileDownloadHandler: FileDownloadHandler = async (userId, fileData) => {\n * if (isUnauthorizedUser(userId)) {\n * return { errorMessage: 'You don’t have permission to download this file.' };\n * } else {\n * return new URL(fileData.url);\n * }\n * }\n *\n * const App = () => (\n * <ChatComposite\n * ...\n * fileSharing={{\n * fileDownloadHandler: fileDownloadHandler\n * }}\n * />\n * )\n *\n * ```\n * @param userId - The user ID of the user downloading the file.\n * @param fileMetadata - The {@link FileMetadata} containing file `url`, `extension` and `name`.\n */\nexport type FileDownloadHandler = (userId: string, fileMetadata: FileMetadata) => Promise<URL | FileDownloadError>;\n\n/**\n * @internal\n */\nexport interface _FileDownloadCards {\n /**\n * User id of the local participant\n */\n userId: string;\n /**\n * A chat message metadata that inculdes file metadata\n */\n fileMetadata: FileMetadata[];\n /**\n * A function of type {@link FileDownloadHandler} for handling file downloads.\n * If the function is not specified, the file's `url` will be opened in a new tab to\n * initiate the download.\n */\n downloadHandler?: FileDownloadHandler;\n /**\n * Optional callback that runs if downloadHandler returns {@link FileDownloadError}.\n */\n onDownloadErrorMessage?: (errMsg: string) => void;\n /**\n * Optional arialabel strings for file download cards\n */\n strings?: _FileDownloadCardsStrings;\n}\nconst fileDownloadCardsStyle = {\n marginTop: '0.25rem'\n};\nconst actionIconStyle = {\n height: '1rem'\n};\n\n/**\n * @internal\n */\nexport const _FileDownloadCards = (props: _FileDownloadCards): JSX.Element => {\n const {\n userId,\n fileMetadata\n } = props;\n const [showSpinner, setShowSpinner] = useState(false);\n const localeStrings = useLocaleStringsTrampoline();\n const downloadFileButtonString = useMemo(() => () => {\n return props.strings?.downloadFile ?? localeStrings.downloadFile;\n }, [props.strings?.downloadFile, localeStrings.downloadFile]);\n const fileCardGroupDescription = useMemo(() => () => {\n const fileGroupLocaleString = props.strings?.fileCardGroupMessage ?? localeStrings.fileCardGroupMessage;\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n return _formatString(fileGroupLocaleString, {\n fileCount: `${fileMetadata.filter(file => file.attachmentType === 'fileSharing').length}`\n });\n return _formatString(fileGroupLocaleString, {\n fileCount: `${fileMetadata.length}`\n });\n }, [props.strings?.fileCardGroupMessage, localeStrings.fileCardGroupMessage, fileMetadata]);\n const fileDownloadHandler = useCallback(async (userId, file: FileMetadata) => {\n if (!props.downloadHandler) {\n window.open(file.url, '_blank', 'noopener,noreferrer');\n } else {\n setShowSpinner(true);\n try {\n const response = await props.downloadHandler(userId, file);\n setShowSpinner(false);\n if (response instanceof URL) {\n window.open(response.toString(), '_blank', 'noopener,noreferrer');\n } else {\n props.onDownloadErrorMessage && props.onDownloadErrorMessage(response.errorMessage);\n }\n } finally {\n setShowSpinner(false);\n }\n }\n }, [props]);\n if (!fileMetadata || fileMetadata.length === 0 || /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */!fileMetadata.some(attachment => attachment.attachmentType === 'fileSharing')) {\n return <></>;\n }\n return <div style={fileDownloadCardsStyle} data-ui-id=\"file-download-card-group\">\n <_FileCardGroup ariaLabel={fileCardGroupDescription()}>\n {fileMetadata && fileMetadata.filter(attachment => {\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n return attachment.attachmentType === 'fileSharing';\n return true;\n }).map(file => <_FileCard fileName={file.name} key={file.name} fileExtension={file.extension} actionIcon={showSpinner ? <Spinner size={SpinnerSize.medium} aria-live={'polite'} role={'status'} /> : true && /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */!file.previewUrl ? <IconButton className={iconButtonClassName} ariaLabel={downloadFileButtonString()}>\n <DownloadIconTrampoline />\n </IconButton> : undefined} actionHandler={() => fileDownloadHandler(userId, file)} />)}\n </_FileCardGroup>\n </div>;\n};\n\n/**\n * @private\n */\nconst DownloadIconTrampoline = (): JSX.Element => {\n // @conditional-compile-remove(file-sharing)\n return <Icon data-ui-id=\"file-download-card-download-icon\" iconName=\"DownloadFile\" style={actionIconStyle} />;\n // Return _some_ available icon, as the real icon is beta-only.\n return <Icon iconName=\"EditBoxCancel\" style={actionIconStyle} />;\n};\nconst useLocaleStringsTrampoline = (): _FileDownloadCardsStrings => {\n /* @conditional-compile-remove(file-sharing) @conditional-compile-remove(teams-inline-images-and-file-sharing)*/\n return useLocale().strings.messageThread;\n return {\n downloadFile: '',\n fileCardGroupMessage: ''\n };\n};\"../../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"FileDownloadCards.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/FileDownloadCards.tsx"],"names":[],"mappings":";;;;;;;;;AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,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E;gBAC5F,oBAAC,sBAAsB,OAAG,CACf,CAAC,CAAC,CAAC,SAAS,EAAE,aAAa,EAAE,GAAG,EAAE,CAAC,mBAAmB,CAAC,MAAM,EAAE,IAAI,CAAC,GAAI,CAAC,CACnF,CACb,CAAC;AACX,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,sBAAsB,GAAG,GAAgB,EAAE;IAC/C,4CAA4C;IAC5C,OAAO,oBAAC,IAAI,kBAAY,kCAAkC,EAAC,QAAQ,EAAC,cAAc,EAAC,KAAK,EAAE,eAAe,GAAI,CAAC;IAC9G,+DAA+D;IAC/D,OAAO,oBAAC,IAAI,IAAC,QAAQ,EAAC,eAAe,EAAC,KAAK,EAAE,eAAe,GAAI,CAAC;AACnE,CAAC,CAAC;AACF,MAAM,0BAA0B,GAAG,GAA8B,EAAE;IACjE,gHAAgH;IAChH,OAAO,SAAS,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC;IACzC,OAAO;QACL,YAAY,EAAE,EAAE;QAChB,oBAAoB,EAAE,EAAE;KACzB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { Icon, IconButton, Spinner, SpinnerSize } from '@fluentui/react';\nimport React, { useCallback, useState } from 'react';\nimport { useMemo } from 'react';\n/* @conditional-compile-remove(file-sharing) */\nimport { useLocale } from '../localization';\nimport { _FileCard } from './FileCard';\nimport { _FileCardGroup } from './FileCardGroup';\nimport { iconButtonClassName } from './styles/IconButton.styles';\nimport { _formatString } from '@internal/acs-ui-common';\n\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n/**\n * @beta\n */\nexport type FileMetadataAttachmentType = 'fileSharing' | /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */'inlineImage' | 'unknown';\n\n/**\n * Base interface that all Meta Data should extend.\n * Typically used for ACS to ACS file transfers.\n * @beta\n */\nexport interface BaseFileMetadata {\n /**\n * File name to be displayed.\n */\n name: string;\n /**\n * Extension is used for rendering the file icon.\n * An unknown extension will be rendered as a generic icon.\n * Example: `jpeg`\n */\n extension: string;\n /**\n * Download URL for the file.\n */\n url: string;\n /**\n * Unique ID of the file.\n */\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n id: string;\n /**\n * Attachment Type\n */\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n attachmentType: FileMetadataAttachmentType;\n}\n/**\n * Meta Data containing basic information about the uploaded file.\n * Typically used for ACS to ACS file transfers.\n * @beta\n */\nexport interface FileSharingMetadata extends BaseFileMetadata {\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n attachmentType: 'fileSharing';\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n /*\n * Optional dictionary of meta data asscoiated with the file.\n */\n payload?: Record<string, string>;\n}\n\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n/**\n * Meta Data containing data for images.\n * @beta\n */\nexport interface ImageFileMetadata extends BaseFileMetadata {\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n /*\n * Attachment type of the file.\n * Possible values {@link FileDownloadHandler}.\n */\n attachmentType: 'inlineImage';\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n /*\n * Preview URL for the file.\n * Used in the message bubble for inline images.\n */\n previewUrl?: string;\n}\n\n/**\n * Meta Data containing information about the uploaded file.\n * @beta\n */\nexport type FileMetadata = FileSharingMetadata | /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ImageFileMetadata;\n\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n/**\n * @beta\n */\nexport interface AttachmentDownloadResult {\n blobUrl: string;\n}\n\n/**\n * Strings of _FileDownloadCards that can be overridden.\n *\n * @internal\n */\nexport interface _FileDownloadCardsStrings {\n /** Aria label to notify user when focus is on file download button. */\n downloadFile: string;\n fileCardGroupMessage: string;\n}\n\n/**\n * @beta\n * A file download error returned via a {@link FileDownloadHandler}.\n * This error message is used to render an error message in the UI.\n */\nexport interface FileDownloadError {\n /** The error message to display in the UI */\n errorMessage: string;\n}\n\n/**\n * @beta\n *\n * A callback function for handling file downloads.\n * The function needs to return a promise that resolves to a file download URL.\n * If the promise is rejected, the {@link Error.message} will be used to display an error message to the user.\n *\n * @example\n * ```ts\n * const fileDownloadHandler: FileDownloadHandler = async (userId, fileData) => {\n * if (isUnauthorizedUser(userId)) {\n * return { errorMessage: 'You don’t have permission to download this file.' };\n * } else {\n * return new URL(fileData.url);\n * }\n * }\n *\n * const App = () => (\n * <ChatComposite\n * ...\n * fileSharing={{\n * fileDownloadHandler: fileDownloadHandler\n * }}\n * />\n * )\n *\n * ```\n * @param userId - The user ID of the user downloading the file.\n * @param fileMetadata - The {@link FileMetadata} containing file `url`, `extension` and `name`.\n */\nexport type FileDownloadHandler = (userId: string, fileMetadata: FileMetadata) => Promise<URL | FileDownloadError>;\n\n/**\n * @internal\n */\nexport interface _FileDownloadCards {\n /**\n * User id of the local participant\n */\n userId: string;\n /**\n * A chat message metadata that inculdes file metadata\n */\n fileMetadata: FileMetadata[];\n /**\n * A function of type {@link FileDownloadHandler} for handling file downloads.\n * If the function is not specified, the file's `url` will be opened in a new tab to\n * initiate the download.\n */\n downloadHandler?: FileDownloadHandler;\n /**\n * Optional callback that runs if downloadHandler returns {@link FileDownloadError}.\n */\n onDownloadErrorMessage?: (errMsg: string) => void;\n /**\n * Optional arialabel strings for file download cards\n */\n strings?: _FileDownloadCardsStrings;\n}\nconst fileDownloadCardsStyle = {\n marginTop: '0.25rem'\n};\nconst actionIconStyle = {\n height: '1rem'\n};\n\n/**\n * @internal\n */\nexport const _FileDownloadCards = (props: _FileDownloadCards): JSX.Element => {\n const {\n userId,\n fileMetadata\n } = props;\n const [showSpinner, setShowSpinner] = useState(false);\n const localeStrings = useLocaleStringsTrampoline();\n const downloadFileButtonString = useMemo(() => () => {\n return props.strings?.downloadFile ?? localeStrings.downloadFile;\n }, [props.strings?.downloadFile, localeStrings.downloadFile]);\n const isFileSharingAttachment = useCallback((attachment: FileMetadata): boolean => {\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n return attachment.attachmentType === 'fileSharing';\n return false;\n }, []);\n\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n const isShowDownloadIcon = useCallback((attachment: FileMetadata): boolean => {\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n return attachment.attachmentType === 'fileSharing' && attachment.payload?.teamsFileAttachment !== 'true';\n return true;\n }, []);\n const fileCardGroupDescription = useMemo(() => () => {\n const fileGroupLocaleString = props.strings?.fileCardGroupMessage ?? localeStrings.fileCardGroupMessage;\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n return _formatString(fileGroupLocaleString, {\n fileCount: `${fileMetadata.filter(isFileSharingAttachment).length}`\n });\n return _formatString(fileGroupLocaleString, {\n fileCount: `${fileMetadata.length}`\n });\n }, [props.strings?.fileCardGroupMessage, localeStrings.fileCardGroupMessage, fileMetadata, isFileSharingAttachment]);\n const fileDownloadHandler = useCallback(async (userId, file: FileMetadata) => {\n if (!props.downloadHandler) {\n window.open(file.url, '_blank', 'noopener,noreferrer');\n } else {\n setShowSpinner(true);\n try {\n const response = await props.downloadHandler(userId, file);\n setShowSpinner(false);\n if (response instanceof URL) {\n window.open(response.toString(), '_blank', 'noopener,noreferrer');\n } else {\n props.onDownloadErrorMessage && props.onDownloadErrorMessage(response.errorMessage);\n }\n } finally {\n setShowSpinner(false);\n }\n }\n }, [props]);\n if (!fileMetadata || fileMetadata.length === 0 || /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */!fileMetadata.some(isFileSharingAttachment)) {\n return <></>;\n }\n return <div style={fileDownloadCardsStyle} data-ui-id=\"file-download-card-group\">\n <_FileCardGroup ariaLabel={fileCardGroupDescription()}>\n {fileMetadata && fileMetadata.filter(attachment => {\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n return isFileSharingAttachment(attachment);\n return true;\n }).map(file => <_FileCard fileName={file.name} key={file.name} fileExtension={file.extension} actionIcon={showSpinner ? <Spinner size={SpinnerSize.medium} aria-live={'polite'} role={'status'} /> : true && /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n isShowDownloadIcon(file) ? <IconButton className={iconButtonClassName} ariaLabel={downloadFileButtonString()}>\n <DownloadIconTrampoline />\n </IconButton> : undefined} actionHandler={() => fileDownloadHandler(userId, file)} />)}\n </_FileCardGroup>\n </div>;\n};\n\n/**\n * @private\n */\nconst DownloadIconTrampoline = (): JSX.Element => {\n // @conditional-compile-remove(file-sharing)\n return <Icon data-ui-id=\"file-download-card-download-icon\" iconName=\"DownloadFile\" style={actionIconStyle} />;\n // Return _some_ available icon, as the real icon is beta-only.\n return <Icon iconName=\"EditBoxCancel\" style={actionIconStyle} />;\n};\nconst useLocaleStringsTrampoline = (): _FileDownloadCardsStrings => {\n /* @conditional-compile-remove(file-sharing) @conditional-compile-remove(teams-inline-images-and-file-sharing)*/\n return useLocale().strings.messageThread;\n return {\n downloadFile: '',\n fileCardGroupMessage: ''\n };\n};\"../../../acs-ui-common/src\""]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ActiveFileUpload } from './SendBox';
3
2
  /**
4
3
  * Strings of _FileUploadCards that can be overridden.
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  /**
3
2
  * @internal
4
3
  */
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ControlBarButtonProps } from './ControlBarButton';
3
2
  /**
4
3
  *@beta
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { OptionsDevice } from './DevicesButton';
3
2
  /**
4
3
  * @public
@@ -18,9 +18,7 @@ export const _MentionPopover = (props) => {
18
18
  const ids = useIdentifiers();
19
19
  const localeStrings = useLocale().strings;
20
20
  const popoverRef = useRef();
21
- const [position, setPosition] = useState({
22
- left: 0
23
- });
21
+ const [position, setPosition] = useState();
24
22
  const [hoveredSuggestion, setHoveredSuggestion] = useState(undefined);
25
23
  const [changedSelection, setChangedSelection] = useState(undefined); // Selection UI as per teams
26
24
  const dismissPopoverWhenClickingOutside = useCallback((e) => {
@@ -59,12 +57,14 @@ export const _MentionPopover = (props) => {
59
57
  else {
60
58
  finalPosition.left = leftOffset;
61
59
  }
60
+ // Offset between cursor and mention popover
61
+ const verticalOffset = 4;
62
62
  if (location === 'below') {
63
- finalPosition.top = ((_e = rect === null || rect === void 0 ? void 0 : rect.height) !== null && _e !== void 0 ? _e : 0) + ((_f = targetPositionOffset === null || targetPositionOffset === void 0 ? void 0 : targetPositionOffset.top) !== null && _f !== void 0 ? _f : 0);
63
+ finalPosition.top = ((_e = rect === null || rect === void 0 ? void 0 : rect.height) !== null && _e !== void 0 ? _e : 0) + ((_f = targetPositionOffset === null || targetPositionOffset === void 0 ? void 0 : targetPositionOffset.top) !== null && _f !== void 0 ? _f : 0) + verticalOffset;
64
64
  }
65
65
  else {
66
66
  // (location === 'above')
67
- finalPosition.bottom = ((_g = rect === null || rect === void 0 ? void 0 : rect.height) !== null && _g !== void 0 ? _g : 0) - ((_h = targetPositionOffset === null || targetPositionOffset === void 0 ? void 0 : targetPositionOffset.top) !== null && _h !== void 0 ? _h : 0);
67
+ finalPosition.bottom = ((_g = rect === null || rect === void 0 ? void 0 : rect.height) !== null && _g !== void 0 ? _g : 0) - ((_h = targetPositionOffset === null || targetPositionOffset === void 0 ? void 0 : targetPositionOffset.top) !== null && _h !== void 0 ? _h : 0) + verticalOffset;
68
68
  }
69
69
  setPosition(finalPosition);
70
70
  }, [location, target, targetPositionOffset]);
@@ -103,16 +103,15 @@ export const _MentionPopover = (props) => {
103
103
  return localeStrings.mentionPopover.mentionPopoverHeader;
104
104
  return '';
105
105
  }, [localeStrings, title]);
106
- return React.createElement("div", { ref: popoverRef },
107
- React.createElement(Stack, { "data-testid": 'mention-suggestion-list-container', className: mergeStyles({
108
- maxHeight: 212,
109
- maxWidth: position.maxWidth
110
- }, mentionPopoverContainerStyle(theme), Object.assign(Object.assign({}, position), { position: 'absolute' })) },
111
- React.createElement(Stack.Item, { styles: headerStyleThemed(theme), "aria-label": title }, getHeaderTitle()),
112
- React.createElement(Stack
113
- /* @conditional-compile-remove(mention) */ , { "data-ui-id": ids.mentionSuggestionList, className: suggestionListStyle }, suggestions.map((suggestion, index) => {
114
- const active = index === activeSuggestionIndex;
115
- return onRenderSuggestionItem ? onRenderSuggestionItem(suggestion, onSuggestionSelected, active) : defaultOnRenderSuggestionItem(suggestion, onSuggestionSelected, active);
116
- }))));
106
+ return React.createElement("div", { ref: popoverRef }, position && React.createElement(Stack, { "data-testid": 'mention-suggestion-list-container', className: mergeStyles({
107
+ maxHeight: 212,
108
+ maxWidth: position.maxWidth
109
+ }, mentionPopoverContainerStyle(theme), Object.assign(Object.assign({}, position), { position: 'absolute' })) },
110
+ React.createElement(Stack.Item, { styles: headerStyleThemed(theme), "aria-label": title }, getHeaderTitle()),
111
+ React.createElement(Stack
112
+ /* @conditional-compile-remove(mention) */ , { "data-ui-id": ids.mentionSuggestionList, className: suggestionListStyle }, suggestions.map((suggestion, index) => {
113
+ const active = index === activeSuggestionIndex;
114
+ return onRenderSuggestionItem ? onRenderSuggestionItem(suggestion, onSuggestionSelected, active) : defaultOnRenderSuggestionItem(suggestion, onSuggestionSelected, active);
115
+ }))));
117
116
  };
118
117
  //# sourceMappingURL=MentionPopover.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"MentionPopover.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/MentionPopover.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,0B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EAAE,QAAQ,CAAC,QAAQ;aAC5B,EAAE,4BAA4B,CAAC,KAAK,CAAC,kCACjC,QAAQ,KACX,QAAQ,EAAE,UAAU,IACpB;YACE,oBAAC,KAAK,CAAC,IAAI,IAAC,MAAM,EAAE,iBAAiB,CAAC,KAAK,CAAC,gBAAc,KAAK,IAC5D,cAAc,EAAE,CACN;YACb,oBAAC,KAAK;YACR,0CAA0C,mBAAa,GAAG,CAAC,qBAAqB,EAAE,SAAS,EAAE,mBAAmB,IAC3G,WAAW,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,KAAK,EAAE,EAAE;gBACvC,MAAM,MAAM,GAAG,KAAK,KAAK,qBAAqB,CAAC;gBAC/C,OAAO,sBAAsB,CAAC,CAAC,CAAC,sBAAsB,CAAC,UAAU,EAAE,oBAAoB,EAAE,MAAM,CAAC,CAAC,CAAC,CAAC,6BAA6B,CAAC,UAAU,EAAE,oBAAoB,EAAE,MAAM,CAAC,CAAC;YAC7K,CAAC,CAAC,CACM,CACF,CACJ,CAAC;AACX,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport React, { useEffect, useRef, useState, useCallback } from 'react';\nimport { Persona, PersonaSize, Stack, mergeStyles, useTheme } from '@fluentui/react';\nimport { mentionPopoverContainerStyle, headerStyleThemed, suggestionListStyle, suggestionItemStackStyle, suggestionItemWrapperStyle } from './styles/MentionPopover.style';\n/* @conditional-compile-remove(mention) */\nimport { useIdentifiers } from '../identifiers';\nimport { useLocale } from '../localization';\n\n/**\n * Props for {@link _MentionPopover}.\n *\n * @internal\n */\nexport interface _MentionPopoverProps {\n /**\n * Array of mention suggestions used to populate the suggestion list\n */\n suggestions: Mention[];\n /**\n * Index of the currently focused suggestion, if any\n */\n activeSuggestionIndex?: number;\n /**\n * Optional string used as mention popover's title.\n * @defaultValue `Suggestions`\n */\n title?: string;\n /**\n * Element to anchor the popover to.\n */\n target: React.RefObject<Element>;\n /**\n * When rendering the popover, where to position it relative to the target.\n */\n targetPositionOffset?: {\n top: number;\n left: number;\n };\n /**\n * Where to display the suggestions relative to the target.\n * @defaultValue `above`\n */\n location?: 'above' | 'below';\n /**\n * Callback called when a mention suggestion is selected.\n */\n onSuggestionSelected: (suggestion: Mention) => void;\n /**\n * Callback to invoke when the popover is dismissed\n */\n onDismiss?: () => void;\n /**\n * Optional callback to render an item of the mention suggestions list.\n */\n onRenderSuggestionItem?: (suggestion: Mention, onSuggestionSelected: (suggestion: Mention) => void, isActive: boolean) => JSX.Element;\n}\n\n/**\n * Options to lookup suggestions in the mention scenario.\n *\n * @beta\n */\nexport interface MentionLookupOptions {\n /**\n * Optional string to set trigger keyword for mention a specific participant.\n *\n * @defaultValue `@`\n */\n trigger?: string;\n /**\n * Optional callback to fetch a list of mention suggestions base on the query.\n */\n onQueryUpdated: (query: string) => Promise<Mention[]>;\n /**\n * Optional callback to render an item of the mention suggestions list.\n */\n onRenderSuggestionItem?: (suggestion: Mention, onSuggestionSelected: (suggestion: Mention) => void) => JSX.Element;\n}\n\n/**\n * Options to display suggestions in the mention scenario.\n *\n * @beta\n */\nexport interface MentionDisplayOptions {\n /**\n * Optional callback for customizing the mention renderer in a message thread.\n */\n onRenderMention?: (mention: Mention, defaultOnRender: (mention: Mention) => JSX.Element) => JSX.Element;\n}\n\n/**\n * Options to lookup suggestions and display mentions in the mention scenario.\n *\n * @beta\n */\nexport type MentionOptions = {\n lookupOptions?: MentionLookupOptions;\n displayOptions?: MentionDisplayOptions;\n};\n\n/**\n * Mention's state, as reflected in the UI.\n *\n * @beta\n */\nexport interface Mention {\n /** ID of a mention */\n id: string;\n /** Display text of a mention */\n displayText: string;\n /** Optional React element to render an item icon of a mention suggestion */\n icon?: JSX.Element;\n}\n\n/**\n * Strings of {@link _MentionPopover} that can be overridden.\n *\n * @beta\n */\nexport interface MentionPopoverStrings {\n /**\n * Header text for MentionPopover\n */\n mentionPopoverHeader: string;\n}\n\n/**\n * Component to render a pop-up of mention suggestions.\n *\n * @internal\n */\nexport const _MentionPopover = (props: _MentionPopoverProps): JSX.Element => {\n interface Position {\n left?: number;\n right?: number;\n top?: number;\n bottom?: number;\n maxWidth?: number;\n }\n const {\n suggestions,\n activeSuggestionIndex,\n title,\n target,\n targetPositionOffset,\n onRenderSuggestionItem,\n onSuggestionSelected,\n onDismiss,\n location\n } = props;\n const theme = useTheme();\n /* @conditional-compile-remove(mention) */\n const ids = useIdentifiers();\n const localeStrings = useLocale().strings;\n const popoverRef = (useRef() as React.MutableRefObject<HTMLDivElement>);\n const [position, setPosition] = useState<Position>({\n left: 0\n });\n const [hoveredSuggestion, setHoveredSuggestion] = useState<Mention | undefined>(undefined);\n const [changedSelection, setChangedSelection] = useState<boolean | undefined>(undefined); // Selection UI as per teams\n\n const dismissPopoverWhenClickingOutside = useCallback((e: MouseEvent) => {\n const target = (e.target as HTMLElement);\n if (popoverRef.current && !popoverRef.current.contains(target)) {\n onDismiss && onDismiss();\n }\n }, [onDismiss]);\n useEffect(() => {\n if (changedSelection === undefined) {\n setChangedSelection(false);\n } else if (changedSelection === false) {\n setChangedSelection(true);\n }\n }, [activeSuggestionIndex, changedSelection]);\n useEffect(() => {\n window && window.addEventListener('click', dismissPopoverWhenClickingOutside);\n return () => {\n window && window.removeEventListener('click', dismissPopoverWhenClickingOutside);\n };\n }, [dismissPopoverWhenClickingOutside]);\n\n // Determine popover position\n useEffect(() => {\n const rect = target?.current?.getBoundingClientRect();\n const maxWidth = 200;\n const finalPosition: Position = {\n maxWidth\n };\n\n // Figure out whether it will fit horizontally\n const leftOffset = targetPositionOffset?.left ?? 0;\n if (leftOffset + maxWidth > (rect?.width ?? 0)) {\n finalPosition.right = (rect?.width ?? 0) - leftOffset;\n } else {\n finalPosition.left = leftOffset;\n }\n if (location === 'below') {\n finalPosition.top = (rect?.height ?? 0) + (targetPositionOffset?.top ?? 0);\n } else {\n // (location === 'above')\n finalPosition.bottom = (rect?.height ?? 0) - (targetPositionOffset?.top ?? 0);\n }\n setPosition(finalPosition);\n }, [location, target, targetPositionOffset]);\n const handleOnKeyDown = useCallback((e: React.KeyboardEvent<HTMLDivElement>) => {\n switch (e.key) {\n case 'Escape':\n onDismiss && onDismiss();\n break;\n default:\n break;\n }\n }, [onDismiss]);\n const personaRenderer = useCallback((displayName: string): JSX.Element => {\n const avatarOptions = {\n text: displayName.trim(),\n size: PersonaSize.size24,\n initialsColor: theme.palette.neutralLight,\n initialsTextColor: theme.palette.neutralSecondary,\n showOverflowTooltip: false,\n showUnknownPersonaCoin: false\n };\n return <Persona {...avatarOptions} />;\n }, [theme]);\n const defaultOnRenderSuggestionItem = useCallback((suggestion: Mention, onSuggestionSelected: (suggestion: Mention) => void, active: boolean): JSX.Element => {\n return <div data-is-focusable={true}\n /* @conditional-compile-remove(mention) */ data-ui-id={ids.mentionSuggestionItem} key={suggestion.id} onClick={() => onSuggestionSelected(suggestion)} onMouseEnter={() => setHoveredSuggestion(suggestion)} onMouseLeave={() => setHoveredSuggestion(undefined)} onKeyDown={e => {\n handleOnKeyDown(e);\n }} className={suggestionItemWrapperStyle(theme)}>\n <Stack horizontal className={suggestionItemStackStyle(theme, hoveredSuggestion?.id === suggestion.id, (changedSelection ?? false) && active)}>\n {personaRenderer(suggestion.displayText)}\n </Stack>\n </div>;\n }, [handleOnKeyDown, theme, /* @conditional-compile-remove(mention) */\n ids, hoveredSuggestion, changedSelection, personaRenderer]);\n const getHeaderTitle = useCallback((): string => {\n if (title) {\n return title;\n }\n /* @conditional-compile-remove(mention) */\n return localeStrings.mentionPopover.mentionPopoverHeader;\n return '';\n }, [localeStrings, title]);\n return <div ref={popoverRef}>\n <Stack data-testid={'mention-suggestion-list-container'} className={mergeStyles({\n maxHeight: 212,\n maxWidth: position.maxWidth\n }, mentionPopoverContainerStyle(theme), {\n ...position,\n position: 'absolute'\n })}>\n <Stack.Item styles={headerStyleThemed(theme)} aria-label={title}>\n {getHeaderTitle()}\n </Stack.Item>\n <Stack\n /* @conditional-compile-remove(mention) */ data-ui-id={ids.mentionSuggestionList} className={suggestionListStyle}>\n {suggestions.map((suggestion, index) => {\n const active = index === activeSuggestionIndex;\n return onRenderSuggestionItem ? onRenderSuggestionItem(suggestion, onSuggestionSelected, active) : defaultOnRenderSuggestionItem(suggestion, onSuggestionSelected, active);\n })}\n </Stack>\n </Stack>\n </div>;\n};"]}
1
+ {"version":3,"file":"MentionPopover.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/MentionPopover.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACrF,OAAO,EAAE,4BAA4B,EAAE,iBAAiB,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3K,0CAA0C;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAyH5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAe,EAAE;IAQ1E,MAAM,EACJ,WAAW,EACX,qBAAqB,EACrB,KAAK,EACL,MAAM,EACN,oBAAoB,EACpB,sBAAsB,EACtB,oBAAoB,EACpB,SAAS,EACT,QAAQ,EACT,GAAG,KAAK,CAAC;IACV,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,0CAA0C;IAC1C,MAAM,GAAG,GAAG,cAAc,EAAE,CAAC;IAC7B,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC;IAC1C,MAAM,UAAU,GAAI,MAAM,EAA6C,CAAC;IACxE,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,G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EAAE,MAAM,CAAC,CAAC;QAC7K,CAAC,CAAC,CACQ,CACF,CACN,CAAC;AACX,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport React, { useEffect, useRef, useState, useCallback } from 'react';\nimport { Persona, PersonaSize, Stack, mergeStyles, useTheme } from '@fluentui/react';\nimport { mentionPopoverContainerStyle, headerStyleThemed, suggestionListStyle, suggestionItemStackStyle, suggestionItemWrapperStyle } from './styles/MentionPopover.style';\n/* @conditional-compile-remove(mention) */\nimport { useIdentifiers } from '../identifiers';\nimport { useLocale } from '../localization';\n\n/**\n * Props for {@link _MentionPopover}.\n *\n * @internal\n */\nexport interface _MentionPopoverProps {\n /**\n * Array of mention suggestions used to populate the suggestion list\n */\n suggestions: Mention[];\n /**\n * Index of the currently focused suggestion, if any\n */\n activeSuggestionIndex?: number;\n /**\n * Optional string used as mention popover's title.\n * @defaultValue `Suggestions`\n */\n title?: string;\n /**\n * Element to anchor the popover to.\n */\n target: React.RefObject<Element>;\n /**\n * When rendering the popover, where to position it relative to the target.\n */\n targetPositionOffset?: {\n top: number;\n left: number;\n };\n /**\n * Where to display the suggestions relative to the target.\n * @defaultValue `above`\n */\n location?: 'above' | 'below';\n /**\n * Callback called when a mention suggestion is selected.\n */\n onSuggestionSelected: (suggestion: Mention) => void;\n /**\n * Callback to invoke when the popover is dismissed\n */\n onDismiss?: () => void;\n /**\n * Optional callback to render an item of the mention suggestions list.\n */\n onRenderSuggestionItem?: (suggestion: Mention, onSuggestionSelected: (suggestion: Mention) => void, isActive: boolean) => JSX.Element;\n}\n\n/**\n * Options to lookup suggestions in the mention scenario.\n *\n * @beta\n */\nexport interface MentionLookupOptions {\n /**\n * Optional string to set trigger keyword for mention a specific participant.\n *\n * @defaultValue `@`\n */\n trigger?: string;\n /**\n * Optional callback to fetch a list of mention suggestions base on the query.\n */\n onQueryUpdated: (query: string) => Promise<Mention[]>;\n /**\n * Optional callback to render an item of the mention suggestions list.\n */\n onRenderSuggestionItem?: (suggestion: Mention, onSuggestionSelected: (suggestion: Mention) => void) => JSX.Element;\n}\n\n/**\n * Options to display suggestions in the mention scenario.\n *\n * @beta\n */\nexport interface MentionDisplayOptions {\n /**\n * Optional callback for customizing the mention renderer in a message thread.\n */\n onRenderMention?: (mention: Mention, defaultOnRender: (mention: Mention) => JSX.Element) => JSX.Element;\n}\n\n/**\n * Options to lookup suggestions and display mentions in the mention scenario.\n *\n * @beta\n */\nexport type MentionOptions = {\n lookupOptions?: MentionLookupOptions;\n displayOptions?: MentionDisplayOptions;\n};\n\n/**\n * Mention's state, as reflected in the UI.\n *\n * @beta\n */\nexport interface Mention {\n /** ID of a mention */\n id: string;\n /** Display text of a mention */\n displayText: string;\n /** Optional React element to render an item icon of a mention suggestion */\n icon?: JSX.Element;\n}\n\n/**\n * Strings of {@link _MentionPopover} that can be overridden.\n *\n * @beta\n */\nexport interface MentionPopoverStrings {\n /**\n * Header text for MentionPopover\n */\n mentionPopoverHeader: string;\n}\n\n/**\n * Component to render a pop-up of mention suggestions.\n *\n * @internal\n */\nexport const _MentionPopover = (props: _MentionPopoverProps): JSX.Element => {\n interface Position {\n left?: number;\n right?: number;\n top?: number;\n bottom?: number;\n maxWidth?: number;\n }\n const {\n suggestions,\n activeSuggestionIndex,\n title,\n target,\n targetPositionOffset,\n onRenderSuggestionItem,\n onSuggestionSelected,\n onDismiss,\n location\n } = props;\n const theme = useTheme();\n /* @conditional-compile-remove(mention) */\n const ids = useIdentifiers();\n const localeStrings = useLocale().strings;\n const popoverRef = (useRef() as React.MutableRefObject<HTMLDivElement>);\n const [position, setPosition] = useState<Position | undefined>();\n const [hoveredSuggestion, setHoveredSuggestion] = useState<Mention | undefined>(undefined);\n const [changedSelection, setChangedSelection] = useState<boolean | undefined>(undefined); // Selection UI as per teams\n\n const dismissPopoverWhenClickingOutside = useCallback((e: MouseEvent) => {\n const target = (e.target as HTMLElement);\n if (popoverRef.current && !popoverRef.current.contains(target)) {\n onDismiss && onDismiss();\n }\n }, [onDismiss]);\n useEffect(() => {\n if (changedSelection === undefined) {\n setChangedSelection(false);\n } else if (changedSelection === false) {\n setChangedSelection(true);\n }\n }, [activeSuggestionIndex, changedSelection]);\n useEffect(() => {\n window && window.addEventListener('click', dismissPopoverWhenClickingOutside);\n return () => {\n window && window.removeEventListener('click', dismissPopoverWhenClickingOutside);\n };\n }, [dismissPopoverWhenClickingOutside]);\n\n // Determine popover position\n useEffect(() => {\n const rect = target?.current?.getBoundingClientRect();\n const maxWidth = 200;\n const finalPosition: Position = {\n maxWidth\n };\n\n // Figure out whether it will fit horizontally\n const leftOffset = targetPositionOffset?.left ?? 0;\n if (leftOffset + maxWidth > (rect?.width ?? 0)) {\n finalPosition.right = (rect?.width ?? 0) - leftOffset;\n } else {\n finalPosition.left = leftOffset;\n }\n // Offset between cursor and mention popover\n const verticalOffset = 4;\n if (location === 'below') {\n finalPosition.top = (rect?.height ?? 0) + (targetPositionOffset?.top ?? 0) + verticalOffset;\n } else {\n // (location === 'above')\n finalPosition.bottom = (rect?.height ?? 0) - (targetPositionOffset?.top ?? 0) + verticalOffset;\n }\n setPosition(finalPosition);\n }, [location, target, targetPositionOffset]);\n const handleOnKeyDown = useCallback((e: React.KeyboardEvent<HTMLDivElement>) => {\n switch (e.key) {\n case 'Escape':\n onDismiss && onDismiss();\n break;\n default:\n break;\n }\n }, [onDismiss]);\n const personaRenderer = useCallback((displayName: string): JSX.Element => {\n const avatarOptions = {\n text: displayName.trim(),\n size: PersonaSize.size24,\n initialsColor: theme.palette.neutralLight,\n initialsTextColor: theme.palette.neutralSecondary,\n showOverflowTooltip: false,\n showUnknownPersonaCoin: false\n };\n return <Persona {...avatarOptions} />;\n }, [theme]);\n const defaultOnRenderSuggestionItem = useCallback((suggestion: Mention, onSuggestionSelected: (suggestion: Mention) => void, active: boolean): JSX.Element => {\n return <div data-is-focusable={true}\n /* @conditional-compile-remove(mention) */ data-ui-id={ids.mentionSuggestionItem} key={suggestion.id} onClick={() => onSuggestionSelected(suggestion)} onMouseEnter={() => setHoveredSuggestion(suggestion)} onMouseLeave={() => setHoveredSuggestion(undefined)} onKeyDown={e => {\n handleOnKeyDown(e);\n }} className={suggestionItemWrapperStyle(theme)}>\n <Stack horizontal className={suggestionItemStackStyle(theme, hoveredSuggestion?.id === suggestion.id, (changedSelection ?? false) && active)}>\n {personaRenderer(suggestion.displayText)}\n </Stack>\n </div>;\n }, [handleOnKeyDown, theme, /* @conditional-compile-remove(mention) */\n ids, hoveredSuggestion, changedSelection, personaRenderer]);\n const getHeaderTitle = useCallback((): string => {\n if (title) {\n return title;\n }\n /* @conditional-compile-remove(mention) */\n return localeStrings.mentionPopover.mentionPopoverHeader;\n return '';\n }, [localeStrings, title]);\n return <div ref={popoverRef}>\n {position && <Stack data-testid={'mention-suggestion-list-container'} className={mergeStyles({\n maxHeight: 212,\n maxWidth: position.maxWidth\n }, mentionPopoverContainerStyle(theme), {\n ...position,\n position: 'absolute'\n })}>\n <Stack.Item styles={headerStyleThemed(theme)} aria-label={title}>\n {getHeaderTitle()}\n </Stack.Item>\n <Stack\n /* @conditional-compile-remove(mention) */ data-ui-id={ids.mentionSuggestionList} className={suggestionListStyle}>\n {suggestions.map((suggestion, index) => {\n const active = index === activeSuggestionIndex;\n return onRenderSuggestionItem ? onRenderSuggestionItem(suggestion, onSuggestionSelected, active) : defaultOnRenderSuggestionItem(suggestion, onSuggestionSelected, active);\n })}\n </Stack>\n </Stack>}\n </div>;\n};"]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { MessageStatus } from "../../../acs-ui-common/src";
3
2
  import { BaseCustomStyles } from '../types';
4
3
  /**
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { IStyle } from '@fluentui/react';
3
2
  import { BaseCustomStyles, ChatMessage, CustomMessage, SystemMessage, OnRenderAvatarCallback, Message, ReadReceiptsBySenderId, ComponentSlotStyle } from '../types';
4
3
  import { BlockedMessage } from '../types';
@@ -227,7 +227,7 @@ export const MessageThread = (props) => {
227
227
  const [inlineAttachments, setInlineAttachments] = useState({});
228
228
  /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */
229
229
  const onFetchInlineAttachment = useCallback((attachment) => __awaiter(void 0, void 0, void 0, function* () {
230
- if (!onFetchAttachments || attachment.id in inlineAttachments || attachment.attachmentType !== 'teamsInlineImage') {
230
+ if (!onFetchAttachments || attachment.attachmentType !== 'inlineImage' || attachment.id in inlineAttachments) {
231
231
  return;
232
232
  }
233
233
  setInlineAttachments(prev => (Object.assign(Object.assign({}, prev), { [attachment.id]: '' })));
@@ -1 +1 @@
1
- {"version":3,"file":"MessageThread.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/MessageThread.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,IAAI,EAAiB,IAAI,EAAkB,WAAW,IAAI,oBAAoB,EAAE,GAAG,EAAE,uCAAoC;AAClI,OAAO,EAAE,aAAa,EAAE,8BAA8B,EAAE,2BAA2B,EAAE,SAAS,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC3Y,uDAAuD;AACvD,OAAO,EAAE,mCAAmC,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,IAAI,EAAU,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,EAAmB,MAAM,iBAAiB,CAAC;AACzH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAItC,OAAO,EAAE,sBAAsB,EAA+B,MAAM,0BAA0B,CAAC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AAW;SACjC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Chat, ChatItemProps, Flex, ShorthandValue, mergeStyles as mergeNorthstarThemes, Ref } from '@internal/northstar-wrapper';\nimport { DownIconStyle, newMessageButtonContainerStyle, messageThreadContainerStyle, chatStyle, buttonWithIconStyles, newMessageButtonStyle, messageStatusContainerStyle, noMessageStatusStyle, defaultChatItemMessageContainer, defaultMyChatMessageContainer, defaultChatMessageContainer, gutterWithAvatar, gutterWithHiddenAvatar, FailedMyChatMessageContainer } from './styles/MessageThread.styles';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { defaultBlockedMessageStyleContainer } from './styles/MessageThread.styles';\nimport { Icon, IStyle, mergeStyles, Persona, PersonaSize, PrimaryButton, Stack, IPersona, Theme } from '@fluentui/react';\nimport { delay } from './utils/delay';\nimport { BaseCustomStyles, ChatMessage, CustomMessage, SystemMessage, CommunicationParticipant, OnRenderAvatarCallback, ParticipantAddedSystemMessage, ParticipantRemovedSystemMessage, Message, ReadReceiptsBySenderId, ComponentSlotStyle } from '../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../types';\nimport { MessageStatusIndicator, MessageStatusIndicatorProps } from './MessageStatusIndicator';\nimport { memoizeFnAll, MessageStatus } from '@internal/acs-ui-common';\nimport { SystemMessage as SystemMessageComponent, SystemMessageIconTypes } from './SystemMessage';\nimport { ChatMessageComponent } from './ChatMessage/ChatMessageComponent';\nimport { useLocale } from '../localization/LocalizationProvider';\nimport { isNarrowWidth, _useContainerWidth } from './utils/responsive';\nimport getParticipantsWhoHaveReadMessage from './utils/getParticipantsWhoHaveReadMessage';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileDownloadHandler } from './FileDownloadCards';\n/* @conditional-compile-remove(file-sharing) */ /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { FileMetadata } from './FileDownloadCards';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { AttachmentDownloadResult } from './FileDownloadCards';\nimport { useTheme } from '../theming';\nimport LiveAnnouncer from './Announcer/LiveAnnouncer';\n/* @conditional-compile-remove(mention) */\nimport { MentionOptions } from './MentionPopover';\n/* @conditional-compile-remove(file-sharing) */ /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { initializeFileTypeIcons } from '@fluentui/react-file-type-icons';\nconst isMessageSame = (first: ChatMessage, second: ChatMessage): boolean => {\n return first.messageId === second.messageId && first.content === second.content && first.contentType === second.contentType && JSON.stringify(first.createdOn) === JSON.stringify(second.createdOn) && first.senderId === second.senderId && first.senderDisplayName === second.senderDisplayName && first.status === second.status;\n};\n\n/**\n * Get the latest message from the message array.\n *\n * @param messages\n */\nconst getLatestChatMessage = (messages: Message[]): ChatMessage | undefined => {\n for (let i = messages.length - 1; i >= 0; i--) {\n const message = messages[i];\n if (message.messageType === 'chat' && !!message.createdOn) {\n return message;\n }\n }\n return undefined;\n};\n\n/**\n * Compare latestMessageFromPreviousMessages & latestMessageFromNewMessages to see if the new message is not from\n * current user.\n */\nconst isThereNewMessageNotFromCurrentUser = (userId: string, latestMessageFromPreviousMessages?: ChatMessage, latestMessageFromNewMessages?: ChatMessage): boolean => {\n if (latestMessageFromNewMessages === undefined) {\n return false;\n }\n if (latestMessageFromPreviousMessages === undefined) {\n return latestMessageFromNewMessages.senderId !== userId;\n }\n return !isMessageSame(latestMessageFromNewMessages, latestMessageFromPreviousMessages) && latestMessageFromNewMessages.senderId !== userId;\n};\n\n/**\n * Returns true if the current user sent the latest message and false otherwise. It will ignore messages that have no\n * sender, messages that have failed to send, and messages from the current user that is marked as SEEN. This is meant\n * as an indirect way to detect if user is at bottom of the chat when the component updates with new messages. If we\n * updated this component due to current user sending a message we want to then call scrollToBottom.\n */\nconst didUserSendTheLatestMessage = (userId: string, latestMessageFromPreviousMessages?: ChatMessage, latestMessageFromNewMessages?: ChatMessage): boolean => {\n if (latestMessageFromNewMessages === undefined) {\n return false;\n }\n if (latestMessageFromPreviousMessages === undefined) {\n return latestMessageFromNewMessages.senderId === userId;\n }\n return !isMessageSame(latestMessageFromNewMessages, latestMessageFromPreviousMessages) && latestMessageFromNewMessages.senderId === userId;\n};\n\n/**\n * Fluent styles for {@link MessageThread}.\n *\n * @public\n */\nexport interface MessageThreadStyles extends BaseCustomStyles {\n /** Styles for load previous messages container. */\n loadPreviousMessagesButtonContainer?: IStyle;\n /** Styles for new message container. */\n newMessageButtonContainer?: IStyle;\n /** Styles for chat container. */\n chatContainer?: ComponentSlotStyle;\n /** styles for my chat items. */\n myChatItemMessageContainer?: ComponentSlotStyle;\n /** styles for chat items. */\n chatItemMessageContainer?: ComponentSlotStyle;\n /** Styles for my chat message container. */\n myChatMessageContainer?: ComponentSlotStyle;\n /** Styles for my chat message container in case of failure. */\n failedMyChatMessageContainer?: ComponentSlotStyle;\n /** Styles for chat message container. */\n chatMessageContainer?: ComponentSlotStyle;\n /** Styles for system message container. */\n systemMessageContainer?: ComponentSlotStyle;\n /** Styles for blocked message container. */\n /* @conditional-compile-remove(data-loss-prevention) */\n blockedMessageContainer?: ComponentSlotStyle;\n /** Styles for message status indicator container. */\n messageStatusContainer?: (mine: boolean) => IStyle;\n}\n\n/**\n * Strings of {@link MessageThread} that can be overridden.\n *\n * @public\n */\nexport interface MessageThreadStrings {\n /** String for Sunday */\n sunday: string;\n /** String for Monday */\n monday: string;\n /** String for Tuesday */\n tuesday: string;\n /** String for Wednesday */\n wednesday: string;\n /** String for Thursday */\n thursday: string;\n /** String for Friday */\n friday: string;\n /** String for Saturday */\n saturday: string;\n /** String for Yesterday */\n yesterday: string;\n /** String for participants joined */\n participantJoined: string;\n /** String for participants left */\n participantLeft: string;\n /** Tag shown on a message that has been edited */\n editedTag: string;\n /** String for editing message in floating menu */\n editMessage: string;\n /** String for removing message in floating menu */\n removeMessage: string;\n /** String for resending failed message in floating menu */\n resendMessage?: string;\n /** String for indicating failed to send messages */\n failToSendTag?: string;\n /** String for LiveMessage introduction for the Chat Message */\n liveAuthorIntro: string;\n /** String for aria text of remote user's message content */\n messageContentAriaText: string;\n /** String for aria text of local user's message content */\n messageContentMineAriaText: string;\n /** String for warning on text limit exceeded in EditBox*/\n editBoxTextLimit: string;\n /** String for placeholder text in EditBox when there is no user input*/\n editBoxPlaceholderText: string;\n /** String for new messages indicator*/\n newMessagesIndicator: string;\n /** String for showing message read status in floating menu */\n messageReadCount?: string;\n /** String for replacing display name when there is none*/\n noDisplayNameSub: string;\n /** String for Cancel button in EditBox*/\n editBoxCancelButton: string;\n /** String for Submit in EditBox when there is no user input*/\n editBoxSubmitButton: string;\n /** String for action menu indicating there are more options */\n actionMenuMoreOptions?: string;\n /* @conditional-compile-remove(file-sharing) */\n /** String for download file button in file card */\n downloadFile: string;\n /* @conditional-compile-remove(data-loss-prevention) */\n /** String for policy violation message removal */\n blockedWarningText: string;\n /* @conditional-compile-remove(data-loss-prevention) */\n /** String for policy violation message removal details link */\n blockedWarningLinkText: string;\n /* @conditional-compile-remove(file-sharing) @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n /** String for aria text in file attachment group*/\n fileCardGroupMessage: string;\n}\n\n/**\n * Arguments for {@link MessageThreadProps.onRenderJumpToNewMessageButton}.\n *\n * @public\n */\nexport interface JumpToNewMessageButtonProps {\n /** String for button text */\n text: string;\n /** Callback for when button is clicked */\n onClick: () => void;\n}\nconst DefaultJumpToNewMessageButton = (props: JumpToNewMessageButtonProps): JSX.Element => {\n const {\n text,\n onClick\n } = props;\n return <PrimaryButton className={newMessageButtonStyle} styles={buttonWithIconStyles} text={text} onClick={onClick} onRenderIcon={() => <Icon iconName=\"Down\" className={DownIconStyle} />} />;\n};\nconst generateParticipantsStr = (participants: CommunicationParticipant[], defaultName: string): string => participants.map(participant => `${!participant.displayName || participant.displayName === '' ? defaultName : participant.displayName}`).join(', ');\n\n/**\n * A component to render a single message.\n *\n * @public\n */\nexport type MessageRenderer = (props: MessageProps) => JSX.Element;\nconst ParticipantSystemMessageComponent = ({\n message,\n style,\n defaultName\n}: {\n message: ParticipantAddedSystemMessage | ParticipantRemovedSystemMessage;\n style?: ComponentSlotStyle;\n defaultName: string;\n}): JSX.Element => {\n const {\n strings\n } = useLocale();\n const participantsStr = generateParticipantsStr(message.participants, defaultName);\n const messageSuffix = message.systemMessageType === 'participantAdded' ? strings.messageThread.participantJoined : strings.messageThread.participantLeft;\n if (participantsStr !== '') {\n return <SystemMessageComponent iconName={((message.iconName ? message.iconName : '') as SystemMessageIconTypes)} content={`${participantsStr} ${messageSuffix}`} containerStyle={style} />;\n }\n return <></>;\n};\nconst DefaultSystemMessage: MessageRenderer = (props: MessageProps) => {\n const message = props.message;\n switch (message.messageType) {\n case 'system':\n switch (message.systemMessageType) {\n case 'content':\n return <SystemMessageComponent iconName={((message.iconName ? message.iconName : '') as SystemMessageIconTypes)} content={message.content ?? ''} containerStyle={props?.messageContainerStyle} />;\n case 'participantAdded':\n case 'participantRemoved':\n return <ParticipantSystemMessageComponent message={message} style={props.messageContainerStyle} defaultName={props.strings.noDisplayNameSub} />;\n }\n }\n return <></>;\n};\nconst memoizeAllMessages = memoizeFnAll((_messageKey: string, message: Message, showMessageDate: boolean, showMessageStatus: boolean, onRenderAvatar: OnRenderAvatarCallback | undefined, shouldOverlapAvatarAndMessage: boolean, styles: MessageThreadStyles | undefined, onRenderMessageStatus: ((messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null) | undefined, defaultStatusRenderer: (message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */BlockedMessage, status: MessageStatus, participantCount: number, readCount: number) => JSX.Element, defaultChatMessageRenderer: (message: MessageProps) => JSX.Element, strings: MessageThreadStrings, theme: Theme, _attached?: boolean | string, statusToRender?: MessageStatus, participantCount?: number, readCount?: number, onRenderMessage?: (message: MessageProps, defaultOnRender?: MessageRenderer) => JSX.Element, onUpdateMessage?: UpdateMessageCallback, onCancelEditMessage?: CancelEditCallback, onDeleteMessage?: (messageId: string) => Promise<void>, onSendMessage?: (content: string) => Promise<void>, disableEditing?: boolean): ShorthandValue<ChatItemProps> => {\n const messageProps: MessageProps = {\n message,\n strings,\n showDate: showMessageDate,\n onUpdateMessage,\n onCancelEditMessage,\n onDeleteMessage,\n onSendMessage,\n disableEditing\n };\n const chatMessageItemProps = (message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */BlockedMessage, messageProps: MessageProps): ShorthandValue<ChatItemProps> => {\n const chatMessageComponent = onRenderMessage === undefined ? defaultChatMessageRenderer(messageProps) : onRenderMessage(messageProps, defaultChatMessageRenderer);\n const personaOptions: IPersona = {\n hidePersonaDetails: true,\n size: PersonaSize.size32,\n text: message.senderDisplayName,\n showOverflowTooltip: false\n };\n const chatItemMessageStyle = (message.mine ? styles?.myChatItemMessageContainer : styles?.chatItemMessageContainer) || defaultChatItemMessageContainer(shouldOverlapAvatarAndMessage);\n const chatGutterStyles = message.attached === 'top' || message.attached === false ? gutterWithAvatar : gutterWithHiddenAvatar;\n return {\n gutter: {\n styles: chatGutterStyles,\n content: message.mine ? '' : onRenderAvatar ? onRenderAvatar(message.senderId ?? '', personaOptions) : <Persona {...personaOptions} />\n },\n contentPosition: message.mine ? 'end' : 'start',\n message: {\n styles: chatItemMessageStyle,\n content: <Flex hAlign={message.mine ? 'end' : undefined} vAlign=\"end\">\n {chatMessageComponent}\n <div className={mergeStyles(messageStatusContainerStyle(message.mine ?? false), styles?.messageStatusContainer ? styles.messageStatusContainer(message.mine ?? false) : '')}>\n {showMessageStatus && statusToRender ? onRenderMessageStatus ? onRenderMessageStatus({\n status: statusToRender\n }) : defaultStatusRenderer(message, statusToRender, participantCount ?? 0, readCount ?? 0) : <div className={mergeStyles(noMessageStatusStyle)} />}\n </div>\n </Flex>\n },\n attached: message.attached,\n key: _messageKey\n };\n };\n\n /* @conditional-compile-remove(data-loss-prevention) */\n // Similar logic as switch statement case 'chat', if statement for conditional compile (merge logic to switch case when stablize)\n if (message.messageType === 'blocked') {\n const myChatMessageStyle = message.status === 'failed' ? styles?.failedMyChatMessageContainer ?? styles?.myChatMessageContainer ?? FailedMyChatMessageContainer : styles?.myChatMessageContainer ?? defaultBlockedMessageStyleContainer(theme);\n const blockedMessageStyle = styles?.blockedMessageContainer ?? defaultBlockedMessageStyleContainer(theme);\n messageProps.messageContainerStyle = message.mine ? myChatMessageStyle : blockedMessageStyle;\n return chatMessageItemProps(message, messageProps);\n }\n switch (message.messageType) {\n case 'chat':\n {\n const myChatMessageStyle = message.status === 'failed' ? styles?.failedMyChatMessageContainer ?? styles?.myChatMessageContainer ?? FailedMyChatMessageContainer : styles?.myChatMessageContainer ?? defaultMyChatMessageContainer;\n const chatMessageStyle = styles?.chatMessageContainer ?? defaultChatMessageContainer(theme);\n messageProps.messageContainerStyle = message.mine ? myChatMessageStyle : chatMessageStyle;\n return chatMessageItemProps(message, messageProps);\n }\n case 'system':\n {\n messageProps.messageContainerStyle = styles?.systemMessageContainer;\n const systemMessageComponent = onRenderMessage === undefined ? <DefaultSystemMessage {...messageProps} /> : onRenderMessage(messageProps, props => <DefaultSystemMessage {...props} />);\n return {\n children: systemMessageComponent,\n key: _messageKey\n };\n }\n default:\n {\n // We do not handle custom type message by default, users can handle custom type by using onRenderMessage function.\n const customMessageComponent = onRenderMessage === undefined ? <></> : onRenderMessage(messageProps);\n return {\n children: customMessageComponent,\n key: _messageKey\n };\n }\n }\n});\nconst getLastChatMessageIdWithStatus = (messages: Message[], status: MessageStatus): string | undefined => {\n for (let i = messages.length - 1; i >= 0; i--) {\n const message = messages[i];\n if (message.messageType === 'chat' && message.status === status && message.mine) {\n return message.messageId;\n }\n }\n return undefined;\n};\n\n/**\n * @public\n * Callback function run when a message is updated.\n */\nexport type UpdateMessageCallback = (messageId: string, content: string, /* @conditional-compile-remove(file-sharing) */\nmetadata?: Record<string, string>, /* @conditional-compile-remove(file-sharing) */\noptions?: {\n attachedFilesMetadata?: FileMetadata[];\n}) => Promise<void>;\n/**\n * @public\n * Callback function run when a message edit is cancelled.\n */\nexport type CancelEditCallback = (messageId: string) => void;\n\n/**\n * Props for {@link MessageThread}.\n *\n * @public\n */\nexport type MessageThreadProps = {\n /**\n * UserId of the current user.\n */\n userId: string;\n /**\n * Messages to render in message thread. A message can be of type `ChatMessage`, `SystemMessage`, `BlockedMessage` or `CustomMessage`.\n */\n messages: (ChatMessage | SystemMessage | CustomMessage | /* @conditional-compile-remove(data-loss-prevention) */BlockedMessage)[];\n /**\n * number of participants in the thread\n */\n participantCount?: number;\n /**\n * read receipts for each sender in the chat\n */\n readReceiptsBySenderId?: ReadReceiptsBySenderId;\n /**\n * Allows users to pass an object containing custom CSS styles.\n * @Example\n * ```\n * <MessageThread styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: MessageThreadStyles;\n /**\n * Whether the new message button is disabled or not.\n *\n * @defaultValue `false`\n */\n disableJumpToNewMessageButton?: boolean;\n /**\n * Whether the date of each message is displayed or not.\n * It is ignored when onDisplayDateTimeString is supplied.\n *\n * @defaultValue `false`\n */\n showMessageDate?: boolean;\n /**\n * Whether the status indicator for each message is displayed or not.\n *\n * @defaultValue `false`\n */\n showMessageStatus?: boolean;\n /**\n * Number of chat messages to reload each time onLoadPreviousChatMessages is called.\n *\n * @defaultValue 0\n */\n numberOfChatMessagesToReload?: number;\n /**\n * Optional callback to override actions on message being seen.\n *\n * @param messageId - message Id\n */\n onMessageSeen?: (messageId: string) => Promise<void>;\n /**\n * Optional callback to override render of the message status indicator.\n *\n * @param messageStatusIndicatorProps - props of type MessageStatusIndicatorProps\n */\n onRenderMessageStatus?: (messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null;\n /**\n * Optional callback to override render of the avatar.\n *\n * @param userId - user Id\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n /**\n * Optional callback to override render of the button for jumping to the new message.\n *\n * @param newMessageButtonProps - button props of type JumpToNewMessageButtonProps\n */\n onRenderJumpToNewMessageButton?: (newMessageButtonProps: JumpToNewMessageButtonProps) => JSX.Element;\n /**\n * Optional callback to override loading of previous messages.\n * It accepts the number of history chat messages that we want to load and return a boolean Promise indicating if we have got all the history messages.\n * If the promise resolves to `true`, we have load all chat messages into the message thread and `loadPreviousMessagesButton` will not be rendered anymore.\n */\n onLoadPreviousChatMessages?: (messagesToLoad: number) => Promise<boolean>;\n /**\n * Optional callback to override render of a message.\n *\n * @param messageProps - props of type {@link communication-react#MessageProps}\n * @param defaultOnRender - default render of type {@link communication-react#MessageRenderer}\n *\n * @remarks\n * `messageRenderer` is not provided for `CustomMessage` and thus only available for `ChatMessage` and `SystemMessage`.\n */\n onRenderMessage?: (messageProps: MessageProps, messageRenderer?: MessageRenderer) => JSX.Element;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optional callback to render uploaded files in the message component.\n * @beta\n */\n onRenderFileDownloads?: (userId: string, message: ChatMessage) => JSX.Element;\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n /**\n * Optional callback to retrieve the inline image in a message.\n * @param attachment - FileMetadata object we want to render\n * @beta\n */\n onFetchAttachments?: (attachment: FileMetadata) => Promise<AttachmentDownloadResult[]>;\n /**\n * Optional callback to edit a message.\n *\n * @param messageId - message id from chatClient\n * @param content - new content of the message\n *\n */\n onUpdateMessage?: UpdateMessageCallback;\n\n /**\n * Optional callback for when a message edit is cancelled.\n *\n * @param messageId - message id from chatClient\n */\n onCancelEditMessage?: CancelEditCallback;\n /**\n * Optional callback to delete a message.\n *\n * @param messageId - message id from chatClient\n *\n */\n onDeleteMessage?: (messageId: string) => Promise<void>;\n\n /**\n * Optional callback to send a message.\n *\n * @param content - message body to send\n *\n */\n onSendMessage?: (content: string) => Promise<void>;\n\n /**\n /**\n * Disable editing messages.\n *\n * @remarks This removes the action menu on messages.\n *\n * @defaultValue `false`\n */\n disableEditing?: boolean;\n\n /**\n * Optional strings to override in component\n */\n strings?: Partial<MessageThreadStrings>;\n\n /* @conditional-compile-remove(file-sharing) */\n /**\n * @beta\n * Optional function called when someone clicks on the file download icon.\n * If file attachments are defined in the `message.metadata` property using the `fileSharingMetadata` key,\n * this function will be called with the data inside `fileSharingMetadata` key.\n */\n fileDownloadHandler?: FileDownloadHandler;\n\n /* @conditional-compile-remove(date-time-customization) */\n /**\n * Optional function to provide customized date format.\n * @beta\n */\n onDisplayDateTimeString?: (messageDate: Date) => string;\n /* @conditional-compile-remove(mention) */\n /**\n * Optional props needed to lookup a mention query and display mentions\n * @beta\n */\n mentionOptions?: MentionOptions;\n};\n\n/**\n * Props to render a single message.\n *\n * See {@link MessageRenderer}.\n *\n * @public\n */\nexport type MessageProps = {\n /**\n * Message to render. It can type `ChatMessage` or `SystemMessage`, `BlockedMessage` or `CustomMessage`.\n */\n message: Message;\n /**\n * Strings from parent MessageThread component\n */\n strings: MessageThreadStrings;\n /**\n * Custom CSS styles for chat message container.\n */\n messageContainerStyle?: ComponentSlotStyle;\n /**\n * Whether the date of a message is displayed or not.\n *\n * @defaultValue `false`\n */\n showDate?: boolean;\n /**\n * Disable editing messages.\n *\n * @remarks This removes the action menu on messages.\n *\n * @defaultValue `false`\n */\n disableEditing?: boolean;\n /**\n * Optional callback to edit a message.\n *\n * @param messageId - message id from chatClient\n * @param content - new content of the message\n */\n onUpdateMessage?: UpdateMessageCallback;\n\n /**\n * Optional callback for when a message edit is cancelled.\n *\n * @param messageId - message id from chatClient\n */\n onCancelEditMessage?: CancelEditCallback;\n /**\n * Optional callback to delete a message.\n *\n * @param messageId - message id from chatClient\n *\n */\n onDeleteMessage?: (messageId: string) => Promise<void>;\n\n /**\n * Optional callback to send a message.\n *\n * @param messageId - message id from chatClient\n *\n */\n onSendMessage?: (messageId: string) => Promise<void>;\n};\n\n/**\n * `MessageThread` allows you to easily create a component for rendering chat messages, handling scrolling behavior of new/old messages and customizing icons & controls inside the chat thread.\n * @param props - of type MessageThreadProps\n *\n * Users will need to provide at least chat messages and userId to render the `MessageThread` component.\n * Users can also customize `MessageThread` by passing in their own Avatar, `MessageStatusIndicator` icon, `JumpToNewMessageButton`, `LoadPreviousMessagesButton` and the behavior of these controls.\n *\n * `MessageThread` internally uses the `Chat` & `Chat.Message` component from `@fluentui/react-northstar`. You can checkout the details about these [two components](https://fluentsite.z22.web.core.windows.net/0.53.0/components/chat/props).\n *\n * @public\n */\nexport const MessageThread = (props: MessageThreadProps): JSX.Element => {\n const {\n messages: newMessages,\n userId,\n participantCount,\n readReceiptsBySenderId,\n styles,\n disableJumpToNewMessageButton = false,\n showMessageDate = false,\n showMessageStatus = false,\n numberOfChatMessagesToReload = 5,\n onMessageSeen,\n onRenderMessageStatus,\n onRenderAvatar,\n onLoadPreviousChatMessages,\n onRenderJumpToNewMessageButton,\n onRenderMessage,\n onUpdateMessage,\n onCancelEditMessage,\n onDeleteMessage,\n onSendMessage,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString,\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n onFetchAttachments,\n /* @conditional-compile-remove(mention) */\n mentionOptions\n } = props;\n const onRenderFileDownloads = onRenderFileDownloadsTrampoline(props);\n const [messages, setMessages] = useState<Message[]>([]);\n // We need this state to wait for one tick and scroll to bottom after messages have been initialized.\n // Otherwise chatScrollDivRef.current.clientHeight is wrong if we scroll to bottom before messages are initialized.\n const [chatMessagesInitialized, setChatMessagesInitialized] = useState<boolean>(false);\n const [isAtBottomOfScroll, setIsAtBottomOfScroll] = useState<boolean>(true);\n const [forceUpdate, setForceUpdate] = useState<number>(0);\n\n // Used to decide if should auto scroll to bottom or show \"new message\" button\n const [latestPreviousChatMessage, setLatestPreviousChatMessage] = useState<ChatMessage | undefined>(undefined);\n const [latestCurrentChatMessage, setLatestCurrentChatMessage] = useState<ChatMessage | undefined>(undefined);\n const [existsNewChatMessage, setExistsNewChatMessage] = useState<boolean>(false);\n const [lastSeenChatMessage, setLastSeenChatMessage] = useState<string | undefined>(undefined);\n const [lastDeliveredChatMessage, setLastDeliveredChatMessage] = useState<string | undefined>(undefined);\n const [lastSendingChatMessage, setLastSendingChatMessage] = useState<string | undefined>(undefined);\n\n // readCount and participantCount will only need to be updated on-fly when user hover on an indicator\n const [readCountForHoveredIndicator, setReadCountForHoveredIndicator] = useState<number | undefined>(undefined);\n\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n const [inlineAttachments, setInlineAttachments] = useState<Record<string, string>>({});\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n const onFetchInlineAttachment = useCallback(async (attachment: FileMetadata): Promise<void> => {\n if (!onFetchAttachments || attachment.id in inlineAttachments || attachment.attachmentType !== 'teamsInlineImage') {\n return;\n }\n setInlineAttachments(prev => ({\n ...prev,\n [attachment.id]: ''\n }));\n const attachmentDownloadResult = await onFetchAttachments(attachment);\n if (attachmentDownloadResult[0]) {\n setInlineAttachments(prev => ({\n ...prev,\n [attachment.id]: attachmentDownloadResult[0].blobUrl\n }));\n }\n }, [inlineAttachments, onFetchAttachments]);\n const isAllChatMessagesLoadedRef = useRef(false);\n // isAllChatMessagesLoadedRef needs to be updated every time when a new adapter is set in order to display correct data\n // onLoadPreviousChatMessages is updated when a new adapter is set\n useEffect(() => {\n if (onLoadPreviousChatMessages) {\n isAllChatMessagesLoadedRef.current = false;\n }\n }, [onLoadPreviousChatMessages]);\n\n /* @conditional-compile-remove(file-sharing) */ /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n useEffect(() => {\n initializeFileTypeIcons();\n }, []);\n const previousTopRef = useRef<number>(-1);\n const previousHeightRef = useRef<number>(-1);\n const messageIdSeenByMeRef = useRef<string>('');\n const chatScrollDivRef = useRef<HTMLElement>(null);\n const chatThreadRef = useRef<HTMLElement>(null);\n const isLoadingChatMessagesRef = useRef(false);\n\n // When the chat thread is narrow, we perform space optimizations such as overlapping\n // the avatar on top of the chat message and moving the chat accept/reject edit buttons\n // to a new line\n const chatThreadWidth = _useContainerWidth(chatThreadRef);\n const isNarrow = chatThreadWidth ? isNarrowWidth(chatThreadWidth) : false;\n const messagesRef = useRef(messages);\n const setMessagesRef = (messagesWithAttachedValue: Message[]): void => {\n messagesRef.current = messagesWithAttachedValue;\n setMessages(messagesWithAttachedValue);\n };\n const isAtBottomOfScrollRef = useRef(isAtBottomOfScroll);\n const setIsAtBottomOfScrollRef = (isAtBottomOfScrollValue: boolean): void => {\n isAtBottomOfScrollRef.current = isAtBottomOfScrollValue;\n setIsAtBottomOfScroll(isAtBottomOfScrollValue);\n };\n const chatMessagesInitializedRef = useRef(chatMessagesInitialized);\n const setChatMessagesInitializedRef = (chatMessagesInitialized: boolean): void => {\n chatMessagesInitializedRef.current = chatMessagesInitialized;\n setChatMessagesInitialized(chatMessagesInitialized);\n };\n\n // we try to only send those message status if user is scrolled to the bottom.\n const sendMessageStatusIfAtBottom = useCallback(async (): Promise<void> => {\n if (!isAtBottomOfScrollRef.current || !document.hasFocus() || !messagesRef.current || messagesRef.current.length === 0 || !showMessageStatus) {\n return;\n }\n const messagesWithId = messagesRef.current.filter(message => {\n return message.messageType === 'chat' && !message.mine && !!message.messageId;\n });\n if (messagesWithId.length === 0) {\n return;\n }\n const lastMessage: ChatMessage = (messagesWithId[messagesWithId.length - 1] as ChatMessage);\n try {\n if (onMessageSeen && lastMessage && lastMessage.messageId && lastMessage.messageId !== messageIdSeenByMeRef.current) {\n await onMessageSeen(lastMessage.messageId);\n messageIdSeenByMeRef.current = lastMessage.messageId;\n }\n } catch (e) {\n console.log('onMessageSeen Error', lastMessage, e);\n }\n }, [showMessageStatus, onMessageSeen]);\n const scrollToBottom = useCallback((): void => {\n if (chatScrollDivRef.current) {\n chatScrollDivRef.current.scrollTop = chatScrollDivRef.current.scrollHeight;\n }\n setExistsNewChatMessage(false);\n setIsAtBottomOfScrollRef(true);\n sendMessageStatusIfAtBottom();\n }, [sendMessageStatusIfAtBottom]);\n const handleScrollToTheBottom = useCallback((): void => {\n if (!chatScrollDivRef.current) {\n return;\n }\n const atBottom = Math.ceil(chatScrollDivRef.current.scrollTop) >= chatScrollDivRef.current.scrollHeight - chatScrollDivRef.current.clientHeight;\n if (atBottom) {\n sendMessageStatusIfAtBottom();\n if (!isAtBottomOfScrollRef.current) {\n scrollToBottom();\n }\n }\n setIsAtBottomOfScrollRef(atBottom);\n }, [scrollToBottom, sendMessageStatusIfAtBottom]);\n\n // Infinite scrolling + threadInitialize function\n const fetchNewMessageWhenAtTop = useCallback(async () => {\n if (!isLoadingChatMessagesRef.current) {\n if (onLoadPreviousChatMessages) {\n isLoadingChatMessagesRef.current = true;\n try {\n // Fetch message until scrollTop reach the threshold for fetching new message\n while (!isAllChatMessagesLoadedRef.current && chatScrollDivRef.current && chatScrollDivRef.current.scrollTop <= 500) {\n isAllChatMessagesLoadedRef.current = await onLoadPreviousChatMessages(numberOfChatMessagesToReload);\n await delay(200);\n }\n } finally {\n // Set isLoadingChatMessagesRef to false after messages are fetched\n isLoadingChatMessagesRef.current = false;\n }\n }\n }\n }, [numberOfChatMessagesToReload, onLoadPreviousChatMessages]);\n\n // The below 2 of useEffects are design for fixing infinite scrolling problem\n // Scrolling element will behave differently when scrollTop = 0(it sticks at the top)\n // we need to get previousTop before it prepend contents\n // Execute order [newMessage useEffect] => get previousTop => dom update => [messages useEffect]\n useEffect(() => {\n if (!chatScrollDivRef.current) {\n return;\n }\n previousTopRef.current = chatScrollDivRef.current.scrollTop;\n previousHeightRef.current = chatScrollDivRef.current.scrollHeight;\n }, [newMessages]);\n useEffect(() => {\n if (!chatScrollDivRef.current) {\n return;\n }\n chatScrollDivRef.current.scrollTop = chatScrollDivRef.current.scrollHeight - (previousHeightRef.current - previousTopRef.current);\n }, [messages]);\n\n // Fetch more messages to make the scroll bar appear, infinity scroll is then handled in the handleScroll function.\n useEffect(() => {\n fetchNewMessageWhenAtTop();\n }, [fetchNewMessageWhenAtTop]);\n\n /**\n * One time run useEffects. Sets up listeners when component is mounted and tears down listeners when component\n * unmounts unless these function changed\n */\n useEffect(() => {\n window && window.addEventListener('click', sendMessageStatusIfAtBottom);\n window && window.addEventListener('focus', sendMessageStatusIfAtBottom);\n return () => {\n window && window.removeEventListener('click', sendMessageStatusIfAtBottom);\n window && window.removeEventListener('focus', sendMessageStatusIfAtBottom);\n };\n }, [sendMessageStatusIfAtBottom]);\n useEffect(() => {\n const chatScrollDiv = chatScrollDivRef.current;\n chatScrollDiv?.addEventListener('scroll', handleScrollToTheBottom);\n chatScrollDiv?.addEventListener('scroll', fetchNewMessageWhenAtTop);\n return () => {\n chatScrollDiv?.removeEventListener('scroll', handleScrollToTheBottom);\n chatScrollDiv?.removeEventListener('scroll', fetchNewMessageWhenAtTop);\n };\n }, [fetchNewMessageWhenAtTop, handleScrollToTheBottom]);\n\n /**\n * ClientHeight controls the number of messages to render. However ClientHeight will not be initialized after the\n * first render (not sure but I guess Fluent is updating it in hook which is after render maybe?) so we need to\n * trigger a re-render until ClientHeight is initialized. This force re-render should only happen once.\n */\n const clientHeight = chatThreadRef.current?.clientHeight;\n useEffect(() => {\n if (clientHeight === undefined) {\n setForceUpdate(forceUpdate + 1);\n return;\n }\n // Only scroll to bottom if isAtBottomOfScrollRef is true\n isAtBottomOfScrollRef.current && scrollToBottom();\n }, [clientHeight, forceUpdate, scrollToBottom, chatMessagesInitialized]);\n\n /**\n * This needs to run to update latestPreviousChatMessage & latestCurrentChatMessage.\n * These two states are used to manipulate scrollbar\n */\n useEffect(() => {\n setLatestPreviousChatMessage(getLatestChatMessage(messagesRef.current));\n setLatestCurrentChatMessage(getLatestChatMessage(newMessages));\n setMessagesRef(newMessages);\n !chatMessagesInitializedRef.current && setChatMessagesInitializedRef(true);\n setLastDeliveredChatMessage(getLastChatMessageIdWithStatus(newMessages, 'delivered'));\n setLastSeenChatMessage(getLastChatMessageIdWithStatus(newMessages, 'seen'));\n setLastSendingChatMessage(getLastChatMessageIdWithStatus(newMessages, 'sending'));\n }, [newMessages]);\n\n /**\n * This needs to run after messages are rendered so we can manipulate the scroll bar.\n */\n useEffect(() => {\n // If user just sent the latest message then we assume we can move user to bottom of scroll.\n if (isThereNewMessageNotFromCurrentUser(userId, latestPreviousChatMessage, latestCurrentChatMessage) && !isAtBottomOfScrollRef.current) {\n setExistsNewChatMessage(true);\n } else if (didUserSendTheLatestMessage(userId, latestPreviousChatMessage, latestCurrentChatMessage) || isAtBottomOfScrollRef.current) {\n scrollToBottom();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [messages]);\n const participantCountRef = useRef(participantCount);\n const readReceiptsBySenderIdRef = useRef(readReceiptsBySenderId);\n participantCountRef.current = participantCount;\n readReceiptsBySenderIdRef.current = readReceiptsBySenderId;\n const onActionButtonClickMemo = useCallback((message: ChatMessage, setMessageReadBy: (readBy: {\n id: string;\n displayName: string;\n }[]) => void) => {\n if (participantCountRef.current && participantCountRef.current - 1 > 1 && readReceiptsBySenderIdRef.current) {\n setMessageReadBy(getParticipantsWhoHaveReadMessage(message, readReceiptsBySenderIdRef.current));\n }\n }, []);\n const localeStrings = useLocale().strings.messageThread;\n const strings = useMemo(() => ({\n ...localeStrings,\n ...props.strings\n }), [localeStrings, props.strings]);\n // To rerender the defaultChatMessageRenderer if app running across days(every new day chat time stamp need to be regenerated)\n const defaultChatMessageRenderer = useCallback((messageProps: MessageProps) => {\n if (messageProps.message.messageType === 'chat' || /* @conditional-compile-remove(data-loss-prevention) */messageProps.message.messageType === 'blocked') {\n return <ChatMessageComponent {...messageProps} onRenderFileDownloads={onRenderFileDownloads}\n /* @conditional-compile-remove(file-sharing) */ strings={strings} message={messageProps.message} userId={props.userId} remoteParticipantsCount={participantCount ? participantCount - 1 : 0} inlineAcceptRejectEditButtons={!isNarrow} onRenderAvatar={onRenderAvatar} showMessageStatus={showMessageStatus} messageStatus={messageProps.message.status} onActionButtonClick={onActionButtonClickMemo}\n /* @conditional-compile-remove(date-time-customization) */ onDisplayDateTimeString={onDisplayDateTimeString}\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ onFetchAttachments={onFetchInlineAttachment}\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ attachmentsMap={inlineAttachments}\n /* @conditional-compile-remove(mention) */ mentionOptions={mentionOptions} />;\n }\n return <></>;\n }, [onRenderFileDownloads, /* @conditional-compile-remove(file-sharing) */\n strings, props.userId, participantCount, isNarrow, onRenderAvatar, showMessageStatus, onActionButtonClickMemo, /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString, /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n onFetchInlineAttachment, /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n inlineAttachments, /* @conditional-compile-remove(mention) */\n mentionOptions]);\n const defaultStatusRenderer = useCallback((message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */BlockedMessage, status: MessageStatus, participantCount: number, readCount: number) => {\n const onToggleToolTip = (isToggled: boolean): void => {\n if (isToggled && readReceiptsBySenderIdRef.current) {\n setReadCountForHoveredIndicator(getParticipantsWhoHaveReadMessage(message, readReceiptsBySenderIdRef.current).length);\n } else {\n setReadCountForHoveredIndicator(undefined);\n }\n };\n return <MessageStatusIndicator status={status} readCount={readCount} onToggleToolTip={onToggleToolTip}\n // -1 because participant count does not include myself\n remoteParticipantsCount={participantCount ? participantCount - 1 : 0} />;\n }, []);\n const theme = useTheme();\n const messagesToDisplay = useMemo(() => memoizeAllMessages(memoizedMessageFn => {\n return messages.map((message: Message, index: number): ShorthandValue<ChatItemProps> => {\n let key: string | undefined = message.messageId;\n let statusToRender: MessageStatus | undefined = undefined;\n if (message.messageType === 'chat' || /* @conditional-compile-remove(data-loss-prevention) */message.messageType === 'blocked') {\n if ((!message.messageId || message.messageId === '') && 'clientMessageId' in message) {\n key = message.clientMessageId;\n }\n if (showMessageStatus && message.mine) {\n switch (message.messageId) {\n case lastSeenChatMessage:\n {\n statusToRender = 'seen';\n break;\n }\n case lastSendingChatMessage:\n {\n statusToRender = 'sending';\n break;\n }\n case lastDeliveredChatMessage:\n {\n statusToRender = 'delivered';\n break;\n }\n }\n }\n if (message.mine && message.status === 'failed') {\n statusToRender = 'failed';\n }\n }\n return memoizedMessageFn(key ?? 'id_' + index, message, showMessageDate, showMessageStatus, onRenderAvatar, isNarrow, styles, onRenderMessageStatus, defaultStatusRenderer, defaultChatMessageRenderer, strings, theme,\n // Temporary solution to make sure we re-render if attach attribute is changed.\n // The proper fix should be in selector.\n message.messageType === 'chat' || /* @conditional-compile-remove(data-loss-prevention) */message.messageType === 'blocked' ? message.attached : undefined, statusToRender, participantCount, readCountForHoveredIndicator, onRenderMessage, onUpdateMessage, onCancelEditMessage, onDeleteMessage, onSendMessage, props.disableEditing);\n });\n }), [messages, showMessageDate, showMessageStatus, onRenderAvatar, isNarrow, styles, onRenderMessageStatus, defaultStatusRenderer, defaultChatMessageRenderer, strings, theme, participantCount, readCountForHoveredIndicator, onRenderMessage, onUpdateMessage, onCancelEditMessage, onDeleteMessage, onSendMessage, lastSeenChatMessage, lastSendingChatMessage, lastDeliveredChatMessage, props.disableEditing]);\n const chatBody = useMemo(() => {\n return <LiveAnnouncer>\n <Chat styles={mergeNorthstarThemes(chatStyle, linkStyles(theme), styles?.chatContainer ?? {})} items={messagesToDisplay} />\n </LiveAnnouncer>;\n }, [theme, styles?.chatContainer, messagesToDisplay]);\n return <Ref innerRef={chatThreadRef}>\n <Stack className={mergeStyles(messageThreadContainerStyle, styles?.root)} grow>\n {/* Always ensure New Messages button is above the chat body element in the DOM tree. This is to ensure correct\n tab ordering. Because the New Messages button floats on top of the chat body it is in a higher z-index and\n thus Users should be able to tab navigate to the new messages button _before_ tab focus is taken to the chat body.*/}\n {existsNewChatMessage && !disableJumpToNewMessageButton && <div className={mergeStyles(newMessageButtonContainerStyle, styles?.newMessageButtonContainer)}>\n {onRenderJumpToNewMessageButton ? onRenderJumpToNewMessageButton({\n text: strings.newMessagesIndicator,\n onClick: scrollToBottom\n }) : <DefaultJumpToNewMessageButton text={strings.newMessagesIndicator} onClick={scrollToBottom} />}\n </div>}\n\n <Ref innerRef={chatScrollDivRef}>{chatBody}</Ref>\n </Stack>\n </Ref>;\n};\nconst onRenderFileDownloadsTrampoline = (props: MessageThreadProps): ((userId: string, message: ChatMessage) => JSX.Element) | undefined => {\n /* @conditional-compile-remove(file-sharing) */\n return props.onRenderFileDownloads;\n return undefined;\n};\nconst linkStyles = (theme: Theme): ComponentSlotStyle => {\n return {\n '& a:link': {\n color: theme.palette.themePrimary\n },\n '& a:visited': {\n color: theme.palette.themeDarker\n },\n '& a:hover': {\n color: theme.palette.themeDarker\n },\n '& a:selected': {\n color: theme.palette.themeDarker\n }\n };\n};\"../../../northstar-wrapper/src\"\"../../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"MessageThread.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/MessageThread.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,IAAI,EAAiB,IAAI,EAAkB,WAAW,IAAI,oBAAoB,EAAE,GAAG,EAAE,uCAAoC;AAClI,OAAO,EAAE,aAAa,EAAE,8BAA8B,EAAE,2BAA2B,EAAE,SAAS,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,2BAA2B,EAAE,oBAAoB,EAAE,+BAA+B,EAAE,6BAA6B,EAAE,2BAA2B,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAC3Y,uDAAuD;AACvD,OAAO,EAAE,mCAAmC,EAAE,MAAM,+BAA+B,CAAC;AACpF,OAAO,EAAE,IAAI,EAAU,WAAW,EAAE,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,KAAK,EAAmB,MAAM,iBAAiB,CAAC;AACzH,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAItC,OAAO,EAAE,sBAAsB,EAA+B,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EA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AC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Chat, ChatItemProps, Flex, ShorthandValue, mergeStyles as mergeNorthstarThemes, Ref } from '@internal/northstar-wrapper';\nimport { DownIconStyle, newMessageButtonContainerStyle, messageThreadContainerStyle, chatStyle, buttonWithIconStyles, newMessageButtonStyle, messageStatusContainerStyle, noMessageStatusStyle, defaultChatItemMessageContainer, defaultMyChatMessageContainer, defaultChatMessageContainer, gutterWithAvatar, gutterWithHiddenAvatar, FailedMyChatMessageContainer } from './styles/MessageThread.styles';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { defaultBlockedMessageStyleContainer } from './styles/MessageThread.styles';\nimport { Icon, IStyle, mergeStyles, Persona, PersonaSize, PrimaryButton, Stack, IPersona, Theme } from '@fluentui/react';\nimport { delay } from './utils/delay';\nimport { BaseCustomStyles, ChatMessage, CustomMessage, SystemMessage, CommunicationParticipant, OnRenderAvatarCallback, ParticipantAddedSystemMessage, ParticipantRemovedSystemMessage, Message, ReadReceiptsBySenderId, ComponentSlotStyle } from '../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../types';\nimport { MessageStatusIndicator, MessageStatusIndicatorProps } from './MessageStatusIndicator';\nimport { memoizeFnAll, MessageStatus } from '@internal/acs-ui-common';\nimport { SystemMessage as SystemMessageComponent, SystemMessageIconTypes } from './SystemMessage';\nimport { ChatMessageComponent } from './ChatMessage/ChatMessageComponent';\nimport { useLocale } from '../localization/LocalizationProvider';\nimport { isNarrowWidth, _useContainerWidth } from './utils/responsive';\nimport getParticipantsWhoHaveReadMessage from './utils/getParticipantsWhoHaveReadMessage';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileDownloadHandler } from './FileDownloadCards';\n/* @conditional-compile-remove(file-sharing) */ /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { FileMetadata } from './FileDownloadCards';\n/* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { AttachmentDownloadResult } from './FileDownloadCards';\nimport { useTheme } from '../theming';\nimport LiveAnnouncer from './Announcer/LiveAnnouncer';\n/* @conditional-compile-remove(mention) */\nimport { MentionOptions } from './MentionPopover';\n/* @conditional-compile-remove(file-sharing) */ /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\nimport { initializeFileTypeIcons } from '@fluentui/react-file-type-icons';\nconst isMessageSame = (first: ChatMessage, second: ChatMessage): boolean => {\n return first.messageId === second.messageId && first.content === second.content && first.contentType === second.contentType && JSON.stringify(first.createdOn) === JSON.stringify(second.createdOn) && first.senderId === second.senderId && first.senderDisplayName === second.senderDisplayName && first.status === second.status;\n};\n\n/**\n * Get the latest message from the message array.\n *\n * @param messages\n */\nconst getLatestChatMessage = (messages: Message[]): ChatMessage | undefined => {\n for (let i = messages.length - 1; i >= 0; i--) {\n const message = messages[i];\n if (message.messageType === 'chat' && !!message.createdOn) {\n return message;\n }\n }\n return undefined;\n};\n\n/**\n * Compare latestMessageFromPreviousMessages & latestMessageFromNewMessages to see if the new message is not from\n * current user.\n */\nconst isThereNewMessageNotFromCurrentUser = (userId: string, latestMessageFromPreviousMessages?: ChatMessage, latestMessageFromNewMessages?: ChatMessage): boolean => {\n if (latestMessageFromNewMessages === undefined) {\n return false;\n }\n if (latestMessageFromPreviousMessages === undefined) {\n return latestMessageFromNewMessages.senderId !== userId;\n }\n return !isMessageSame(latestMessageFromNewMessages, latestMessageFromPreviousMessages) && latestMessageFromNewMessages.senderId !== userId;\n};\n\n/**\n * Returns true if the current user sent the latest message and false otherwise. It will ignore messages that have no\n * sender, messages that have failed to send, and messages from the current user that is marked as SEEN. This is meant\n * as an indirect way to detect if user is at bottom of the chat when the component updates with new messages. If we\n * updated this component due to current user sending a message we want to then call scrollToBottom.\n */\nconst didUserSendTheLatestMessage = (userId: string, latestMessageFromPreviousMessages?: ChatMessage, latestMessageFromNewMessages?: ChatMessage): boolean => {\n if (latestMessageFromNewMessages === undefined) {\n return false;\n }\n if (latestMessageFromPreviousMessages === undefined) {\n return latestMessageFromNewMessages.senderId === userId;\n }\n return !isMessageSame(latestMessageFromNewMessages, latestMessageFromPreviousMessages) && latestMessageFromNewMessages.senderId === userId;\n};\n\n/**\n * Fluent styles for {@link MessageThread}.\n *\n * @public\n */\nexport interface MessageThreadStyles extends BaseCustomStyles {\n /** Styles for load previous messages container. */\n loadPreviousMessagesButtonContainer?: IStyle;\n /** Styles for new message container. */\n newMessageButtonContainer?: IStyle;\n /** Styles for chat container. */\n chatContainer?: ComponentSlotStyle;\n /** styles for my chat items. */\n myChatItemMessageContainer?: ComponentSlotStyle;\n /** styles for chat items. */\n chatItemMessageContainer?: ComponentSlotStyle;\n /** Styles for my chat message container. */\n myChatMessageContainer?: ComponentSlotStyle;\n /** Styles for my chat message container in case of failure. */\n failedMyChatMessageContainer?: ComponentSlotStyle;\n /** Styles for chat message container. */\n chatMessageContainer?: ComponentSlotStyle;\n /** Styles for system message container. */\n systemMessageContainer?: ComponentSlotStyle;\n /** Styles for blocked message container. */\n /* @conditional-compile-remove(data-loss-prevention) */\n blockedMessageContainer?: ComponentSlotStyle;\n /** Styles for message status indicator container. */\n messageStatusContainer?: (mine: boolean) => IStyle;\n}\n\n/**\n * Strings of {@link MessageThread} that can be overridden.\n *\n * @public\n */\nexport interface MessageThreadStrings {\n /** String for Sunday */\n sunday: string;\n /** String for Monday */\n monday: string;\n /** String for Tuesday */\n tuesday: string;\n /** String for Wednesday */\n wednesday: string;\n /** String for Thursday */\n thursday: string;\n /** String for Friday */\n friday: string;\n /** String for Saturday */\n saturday: string;\n /** String for Yesterday */\n yesterday: string;\n /** String for participants joined */\n participantJoined: string;\n /** String for participants left */\n participantLeft: string;\n /** Tag shown on a message that has been edited */\n editedTag: string;\n /** String for editing message in floating menu */\n editMessage: string;\n /** String for removing message in floating menu */\n removeMessage: string;\n /** String for resending failed message in floating menu */\n resendMessage?: string;\n /** String for indicating failed to send messages */\n failToSendTag?: string;\n /** String for LiveMessage introduction for the Chat Message */\n liveAuthorIntro: string;\n /** String for aria text of remote user's message content */\n messageContentAriaText: string;\n /** String for aria text of local user's message content */\n messageContentMineAriaText: string;\n /** String for warning on text limit exceeded in EditBox*/\n editBoxTextLimit: string;\n /** String for placeholder text in EditBox when there is no user input*/\n editBoxPlaceholderText: string;\n /** String for new messages indicator*/\n newMessagesIndicator: string;\n /** String for showing message read status in floating menu */\n messageReadCount?: string;\n /** String for replacing display name when there is none*/\n noDisplayNameSub: string;\n /** String for Cancel button in EditBox*/\n editBoxCancelButton: string;\n /** String for Submit in EditBox when there is no user input*/\n editBoxSubmitButton: string;\n /** String for action menu indicating there are more options */\n actionMenuMoreOptions?: string;\n /* @conditional-compile-remove(file-sharing) */\n /** String for download file button in file card */\n downloadFile: string;\n /* @conditional-compile-remove(data-loss-prevention) */\n /** String for policy violation message removal */\n blockedWarningText: string;\n /* @conditional-compile-remove(data-loss-prevention) */\n /** String for policy violation message removal details link */\n blockedWarningLinkText: string;\n /* @conditional-compile-remove(file-sharing) @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n /** String for aria text in file attachment group*/\n fileCardGroupMessage: string;\n}\n\n/**\n * Arguments for {@link MessageThreadProps.onRenderJumpToNewMessageButton}.\n *\n * @public\n */\nexport interface JumpToNewMessageButtonProps {\n /** String for button text */\n text: string;\n /** Callback for when button is clicked */\n onClick: () => void;\n}\nconst DefaultJumpToNewMessageButton = (props: JumpToNewMessageButtonProps): JSX.Element => {\n const {\n text,\n onClick\n } = props;\n return <PrimaryButton className={newMessageButtonStyle} styles={buttonWithIconStyles} text={text} onClick={onClick} onRenderIcon={() => <Icon iconName=\"Down\" className={DownIconStyle} />} />;\n};\nconst generateParticipantsStr = (participants: CommunicationParticipant[], defaultName: string): string => participants.map(participant => `${!participant.displayName || participant.displayName === '' ? defaultName : participant.displayName}`).join(', ');\n\n/**\n * A component to render a single message.\n *\n * @public\n */\nexport type MessageRenderer = (props: MessageProps) => JSX.Element;\nconst ParticipantSystemMessageComponent = ({\n message,\n style,\n defaultName\n}: {\n message: ParticipantAddedSystemMessage | ParticipantRemovedSystemMessage;\n style?: ComponentSlotStyle;\n defaultName: string;\n}): JSX.Element => {\n const {\n strings\n } = useLocale();\n const participantsStr = generateParticipantsStr(message.participants, defaultName);\n const messageSuffix = message.systemMessageType === 'participantAdded' ? strings.messageThread.participantJoined : strings.messageThread.participantLeft;\n if (participantsStr !== '') {\n return <SystemMessageComponent iconName={((message.iconName ? message.iconName : '') as SystemMessageIconTypes)} content={`${participantsStr} ${messageSuffix}`} containerStyle={style} />;\n }\n return <></>;\n};\nconst DefaultSystemMessage: MessageRenderer = (props: MessageProps) => {\n const message = props.message;\n switch (message.messageType) {\n case 'system':\n switch (message.systemMessageType) {\n case 'content':\n return <SystemMessageComponent iconName={((message.iconName ? message.iconName : '') as SystemMessageIconTypes)} content={message.content ?? ''} containerStyle={props?.messageContainerStyle} />;\n case 'participantAdded':\n case 'participantRemoved':\n return <ParticipantSystemMessageComponent message={message} style={props.messageContainerStyle} defaultName={props.strings.noDisplayNameSub} />;\n }\n }\n return <></>;\n};\nconst memoizeAllMessages = memoizeFnAll((_messageKey: string, message: Message, showMessageDate: boolean, showMessageStatus: boolean, onRenderAvatar: OnRenderAvatarCallback | undefined, shouldOverlapAvatarAndMessage: boolean, styles: MessageThreadStyles | undefined, onRenderMessageStatus: ((messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null) | undefined, defaultStatusRenderer: (message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */BlockedMessage, status: MessageStatus, participantCount: number, readCount: number) => JSX.Element, defaultChatMessageRenderer: (message: MessageProps) => JSX.Element, strings: MessageThreadStrings, theme: Theme, _attached?: boolean | string, statusToRender?: MessageStatus, participantCount?: number, readCount?: number, onRenderMessage?: (message: MessageProps, defaultOnRender?: MessageRenderer) => JSX.Element, onUpdateMessage?: UpdateMessageCallback, onCancelEditMessage?: CancelEditCallback, onDeleteMessage?: (messageId: string) => Promise<void>, onSendMessage?: (content: string) => Promise<void>, disableEditing?: boolean): ShorthandValue<ChatItemProps> => {\n const messageProps: MessageProps = {\n message,\n strings,\n showDate: showMessageDate,\n onUpdateMessage,\n onCancelEditMessage,\n onDeleteMessage,\n onSendMessage,\n disableEditing\n };\n const chatMessageItemProps = (message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */BlockedMessage, messageProps: MessageProps): ShorthandValue<ChatItemProps> => {\n const chatMessageComponent = onRenderMessage === undefined ? defaultChatMessageRenderer(messageProps) : onRenderMessage(messageProps, defaultChatMessageRenderer);\n const personaOptions: IPersona = {\n hidePersonaDetails: true,\n size: PersonaSize.size32,\n text: message.senderDisplayName,\n showOverflowTooltip: false\n };\n const chatItemMessageStyle = (message.mine ? styles?.myChatItemMessageContainer : styles?.chatItemMessageContainer) || defaultChatItemMessageContainer(shouldOverlapAvatarAndMessage);\n const chatGutterStyles = message.attached === 'top' || message.attached === false ? gutterWithAvatar : gutterWithHiddenAvatar;\n return {\n gutter: {\n styles: chatGutterStyles,\n content: message.mine ? '' : onRenderAvatar ? onRenderAvatar(message.senderId ?? '', personaOptions) : <Persona {...personaOptions} />\n },\n contentPosition: message.mine ? 'end' : 'start',\n message: {\n styles: chatItemMessageStyle,\n content: <Flex hAlign={message.mine ? 'end' : undefined} vAlign=\"end\">\n {chatMessageComponent}\n <div className={mergeStyles(messageStatusContainerStyle(message.mine ?? false), styles?.messageStatusContainer ? styles.messageStatusContainer(message.mine ?? false) : '')}>\n {showMessageStatus && statusToRender ? onRenderMessageStatus ? onRenderMessageStatus({\n status: statusToRender\n }) : defaultStatusRenderer(message, statusToRender, participantCount ?? 0, readCount ?? 0) : <div className={mergeStyles(noMessageStatusStyle)} />}\n </div>\n </Flex>\n },\n attached: message.attached,\n key: _messageKey\n };\n };\n\n /* @conditional-compile-remove(data-loss-prevention) */\n // Similar logic as switch statement case 'chat', if statement for conditional compile (merge logic to switch case when stablize)\n if (message.messageType === 'blocked') {\n const myChatMessageStyle = message.status === 'failed' ? styles?.failedMyChatMessageContainer ?? styles?.myChatMessageContainer ?? FailedMyChatMessageContainer : styles?.myChatMessageContainer ?? defaultBlockedMessageStyleContainer(theme);\n const blockedMessageStyle = styles?.blockedMessageContainer ?? defaultBlockedMessageStyleContainer(theme);\n messageProps.messageContainerStyle = message.mine ? myChatMessageStyle : blockedMessageStyle;\n return chatMessageItemProps(message, messageProps);\n }\n switch (message.messageType) {\n case 'chat':\n {\n const myChatMessageStyle = message.status === 'failed' ? styles?.failedMyChatMessageContainer ?? styles?.myChatMessageContainer ?? FailedMyChatMessageContainer : styles?.myChatMessageContainer ?? defaultMyChatMessageContainer;\n const chatMessageStyle = styles?.chatMessageContainer ?? defaultChatMessageContainer(theme);\n messageProps.messageContainerStyle = message.mine ? myChatMessageStyle : chatMessageStyle;\n return chatMessageItemProps(message, messageProps);\n }\n case 'system':\n {\n messageProps.messageContainerStyle = styles?.systemMessageContainer;\n const systemMessageComponent = onRenderMessage === undefined ? <DefaultSystemMessage {...messageProps} /> : onRenderMessage(messageProps, props => <DefaultSystemMessage {...props} />);\n return {\n children: systemMessageComponent,\n key: _messageKey\n };\n }\n default:\n {\n // We do not handle custom type message by default, users can handle custom type by using onRenderMessage function.\n const customMessageComponent = onRenderMessage === undefined ? <></> : onRenderMessage(messageProps);\n return {\n children: customMessageComponent,\n key: _messageKey\n };\n }\n }\n});\nconst getLastChatMessageIdWithStatus = (messages: Message[], status: MessageStatus): string | undefined => {\n for (let i = messages.length - 1; i >= 0; i--) {\n const message = messages[i];\n if (message.messageType === 'chat' && message.status === status && message.mine) {\n return message.messageId;\n }\n }\n return undefined;\n};\n\n/**\n * @public\n * Callback function run when a message is updated.\n */\nexport type UpdateMessageCallback = (messageId: string, content: string, /* @conditional-compile-remove(file-sharing) */\nmetadata?: Record<string, string>, /* @conditional-compile-remove(file-sharing) */\noptions?: {\n attachedFilesMetadata?: FileMetadata[];\n}) => Promise<void>;\n/**\n * @public\n * Callback function run when a message edit is cancelled.\n */\nexport type CancelEditCallback = (messageId: string) => void;\n\n/**\n * Props for {@link MessageThread}.\n *\n * @public\n */\nexport type MessageThreadProps = {\n /**\n * UserId of the current user.\n */\n userId: string;\n /**\n * Messages to render in message thread. A message can be of type `ChatMessage`, `SystemMessage`, `BlockedMessage` or `CustomMessage`.\n */\n messages: (ChatMessage | SystemMessage | CustomMessage | /* @conditional-compile-remove(data-loss-prevention) */BlockedMessage)[];\n /**\n * number of participants in the thread\n */\n participantCount?: number;\n /**\n * read receipts for each sender in the chat\n */\n readReceiptsBySenderId?: ReadReceiptsBySenderId;\n /**\n * Allows users to pass an object containing custom CSS styles.\n * @Example\n * ```\n * <MessageThread styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: MessageThreadStyles;\n /**\n * Whether the new message button is disabled or not.\n *\n * @defaultValue `false`\n */\n disableJumpToNewMessageButton?: boolean;\n /**\n * Whether the date of each message is displayed or not.\n * It is ignored when onDisplayDateTimeString is supplied.\n *\n * @defaultValue `false`\n */\n showMessageDate?: boolean;\n /**\n * Whether the status indicator for each message is displayed or not.\n *\n * @defaultValue `false`\n */\n showMessageStatus?: boolean;\n /**\n * Number of chat messages to reload each time onLoadPreviousChatMessages is called.\n *\n * @defaultValue 0\n */\n numberOfChatMessagesToReload?: number;\n /**\n * Optional callback to override actions on message being seen.\n *\n * @param messageId - message Id\n */\n onMessageSeen?: (messageId: string) => Promise<void>;\n /**\n * Optional callback to override render of the message status indicator.\n *\n * @param messageStatusIndicatorProps - props of type MessageStatusIndicatorProps\n */\n onRenderMessageStatus?: (messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null;\n /**\n * Optional callback to override render of the avatar.\n *\n * @param userId - user Id\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n /**\n * Optional callback to override render of the button for jumping to the new message.\n *\n * @param newMessageButtonProps - button props of type JumpToNewMessageButtonProps\n */\n onRenderJumpToNewMessageButton?: (newMessageButtonProps: JumpToNewMessageButtonProps) => JSX.Element;\n /**\n * Optional callback to override loading of previous messages.\n * It accepts the number of history chat messages that we want to load and return a boolean Promise indicating if we have got all the history messages.\n * If the promise resolves to `true`, we have load all chat messages into the message thread and `loadPreviousMessagesButton` will not be rendered anymore.\n */\n onLoadPreviousChatMessages?: (messagesToLoad: number) => Promise<boolean>;\n /**\n * Optional callback to override render of a message.\n *\n * @param messageProps - props of type {@link communication-react#MessageProps}\n * @param defaultOnRender - default render of type {@link communication-react#MessageRenderer}\n *\n * @remarks\n * `messageRenderer` is not provided for `CustomMessage` and thus only available for `ChatMessage` and `SystemMessage`.\n */\n onRenderMessage?: (messageProps: MessageProps, messageRenderer?: MessageRenderer) => JSX.Element;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optional callback to render uploaded files in the message component.\n * @beta\n */\n onRenderFileDownloads?: (userId: string, message: ChatMessage) => JSX.Element;\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n /**\n * Optional callback to retrieve the inline image in a message.\n * @param attachment - FileMetadata object we want to render\n * @beta\n */\n onFetchAttachments?: (attachment: FileMetadata) => Promise<AttachmentDownloadResult[]>;\n /**\n * Optional callback to edit a message.\n *\n * @param messageId - message id from chatClient\n * @param content - new content of the message\n *\n */\n onUpdateMessage?: UpdateMessageCallback;\n\n /**\n * Optional callback for when a message edit is cancelled.\n *\n * @param messageId - message id from chatClient\n */\n onCancelEditMessage?: CancelEditCallback;\n /**\n * Optional callback to delete a message.\n *\n * @param messageId - message id from chatClient\n *\n */\n onDeleteMessage?: (messageId: string) => Promise<void>;\n\n /**\n * Optional callback to send a message.\n *\n * @param content - message body to send\n *\n */\n onSendMessage?: (content: string) => Promise<void>;\n\n /**\n /**\n * Disable editing messages.\n *\n * @remarks This removes the action menu on messages.\n *\n * @defaultValue `false`\n */\n disableEditing?: boolean;\n\n /**\n * Optional strings to override in component\n */\n strings?: Partial<MessageThreadStrings>;\n\n /* @conditional-compile-remove(file-sharing) */\n /**\n * @beta\n * Optional function called when someone clicks on the file download icon.\n * If file attachments are defined in the `message.metadata` property using the `fileSharingMetadata` key,\n * this function will be called with the data inside `fileSharingMetadata` key.\n */\n fileDownloadHandler?: FileDownloadHandler;\n\n /* @conditional-compile-remove(date-time-customization) */\n /**\n * Optional function to provide customized date format.\n * @beta\n */\n onDisplayDateTimeString?: (messageDate: Date) => string;\n /* @conditional-compile-remove(mention) */\n /**\n * Optional props needed to lookup a mention query and display mentions\n * @beta\n */\n mentionOptions?: MentionOptions;\n};\n\n/**\n * Props to render a single message.\n *\n * See {@link MessageRenderer}.\n *\n * @public\n */\nexport type MessageProps = {\n /**\n * Message to render. It can type `ChatMessage` or `SystemMessage`, `BlockedMessage` or `CustomMessage`.\n */\n message: Message;\n /**\n * Strings from parent MessageThread component\n */\n strings: MessageThreadStrings;\n /**\n * Custom CSS styles for chat message container.\n */\n messageContainerStyle?: ComponentSlotStyle;\n /**\n * Whether the date of a message is displayed or not.\n *\n * @defaultValue `false`\n */\n showDate?: boolean;\n /**\n * Disable editing messages.\n *\n * @remarks This removes the action menu on messages.\n *\n * @defaultValue `false`\n */\n disableEditing?: boolean;\n /**\n * Optional callback to edit a message.\n *\n * @param messageId - message id from chatClient\n * @param content - new content of the message\n */\n onUpdateMessage?: UpdateMessageCallback;\n\n /**\n * Optional callback for when a message edit is cancelled.\n *\n * @param messageId - message id from chatClient\n */\n onCancelEditMessage?: CancelEditCallback;\n /**\n * Optional callback to delete a message.\n *\n * @param messageId - message id from chatClient\n *\n */\n onDeleteMessage?: (messageId: string) => Promise<void>;\n\n /**\n * Optional callback to send a message.\n *\n * @param messageId - message id from chatClient\n *\n */\n onSendMessage?: (messageId: string) => Promise<void>;\n};\n\n/**\n * `MessageThread` allows you to easily create a component for rendering chat messages, handling scrolling behavior of new/old messages and customizing icons & controls inside the chat thread.\n * @param props - of type MessageThreadProps\n *\n * Users will need to provide at least chat messages and userId to render the `MessageThread` component.\n * Users can also customize `MessageThread` by passing in their own Avatar, `MessageStatusIndicator` icon, `JumpToNewMessageButton`, `LoadPreviousMessagesButton` and the behavior of these controls.\n *\n * `MessageThread` internally uses the `Chat` & `Chat.Message` component from `@fluentui/react-northstar`. You can checkout the details about these [two components](https://fluentsite.z22.web.core.windows.net/0.53.0/components/chat/props).\n *\n * @public\n */\nexport const MessageThread = (props: MessageThreadProps): JSX.Element => {\n const {\n messages: newMessages,\n userId,\n participantCount,\n readReceiptsBySenderId,\n styles,\n disableJumpToNewMessageButton = false,\n showMessageDate = false,\n showMessageStatus = false,\n numberOfChatMessagesToReload = 5,\n onMessageSeen,\n onRenderMessageStatus,\n onRenderAvatar,\n onLoadPreviousChatMessages,\n onRenderJumpToNewMessageButton,\n onRenderMessage,\n onUpdateMessage,\n onCancelEditMessage,\n onDeleteMessage,\n onSendMessage,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString,\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n onFetchAttachments,\n /* @conditional-compile-remove(mention) */\n mentionOptions\n } = props;\n const onRenderFileDownloads = onRenderFileDownloadsTrampoline(props);\n const [messages, setMessages] = useState<Message[]>([]);\n // We need this state to wait for one tick and scroll to bottom after messages have been initialized.\n // Otherwise chatScrollDivRef.current.clientHeight is wrong if we scroll to bottom before messages are initialized.\n const [chatMessagesInitialized, setChatMessagesInitialized] = useState<boolean>(false);\n const [isAtBottomOfScroll, setIsAtBottomOfScroll] = useState<boolean>(true);\n const [forceUpdate, setForceUpdate] = useState<number>(0);\n\n // Used to decide if should auto scroll to bottom or show \"new message\" button\n const [latestPreviousChatMessage, setLatestPreviousChatMessage] = useState<ChatMessage | undefined>(undefined);\n const [latestCurrentChatMessage, setLatestCurrentChatMessage] = useState<ChatMessage | undefined>(undefined);\n const [existsNewChatMessage, setExistsNewChatMessage] = useState<boolean>(false);\n const [lastSeenChatMessage, setLastSeenChatMessage] = useState<string | undefined>(undefined);\n const [lastDeliveredChatMessage, setLastDeliveredChatMessage] = useState<string | undefined>(undefined);\n const [lastSendingChatMessage, setLastSendingChatMessage] = useState<string | undefined>(undefined);\n\n // readCount and participantCount will only need to be updated on-fly when user hover on an indicator\n const [readCountForHoveredIndicator, setReadCountForHoveredIndicator] = useState<number | undefined>(undefined);\n\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n const [inlineAttachments, setInlineAttachments] = useState<Record<string, string>>({});\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n const onFetchInlineAttachment = useCallback(async (attachment: FileMetadata): Promise<void> => {\n if (!onFetchAttachments || attachment.attachmentType !== 'inlineImage' || attachment.id in inlineAttachments) {\n return;\n }\n setInlineAttachments(prev => ({\n ...prev,\n [attachment.id]: ''\n }));\n const attachmentDownloadResult = await onFetchAttachments(attachment);\n if (attachmentDownloadResult[0]) {\n setInlineAttachments(prev => ({\n ...prev,\n [attachment.id]: attachmentDownloadResult[0].blobUrl\n }));\n }\n }, [inlineAttachments, onFetchAttachments]);\n const isAllChatMessagesLoadedRef = useRef(false);\n // isAllChatMessagesLoadedRef needs to be updated every time when a new adapter is set in order to display correct data\n // onLoadPreviousChatMessages is updated when a new adapter is set\n useEffect(() => {\n if (onLoadPreviousChatMessages) {\n isAllChatMessagesLoadedRef.current = false;\n }\n }, [onLoadPreviousChatMessages]);\n\n /* @conditional-compile-remove(file-sharing) */ /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n useEffect(() => {\n initializeFileTypeIcons();\n }, []);\n const previousTopRef = useRef<number>(-1);\n const previousHeightRef = useRef<number>(-1);\n const messageIdSeenByMeRef = useRef<string>('');\n const chatScrollDivRef = useRef<HTMLElement>(null);\n const chatThreadRef = useRef<HTMLElement>(null);\n const isLoadingChatMessagesRef = useRef(false);\n\n // When the chat thread is narrow, we perform space optimizations such as overlapping\n // the avatar on top of the chat message and moving the chat accept/reject edit buttons\n // to a new line\n const chatThreadWidth = _useContainerWidth(chatThreadRef);\n const isNarrow = chatThreadWidth ? isNarrowWidth(chatThreadWidth) : false;\n const messagesRef = useRef(messages);\n const setMessagesRef = (messagesWithAttachedValue: Message[]): void => {\n messagesRef.current = messagesWithAttachedValue;\n setMessages(messagesWithAttachedValue);\n };\n const isAtBottomOfScrollRef = useRef(isAtBottomOfScroll);\n const setIsAtBottomOfScrollRef = (isAtBottomOfScrollValue: boolean): void => {\n isAtBottomOfScrollRef.current = isAtBottomOfScrollValue;\n setIsAtBottomOfScroll(isAtBottomOfScrollValue);\n };\n const chatMessagesInitializedRef = useRef(chatMessagesInitialized);\n const setChatMessagesInitializedRef = (chatMessagesInitialized: boolean): void => {\n chatMessagesInitializedRef.current = chatMessagesInitialized;\n setChatMessagesInitialized(chatMessagesInitialized);\n };\n\n // we try to only send those message status if user is scrolled to the bottom.\n const sendMessageStatusIfAtBottom = useCallback(async (): Promise<void> => {\n if (!isAtBottomOfScrollRef.current || !document.hasFocus() || !messagesRef.current || messagesRef.current.length === 0 || !showMessageStatus) {\n return;\n }\n const messagesWithId = messagesRef.current.filter(message => {\n return message.messageType === 'chat' && !message.mine && !!message.messageId;\n });\n if (messagesWithId.length === 0) {\n return;\n }\n const lastMessage: ChatMessage = (messagesWithId[messagesWithId.length - 1] as ChatMessage);\n try {\n if (onMessageSeen && lastMessage && lastMessage.messageId && lastMessage.messageId !== messageIdSeenByMeRef.current) {\n await onMessageSeen(lastMessage.messageId);\n messageIdSeenByMeRef.current = lastMessage.messageId;\n }\n } catch (e) {\n console.log('onMessageSeen Error', lastMessage, e);\n }\n }, [showMessageStatus, onMessageSeen]);\n const scrollToBottom = useCallback((): void => {\n if (chatScrollDivRef.current) {\n chatScrollDivRef.current.scrollTop = chatScrollDivRef.current.scrollHeight;\n }\n setExistsNewChatMessage(false);\n setIsAtBottomOfScrollRef(true);\n sendMessageStatusIfAtBottom();\n }, [sendMessageStatusIfAtBottom]);\n const handleScrollToTheBottom = useCallback((): void => {\n if (!chatScrollDivRef.current) {\n return;\n }\n const atBottom = Math.ceil(chatScrollDivRef.current.scrollTop) >= chatScrollDivRef.current.scrollHeight - chatScrollDivRef.current.clientHeight;\n if (atBottom) {\n sendMessageStatusIfAtBottom();\n if (!isAtBottomOfScrollRef.current) {\n scrollToBottom();\n }\n }\n setIsAtBottomOfScrollRef(atBottom);\n }, [scrollToBottom, sendMessageStatusIfAtBottom]);\n\n // Infinite scrolling + threadInitialize function\n const fetchNewMessageWhenAtTop = useCallback(async () => {\n if (!isLoadingChatMessagesRef.current) {\n if (onLoadPreviousChatMessages) {\n isLoadingChatMessagesRef.current = true;\n try {\n // Fetch message until scrollTop reach the threshold for fetching new message\n while (!isAllChatMessagesLoadedRef.current && chatScrollDivRef.current && chatScrollDivRef.current.scrollTop <= 500) {\n isAllChatMessagesLoadedRef.current = await onLoadPreviousChatMessages(numberOfChatMessagesToReload);\n await delay(200);\n }\n } finally {\n // Set isLoadingChatMessagesRef to false after messages are fetched\n isLoadingChatMessagesRef.current = false;\n }\n }\n }\n }, [numberOfChatMessagesToReload, onLoadPreviousChatMessages]);\n\n // The below 2 of useEffects are design for fixing infinite scrolling problem\n // Scrolling element will behave differently when scrollTop = 0(it sticks at the top)\n // we need to get previousTop before it prepend contents\n // Execute order [newMessage useEffect] => get previousTop => dom update => [messages useEffect]\n useEffect(() => {\n if (!chatScrollDivRef.current) {\n return;\n }\n previousTopRef.current = chatScrollDivRef.current.scrollTop;\n previousHeightRef.current = chatScrollDivRef.current.scrollHeight;\n }, [newMessages]);\n useEffect(() => {\n if (!chatScrollDivRef.current) {\n return;\n }\n chatScrollDivRef.current.scrollTop = chatScrollDivRef.current.scrollHeight - (previousHeightRef.current - previousTopRef.current);\n }, [messages]);\n\n // Fetch more messages to make the scroll bar appear, infinity scroll is then handled in the handleScroll function.\n useEffect(() => {\n fetchNewMessageWhenAtTop();\n }, [fetchNewMessageWhenAtTop]);\n\n /**\n * One time run useEffects. Sets up listeners when component is mounted and tears down listeners when component\n * unmounts unless these function changed\n */\n useEffect(() => {\n window && window.addEventListener('click', sendMessageStatusIfAtBottom);\n window && window.addEventListener('focus', sendMessageStatusIfAtBottom);\n return () => {\n window && window.removeEventListener('click', sendMessageStatusIfAtBottom);\n window && window.removeEventListener('focus', sendMessageStatusIfAtBottom);\n };\n }, [sendMessageStatusIfAtBottom]);\n useEffect(() => {\n const chatScrollDiv = chatScrollDivRef.current;\n chatScrollDiv?.addEventListener('scroll', handleScrollToTheBottom);\n chatScrollDiv?.addEventListener('scroll', fetchNewMessageWhenAtTop);\n return () => {\n chatScrollDiv?.removeEventListener('scroll', handleScrollToTheBottom);\n chatScrollDiv?.removeEventListener('scroll', fetchNewMessageWhenAtTop);\n };\n }, [fetchNewMessageWhenAtTop, handleScrollToTheBottom]);\n\n /**\n * ClientHeight controls the number of messages to render. However ClientHeight will not be initialized after the\n * first render (not sure but I guess Fluent is updating it in hook which is after render maybe?) so we need to\n * trigger a re-render until ClientHeight is initialized. This force re-render should only happen once.\n */\n const clientHeight = chatThreadRef.current?.clientHeight;\n useEffect(() => {\n if (clientHeight === undefined) {\n setForceUpdate(forceUpdate + 1);\n return;\n }\n // Only scroll to bottom if isAtBottomOfScrollRef is true\n isAtBottomOfScrollRef.current && scrollToBottom();\n }, [clientHeight, forceUpdate, scrollToBottom, chatMessagesInitialized]);\n\n /**\n * This needs to run to update latestPreviousChatMessage & latestCurrentChatMessage.\n * These two states are used to manipulate scrollbar\n */\n useEffect(() => {\n setLatestPreviousChatMessage(getLatestChatMessage(messagesRef.current));\n setLatestCurrentChatMessage(getLatestChatMessage(newMessages));\n setMessagesRef(newMessages);\n !chatMessagesInitializedRef.current && setChatMessagesInitializedRef(true);\n setLastDeliveredChatMessage(getLastChatMessageIdWithStatus(newMessages, 'delivered'));\n setLastSeenChatMessage(getLastChatMessageIdWithStatus(newMessages, 'seen'));\n setLastSendingChatMessage(getLastChatMessageIdWithStatus(newMessages, 'sending'));\n }, [newMessages]);\n\n /**\n * This needs to run after messages are rendered so we can manipulate the scroll bar.\n */\n useEffect(() => {\n // If user just sent the latest message then we assume we can move user to bottom of scroll.\n if (isThereNewMessageNotFromCurrentUser(userId, latestPreviousChatMessage, latestCurrentChatMessage) && !isAtBottomOfScrollRef.current) {\n setExistsNewChatMessage(true);\n } else if (didUserSendTheLatestMessage(userId, latestPreviousChatMessage, latestCurrentChatMessage) || isAtBottomOfScrollRef.current) {\n scrollToBottom();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [messages]);\n const participantCountRef = useRef(participantCount);\n const readReceiptsBySenderIdRef = useRef(readReceiptsBySenderId);\n participantCountRef.current = participantCount;\n readReceiptsBySenderIdRef.current = readReceiptsBySenderId;\n const onActionButtonClickMemo = useCallback((message: ChatMessage, setMessageReadBy: (readBy: {\n id: string;\n displayName: string;\n }[]) => void) => {\n if (participantCountRef.current && participantCountRef.current - 1 > 1 && readReceiptsBySenderIdRef.current) {\n setMessageReadBy(getParticipantsWhoHaveReadMessage(message, readReceiptsBySenderIdRef.current));\n }\n }, []);\n const localeStrings = useLocale().strings.messageThread;\n const strings = useMemo(() => ({\n ...localeStrings,\n ...props.strings\n }), [localeStrings, props.strings]);\n // To rerender the defaultChatMessageRenderer if app running across days(every new day chat time stamp need to be regenerated)\n const defaultChatMessageRenderer = useCallback((messageProps: MessageProps) => {\n if (messageProps.message.messageType === 'chat' || /* @conditional-compile-remove(data-loss-prevention) */messageProps.message.messageType === 'blocked') {\n return <ChatMessageComponent {...messageProps} onRenderFileDownloads={onRenderFileDownloads}\n /* @conditional-compile-remove(file-sharing) */ strings={strings} message={messageProps.message} userId={props.userId} remoteParticipantsCount={participantCount ? participantCount - 1 : 0} inlineAcceptRejectEditButtons={!isNarrow} onRenderAvatar={onRenderAvatar} showMessageStatus={showMessageStatus} messageStatus={messageProps.message.status} onActionButtonClick={onActionButtonClickMemo}\n /* @conditional-compile-remove(date-time-customization) */ onDisplayDateTimeString={onDisplayDateTimeString}\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ onFetchAttachments={onFetchInlineAttachment}\n /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */ attachmentsMap={inlineAttachments}\n /* @conditional-compile-remove(mention) */ mentionOptions={mentionOptions} />;\n }\n return <></>;\n }, [onRenderFileDownloads, /* @conditional-compile-remove(file-sharing) */\n strings, props.userId, participantCount, isNarrow, onRenderAvatar, showMessageStatus, onActionButtonClickMemo, /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString, /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n onFetchInlineAttachment, /* @conditional-compile-remove(teams-inline-images-and-file-sharing) */\n inlineAttachments, /* @conditional-compile-remove(mention) */\n mentionOptions]);\n const defaultStatusRenderer = useCallback((message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */BlockedMessage, status: MessageStatus, participantCount: number, readCount: number) => {\n const onToggleToolTip = (isToggled: boolean): void => {\n if (isToggled && readReceiptsBySenderIdRef.current) {\n setReadCountForHoveredIndicator(getParticipantsWhoHaveReadMessage(message, readReceiptsBySenderIdRef.current).length);\n } else {\n setReadCountForHoveredIndicator(undefined);\n }\n };\n return <MessageStatusIndicator status={status} readCount={readCount} onToggleToolTip={onToggleToolTip}\n // -1 because participant count does not include myself\n remoteParticipantsCount={participantCount ? participantCount - 1 : 0} />;\n }, []);\n const theme = useTheme();\n const messagesToDisplay = useMemo(() => memoizeAllMessages(memoizedMessageFn => {\n return messages.map((message: Message, index: number): ShorthandValue<ChatItemProps> => {\n let key: string | undefined = message.messageId;\n let statusToRender: MessageStatus | undefined = undefined;\n if (message.messageType === 'chat' || /* @conditional-compile-remove(data-loss-prevention) */message.messageType === 'blocked') {\n if ((!message.messageId || message.messageId === '') && 'clientMessageId' in message) {\n key = message.clientMessageId;\n }\n if (showMessageStatus && message.mine) {\n switch (message.messageId) {\n case lastSeenChatMessage:\n {\n statusToRender = 'seen';\n break;\n }\n case lastSendingChatMessage:\n {\n statusToRender = 'sending';\n break;\n }\n case lastDeliveredChatMessage:\n {\n statusToRender = 'delivered';\n break;\n }\n }\n }\n if (message.mine && message.status === 'failed') {\n statusToRender = 'failed';\n }\n }\n return memoizedMessageFn(key ?? 'id_' + index, message, showMessageDate, showMessageStatus, onRenderAvatar, isNarrow, styles, onRenderMessageStatus, defaultStatusRenderer, defaultChatMessageRenderer, strings, theme,\n // Temporary solution to make sure we re-render if attach attribute is changed.\n // The proper fix should be in selector.\n message.messageType === 'chat' || /* @conditional-compile-remove(data-loss-prevention) */message.messageType === 'blocked' ? message.attached : undefined, statusToRender, participantCount, readCountForHoveredIndicator, onRenderMessage, onUpdateMessage, onCancelEditMessage, onDeleteMessage, onSendMessage, props.disableEditing);\n });\n }), [messages, showMessageDate, showMessageStatus, onRenderAvatar, isNarrow, styles, onRenderMessageStatus, defaultStatusRenderer, defaultChatMessageRenderer, strings, theme, participantCount, readCountForHoveredIndicator, onRenderMessage, onUpdateMessage, onCancelEditMessage, onDeleteMessage, onSendMessage, lastSeenChatMessage, lastSendingChatMessage, lastDeliveredChatMessage, props.disableEditing]);\n const chatBody = useMemo(() => {\n return <LiveAnnouncer>\n <Chat styles={mergeNorthstarThemes(chatStyle, linkStyles(theme), styles?.chatContainer ?? {})} items={messagesToDisplay} />\n </LiveAnnouncer>;\n }, [theme, styles?.chatContainer, messagesToDisplay]);\n return <Ref innerRef={chatThreadRef}>\n <Stack className={mergeStyles(messageThreadContainerStyle, styles?.root)} grow>\n {/* Always ensure New Messages button is above the chat body element in the DOM tree. This is to ensure correct\n tab ordering. Because the New Messages button floats on top of the chat body it is in a higher z-index and\n thus Users should be able to tab navigate to the new messages button _before_ tab focus is taken to the chat body.*/}\n {existsNewChatMessage && !disableJumpToNewMessageButton && <div className={mergeStyles(newMessageButtonContainerStyle, styles?.newMessageButtonContainer)}>\n {onRenderJumpToNewMessageButton ? onRenderJumpToNewMessageButton({\n text: strings.newMessagesIndicator,\n onClick: scrollToBottom\n }) : <DefaultJumpToNewMessageButton text={strings.newMessagesIndicator} onClick={scrollToBottom} />}\n </div>}\n\n <Ref innerRef={chatScrollDivRef}>{chatBody}</Ref>\n </Stack>\n </Ref>;\n};\nconst onRenderFileDownloadsTrampoline = (props: MessageThreadProps): ((userId: string, message: ChatMessage) => JSX.Element) | undefined => {\n /* @conditional-compile-remove(file-sharing) */\n return props.onRenderFileDownloads;\n return undefined;\n};\nconst linkStyles = (theme: Theme): ComponentSlotStyle => {\n return {\n '& a:link': {\n color: theme.palette.themePrimary\n },\n '& a:visited': {\n color: theme.palette.themeDarker\n },\n '& a:hover': {\n color: theme.palette.themeDarker\n },\n '& a:selected': {\n color: theme.palette.themeDarker\n }\n };\n};\"../../../northstar-wrapper/src\"\"../../../acs-ui-common/src\""]}
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { ControlBarButtonProps } from './ControlBarButton';
3
2
  import { IContextualMenuItemStyles, IContextualMenuStyles } from '@fluentui/react';
4
3
  import { ControlBarButtonStyles } from './ControlBarButton';