@azure/communication-react 1.14.1-alpha-202403280012 → 1.14.1-alpha-202404020012

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 (202) hide show
  1. package/dist/communication-react.d.ts +230 -250
  2. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-D3ER8Kz9.js → RichTextSendBoxWrapper-BTyywbnH.js} +4 -4
  3. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-D3ER8Kz9.js.map → RichTextSendBoxWrapper-BTyywbnH.js.map} +1 -1
  4. package/dist/dist-cjs/communication-react/{index-BI61bnOi.js → index-Bj9ORqhl.js} +1176 -951
  5. package/dist/dist-cjs/communication-react/index-Bj9ORqhl.js.map +1 -0
  6. package/dist/dist-cjs/communication-react/index.js +4 -3
  7. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  8. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  10. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +4 -4
  11. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  12. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +4 -0
  13. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +6 -1
  14. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  15. package/dist/dist-esm/calling-stateful-client/src/ReactionSubscriber.d.ts +1 -1
  16. package/dist/dist-esm/calling-stateful-client/src/ReactionSubscriber.js +2 -2
  17. package/dist/dist-esm/calling-stateful-client/src/ReactionSubscriber.js.map +1 -1
  18. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +1 -2
  19. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  20. package/dist/dist-esm/communication-react/src/index.d.ts +2 -2
  21. package/dist/dist-esm/communication-react/src/index.js +2 -0
  22. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  23. package/dist/dist-esm/react-components/src/components/AttachmentCard.d.ts +10 -18
  24. package/dist/dist-esm/react-components/src/components/AttachmentCard.js +28 -41
  25. package/dist/dist-esm/react-components/src/components/AttachmentCard.js.map +1 -1
  26. package/dist/dist-esm/react-components/src/components/AttachmentDownloadCards.d.ts +18 -11
  27. package/dist/dist-esm/react-components/src/components/AttachmentDownloadCards.js +74 -62
  28. package/dist/dist-esm/react-components/src/components/AttachmentDownloadCards.js.map +1 -1
  29. package/dist/dist-esm/react-components/src/components/AttachmentUploadCards.d.ts +5 -36
  30. package/dist/dist-esm/react-components/src/components/AttachmentUploadCards.js +31 -7
  31. package/dist/dist-esm/react-components/src/components/AttachmentUploadCards.js.map +1 -1
  32. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js +4 -8
  33. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js.map +1 -1
  34. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +6 -3
  35. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
  36. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.d.ts +5 -5
  37. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js +7 -7
  38. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
  39. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js +13 -18
  40. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js.map +1 -1
  41. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +9 -9
  42. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
  43. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.d.ts +9 -9
  44. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js +10 -10
  45. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
  46. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +12 -10
  47. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
  48. package/dist/dist-esm/react-components/src/components/EndCallButton.d.ts +10 -1
  49. package/dist/dist-esm/react-components/src/components/EndCallButton.js +93 -51
  50. package/dist/dist-esm/react-components/src/components/EndCallButton.js.map +1 -1
  51. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +10 -9
  52. package/dist/dist-esm/react-components/src/components/MessageThread.js +6 -3
  53. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  54. package/dist/dist-esm/react-components/src/components/ReactionButton.d.ts +2 -2
  55. package/dist/dist-esm/react-components/src/components/ReactionButton.js +8 -5
  56. package/dist/dist-esm/react-components/src/components/ReactionButton.js.map +1 -1
  57. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.d.ts +1 -1
  58. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +3 -3
  59. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +1 -1
  60. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +6 -6
  61. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +23 -23
  62. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
  63. package/dist/dist-esm/react-components/src/components/SendBox.d.ts +5 -5
  64. package/dist/dist-esm/react-components/src/components/SendBox.js +16 -16
  65. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  66. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.d.ts +8 -0
  67. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js +1 -1
  68. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js.map +1 -1
  69. package/dist/dist-esm/react-components/src/components/VideoGallery/ParticipantVideoTileOverlay.js +8 -4
  70. package/dist/dist-esm/react-components/src/components/VideoGallery/ParticipantVideoTileOverlay.js.map +1 -1
  71. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteContentShareReactionOverlay.js +4 -4
  72. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteContentShareReactionOverlay.js.map +1 -1
  73. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.d.ts +4 -0
  74. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +22 -1
  75. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
  76. package/dist/dist-esm/react-components/src/components/index.d.ts +2 -3
  77. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  78. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.d.ts +1 -1
  79. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.js +1 -1
  80. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.js.map +1 -1
  81. package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.d.ts +1 -1
  82. package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.js +3 -2
  83. package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.js.map +1 -1
  84. package/dist/dist-esm/react-components/src/components/styles/ReactionOverlay.style.d.ts +2 -1
  85. package/dist/dist-esm/react-components/src/components/styles/ReactionOverlay.style.js +10 -12
  86. package/dist/dist-esm/react-components/src/components/styles/ReactionOverlay.style.js.map +1 -1
  87. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.d.ts +1 -0
  88. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js +3 -1
  89. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js.map +1 -1
  90. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.d.ts +10 -2
  91. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js +20 -14
  92. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
  93. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +3 -3
  94. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +7 -7
  95. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  96. package/dist/dist-esm/react-components/src/components/utils/common.d.ts +1 -1
  97. package/dist/dist-esm/react-components/src/components/utils/common.js +1 -1
  98. package/dist/dist-esm/react-components/src/components/utils/common.js.map +1 -1
  99. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
  100. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +4 -1
  101. package/dist/dist-esm/react-components/src/theming/icons.d.ts +3 -2
  102. package/dist/dist-esm/react-components/src/theming/icons.js +5 -3
  103. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  104. package/dist/dist-esm/react-components/src/types/Attachment.d.ts +62 -75
  105. package/dist/dist-esm/react-components/src/types/Attachment.js.map +1 -1
  106. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +24 -0
  107. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  108. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +3 -3
  109. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
  110. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.js +2 -2
  111. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.js.map +1 -1
  112. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.js +0 -7
  113. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.js.map +1 -1
  114. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.d.ts +2 -0
  115. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.js +66 -1
  116. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.js.map +1 -1
  117. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.d.ts +1 -1
  118. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js +32 -17
  119. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js.map +1 -1
  120. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalDeviceSettings.styles.d.ts +5 -1
  121. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalDeviceSettings.styles.js +12 -0
  122. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalDeviceSettings.styles.js.map +1 -1
  123. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalPreview.styles.d.ts +2 -14
  124. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalPreview.styles.js +14 -10
  125. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/LocalPreview.styles.js.map +1 -1
  126. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +2 -2
  127. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +3 -3
  128. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  129. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +8 -8
  130. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +21 -21
  131. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  132. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +8 -8
  133. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  134. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.d.ts +8 -8
  135. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +15 -15
  136. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
  137. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +3 -3
  138. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +2 -2
  139. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  140. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.d.ts +15 -0
  141. package/dist/dist-esm/react-composites/src/composites/ChatComposite/{FileDownloadErrorBar.js → AttachmentDownloadErrorBar.js} +5 -5
  142. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.js.map +1 -0
  143. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts +2 -2
  144. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js +1 -1
  145. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
  146. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.d.ts +2 -34
  147. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +27 -16
  148. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  149. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationAttachmentUploadAdapter.d.ts +47 -0
  150. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationAttachmentUploadAdapter.js +179 -0
  151. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationAttachmentUploadAdapter.js.map +1 -0
  152. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +9 -9
  153. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +29 -29
  154. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  155. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts +4 -4
  156. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
  157. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapterProvider.d.ts +2 -2
  158. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapterProvider.js +8 -8
  159. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapterProvider.js.map +1 -1
  160. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/{FileUpload.d.ts → AttachmentUpload.d.ts} +10 -10
  161. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/{FileUpload.js → AttachmentUpload.js} +12 -12
  162. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js.map +1 -0
  163. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.d.ts +38 -0
  164. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/{FileUploadButton.js → AttachmentUploadButton.js} +11 -9
  165. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js.map +1 -0
  166. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.d.ts +4 -2
  167. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js +2 -2
  168. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js.map +1 -1
  169. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.d.ts +2 -3
  170. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
  171. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/attachmentUploadsSelector.d.ts +29 -0
  172. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/attachmentUploadsSelector.js +12 -0
  173. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/attachmentUploadsSelector.js.map +1 -0
  174. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.d.ts +2 -2
  175. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js +2 -2
  176. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js.map +1 -1
  177. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +24 -8
  178. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  179. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +11 -2
  180. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
  181. package/dist/dist-esm/react-composites/src/composites/common/SendBox.js +5 -5
  182. package/dist/dist-esm/react-composites/src/composites/common/SendBox.js.map +1 -1
  183. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +3 -2
  184. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.d.ts +7 -1
  185. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.js.map +1 -1
  186. package/dist/dist-esm/react-composites/src/composites/common/utils.d.ts +4 -0
  187. package/dist/dist-esm/react-composites/src/composites/common/utils.js +6 -0
  188. package/dist/dist-esm/react-composites/src/composites/common/utils.js.map +1 -1
  189. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +6 -0
  190. package/package.json +7 -7
  191. package/dist/dist-cjs/communication-react/index-BI61bnOi.js.map +0 -1
  192. package/dist/dist-esm/react-composites/src/composites/ChatComposite/FileDownloadErrorBar.d.ts +0 -15
  193. package/dist/dist-esm/react-composites/src/composites/ChatComposite/FileDownloadErrorBar.js.map +0 -1
  194. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.d.ts +0 -48
  195. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js +0 -160
  196. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js.map +0 -1
  197. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUpload.js.map +0 -1
  198. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadButton.d.ts +0 -36
  199. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadButton.js.map +0 -1
  200. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/fileUploadsSelector.d.ts +0 -27
  201. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/fileUploadsSelector.js +0 -12
  202. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/fileUploadsSelector.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"EndCallButton.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/EndCallButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,UA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C,cAAc,CAAC,SAAS;QAC1C,UAAU,EAAE,UAAU,CAAC,cAAc,CAAC,OAAO;QAC7C,gCAAgC,EAAE;YAChC,iBAAiB,EAAE,MAAM;SAC1B;KACF;IACD,KAAK,EAAE;QACL,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC,SAAS;KAC3C;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { concatStyleSets, Icon } from '@fluentui/react';\nimport React from 'react';\nimport { useLocale } from '../localization';\nimport { useTheme } from '../theming';\nimport { darkTheme, lightTheme } from '../theming/themes';\nimport { isDarkThemed } from '../theming/themeUtils';\nimport { ControlBarButton, ControlBarButtonProps } from './ControlBarButton';\n\n/**\n * Strings of {@link EndCallButton} that can be overridden.\n *\n * @public\n */\nexport interface EndCallButtonStrings {\n /**\n * Label of button\n */\n label: string;\n /** Tooltip content. */\n tooltipContent?: string;\n}\n\n/**\n * Props for {@link EndCallButton}.\n *\n * @public\n */\nexport interface EndCallButtonProps extends ControlBarButtonProps {\n /**\n * Utility property for using this component with `communication react eventHandlers`.\n * Maps directly to the `onClick` property.\n */\n onHangUp?: () => Promise<void>;\n\n /**\n * Optional strings to override in component\n */\n strings?: EndCallButtonStrings;\n}\n\nconst onRenderEndCallIcon = (): JSX.Element => <Icon iconName=\"ControlButtonEndCall\" />;\n\n/**\n * A button to end an ongoing call.\n *\n * Can be used with {@link ControlBar}.\n *\n * @public\n */\nexport const EndCallButton = (props: EndCallButtonProps): JSX.Element => {\n const { styles } = props;\n\n const localeStrings = useLocale().strings.endCallButton;\n const strings = { ...localeStrings, ...props.strings };\n\n const theme = useTheme();\n const isDarkTheme = isDarkThemed(theme);\n const componentStyles = concatStyleSets(\n isDarkTheme ? darkThemeCallButtonStyles : lightThemeCallButtonStyles,\n styles ?? {}\n );\n\n return (\n <ControlBarButton\n {...props}\n onClick={props.onHangUp ?? props.onClick}\n styles={componentStyles}\n onRenderIcon={props.onRenderIcon ?? onRenderEndCallIcon}\n strings={strings}\n labelKey={props.labelKey ?? 'endCallButtonLabel'}\n />\n );\n};\n// using media query to prevent windows from overwriting the button color\nconst darkThemeCallButtonStyles = {\n root: {\n color: darkTheme.callingPalette.iconWhite,\n background: darkTheme.callingPalette.callRed,\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'auto',\n border: `1px ${lightTheme.palette?.neutralQuaternaryAlt} solid`\n },\n ':focus::after': { outlineColor: `${darkTheme.callingPalette.iconWhite} !important` } // added !important to avoid override by FluentUI button styles\n },\n rootHovered: {\n color: darkTheme.callingPalette.iconWhite,\n background: darkTheme.callingPalette.callRed,\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'auto'\n }\n },\n rootPressed: {\n color: darkTheme.callingPalette.iconWhite,\n background: darkTheme.callingPalette.callRed,\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'auto'\n }\n },\n label: {\n color: darkTheme.callingPalette.iconWhite\n }\n};\n\nconst lightThemeCallButtonStyles = {\n root: {\n color: lightTheme.callingPalette.iconWhite,\n background: lightTheme.callingPalette.callRed,\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'auto',\n border: `1px ${lightTheme.palette?.neutralQuaternaryAlt} solid`\n },\n ':focus::after': { outlineColor: `${lightTheme.callingPalette.iconWhite} !important` } // added !important to avoid override by FluentUI button styles\n },\n rootHovered: {\n color: lightTheme.callingPalette.iconWhite,\n background: lightTheme.callingPalette.callRed,\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'auto'\n }\n },\n rootPressed: {\n color: lightTheme.callingPalette.iconWhite,\n background: lightTheme.callingPalette.callRed,\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'auto'\n }\n },\n label: {\n color: lightTheme.callingPalette.iconWhite\n }\n};\n"]}
1
+ {"version":3,"file":"EndCallButton.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/EndCallButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,eAAe,EAAE,I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E,qBAAqB,CAAC,OAAO,GACzC;IACD,4BAA4B,EAAE,qBAAqB,CAAC,OAAO;IAC3D,6BAA6B,EAAE,qBAAqB,CAAC,OAAO;CAC7D,CAAC;AAEF,MAAM,0BAA0B,GAAG;IACjC,IAAI,EAAE,sBAAsB,CAAC,OAAO;IACpC,WAAW,EAAE,sBAAsB,CAAC,OAAO;IAC3C,WAAW,EAAE,sBAAsB,CAAC,OAAO;IAC3C,qBAAqB,kCACf,sBAAsB,CAAC,OAAkB,KAC7C,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,YAAY,EAAE,MAAM,EACpB,SAAS,EAAE,sBAAsB,CAAC,OAAO,GAC1C;IACD,4BAA4B,EAAE,sBAAsB,CAAC,OAAO;IAC5D,6BAA6B,EAAE,sBAAsB,CAAC,OAAO;IAC7D,sBAAsB,EAAE,sBAAsB,CAAC,OAAO;IACtD,KAAK,EAAE;QACL,KAAK,EAAE,UAAU,CAAC,cAAc,CAAC,SAAS;KAC3C;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { concatStyleSets, Icon, IStyle, PartialTheme } from '@fluentui/react';\n/* @conditional-compile-remove(end-call-options) */\nimport { IContextualMenuProps } from '@fluentui/react';\nimport React from 'react';\nimport { useLocale } from '../localization';\nimport { useTheme } from '../theming';\nimport { CallingTheme, darkTheme, lightTheme } from '../theming/themes';\nimport { isDarkThemed } from '../theming/themeUtils';\nimport { ControlBarButton, ControlBarButtonProps } from './ControlBarButton';\n/* @conditional-compile-remove(end-call-options) */\nimport { _preventDismissOnEvent as preventDismissOnEvent } from '@internal/acs-ui-common';\n\n/**\n * Strings of {@link EndCallButton} that can be overridden.\n *\n * @public\n */\nexport interface EndCallButtonStrings {\n /**\n * Label of button\n */\n label: string;\n /** Tooltip content. */\n tooltipContent?: string;\n\n /* @conditional-compile-remove(end-call-options) */\n /** Label for leave option when ending call */\n leaveOption?: string;\n\n /* @conditional-compile-remove(end-call-options) */\n /** Label for end the whole call option when ending call */\n endCallOption?: string;\n}\n\n/**\n * Props for {@link EndCallButton}.\n *\n * @public\n */\nexport interface EndCallButtonProps extends ControlBarButtonProps {\n /**\n * Utility property for using this component with `communication react eventHandlers`.\n * Maps directly to the `onClick` property.\n */\n onHangUp?: (forEveryone?: boolean) => Promise<void>;\n\n /* @conditional-compile-remove(end-call-options) */\n /**\n * Set this to true to make it a split button.\n * The split arrow will trigger a contextual menu to allow end for everyone or just for the user.\n */\n enableEndCallMenu?: boolean;\n\n /**\n * Optional strings to override in component\n */\n strings?: EndCallButtonStrings;\n}\n\nconst onRenderEndCallIcon = (): JSX.Element => <Icon iconName=\"ControlButtonEndCall\" />;\n\n/**\n * A button to end an ongoing call.\n *\n * Can be used with {@link ControlBar}.\n *\n * @public\n */\nexport const EndCallButton = (props: EndCallButtonProps): JSX.Element => {\n const { styles, /* @conditional-compile-remove(end-call-options) */ enableEndCallMenu, onHangUp } = props;\n\n const localeStrings = useLocale().strings.endCallButton;\n const strings = { ...localeStrings, ...props.strings };\n\n const theme = useTheme();\n const isDarkTheme = isDarkThemed(theme);\n const componentStyles = concatStyleSets(\n isDarkTheme ? darkThemeCallButtonStyles : lightThemeCallButtonStyles,\n styles ?? {}\n );\n\n /* @conditional-compile-remove(end-call-options) */\n const defaultMenuProps: IContextualMenuProps = {\n items: [\n {\n key: 'endForSelf',\n text: localeStrings.leaveOption,\n title: localeStrings.leaveOption,\n onClick: () => {\n onHangUp && onHangUp(false);\n }\n },\n {\n key: 'endForEveryone',\n text: localeStrings.endCallOption,\n title: localeStrings.endCallOption,\n onClick: () => {\n onHangUp && onHangUp(true);\n }\n }\n ],\n styles: props.styles,\n calloutProps: {\n styles: {\n root: {\n maxWidth: '95%'\n }\n },\n preventDismissOnEvent\n }\n };\n\n return (\n <>\n <ControlBarButton\n {...props}\n /* @conditional-compile-remove(end-call-options) */\n menuProps={enableEndCallMenu ? defaultMenuProps : undefined}\n onClick={onHangUp ? () => onHangUp() : props.onClick}\n styles={componentStyles}\n onRenderIcon={props.onRenderIcon ?? onRenderEndCallIcon}\n strings={strings}\n labelKey={props.labelKey ?? 'endCallButtonLabel'}\n />\n </>\n );\n};\n\nconst getButtonStyles = (\n theme: PartialTheme & CallingTheme\n): { regular: IStyle; pressed: IStyle; hovered: IStyle } => ({\n regular: {\n color: theme.callingPalette.iconWhite,\n background: theme.callingPalette.callRed,\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'auto',\n border: `1px ${theme.palette?.neutralQuaternaryAlt} solid`\n },\n ' i': {\n color: theme.callingPalette.iconWhite\n },\n ':focus::after': { outlineColor: `${theme.callingPalette.iconWhite} !important` } // added !important to avoid override by FluentUI button styles\n },\n pressed: {\n color: theme.callingPalette.iconWhite,\n background: theme.callingPalette.callRedDarker,\n border: 'none',\n ' i': {\n color: theme.callingPalette.iconWhite\n },\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'auto'\n }\n },\n hovered: {\n color: theme.callingPalette.iconWhite,\n background: theme.callingPalette.callRedDark,\n border: 'none',\n ' i': {\n color: theme.callingPalette.iconWhite\n },\n '@media (forced-colors: active)': {\n forcedColorAdjust: 'auto'\n }\n }\n});\n\nconst darkThemeButtonStyles = getButtonStyles(darkTheme);\nconst lightThemeButtonStyles = getButtonStyles(lightTheme);\n\n// using media query to prevent windows from overwriting the button color\nconst darkThemeCallButtonStyles = {\n root: darkThemeButtonStyles.regular,\n rootHovered: darkThemeButtonStyles.hovered,\n rootPressed: darkThemeButtonStyles.pressed,\n label: {\n color: darkTheme.callingPalette.iconWhite\n },\n splitButtonMenuButton: {\n ...(darkThemeButtonStyles.regular as object),\n borderTop: 'none',\n borderRight: 'none',\n borderBottom: 'none',\n '&:hover': darkThemeButtonStyles.hovered\n },\n splitButtonMenuButtonChecked: darkThemeButtonStyles.hovered,\n splitButtonMenuButtonExpanded: darkThemeButtonStyles.pressed\n};\n\nconst lightThemeCallButtonStyles = {\n root: lightThemeButtonStyles.regular,\n rootHovered: lightThemeButtonStyles.hovered,\n rootPressed: lightThemeButtonStyles.pressed,\n splitButtonMenuButton: {\n ...(lightThemeButtonStyles.regular as object),\n borderTop: 'none',\n borderRight: 'none',\n borderBottom: 'none',\n '&:hover': lightThemeButtonStyles.hovered\n },\n splitButtonMenuButtonChecked: lightThemeButtonStyles.hovered,\n splitButtonMenuButtonExpanded: lightThemeButtonStyles.pressed,\n splitButtonMenuFocused: lightThemeButtonStyles.pressed,\n label: {\n color: lightTheme.callingPalette.iconWhite\n }\n};\n"]}
@@ -4,7 +4,7 @@ import { BaseCustomStyles, ChatMessage, CustomMessage, SystemMessage, OnRenderAv
4
4
  import { BlockedMessage } from '../types';
5
5
  import { MessageStatusIndicatorProps } from './MessageStatusIndicator';
6
6
  import { MessageStatus } from "../../../acs-ui-common/src";
7
- import { AttachmentMetadata, FileDownloadHandler } from '../types/Attachment';
7
+ import { AttachmentMetadata, AttachmentOptions } from '../types/Attachment';
8
8
  import { MentionOptions } from './MentionPopover';
9
9
  import { InlineImageOptions } from './ChatMessage/ChatMessageContent';
10
10
  /**
@@ -96,13 +96,15 @@ export interface MessageThreadStrings {
96
96
  actionMenuMoreOptions?: string;
97
97
  /** Aria label to announce when a message is deleted */
98
98
  messageDeletedAnnouncementAriaLabel: string;
99
- /** String for download file button in attachment card */
99
+ /** String for download attachment button in attachment card */
100
100
  downloadAttachment: string;
101
+ /** String for open attachment button in attachment card */
102
+ openAttachment: string;
101
103
  /** String for policy violation message removal */
102
104
  blockedWarningText: string;
103
105
  /** String for policy violation message removal details link */
104
106
  blockedWarningLinkText: string;
105
- /** String for aria text in file attachment group*/
107
+ /** String for aria text in attachment card group*/
106
108
  attachmentCardGroupMessage: string;
107
109
  }
108
110
  /**
@@ -230,10 +232,10 @@ export type MessageThreadProps = {
230
232
  */
231
233
  onRenderMessage?: (messageProps: MessageProps, messageRenderer?: MessageRenderer) => JSX.Element;
232
234
  /**
233
- * Optional callback to render attached files in the message component.
235
+ * Optional callback to render attachments in the message component.
234
236
  * @beta
235
237
  */
236
- onRenderFileDownloads?: (userId: string, message: ChatMessage) => JSX.Element;
238
+ onRenderAttachmentDownloads?: (userId: string, message: ChatMessage) => JSX.Element;
237
239
  /**
238
240
  * Optional callback to edit a message.
239
241
  *
@@ -277,11 +279,10 @@ export type MessageThreadProps = {
277
279
  strings?: Partial<MessageThreadStrings>;
278
280
  /**
279
281
  * @beta
280
- * Optional function called when someone clicks on the file download icon.
281
- * If file attachments are defined in the `message.metadata` property using the `fileSharingMetadata` key,
282
- * this function will be called with the data inside `fileSharingMetadata` key.
282
+ * Optional attachment options, which defines behvaiour for uploading and downloading attachments.
283
+ * As this moment, the uploadOptions would be ignored and this option is intended for download only.
283
284
  */
284
- fileDownloadHandler?: FileDownloadHandler;
285
+ attachmentOptions?: AttachmentOptions;
285
286
  /**
286
287
  * Optional function to provide customized date format.
287
288
  * @beta
@@ -174,7 +174,9 @@ export const MessageThreadWrapper = (props) => {
174
174
  /* @conditional-compile-remove(mention) */
175
175
  mentionOptions, inlineImageOptions,
176
176
  /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
177
- onRenderFileDownloads } = props;
177
+ attachmentOptions,
178
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
179
+ onRenderAttachmentDownloads } = props;
178
180
  // We need this state to wait for one tick and scroll to bottom after messages have been initialized.
179
181
  // Otherwise chatScrollDivRef.current.clientHeight is wrong if we scroll to bottom before messages are initialized.
180
182
  const [chatMessagesInitialized, setChatMessagesInitialized] = useState(false);
@@ -508,15 +510,16 @@ export const MessageThreadWrapper = (props) => {
508
510
  className: mergeClasses(classes.root, mergeStyles(styles === null || styles === void 0 ? void 0 : styles.chatContainer)), ref: chatScrollDivRef, style: Object.assign({}, createStyleFromV8Style(styles === null || styles === void 0 ? void 0 : styles.chatContainer)) },
509
511
  latestDeletedMessageId && (React.createElement(Announcer, { key: latestDeletedMessageId, announcementString: deletedMessageAriaLabel, ariaLive: 'polite' })),
510
512
  messagesToDisplay.map((message) => {
513
+ var _a;
511
514
  return (React.createElement(MemoChatMessageComponentWrapper, Object.assign({}, message, { userId: userId, key: message.key, styles: styles, shouldOverlapAvatarAndMessage: isNarrow, strings: strings, onRenderAvatar: onRenderAvatar, onRenderMessage: onRenderMessage, onRenderMessageStatus: onRenderMessageStatus, defaultStatusRenderer: defaultStatusRenderer, onActionButtonClick: onActionButtonClickMemo, readCount: readCountForHoveredIndicator, participantCount: participantCount,
512
515
  /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
513
- fileDownloadHandler: props.fileDownloadHandler, inlineImageOptions: inlineImageOptions,
516
+ actionsForAttachment: (_a = attachmentOptions === null || attachmentOptions === void 0 ? void 0 : attachmentOptions.downloadOptions) === null || _a === void 0 ? void 0 : _a.actionsForAttachment, inlineImageOptions: inlineImageOptions,
514
517
  /* @conditional-compile-remove(date-time-customization) */
515
518
  onDisplayDateTimeString: onDisplayDateTimeString,
516
519
  /* @conditional-compile-remove(mention) */
517
520
  mentionOptions: mentionOptions,
518
521
  /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
519
- onRenderFileDownloads: onRenderFileDownloads })));
522
+ onRenderAttachmentDownloads: onRenderAttachmentDownloads })));
520
523
  }))))));
521
524
  };
522
525
  const MemoChatMessageComponentWrapper = React.memo((obj) => {
@@ -1 +1 @@
1
- {"version":3,"file":"MessageThread.js","sourceRoot":"","sources":["../../../../../../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,EAAU,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,YAAY,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poration.\n// Licensed under the MIT License.\n\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Icon, IStyle, mergeStyles, PrimaryButton } from '@fluentui/react';\nimport { Chat } from '@fluentui-contrib/react-chat';\nimport { mergeClasses } from '@fluentui/react-components';\nimport {\n DownIconStyle,\n newMessageButtonContainerStyle,\n messageThreadContainerStyle,\n messageThreadWrapperContainerStyle,\n useChatStyles,\n buttonWithIconStyles,\n newMessageButtonStyle\n} from './styles/MessageThread.styles';\nimport { delay } from './utils/delay';\nimport {\n BaseCustomStyles,\n ChatMessage,\n CustomMessage,\n SystemMessage,\n OnRenderAvatarCallback,\n Message,\n ReadReceiptsBySenderId,\n ComponentSlotStyle\n} from '../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../types';\nimport { MessageStatusIndicatorProps } from './MessageStatusIndicator';\nimport { memoizeFnAll, MessageStatus } from '@internal/acs-ui-common';\nimport { useLocale } from '../localization/LocalizationProvider';\nimport { isNarrowWidth, _useContainerWidth } from './utils/responsive';\nimport getParticipantsWhoHaveReadMessage from './utils/getParticipantsWhoHaveReadMessage';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { AttachmentMetadata, FileDownloadHandler } from '../types/Attachment';\nimport { useTheme } from '../theming';\nimport { FluentV9ThemeProvider } from './../theming/FluentV9ThemeProvider';\nimport LiveAnnouncer from './Announcer/LiveAnnouncer';\n/* @conditional-compile-remove(mention) */\nimport { MentionOptions } from './MentionPopover';\nimport { createStyleFromV8Style } from './styles/v8StyleShim';\nimport {\n ChatMessageComponentWrapper,\n ChatMessageComponentWrapperProps\n} from './ChatMessage/ChatMessageComponentWrapper';\nimport { InlineImageOptions } from './ChatMessage/ChatMessageContent';\nimport { MessageStatusIndicatorInternal } from './MessageStatusIndicatorInternal';\nimport { Announcer } from './Announcer';\n\nconst isMessageSame = (first: ChatMessage, second: ChatMessage): boolean => {\n return (\n first.messageId === second.messageId &&\n first.content === second.content &&\n first.contentType === second.contentType &&\n JSON.stringify(first.createdOn) === JSON.stringify(second.createdOn) &&\n first.senderId === second.senderId &&\n first.senderDisplayName === second.senderDisplayName &&\n JSON.stringify(first.editedOn) === JSON.stringify(second.editedOn)\n );\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 = (\n userId: string,\n latestMessageFromPreviousMessages?: ChatMessage,\n latestMessageFromNewMessages?: ChatMessage\n): boolean => {\n if (latestMessageFromNewMessages === undefined) {\n return false;\n }\n if (latestMessageFromPreviousMessages === undefined) {\n return latestMessageFromNewMessages.senderId !== userId;\n }\n return (\n !isMessageSame(latestMessageFromNewMessages, latestMessageFromPreviousMessages) &&\n latestMessageFromNewMessages.senderId !== userId\n );\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 = (\n userId: string,\n latestMessageFromPreviousMessages?: ChatMessage,\n latestMessageFromNewMessages?: ChatMessage\n): boolean => {\n if (latestMessageFromNewMessages === undefined) {\n return false;\n }\n if (latestMessageFromPreviousMessages === undefined) {\n return latestMessageFromNewMessages.senderId === userId;\n }\n return (\n !isMessageSame(latestMessageFromNewMessages, latestMessageFromPreviousMessages) &&\n latestMessageFromNewMessages.senderId === userId\n );\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 /** Aria label to announce when a message is deleted */\n messageDeletedAnnouncementAriaLabel: string;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n /** String for download file button in attachment card */\n downloadAttachment: 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(attachment-download) @conditional-compile-remove(attachment-upload) */\n /** String for aria text in file attachment group*/\n attachmentCardGroupMessage: 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}\n\nconst DefaultJumpToNewMessageButton = (props: JumpToNewMessageButtonProps): JSX.Element => {\n const { text, onClick } = props;\n return (\n <PrimaryButton\n className={newMessageButtonStyle}\n styles={buttonWithIconStyles}\n text={text}\n onClick={onClick}\n onRenderIcon={() => <Icon iconName=\"Down\" className={DownIconStyle} />}\n />\n );\n};\n\n/**\n * A component to render a single message.\n *\n * @public\n */\nexport type MessageRenderer = (props: MessageProps) => JSX.Element;\n\nconst memoizeAllMessages = memoizeFnAll(\n (\n message: Message,\n showMessageDate: boolean,\n showMessageStatus: boolean,\n strings: MessageThreadStrings,\n index: number,\n onUpdateMessage?: UpdateMessageCallback,\n onCancelEditMessage?: CancelEditCallback,\n onDeleteMessage?: (messageId: string) => Promise<void>,\n onSendMessage?: (content: string) => Promise<void>,\n disableEditing?: boolean,\n lastSeenChatMessage?: string,\n lastSendingChatMessage?: string,\n lastDeliveredChatMessage?: string\n ): _ChatMessageProps => {\n let key: string | undefined = message.messageId;\n let statusToRender: MessageStatus | undefined = undefined;\n\n if (\n message.messageType === 'chat' ||\n /* @conditional-compile-remove(data-loss-prevention) */ message.messageType === 'blocked'\n ) {\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 statusToRender = 'seen';\n break;\n }\n case lastSendingChatMessage: {\n statusToRender = 'sending';\n break;\n }\n case lastDeliveredChatMessage: {\n statusToRender = 'delivered';\n break;\n }\n }\n }\n if (message.mine && message.status === 'failed') {\n statusToRender = 'failed';\n }\n }\n return {\n key: key ?? 'id_' + index,\n statusToRender,\n message,\n strings,\n showDate: showMessageDate,\n onUpdateMessage,\n onCancelEditMessage,\n onDeleteMessage,\n onSendMessage,\n disableEditing,\n showMessageStatus\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\nconst getLastChatMessageForCurrentUser = (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.mine) {\n return message;\n }\n }\n return undefined;\n};\n\n/**\n * @public\n * Callback function run when a message is updated.\n */\nexport type UpdateMessageCallback = (\n messageId: string,\n content: string,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n options?: {\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n metadata?: Record<string, string>;\n attachmentMetadata?: AttachmentMetadata[];\n }\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: (\n | ChatMessage\n | SystemMessage\n | CustomMessage\n | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage\n )[];\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 0 */\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(attachment-download) @conditional-compile-remove(attachment-upload) */\n /**\n * Optional callback to render attached files in the message component.\n * @beta\n */\n onRenderFileDownloads?: (userId: string, message: ChatMessage) => JSX.Element;\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(attachment-download) @conditional-compile-remove(attachment-upload) */\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 * Optional callback called when an inline image is clicked.\n * @beta\n */\n inlineImageOptions?: InlineImageOptions;\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 * @internal\n */\nexport type _ChatMessageProps = MessageProps & {\n key: string;\n statusToRender: MessageStatus | undefined;\n showMessageStatus?: boolean;\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` component from `@fluentui-contrib/chat`. You can checkout the details about these components [here](https://microsoft.github.io/fluentui-contrib/react-chat/).\n *\n * @public\n */\nexport const MessageThread = (props: MessageThreadProps): JSX.Element => {\n const theme = useTheme();\n\n const chatBody = useMemo(() => {\n return (\n <FluentV9ThemeProvider v8Theme={theme}>\n {/* Wrapper is required to call \"useClasses\" hook with proper context values */}\n <MessageThreadWrapper {...props} />\n </FluentV9ThemeProvider>\n );\n }, [theme, props]);\n\n return <div className={mergeStyles(messageThreadContainerStyle, props.styles?.root)}>{chatBody}</div>;\n};\n\n/**\n * @private\n */\nexport const MessageThreadWrapper = (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(mention) */\n mentionOptions,\n inlineImageOptions,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n onRenderFileDownloads\n } = props;\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\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 const localeStrings = useLocale().strings.messageThread;\n const strings = useMemo(() => ({ ...localeStrings, ...props.strings }), [localeStrings, props.strings]);\n // it is required to use useState for messages\n // as the scrolling logic requires re - render at a specific point in time\n const [messages, setMessages] = useState<Message[]>([]);\n\n // id for the latest deleted message\n const [latestDeletedMessageId, setLatestDeletedMessageId] = useState<string | undefined>(undefined);\n // this value is used to check if a message is deleted for the previous value of messages array\n const previousMessagesRef = useRef<Message[]>([]);\n // an aria label for Narrator to notify when a message is deleted\n const [deletedMessageAriaLabel, setDeletedMessageAriaLabel] = useState<string | undefined>(undefined);\n\n const onDeleteMessageCallback = useCallback(\n async (messageId: string): Promise<void> => {\n if (!onDeleteMessage) {\n return;\n }\n try {\n // reset deleted message label in case if there was a value already (messages are deleted 1 after another)\n setDeletedMessageAriaLabel(undefined);\n setLatestDeletedMessageId(messageId);\n lastChatMessageStatus.current = 'deleted';\n // we should set up latestDeletedMessageId before the onDeleteMessage call\n // as otherwise in very rare cases the messages array can be updated before latestDeletedMessageId\n await onDeleteMessage(messageId);\n } catch (e) {\n console.log('onDeleteMessage failed: messageId', messageId, 'error', e);\n }\n },\n [onDeleteMessage]\n );\n\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 const previousTopRef = useRef<number>(-1);\n const previousHeightRef = useRef<number>(-1);\n\n const messageIdSeenByMeRef = useRef<string>('');\n\n const chatScrollDivRef = useRef<HTMLDivElement>(null);\n const isLoadingChatMessagesRef = useRef(false);\n\n useEffect(() => {\n if (latestDeletedMessageId === undefined) {\n setDeletedMessageAriaLabel(undefined);\n } else {\n if (!previousMessagesRef.current.find((message) => message.messageId === latestDeletedMessageId)) {\n // the message is deleted in previousMessagesRef\n // no need to update deletedMessageAriaLabel\n setDeletedMessageAriaLabel(undefined);\n } else if (!messages.find((message) => message.messageId === latestDeletedMessageId)) {\n // the message is deleted in messages array but still exists in previousMessagesRef\n // update deletedMessageAriaLabel\n setDeletedMessageAriaLabel(strings.messageDeletedAnnouncementAriaLabel);\n } else {\n // the message exists in both arrays\n // no need to update deletedMessageAriaLabel\n setDeletedMessageAriaLabel(undefined);\n }\n }\n previousMessagesRef.current = messages;\n }, [latestDeletedMessageId, messages, strings.messageDeletedAnnouncementAriaLabel]);\n\n const messagesRef = useRef(messages);\n const setMessagesRef = (messagesWithAttachedValue: Message[]): void => {\n messagesRef.current = messagesWithAttachedValue;\n setMessages(messagesWithAttachedValue);\n };\n\n const isAtBottomOfScrollRef = useRef(isAtBottomOfScroll);\n const setIsAtBottomOfScrollRef = (isAtBottomOfScrollValue: boolean): void => {\n isAtBottomOfScrollRef.current = isAtBottomOfScrollValue;\n setIsAtBottomOfScroll(isAtBottomOfScrollValue);\n };\n\n const chatMessagesInitializedRef = useRef(chatMessagesInitialized);\n const setChatMessagesInitializedRef = (chatMessagesInitialized: boolean): void => {\n chatMessagesInitializedRef.current = chatMessagesInitialized;\n setChatMessagesInitialized(chatMessagesInitialized);\n };\n\n const chatThreadRef = useRef<HTMLDivElement>(null);\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\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\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 (\n !isAtBottomOfScrollRef.current ||\n !document.hasFocus() ||\n !messagesRef.current ||\n messagesRef.current.length === 0 ||\n !showMessageStatus\n ) {\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 (\n onMessageSeen &&\n lastMessage &&\n lastMessage.messageId &&\n lastMessage.messageId !== messageIdSeenByMeRef.current\n ) {\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\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\n const handleScrollToTheBottom = useCallback((): void => {\n if (!chatScrollDivRef.current) {\n return;\n }\n\n const atBottom =\n Math.ceil(chatScrollDivRef.current.scrollTop) >=\n 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 (\n !isAllChatMessagesLoadedRef.current &&\n chatScrollDivRef.current &&\n chatScrollDivRef.current.scrollTop <= 500\n ) {\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\n useEffect(() => {\n if (!chatScrollDivRef.current) {\n return;\n }\n chatScrollDivRef.current.scrollTop =\n 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\n useEffect(() => {\n const chatScrollDiv = chatScrollDivRef.current;\n chatScrollDiv?.addEventListener('scroll', handleScrollToTheBottom);\n chatScrollDiv?.addEventListener('scroll', fetchNewMessageWhenAtTop);\n\n return () => {\n chatScrollDiv?.removeEventListener('scroll', handleScrollToTheBottom);\n chatScrollDiv?.removeEventListener('scroll', fetchNewMessageWhenAtTop);\n };\n }, [fetchNewMessageWhenAtTop, handleScrollToTheBottom]);\n\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 useEffect(() => {\n const newStatus = getLastChatMessageForCurrentUser(newMessages)?.status;\n if (newStatus !== undefined) {\n if (lastChatMessageStatus.current === 'deleted' && newStatus === 'sending') {\n // enforce message life cycle\n // message status should always be [ sending -> delivered -> seen (optional) -> deleted ] or [sending -> failed -> deleted]\n // not any other way around\n // therefore, if current message status is deleted, we should only update it if newStatus is sending\n lastChatMessageStatus.current = newStatus;\n } else if (lastChatMessageStatus.current !== 'deleted') {\n lastChatMessageStatus.current = newStatus;\n }\n }\n // The hook should depend on newMessages not on messages as otherwise it will skip the sending status for a first message\n }, [newMessages]);\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 (\n isThereNewMessageNotFromCurrentUser(userId, latestPreviousChatMessage, latestCurrentChatMessage) &&\n !isAtBottomOfScrollRef.current\n ) {\n setExistsNewChatMessage(true);\n } else if (\n didUserSendTheLatestMessage(userId, latestPreviousChatMessage, latestCurrentChatMessage) ||\n isAtBottomOfScrollRef.current\n ) {\n scrollToBottom();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [messages]);\n\n const lastChatMessageStatus = useRef<string | undefined>(undefined);\n const participantCountRef = useRef(participantCount);\n const readReceiptsBySenderIdRef = useRef(readReceiptsBySenderId);\n\n participantCountRef.current = participantCount;\n readReceiptsBySenderIdRef.current = readReceiptsBySenderId;\n\n const onActionButtonClickMemo = useCallback(\n (message: ChatMessage, setMessageReadBy: (readBy: { id: string; displayName: string }[]) => void) => {\n if (participantCountRef.current && participantCountRef.current - 1 > 1 && readReceiptsBySenderIdRef.current) {\n setMessageReadBy(getParticipantsWhoHaveReadMessage(message, readReceiptsBySenderIdRef.current));\n }\n },\n []\n );\n\n const defaultStatusRenderer = useCallback(\n (\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage,\n participantCount: number,\n readCount: number,\n status?: MessageStatus\n ) => {\n // we should only announce label if the message status isn't deleted\n // because after message is deleted, we now need to render statusIndicator for previous messages\n // and their status has been announced already and we should not announce them again\n const shouldAnnounce = lastChatMessageStatus.current !== 'deleted';\n\n const onToggleToolTip = (isToggled: boolean): void => {\n if (isToggled && readReceiptsBySenderIdRef.current) {\n setReadCountForHoveredIndicator(\n getParticipantsWhoHaveReadMessage(message, readReceiptsBySenderIdRef.current).length\n );\n } else {\n setReadCountForHoveredIndicator(undefined);\n }\n };\n return (\n <MessageStatusIndicatorInternal\n status={status}\n readCount={readCount}\n onToggleToolTip={onToggleToolTip}\n // -1 because participant count does not include myself\n remoteParticipantsCount={participantCount ? participantCount - 1 : 0}\n shouldAnnounce={shouldAnnounce}\n />\n );\n },\n []\n );\n\n const theme = useTheme();\n\n const messagesToDisplay = useMemo(() => {\n return memoizeAllMessages((memoizedMessageFn) => {\n return messages.map((message: Message, index: number): _ChatMessageProps => {\n return memoizedMessageFn(\n message,\n showMessageDate,\n showMessageStatus,\n strings,\n index,\n onUpdateMessage,\n onCancelEditMessage,\n onDeleteMessageCallback,\n onSendMessage,\n props.disableEditing,\n lastDeliveredChatMessage,\n lastSeenChatMessage,\n lastSendingChatMessage\n );\n });\n });\n }, [\n lastDeliveredChatMessage,\n lastSeenChatMessage,\n lastSendingChatMessage,\n messages,\n onCancelEditMessage,\n onDeleteMessageCallback,\n onSendMessage,\n onUpdateMessage,\n props.disableEditing,\n showMessageDate,\n showMessageStatus,\n strings\n ]);\n\n const classes = useChatStyles();\n\n return (\n <div className={mergeStyles(messageThreadWrapperContainerStyle)} ref={chatThreadRef}>\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 && (\n <div className={mergeStyles(newMessageButtonContainerStyle, styles?.newMessageButtonContainer)}>\n {onRenderJumpToNewMessageButton ? (\n onRenderJumpToNewMessageButton({ text: strings.newMessagesIndicator, onClick: scrollToBottom })\n ) : (\n <DefaultJumpToNewMessageButton text={strings.newMessagesIndicator} onClick={scrollToBottom} />\n )}\n </div>\n )}\n <LiveAnnouncer>\n <FluentV9ThemeProvider v8Theme={theme}>\n <Chat\n // styles?.chatContainer used in className and style prop as style prop can't handle CSS selectors\n className={mergeClasses(classes.root, mergeStyles(styles?.chatContainer))}\n ref={chatScrollDivRef}\n style={{ ...createStyleFromV8Style(styles?.chatContainer) }}\n >\n {latestDeletedMessageId && (\n <Announcer\n key={latestDeletedMessageId}\n announcementString={deletedMessageAriaLabel}\n ariaLive={'polite'}\n />\n )}\n {messagesToDisplay.map((message: _ChatMessageProps): JSX.Element => {\n return (\n <MemoChatMessageComponentWrapper\n {...message}\n userId={userId}\n key={message.key}\n styles={styles}\n shouldOverlapAvatarAndMessage={isNarrow}\n strings={strings}\n onRenderAvatar={onRenderAvatar}\n onRenderMessage={onRenderMessage}\n onRenderMessageStatus={onRenderMessageStatus}\n defaultStatusRenderer={defaultStatusRenderer}\n onActionButtonClick={onActionButtonClickMemo}\n readCount={readCountForHoveredIndicator}\n participantCount={participantCount}\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n fileDownloadHandler={props.fileDownloadHandler}\n inlineImageOptions={inlineImageOptions}\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString={onDisplayDateTimeString}\n /* @conditional-compile-remove(mention) */\n mentionOptions={mentionOptions}\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n onRenderFileDownloads={onRenderFileDownloads}\n />\n );\n })}\n </Chat>\n </FluentV9ThemeProvider>\n </LiveAnnouncer>\n </div>\n );\n};\n\nconst MemoChatMessageComponentWrapper = React.memo((obj: ChatMessageComponentWrapperProps): JSX.Element => {\n return <ChatMessageComponentWrapper {...obj} />;\n});\n"]}
1
+ {"version":3,"file":"MessageThread.js","sourceRoot":"","sources":["../../../../../../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,EAAU,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAC3E,OAAO,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EACL,aAAa,EACb,8BAA8B,EAC9B,2BAA2B,EAC3B,k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\n// Licensed under the MIT License.\n\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport { Icon, IStyle, mergeStyles, PrimaryButton } from '@fluentui/react';\nimport { Chat } from '@fluentui-contrib/react-chat';\nimport { mergeClasses } from '@fluentui/react-components';\nimport {\n DownIconStyle,\n newMessageButtonContainerStyle,\n messageThreadContainerStyle,\n messageThreadWrapperContainerStyle,\n useChatStyles,\n buttonWithIconStyles,\n newMessageButtonStyle\n} from './styles/MessageThread.styles';\nimport { delay } from './utils/delay';\nimport {\n BaseCustomStyles,\n ChatMessage,\n CustomMessage,\n SystemMessage,\n OnRenderAvatarCallback,\n Message,\n ReadReceiptsBySenderId,\n ComponentSlotStyle\n} from '../types';\n/* @conditional-compile-remove(data-loss-prevention) */\nimport { BlockedMessage } from '../types';\nimport { MessageStatusIndicatorProps } from './MessageStatusIndicator';\nimport { memoizeFnAll, MessageStatus } from '@internal/acs-ui-common';\nimport { useLocale } from '../localization/LocalizationProvider';\nimport { isNarrowWidth, _useContainerWidth } from './utils/responsive';\nimport getParticipantsWhoHaveReadMessage from './utils/getParticipantsWhoHaveReadMessage';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { AttachmentMetadata, AttachmentOptions } from '../types/Attachment';\nimport { useTheme } from '../theming';\nimport { FluentV9ThemeProvider } from './../theming/FluentV9ThemeProvider';\nimport LiveAnnouncer from './Announcer/LiveAnnouncer';\n/* @conditional-compile-remove(mention) */\nimport { MentionOptions } from './MentionPopover';\nimport { createStyleFromV8Style } from './styles/v8StyleShim';\nimport {\n ChatMessageComponentWrapper,\n ChatMessageComponentWrapperProps\n} from './ChatMessage/ChatMessageComponentWrapper';\nimport { InlineImageOptions } from './ChatMessage/ChatMessageContent';\nimport { MessageStatusIndicatorInternal } from './MessageStatusIndicatorInternal';\nimport { Announcer } from './Announcer';\n\nconst isMessageSame = (first: ChatMessage, second: ChatMessage): boolean => {\n return (\n first.messageId === second.messageId &&\n first.content === second.content &&\n first.contentType === second.contentType &&\n JSON.stringify(first.createdOn) === JSON.stringify(second.createdOn) &&\n first.senderId === second.senderId &&\n first.senderDisplayName === second.senderDisplayName &&\n JSON.stringify(first.editedOn) === JSON.stringify(second.editedOn)\n );\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 = (\n userId: string,\n latestMessageFromPreviousMessages?: ChatMessage,\n latestMessageFromNewMessages?: ChatMessage\n): boolean => {\n if (latestMessageFromNewMessages === undefined) {\n return false;\n }\n if (latestMessageFromPreviousMessages === undefined) {\n return latestMessageFromNewMessages.senderId !== userId;\n }\n return (\n !isMessageSame(latestMessageFromNewMessages, latestMessageFromPreviousMessages) &&\n latestMessageFromNewMessages.senderId !== userId\n );\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 = (\n userId: string,\n latestMessageFromPreviousMessages?: ChatMessage,\n latestMessageFromNewMessages?: ChatMessage\n): boolean => {\n if (latestMessageFromNewMessages === undefined) {\n return false;\n }\n if (latestMessageFromPreviousMessages === undefined) {\n return latestMessageFromNewMessages.senderId === userId;\n }\n return (\n !isMessageSame(latestMessageFromNewMessages, latestMessageFromPreviousMessages) &&\n latestMessageFromNewMessages.senderId === userId\n );\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 /** Aria label to announce when a message is deleted */\n messageDeletedAnnouncementAriaLabel: string;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n /** String for download attachment button in attachment card */\n downloadAttachment: string;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n /** String for open attachment button in attachment card */\n openAttachment: 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(attachment-download) @conditional-compile-remove(attachment-upload) */\n /** String for aria text in attachment card group*/\n attachmentCardGroupMessage: 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}\n\nconst DefaultJumpToNewMessageButton = (props: JumpToNewMessageButtonProps): JSX.Element => {\n const { text, onClick } = props;\n return (\n <PrimaryButton\n className={newMessageButtonStyle}\n styles={buttonWithIconStyles}\n text={text}\n onClick={onClick}\n onRenderIcon={() => <Icon iconName=\"Down\" className={DownIconStyle} />}\n />\n );\n};\n\n/**\n * A component to render a single message.\n *\n * @public\n */\nexport type MessageRenderer = (props: MessageProps) => JSX.Element;\n\nconst memoizeAllMessages = memoizeFnAll(\n (\n message: Message,\n showMessageDate: boolean,\n showMessageStatus: boolean,\n strings: MessageThreadStrings,\n index: number,\n onUpdateMessage?: UpdateMessageCallback,\n onCancelEditMessage?: CancelEditCallback,\n onDeleteMessage?: (messageId: string) => Promise<void>,\n onSendMessage?: (content: string) => Promise<void>,\n disableEditing?: boolean,\n lastSeenChatMessage?: string,\n lastSendingChatMessage?: string,\n lastDeliveredChatMessage?: string\n ): _ChatMessageProps => {\n let key: string | undefined = message.messageId;\n let statusToRender: MessageStatus | undefined = undefined;\n\n if (\n message.messageType === 'chat' ||\n /* @conditional-compile-remove(data-loss-prevention) */ message.messageType === 'blocked'\n ) {\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 statusToRender = 'seen';\n break;\n }\n case lastSendingChatMessage: {\n statusToRender = 'sending';\n break;\n }\n case lastDeliveredChatMessage: {\n statusToRender = 'delivered';\n break;\n }\n }\n }\n if (message.mine && message.status === 'failed') {\n statusToRender = 'failed';\n }\n }\n return {\n key: key ?? 'id_' + index,\n statusToRender,\n message,\n strings,\n showDate: showMessageDate,\n onUpdateMessage,\n onCancelEditMessage,\n onDeleteMessage,\n onSendMessage,\n disableEditing,\n showMessageStatus\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\nconst getLastChatMessageForCurrentUser = (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.mine) {\n return message;\n }\n }\n return undefined;\n};\n\n/**\n * @public\n * Callback function run when a message is updated.\n */\nexport type UpdateMessageCallback = (\n messageId: string,\n content: string,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n options?: {\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n metadata?: Record<string, string>;\n attachmentMetadata?: AttachmentMetadata[];\n }\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: (\n | ChatMessage\n | SystemMessage\n | CustomMessage\n | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage\n )[];\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 0 */\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(attachment-download) @conditional-compile-remove(attachment-upload) */\n /**\n * Optional callback to render attachments in the message component.\n * @beta\n */\n onRenderAttachmentDownloads?: (userId: string, message: ChatMessage) => JSX.Element;\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(attachment-download) @conditional-compile-remove(attachment-upload) */\n /**\n * @beta\n * Optional attachment options, which defines behvaiour for uploading and downloading attachments.\n * As this moment, the uploadOptions would be ignored and this option is intended for download only.\n */\n attachmentOptions?: AttachmentOptions;\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 * Optional callback called when an inline image is clicked.\n * @beta\n */\n inlineImageOptions?: InlineImageOptions;\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 * @internal\n */\nexport type _ChatMessageProps = MessageProps & {\n key: string;\n statusToRender: MessageStatus | undefined;\n showMessageStatus?: boolean;\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` component from `@fluentui-contrib/chat`. You can checkout the details about these components [here](https://microsoft.github.io/fluentui-contrib/react-chat/).\n *\n * @public\n */\nexport const MessageThread = (props: MessageThreadProps): JSX.Element => {\n const theme = useTheme();\n\n const chatBody = useMemo(() => {\n return (\n <FluentV9ThemeProvider v8Theme={theme}>\n {/* Wrapper is required to call \"useClasses\" hook with proper context values */}\n <MessageThreadWrapper {...props} />\n </FluentV9ThemeProvider>\n );\n }, [theme, props]);\n\n return <div className={mergeStyles(messageThreadContainerStyle, props.styles?.root)}>{chatBody}</div>;\n};\n\n/**\n * @private\n */\nexport const MessageThreadWrapper = (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(mention) */\n mentionOptions,\n inlineImageOptions,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n attachmentOptions,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n onRenderAttachmentDownloads\n } = props;\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\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 const localeStrings = useLocale().strings.messageThread;\n const strings = useMemo(() => ({ ...localeStrings, ...props.strings }), [localeStrings, props.strings]);\n // it is required to use useState for messages\n // as the scrolling logic requires re - render at a specific point in time\n const [messages, setMessages] = useState<Message[]>([]);\n\n // id for the latest deleted message\n const [latestDeletedMessageId, setLatestDeletedMessageId] = useState<string | undefined>(undefined);\n // this value is used to check if a message is deleted for the previous value of messages array\n const previousMessagesRef = useRef<Message[]>([]);\n // an aria label for Narrator to notify when a message is deleted\n const [deletedMessageAriaLabel, setDeletedMessageAriaLabel] = useState<string | undefined>(undefined);\n\n const onDeleteMessageCallback = useCallback(\n async (messageId: string): Promise<void> => {\n if (!onDeleteMessage) {\n return;\n }\n try {\n // reset deleted message label in case if there was a value already (messages are deleted 1 after another)\n setDeletedMessageAriaLabel(undefined);\n setLatestDeletedMessageId(messageId);\n lastChatMessageStatus.current = 'deleted';\n // we should set up latestDeletedMessageId before the onDeleteMessage call\n // as otherwise in very rare cases the messages array can be updated before latestDeletedMessageId\n await onDeleteMessage(messageId);\n } catch (e) {\n console.log('onDeleteMessage failed: messageId', messageId, 'error', e);\n }\n },\n [onDeleteMessage]\n );\n\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 const previousTopRef = useRef<number>(-1);\n const previousHeightRef = useRef<number>(-1);\n\n const messageIdSeenByMeRef = useRef<string>('');\n\n const chatScrollDivRef = useRef<HTMLDivElement>(null);\n const isLoadingChatMessagesRef = useRef(false);\n\n useEffect(() => {\n if (latestDeletedMessageId === undefined) {\n setDeletedMessageAriaLabel(undefined);\n } else {\n if (!previousMessagesRef.current.find((message) => message.messageId === latestDeletedMessageId)) {\n // the message is deleted in previousMessagesRef\n // no need to update deletedMessageAriaLabel\n setDeletedMessageAriaLabel(undefined);\n } else if (!messages.find((message) => message.messageId === latestDeletedMessageId)) {\n // the message is deleted in messages array but still exists in previousMessagesRef\n // update deletedMessageAriaLabel\n setDeletedMessageAriaLabel(strings.messageDeletedAnnouncementAriaLabel);\n } else {\n // the message exists in both arrays\n // no need to update deletedMessageAriaLabel\n setDeletedMessageAriaLabel(undefined);\n }\n }\n previousMessagesRef.current = messages;\n }, [latestDeletedMessageId, messages, strings.messageDeletedAnnouncementAriaLabel]);\n\n const messagesRef = useRef(messages);\n const setMessagesRef = (messagesWithAttachedValue: Message[]): void => {\n messagesRef.current = messagesWithAttachedValue;\n setMessages(messagesWithAttachedValue);\n };\n\n const isAtBottomOfScrollRef = useRef(isAtBottomOfScroll);\n const setIsAtBottomOfScrollRef = (isAtBottomOfScrollValue: boolean): void => {\n isAtBottomOfScrollRef.current = isAtBottomOfScrollValue;\n setIsAtBottomOfScroll(isAtBottomOfScrollValue);\n };\n\n const chatMessagesInitializedRef = useRef(chatMessagesInitialized);\n const setChatMessagesInitializedRef = (chatMessagesInitialized: boolean): void => {\n chatMessagesInitializedRef.current = chatMessagesInitialized;\n setChatMessagesInitialized(chatMessagesInitialized);\n };\n\n const chatThreadRef = useRef<HTMLDivElement>(null);\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\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\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 (\n !isAtBottomOfScrollRef.current ||\n !document.hasFocus() ||\n !messagesRef.current ||\n messagesRef.current.length === 0 ||\n !showMessageStatus\n ) {\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 (\n onMessageSeen &&\n lastMessage &&\n lastMessage.messageId &&\n lastMessage.messageId !== messageIdSeenByMeRef.current\n ) {\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\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\n const handleScrollToTheBottom = useCallback((): void => {\n if (!chatScrollDivRef.current) {\n return;\n }\n\n const atBottom =\n Math.ceil(chatScrollDivRef.current.scrollTop) >=\n 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 (\n !isAllChatMessagesLoadedRef.current &&\n chatScrollDivRef.current &&\n chatScrollDivRef.current.scrollTop <= 500\n ) {\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\n useEffect(() => {\n if (!chatScrollDivRef.current) {\n return;\n }\n chatScrollDivRef.current.scrollTop =\n 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\n useEffect(() => {\n const chatScrollDiv = chatScrollDivRef.current;\n chatScrollDiv?.addEventListener('scroll', handleScrollToTheBottom);\n chatScrollDiv?.addEventListener('scroll', fetchNewMessageWhenAtTop);\n\n return () => {\n chatScrollDiv?.removeEventListener('scroll', handleScrollToTheBottom);\n chatScrollDiv?.removeEventListener('scroll', fetchNewMessageWhenAtTop);\n };\n }, [fetchNewMessageWhenAtTop, handleScrollToTheBottom]);\n\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 useEffect(() => {\n const newStatus = getLastChatMessageForCurrentUser(newMessages)?.status;\n if (newStatus !== undefined) {\n if (lastChatMessageStatus.current === 'deleted' && newStatus === 'sending') {\n // enforce message life cycle\n // message status should always be [ sending -> delivered -> seen (optional) -> deleted ] or [sending -> failed -> deleted]\n // not any other way around\n // therefore, if current message status is deleted, we should only update it if newStatus is sending\n lastChatMessageStatus.current = newStatus;\n } else if (lastChatMessageStatus.current !== 'deleted') {\n lastChatMessageStatus.current = newStatus;\n }\n }\n // The hook should depend on newMessages not on messages as otherwise it will skip the sending status for a first message\n }, [newMessages]);\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 (\n isThereNewMessageNotFromCurrentUser(userId, latestPreviousChatMessage, latestCurrentChatMessage) &&\n !isAtBottomOfScrollRef.current\n ) {\n setExistsNewChatMessage(true);\n } else if (\n didUserSendTheLatestMessage(userId, latestPreviousChatMessage, latestCurrentChatMessage) ||\n isAtBottomOfScrollRef.current\n ) {\n scrollToBottom();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [messages]);\n\n const lastChatMessageStatus = useRef<string | undefined>(undefined);\n const participantCountRef = useRef(participantCount);\n const readReceiptsBySenderIdRef = useRef(readReceiptsBySenderId);\n\n participantCountRef.current = participantCount;\n readReceiptsBySenderIdRef.current = readReceiptsBySenderId;\n\n const onActionButtonClickMemo = useCallback(\n (message: ChatMessage, setMessageReadBy: (readBy: { id: string; displayName: string }[]) => void) => {\n if (participantCountRef.current && participantCountRef.current - 1 > 1 && readReceiptsBySenderIdRef.current) {\n setMessageReadBy(getParticipantsWhoHaveReadMessage(message, readReceiptsBySenderIdRef.current));\n }\n },\n []\n );\n\n const defaultStatusRenderer = useCallback(\n (\n message: ChatMessage | /* @conditional-compile-remove(data-loss-prevention) */ BlockedMessage,\n participantCount: number,\n readCount: number,\n status?: MessageStatus\n ) => {\n // we should only announce label if the message status isn't deleted\n // because after message is deleted, we now need to render statusIndicator for previous messages\n // and their status has been announced already and we should not announce them again\n const shouldAnnounce = lastChatMessageStatus.current !== 'deleted';\n\n const onToggleToolTip = (isToggled: boolean): void => {\n if (isToggled && readReceiptsBySenderIdRef.current) {\n setReadCountForHoveredIndicator(\n getParticipantsWhoHaveReadMessage(message, readReceiptsBySenderIdRef.current).length\n );\n } else {\n setReadCountForHoveredIndicator(undefined);\n }\n };\n return (\n <MessageStatusIndicatorInternal\n status={status}\n readCount={readCount}\n onToggleToolTip={onToggleToolTip}\n // -1 because participant count does not include myself\n remoteParticipantsCount={participantCount ? participantCount - 1 : 0}\n shouldAnnounce={shouldAnnounce}\n />\n );\n },\n []\n );\n\n const theme = useTheme();\n\n const messagesToDisplay = useMemo(() => {\n return memoizeAllMessages((memoizedMessageFn) => {\n return messages.map((message: Message, index: number): _ChatMessageProps => {\n return memoizedMessageFn(\n message,\n showMessageDate,\n showMessageStatus,\n strings,\n index,\n onUpdateMessage,\n onCancelEditMessage,\n onDeleteMessageCallback,\n onSendMessage,\n props.disableEditing,\n lastDeliveredChatMessage,\n lastSeenChatMessage,\n lastSendingChatMessage\n );\n });\n });\n }, [\n lastDeliveredChatMessage,\n lastSeenChatMessage,\n lastSendingChatMessage,\n messages,\n onCancelEditMessage,\n onDeleteMessageCallback,\n onSendMessage,\n onUpdateMessage,\n props.disableEditing,\n showMessageDate,\n showMessageStatus,\n strings\n ]);\n\n const classes = useChatStyles();\n\n return (\n <div className={mergeStyles(messageThreadWrapperContainerStyle)} ref={chatThreadRef}>\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 && (\n <div className={mergeStyles(newMessageButtonContainerStyle, styles?.newMessageButtonContainer)}>\n {onRenderJumpToNewMessageButton ? (\n onRenderJumpToNewMessageButton({ text: strings.newMessagesIndicator, onClick: scrollToBottom })\n ) : (\n <DefaultJumpToNewMessageButton text={strings.newMessagesIndicator} onClick={scrollToBottom} />\n )}\n </div>\n )}\n <LiveAnnouncer>\n <FluentV9ThemeProvider v8Theme={theme}>\n <Chat\n // styles?.chatContainer used in className and style prop as style prop can't handle CSS selectors\n className={mergeClasses(classes.root, mergeStyles(styles?.chatContainer))}\n ref={chatScrollDivRef}\n style={{ ...createStyleFromV8Style(styles?.chatContainer) }}\n >\n {latestDeletedMessageId && (\n <Announcer\n key={latestDeletedMessageId}\n announcementString={deletedMessageAriaLabel}\n ariaLive={'polite'}\n />\n )}\n {messagesToDisplay.map((message: _ChatMessageProps): JSX.Element => {\n return (\n <MemoChatMessageComponentWrapper\n {...message}\n userId={userId}\n key={message.key}\n styles={styles}\n shouldOverlapAvatarAndMessage={isNarrow}\n strings={strings}\n onRenderAvatar={onRenderAvatar}\n onRenderMessage={onRenderMessage}\n onRenderMessageStatus={onRenderMessageStatus}\n defaultStatusRenderer={defaultStatusRenderer}\n onActionButtonClick={onActionButtonClickMemo}\n readCount={readCountForHoveredIndicator}\n participantCount={participantCount}\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n actionsForAttachment={attachmentOptions?.downloadOptions?.actionsForAttachment}\n inlineImageOptions={inlineImageOptions}\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString={onDisplayDateTimeString}\n /* @conditional-compile-remove(mention) */\n mentionOptions={mentionOptions}\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n onRenderAttachmentDownloads={onRenderAttachmentDownloads}\n />\n );\n })}\n </Chat>\n </FluentV9ThemeProvider>\n </LiveAnnouncer>\n </div>\n );\n};\n\nconst MemoChatMessageComponentWrapper = React.memo((obj: ChatMessageComponentWrapperProps): JSX.Element => {\n return <ChatMessageComponentWrapper {...obj} />;\n});\n"]}
@@ -38,10 +38,10 @@ export interface ReactionButtonStrings {
38
38
  likeReactionTooltipContent?: string;
39
39
  /** Tooltip content of heart reaction button. */
40
40
  heartReactionTooltipContent?: string;
41
- /** Tooltip content of laugh reaction button. */
42
- laughReactionTooltipContent?: string;
43
41
  /** Tooltip content of clap reaction button. */
44
42
  applauseReactionTooltipContent?: string;
43
+ /** Tooltip content of laugh reaction button. */
44
+ laughReactionTooltipContent?: string;
45
45
  /** Tooltip content of surprised reaction button. */
46
46
  surprisedReactionTooltipContent?: string;
47
47
  }
@@ -15,6 +15,8 @@ import { emojiStyles, reactionEmojiMenuStyles, reactionToolTipHostStyle } from '
15
15
  /* @conditional-compile-remove(reaction) */
16
16
  import { isDarkThemed } from '../theming/themeUtils';
17
17
  /* @conditional-compile-remove(reaction) */
18
+ import { getEmojiFrameCount } from './VideoGallery/utils/videoGalleryLayoutUtils';
19
+ /* @conditional-compile-remove(reaction) */
18
20
  /**
19
21
  * A button to send reactions.
20
22
  *
@@ -30,19 +32,19 @@ export const ReactionButton = (props) => {
30
32
  const styles = reactionButtonStyles(theme);
31
33
  const onRenderIcon = () => (React.createElement(_HighContrastAwareIcon, { disabled: props.disabled, iconName: "ReactionButtonIcon" }));
32
34
  const [isHoveredMap, setIsHoveredMap] = useState(new Map());
33
- const emojis = ['like', 'heart', 'laugh', 'applause', 'surprised'];
35
+ const emojis = ['like', 'heart', 'applause', 'laugh', 'surprised'];
34
36
  const emojiButtonTooltip = new Map([
35
37
  ['like', strings.likeReactionTooltipContent],
36
38
  ['heart', strings.heartReactionTooltipContent],
37
- ['laugh', strings.laughReactionTooltipContent],
38
39
  ['applause', strings.applauseReactionTooltipContent],
40
+ ['laugh', strings.laughReactionTooltipContent],
39
41
  ['surprised', strings.surprisedReactionTooltipContent]
40
42
  ]);
41
43
  const emojiResource = new Map([
42
44
  ['like', (_a = props.reactionResources.likeReaction) === null || _a === void 0 ? void 0 : _a.url],
43
45
  ['heart', (_b = props.reactionResources.heartReaction) === null || _b === void 0 ? void 0 : _b.url],
44
- ['laugh', (_c = props.reactionResources.laughReaction) === null || _c === void 0 ? void 0 : _c.url],
45
- ['applause', (_d = props.reactionResources.applauseReaction) === null || _d === void 0 ? void 0 : _d.url],
46
+ ['applause', (_c = props.reactionResources.applauseReaction) === null || _c === void 0 ? void 0 : _c.url],
47
+ ['laugh', (_d = props.reactionResources.laughReaction) === null || _d === void 0 ? void 0 : _d.url],
46
48
  ['surprised', (_e = props.reactionResources.surprisedReaction) === null || _e === void 0 ? void 0 : _e.url]
47
49
  ]);
48
50
  const calloutStyle = { root: { padding: 0 }, calloutMain: { padding: '0.5rem' } };
@@ -53,6 +55,7 @@ export const ReactionButton = (props) => {
53
55
  };
54
56
  const renderEmoji = (item, dismissMenu) => (React.createElement("div", { style: reactionEmojiMenuStyles() }, emojis.map((emoji, index) => {
55
57
  const resourceUrl = emojiResource.get(emoji);
58
+ const frameCount = props.reactionResources !== undefined ? getEmojiFrameCount(emoji, props.reactionResources) : 0;
56
59
  return (React.createElement(TooltipHost, { key: index, "data-ui-id": index, hidden: props.disableTooltip, content: emojiButtonTooltip.get(emoji), styles: reactionToolTipHostStyle(), calloutProps: Object.assign({}, calloutProps) },
57
60
  React.createElement(IconButton, { key: index, onClick: () => {
58
61
  props.onReactionClick(emoji);
@@ -60,7 +63,7 @@ export const ReactionButton = (props) => {
60
63
  return new Map(prevMap).set(emoji, false);
61
64
  });
62
65
  dismissMenu();
63
- }, style: emojiStyles(resourceUrl ? resourceUrl : '', isHoveredMap.get(emoji) ? 'running' : 'paused'), onMouseEnter: () => setIsHoveredMap((prevMap) => {
66
+ }, style: emojiStyles(resourceUrl ? resourceUrl : '', isHoveredMap.get(emoji) ? 'running' : 'paused', frameCount), onMouseEnter: () => setIsHoveredMap((prevMap) => {
64
67
  return new Map(prevMap).set(emoji, true);
65
68
  }), onMouseLeave: () => setIsHoveredMap((prevMap) => {
66
69
  return new Map(prevMap).set(emoji, false);
@@ -1 +1 @@
1
- {"version":3,"file":"ReactionButton.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/ReactionButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,2CAA2C;AAC3C,OAAO,EACL,sBAAsB,EACtB,cAAc,EAGd,UAAU,EAEV,WAAW,EAEX,WAAW,EACX,QAAQ,EACT,MAAM,iBAAiB,CAAC;AACzB,2CAA2C;AAC3C,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,2CAA2C;AAC3C,OAAO,EAA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BAAgB,oBACX,KAAK,IACT,SAAS,EAAE,WAAW,CAAC,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,EAC5C,SAAS,EAAE;YACT,kBAAkB,EAAE,IAAI;YACxB,KAAK,EAAE,SAAS;SACjB,EACD,YAAY,EAAE,MAAA,KAAK,CAAC,YAAY,mCAAI,YAAY,EAChD,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAA,KAAK,CAAC,QAAQ,mCAAI,qBAAqB,EACjD,gBAAgB,EAAE,GAAG,EAAE,CAAC,gCAAO,EAC/B,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,SAAS,EAAE,OAAO,CAAC,SAAS,IAC5B,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,2CAA2C;AAC3C,MAAM,oBAAoB,GAAG,CAAC,KAAY,EAAiB,EAAE,CAAC,CAAC;IAC7D,WAAW,EAAE;QACX,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY;QACtC,KAAK,EAAE,cAAc,CAAC,KAAK;KAC5B;IACD,kBAAkB,EAAE;QAClB,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY;QACtC,KAAK,EAAE,cAAc,CAAC,KAAK;KAC5B;IACD,YAAY,EAAE,EAAE,KAAK,EAAE,cAAc,CAAC,KAAK,EAAE;CAC9C,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(reaction) */\nimport {\n ContextualMenuItemType,\n DefaultPalette,\n IButtonStyles,\n ICalloutContentStyles,\n IconButton,\n IContextualMenuItem,\n mergeStyles,\n Theme,\n TooltipHost,\n useTheme\n} from '@fluentui/react';\n/* @conditional-compile-remove(reaction) */\nimport React, { useState } from 'react';\n/* @conditional-compile-remove(reaction) */\nimport { ControlBarButton, ControlBarButtonProps } from './ControlBarButton';\n/* @conditional-compile-remove(reaction) */\nimport { _HighContrastAwareIcon } from './HighContrastAwareIcon';\n/* @conditional-compile-remove(reaction) */\nimport { useLocale } from '../localization';\n/* @conditional-compile-remove(reaction) */\nimport { emojiStyles, reactionEmojiMenuStyles, reactionToolTipHostStyle } from './styles/ReactionButton.styles';\n/* @conditional-compile-remove(reaction) */\nimport { isDarkThemed } from '../theming/themeUtils';\n/* @conditional-compile-remove(reaction) */\nimport { ReactionResources } from '..';\n\n/* @conditional-compile-remove(reaction) */\n/**\n * Props for {@link ReactionButton}.\n *\n * @beta\n */\nexport interface ReactionButtonProps extends ControlBarButtonProps {\n /**\n * Optional strings to override in component\n */\n strings?: Partial<ReactionButtonStrings>;\n /**\n * Click event to send reaction to meeting\n */\n onReactionClick: (reaction: string) => Promise<void>;\n /**\n * Reaction resource locator and parameters\n */\n reactionResources: ReactionResources;\n}\n\n/* @conditional-compile-remove(reaction) */\n/**\n * Strings of {@link ReactionButton} that can be overridden.\n *\n * @beta\n */\nexport interface ReactionButtonStrings {\n /** Label of the button. */\n label: string;\n /** Aria label for reaction button accessibility announcement */\n ariaLabel: string;\n /** Tooltip content when the button is disabled. */\n tooltipDisabledContent?: string;\n /** Tooltip content when the button is enabled. */\n tooltipContent?: string;\n /** Tooltip content of like reaction button. */\n likeReactionTooltipContent?: string;\n /** Tooltip content of heart reaction button. */\n heartReactionTooltipContent?: string;\n /** Tooltip content of laugh reaction button. */\n laughReactionTooltipContent?: string;\n /** Tooltip content of clap reaction button. */\n applauseReactionTooltipContent?: string;\n /** Tooltip content of surprised reaction button. */\n surprisedReactionTooltipContent?: string;\n}\n\n/* @conditional-compile-remove(reaction) */\n/**\n * A button to send reactions.\n *\n * Can be used with {@link ControlBar}.\n *\n * @beta\n */\nexport const ReactionButton = (props: ReactionButtonProps): JSX.Element => {\n const localeStrings = useLocale().strings.reactionButton;\n const strings = { ...localeStrings, ...props.strings };\n const theme = useTheme();\n const styles = reactionButtonStyles(theme);\n const onRenderIcon = (): JSX.Element => (\n <_HighContrastAwareIcon disabled={props.disabled} iconName=\"ReactionButtonIcon\" />\n );\n\n const [isHoveredMap, setIsHoveredMap] = useState(new Map());\n const emojis = ['like', 'heart', 'laugh', 'applause', 'surprised'];\n const emojiButtonTooltip: Map<string, string | undefined> = new Map([\n ['like', strings.likeReactionTooltipContent],\n ['heart', strings.heartReactionTooltipContent],\n ['laugh', strings.laughReactionTooltipContent],\n ['applause', strings.applauseReactionTooltipContent],\n ['surprised', strings.surprisedReactionTooltipContent]\n ]);\n const emojiResource: Map<string, string | undefined> = new Map([\n ['like', props.reactionResources.likeReaction?.url],\n ['heart', props.reactionResources.heartReaction?.url],\n ['laugh', props.reactionResources.laughReaction?.url],\n ['applause', props.reactionResources.applauseReaction?.url],\n ['surprised', props.reactionResources.surprisedReaction?.url]\n ]);\n\n const calloutStyle: Partial<ICalloutContentStyles> = { root: { padding: 0 }, calloutMain: { padding: '0.5rem' } };\n\n const calloutProps = {\n gapSpace: 4,\n styles: calloutStyle,\n backgroundColor: isDarkThemed(theme) ? theme.palette.neutralLighter : ''\n };\n\n const renderEmoji = (item: IContextualMenuItem, dismissMenu: () => void): React.JSX.Element => (\n <div style={reactionEmojiMenuStyles()}>\n {emojis.map((emoji, index) => {\n const resourceUrl = emojiResource.get(emoji);\n return (\n <TooltipHost\n key={index}\n data-ui-id={index}\n hidden={props.disableTooltip}\n content={emojiButtonTooltip.get(emoji)}\n styles={reactionToolTipHostStyle()}\n calloutProps={{ ...calloutProps }}\n >\n <IconButton\n key={index}\n onClick={() => {\n props.onReactionClick(emoji);\n setIsHoveredMap((prevMap) => {\n return new Map(prevMap).set(emoji, false);\n });\n dismissMenu();\n }}\n style={emojiStyles(resourceUrl ? resourceUrl : '', isHoveredMap.get(emoji) ? 'running' : 'paused')}\n onMouseEnter={() =>\n setIsHoveredMap((prevMap) => {\n return new Map(prevMap).set(emoji, true);\n })\n }\n onMouseLeave={() =>\n setIsHoveredMap((prevMap) => {\n return new Map(prevMap).set(emoji, false);\n })\n }\n />\n </TooltipHost>\n );\n })}\n </div>\n );\n\n const emojiList: IContextualMenuItem[] = [\n { key: 'reactions', itemType: ContextualMenuItemType.Normal, onRender: renderEmoji }\n ];\n\n return (\n <ControlBarButton\n {...props}\n className={mergeStyles(styles, props.styles)}\n menuProps={{\n shouldFocusOnMount: true,\n items: emojiList\n }}\n onRenderIcon={props.onRenderIcon ?? onRenderIcon}\n strings={strings}\n labelKey={props.labelKey ?? 'reactionButtonLabel'}\n onRenderMenuIcon={() => <div />}\n disabled={props.disabled}\n ariaLabel={strings.ariaLabel}\n />\n );\n};\n\n/* @conditional-compile-remove(reaction) */\nconst reactionButtonStyles = (theme: Theme): IButtonStyles => ({\n rootChecked: {\n background: theme.palette.themePrimary,\n color: DefaultPalette.white\n },\n rootCheckedHovered: {\n background: theme.palette.themePrimary,\n color: DefaultPalette.white\n },\n labelChecked: { color: DefaultPalette.white }\n});\n"]}
1
+ {"version":3,"file":"ReactionButton.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/ReactionButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,2CAA2C;AAC3C,OAAO,EACL,sBAAsB,EACtB,cAAc,EAGd,UAAU,EAEV,WAAW,EAEX,WAAW,EACX,QAAQ,EACT,MAAM,iBAAiB,CAAC;AACzB,2CAA2C;AAC3C,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,2CAA2C;AAC3C,OAAO,EAAE,gBAAgB,EAAyB,MAAM,oBAAoB,CAAC;AAC7E,2CAA2C;AAC3C,OAAO,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACjE,2CAA2C;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,2CAA2C;AAC3C,OAAO,EAAE,WAAW,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAChH,2CAA2C;AAC3C,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAGrD,2CAA2C;AAC3C,OAAO,EAAE,kBAAkB,EA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E,SAAS;SACjB,EACD,YAAY,EAAE,MAAA,KAAK,CAAC,YAAY,mCAAI,YAAY,EAChD,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,MAAA,KAAK,CAAC,QAAQ,mCAAI,qBAAqB,EACjD,gBAAgB,EAAE,GAAG,EAAE,CAAC,gCAAO,EAC/B,QAAQ,EAAE,KAAK,CAAC,QAAQ,EACxB,SAAS,EAAE,OAAO,CAAC,SAAS,IAC5B,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,2CAA2C;AAC3C,MAAM,oBAAoB,GAAG,CAAC,KAAY,EAAiB,EAAE,CAAC,CAAC;IAC7D,WAAW,EAAE;QACX,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY;QACtC,KAAK,EAAE,cAAc,CAAC,KAAK;KAC5B;IACD,kBAAkB,EAAE;QAClB,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY;QACtC,KAAK,EAAE,cAAc,CAAC,KAAK;KAC5B;IACD,YAAY,EAAE,EAAE,KAAK,EAAE,cAAc,CAAC,KAAK,EAAE;CAC9C,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(reaction) */\nimport {\n ContextualMenuItemType,\n DefaultPalette,\n IButtonStyles,\n ICalloutContentStyles,\n IconButton,\n IContextualMenuItem,\n mergeStyles,\n Theme,\n TooltipHost,\n useTheme\n} from '@fluentui/react';\n/* @conditional-compile-remove(reaction) */\nimport React, { useState } from 'react';\n/* @conditional-compile-remove(reaction) */\nimport { ControlBarButton, ControlBarButtonProps } from './ControlBarButton';\n/* @conditional-compile-remove(reaction) */\nimport { _HighContrastAwareIcon } from './HighContrastAwareIcon';\n/* @conditional-compile-remove(reaction) */\nimport { useLocale } from '../localization';\n/* @conditional-compile-remove(reaction) */\nimport { emojiStyles, reactionEmojiMenuStyles, reactionToolTipHostStyle } from './styles/ReactionButton.styles';\n/* @conditional-compile-remove(reaction) */\nimport { isDarkThemed } from '../theming/themeUtils';\n/* @conditional-compile-remove(reaction) */\nimport { ReactionResources } from '..';\n/* @conditional-compile-remove(reaction) */\nimport { getEmojiFrameCount } from './VideoGallery/utils/videoGalleryLayoutUtils';\n\n/* @conditional-compile-remove(reaction) */\n/**\n * Props for {@link ReactionButton}.\n *\n * @beta\n */\nexport interface ReactionButtonProps extends ControlBarButtonProps {\n /**\n * Optional strings to override in component\n */\n strings?: Partial<ReactionButtonStrings>;\n /**\n * Click event to send reaction to meeting\n */\n onReactionClick: (reaction: string) => Promise<void>;\n /**\n * Reaction resource locator and parameters\n */\n reactionResources: ReactionResources;\n}\n\n/* @conditional-compile-remove(reaction) */\n/**\n * Strings of {@link ReactionButton} that can be overridden.\n *\n * @beta\n */\nexport interface ReactionButtonStrings {\n /** Label of the button. */\n label: string;\n /** Aria label for reaction button accessibility announcement */\n ariaLabel: string;\n /** Tooltip content when the button is disabled. */\n tooltipDisabledContent?: string;\n /** Tooltip content when the button is enabled. */\n tooltipContent?: string;\n /** Tooltip content of like reaction button. */\n likeReactionTooltipContent?: string;\n /** Tooltip content of heart reaction button. */\n heartReactionTooltipContent?: string;\n /** Tooltip content of clap reaction button. */\n applauseReactionTooltipContent?: string;\n /** Tooltip content of laugh reaction button. */\n laughReactionTooltipContent?: string;\n /** Tooltip content of surprised reaction button. */\n surprisedReactionTooltipContent?: string;\n}\n\n/* @conditional-compile-remove(reaction) */\n/**\n * A button to send reactions.\n *\n * Can be used with {@link ControlBar}.\n *\n * @beta\n */\nexport const ReactionButton = (props: ReactionButtonProps): JSX.Element => {\n const localeStrings = useLocale().strings.reactionButton;\n const strings = { ...localeStrings, ...props.strings };\n const theme = useTheme();\n const styles = reactionButtonStyles(theme);\n const onRenderIcon = (): JSX.Element => (\n <_HighContrastAwareIcon disabled={props.disabled} iconName=\"ReactionButtonIcon\" />\n );\n\n const [isHoveredMap, setIsHoveredMap] = useState(new Map());\n const emojis = ['like', 'heart', 'applause', 'laugh', 'surprised'];\n const emojiButtonTooltip: Map<string, string | undefined> = new Map([\n ['like', strings.likeReactionTooltipContent],\n ['heart', strings.heartReactionTooltipContent],\n ['applause', strings.applauseReactionTooltipContent],\n ['laugh', strings.laughReactionTooltipContent],\n ['surprised', strings.surprisedReactionTooltipContent]\n ]);\n const emojiResource: Map<string, string | undefined> = new Map([\n ['like', props.reactionResources.likeReaction?.url],\n ['heart', props.reactionResources.heartReaction?.url],\n ['applause', props.reactionResources.applauseReaction?.url],\n ['laugh', props.reactionResources.laughReaction?.url],\n ['surprised', props.reactionResources.surprisedReaction?.url]\n ]);\n\n const calloutStyle: Partial<ICalloutContentStyles> = { root: { padding: 0 }, calloutMain: { padding: '0.5rem' } };\n\n const calloutProps = {\n gapSpace: 4,\n styles: calloutStyle,\n backgroundColor: isDarkThemed(theme) ? theme.palette.neutralLighter : ''\n };\n\n const renderEmoji = (item: IContextualMenuItem, dismissMenu: () => void): React.JSX.Element => (\n <div style={reactionEmojiMenuStyles()}>\n {emojis.map((emoji, index) => {\n const resourceUrl = emojiResource.get(emoji);\n const frameCount: number =\n props.reactionResources !== undefined ? getEmojiFrameCount(emoji, props.reactionResources) : 0;\n return (\n <TooltipHost\n key={index}\n data-ui-id={index}\n hidden={props.disableTooltip}\n content={emojiButtonTooltip.get(emoji)}\n styles={reactionToolTipHostStyle()}\n calloutProps={{ ...calloutProps }}\n >\n <IconButton\n key={index}\n onClick={() => {\n props.onReactionClick(emoji);\n setIsHoveredMap((prevMap) => {\n return new Map(prevMap).set(emoji, false);\n });\n dismissMenu();\n }}\n style={emojiStyles(\n resourceUrl ? resourceUrl : '',\n isHoveredMap.get(emoji) ? 'running' : 'paused',\n frameCount\n )}\n onMouseEnter={() =>\n setIsHoveredMap((prevMap) => {\n return new Map(prevMap).set(emoji, true);\n })\n }\n onMouseLeave={() =>\n setIsHoveredMap((prevMap) => {\n return new Map(prevMap).set(emoji, false);\n })\n }\n />\n </TooltipHost>\n );\n })}\n </div>\n );\n\n const emojiList: IContextualMenuItem[] = [\n { key: 'reactions', itemType: ContextualMenuItemType.Normal, onRender: renderEmoji }\n ];\n\n return (\n <ControlBarButton\n {...props}\n className={mergeStyles(styles, props.styles)}\n menuProps={{\n shouldFocusOnMount: true,\n items: emojiList\n }}\n onRenderIcon={props.onRenderIcon ?? onRenderIcon}\n strings={strings}\n labelKey={props.labelKey ?? 'reactionButtonLabel'}\n onRenderMenuIcon={() => <div />}\n disabled={props.disabled}\n ariaLabel={strings.ariaLabel}\n />\n );\n};\n\n/* @conditional-compile-remove(reaction) */\nconst reactionButtonStyles = (theme: Theme): IButtonStyles => ({\n rootChecked: {\n background: theme.palette.themePrimary,\n color: DefaultPalette.white\n },\n rootCheckedHovered: {\n background: theme.palette.themePrimary,\n color: DefaultPalette.white\n },\n labelChecked: { color: DefaultPalette.white }\n});\n"]}
@@ -19,7 +19,7 @@ export interface RichTextInputBoxComponentProps {
19
19
  strings: Partial<RichTextSendBoxStrings>;
20
20
  disabled: boolean;
21
21
  actionComponents: ReactNode;
22
- onRenderFileUploads?: () => JSX.Element;
22
+ onRenderAttachmentUploads?: () => JSX.Element;
23
23
  hasFiles?: boolean;
24
24
  richTextEditorStyleProps: (isExpanded: boolean) => RichTextEditorStyleProps;
25
25
  isHorizontalLayoutDisabled?: boolean;
@@ -14,7 +14,7 @@ import { inputBoxContentStackStyle, inputBoxRichTextStackItemStyle, inputBoxRich
14
14
  export const RichTextInputBoxComponent = (props) => {
15
15
  const { placeholderText, initialContent, onChange, onEnterKeyDown, editorComponentRef, disabled, strings, actionComponents,
16
16
  /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
17
- onRenderFileUploads,
17
+ onRenderAttachmentUploads,
18
18
  /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
19
19
  hasFiles, richTextEditorStyleProps, isHorizontalLayoutDisabled = false } = props;
20
20
  const theme = useTheme();
@@ -68,8 +68,8 @@ export const RichTextInputBoxComponent = (props) => {
68
68
  React.createElement(Stack, { grow: true, className: inputBoxRichTextStackStyle },
69
69
  React.createElement(Stack.Item, { className: inputBoxRichTextStackItemStyle },
70
70
  React.createElement(RichTextEditor, { initialContent: initialContent, placeholderText: placeholderText, onChange: onChange, onKeyDown: onKeyDown, ref: editorComponentRef, strings: strings, showRichTextEditorFormatting: showRichTextEditorFormatting, styles: richTextEditorStyle })),
71
- /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */ onRenderFileUploads &&
72
- onRenderFileUploads()),
71
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */ onRenderAttachmentUploads &&
72
+ onRenderAttachmentUploads()),
73
73
  actionButtons)));
74
74
  };
75
75
  //# sourceMappingURL=RichTextInputBoxComponent.js.map