@azure/communication-react 1.14.1-alpha-202404020012 → 1.15.0-alpha-202404040013

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 (213) hide show
  1. package/dist/communication-react.d.ts +30 -37
  2. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-ButXxDca.js +122 -0
  3. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-ButXxDca.js.map +1 -0
  4. package/dist/dist-cjs/communication-react/{index-Bj9ORqhl.js → index-BK44EyzL.js} +542 -563
  5. package/dist/dist-cjs/communication-react/index-BK44EyzL.js.map +1 -0
  6. package/dist/dist-cjs/communication-react/index.js +2 -2
  7. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  8. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  9. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +0 -1
  10. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  11. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js +5 -35
  12. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js.map +1 -1
  13. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  14. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +0 -1
  15. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  16. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +0 -3
  17. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  18. package/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.js +0 -1
  19. package/dist/dist-esm/calling-stateful-client/src/CapabilitiesSubscriber.js.map +1 -1
  20. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  21. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js +16 -9
  22. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
  23. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +20 -20
  24. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  25. package/dist/dist-esm/communication-react/src/index.d.ts +2 -1
  26. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  27. package/dist/dist-esm/react-components/src/components/AttachmentUploadCards.js +2 -2
  28. package/dist/dist-esm/react-components/src/components/AttachmentUploadCards.js.map +1 -1
  29. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js +12 -12
  30. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js.map +1 -1
  31. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsRichTextEditBox.js +7 -7
  32. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsRichTextEditBox.js.map +1 -1
  33. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +1 -0
  34. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
  35. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.d.ts +23 -0
  36. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js +24 -0
  37. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js.map +1 -0
  38. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +7 -4
  39. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js +11 -4
  40. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
  41. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +9 -3
  42. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
  43. package/dist/dist-esm/react-components/src/components/Drawer/ReactionDrawerMenuItem.js +1 -1
  44. package/dist/dist-esm/react-components/src/components/Drawer/ReactionDrawerMenuItem.js.map +1 -1
  45. package/dist/dist-esm/react-components/src/components/MeetingReactionOverlay.js +1 -1
  46. package/dist/dist-esm/react-components/src/components/MeetingReactionOverlay.js.map +1 -1
  47. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +6 -0
  48. package/dist/dist-esm/react-components/src/components/MessageThread.js +6 -2
  49. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  50. package/dist/dist-esm/react-components/src/components/ReactionButton.js +5 -11
  51. package/dist/dist-esm/react-components/src/components/ReactionButton.js.map +1 -1
  52. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/RichTextRibbonButtons.js +1 -1
  53. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/RichTextRibbonButtons.js.map +1 -1
  54. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.js +1 -2
  55. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.js.map +1 -1
  56. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.d.ts +1 -1
  57. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +6 -6
  58. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +1 -1
  59. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +1 -1
  60. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +28 -28
  61. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
  62. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js +6 -6
  63. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js.map +1 -1
  64. package/dist/dist-esm/react-components/src/components/SendBox.d.ts +3 -3
  65. package/dist/dist-esm/react-components/src/components/SendBox.js +20 -20
  66. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  67. package/dist/dist-esm/react-components/src/components/VideoGallery/ParticipantVideoTileOverlay.js +14 -6
  68. package/dist/dist-esm/react-components/src/components/VideoGallery/ParticipantVideoTileOverlay.js.map +1 -1
  69. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/reactionUtils.d.ts +2 -0
  70. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/reactionUtils.js +3 -0
  71. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/reactionUtils.js.map +1 -1
  72. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.d.ts +4 -0
  73. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +21 -0
  74. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
  75. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  76. package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.d.ts +3 -3
  77. package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.js +18 -9
  78. package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.js.map +1 -1
  79. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.d.ts +1 -1
  80. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js +2 -3
  81. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js.map +1 -1
  82. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.d.ts +4 -3
  83. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js +13 -19
  84. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js.map +1 -1
  85. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.d.ts +1 -1
  86. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js +7 -8
  87. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js.map +1 -1
  88. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js +4 -3
  89. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
  90. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +3 -3
  91. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  92. package/dist/dist-esm/react-components/src/theming/icons.js +1 -1
  93. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  94. package/dist/dist-esm/react-components/src/types/Attachment.d.ts +9 -9
  95. package/dist/dist-esm/react-components/src/types/Attachment.js.map +1 -1
  96. package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +2 -2
  97. package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
  98. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +5 -23
  99. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  100. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  101. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -2
  102. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +0 -2
  103. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  104. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +4 -2
  105. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  106. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  107. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +3 -7
  108. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  109. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +7 -1
  110. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  111. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js +0 -7
  112. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CapabilitiesChangedNotificationBar.js.map +1 -1
  113. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js +1 -5
  114. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js.map +1 -1
  115. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js +1 -5
  116. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js.map +1 -1
  117. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js +0 -1
  118. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js.map +1 -1
  119. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  120. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +2 -8
  121. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  122. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +3 -14
  123. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  124. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js.map +1 -1
  125. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js.map +1 -1
  126. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js.map +1 -1
  127. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +0 -2
  128. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  129. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/capabilitiesChangedInfoAndRoleSelector.js +0 -3
  130. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/capabilitiesChangedInfoAndRoleSelector.js.map +1 -1
  131. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CapabilityChangedNotificationTracking.js.map +1 -1
  132. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/TrackCapabilityChangedNotifications.js +0 -6
  133. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/TrackCapabilityChangedNotifications.js.map +1 -1
  134. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +1 -8
  135. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  136. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +15 -15
  137. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  138. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +2 -3
  139. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  140. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.d.ts +1 -2
  141. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +8 -8
  142. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
  143. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +2 -2
  144. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  145. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts +0 -14
  146. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
  147. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +24 -12
  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/Strings.d.ts +2 -2
  150. package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.js.map +1 -1
  151. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationAttachmentUploadAdapter.js +10 -10
  152. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationAttachmentUploadAdapter.js.map +1 -1
  153. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +23 -23
  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 +1 -1
  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.js +1 -1
  158. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapterProvider.js.map +1 -1
  159. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.d.ts +1 -1
  160. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js +1 -1
  161. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js.map +1 -1
  162. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js +7 -7
  163. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js.map +1 -1
  164. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.d.ts +1 -1
  165. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js.map +1 -1
  166. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js +9 -5
  167. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js.map +1 -1
  168. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.d.ts +2 -2
  169. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
  170. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/attachmentUploadsSelector.d.ts +2 -2
  171. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/attachmentUploadsSelector.js +2 -2
  172. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/attachmentUploadsSelector.js.map +1 -1
  173. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js +1 -1
  174. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js.map +1 -1
  175. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +9 -2
  176. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  177. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +6 -2
  178. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
  179. package/dist/dist-esm/react-composites/src/composites/common/icons.js +2 -5
  180. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  181. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.d.ts +1 -1
  182. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.js.map +1 -1
  183. package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json +1 -1
  184. package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +1 -1
  185. package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +1 -1
  186. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +1 -1
  187. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +1 -1
  188. package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +1 -1
  189. package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json +1 -1
  190. package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +1 -1
  191. package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/strings.json +1 -1
  192. package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +1 -1
  193. package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +1 -1
  194. package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +1 -1
  195. package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/strings.json +1 -1
  196. package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +1 -1
  197. package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/strings.json +1 -1
  198. package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +1 -1
  199. package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +1 -1
  200. package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/strings.json +1 -1
  201. package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +1 -1
  202. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +1 -1
  203. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +1 -1
  204. package/package.json +1 -1
  205. package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-BTyywbnH.js +0 -54
  206. package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-BTyywbnH.js.map +0 -1
  207. package/dist/dist-cjs/communication-react/index-Bj9ORqhl.js.map +0 -1
  208. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.d.ts +0 -9
  209. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js +0 -20
  210. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js.map +0 -1
  211. package/dist/dist-esm/react-composites/src/composites/common/SendBox.d.ts +0 -17
  212. package/dist/dist-esm/react-composites/src/composites/common/SendBox.js +0 -45
  213. package/dist/dist-esm/react-composites/src/composites/common/SendBox.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"MeetingReactionOverlay.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/MeetingReactionOverlay.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC,2CAA2C;AAC3C,OAAO,KAAK,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjE,2CAA2C;AAC3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AACzF,2CAA2C;AAC3C,OAAO,EAAE,iCAAiC,EAAE,MAAM,kDAAkD,CAAC;AAiCrG,2CAA2C;AAC3C;;;GAGG;AACH,MAAM,yBAAyB,GAAG,GAAG,CAAC;AACtC,2CAA2C;AAC3C;;;GAGG;AACH,MAAM,yBAAyB,GAAG,EAAE,CAAC;AACrC,2CAA2C;AAC3C;;;GAGG;AACH,MAAM,oCAAoC,GAAG,CAAC,CAAC;AAE/C,2CAA2C;AAC3C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAkC,EAAe,EAAE;IACxF,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,GAAG,KAAK,CAAC;IACjG,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAClD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC9C,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAC5C,MAAM,YAAY,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAElD,MAAM,QAAQ,GAAG,MA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CACL,6BAAK,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;YAC9D,oBAAC,2BAA2B,IAC1B,SAAS,EAAE,WAAW,EACtB,QAAQ,EAAE,QAAQ,EAClB,iBAAiB,EAAE,iBAAiB,GACpC,CACE,CACP,CAAC;IACJ,CAAC;SAAM,IAAI,KAAK,CAAC,WAAW,KAAK,cAAc,IAAI,KAAK,CAAC,WAAW,KAAK,eAAe,EAAE,CAAC;QACzF,OAAO,CACL,6BAAK,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;YAC9D,oBAAC,iCAAiC,IAChC,aAAa,EAAE,SAAS,EACxB,YAAY,EAAE,QAAQ,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,gBAAgB,EAAE,gBAAgB,EAClC,kBAAkB,EAAE,kBAAkB,GACtC,CACE,CACP,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,yCAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(reaction) */\nimport {\n OverlayModeTypes,\n Reaction,\n ReactionResources,\n VideoGalleryLocalParticipant,\n VideoGalleryRemoteParticipant\n} from '../types';\n/* @conditional-compile-remove(reaction) */\nimport React, { useLayoutEffect, useRef, useState } from 'react';\n/* @conditional-compile-remove(reaction) */\nimport { ParticipantVideoTileOverlay } from './VideoGallery/ParticipantVideoTileOverlay';\n/* @conditional-compile-remove(reaction) */\nimport { RemoteContentShareReactionOverlay } from './VideoGallery/RemoteContentShareReactionOverlay';\n\n/* @conditional-compile-remove(reaction) */\n/**\n * Reaction overlay component props\n *\n * Can be used with {@link VideoTile}.\n *\n * @internal\n */\nexport interface MeetingReactionOverlayProps {\n /**\n * Reaction rendering overlay type. i.e. single reaction rendering on grid-tile, screen share mode overlay\n */\n overlayMode: OverlayModeTypes;\n /**\n * Received reaction when overlay mode is grid-tile\n */\n reaction?: Reaction;\n /**\n * Reactions resources' url and metadata.\n */\n reactionResources: ReactionResources;\n /**\n * Local participant's reaction event that comes from participant object.\n */\n localParticipant?: VideoGalleryLocalParticipant;\n /**\n * Remote participant's reaction event.\n */\n remoteParticipants?: VideoGalleryRemoteParticipant[];\n}\n\n/* @conditional-compile-remove(reaction) */\n/**\n * Emoji max size\n * @internal\n */\nconst DEFAULT_EMOJI_MAX_SIZE_PX = 100;\n/* @conditional-compile-remove(reaction) */\n/**\n * Emoji min size\n * @internal\n */\nconst DEFAULT_EMOJI_MIN_SIZE_PX = 32;\n/* @conditional-compile-remove(reaction) */\n/**\n * Emoji resize scale constant\n * @internal\n */\nconst REACTION_EMOJI_RESIZE_SCALE_CONSTANT = 3;\n\n/* @conditional-compile-remove(reaction) */\n/**\n * Reaction overlay component\n *\n * Can be used with {@link VideoTile}.\n *\n * @internal\n */\nexport const MeetingReactionOverlay = (props: MeetingReactionOverlayProps): JSX.Element => {\n const { overlayMode, reaction, reactionResources, localParticipant, remoteParticipants } = props;\n const [emojiSizePx, setEmojiSizePx] = useState(0);\n const [divHeight, setDivHeight] = useState(0);\n const [divWidth, setDivWidth] = useState(0);\n const videoTileRef = useRef<HTMLDivElement>(null);\n\n const observer = useRef(\n new ResizeObserver((entries): void => {\n const domRect = entries.at(0)?.contentRect;\n const width = domRect !== undefined ? domRect.width : 0;\n const height = domRect !== undefined ? domRect.height : 0;\n const reactionEmojiCalcSize = Math.min(width, height) / REACTION_EMOJI_RESIZE_SCALE_CONSTANT;\n // we only want to set the persona size if it has changed\n if (reactionEmojiCalcSize !== emojiSizePx) {\n setEmojiSizePx(Math.max(Math.min(reactionEmojiCalcSize, DEFAULT_EMOJI_MAX_SIZE_PX), DEFAULT_EMOJI_MIN_SIZE_PX));\n }\n\n if (height !== divHeight) {\n setDivHeight(height);\n }\n\n if (width !== divWidth) {\n setDivWidth(width);\n }\n })\n );\n\n useLayoutEffect(() => {\n if (videoTileRef.current) {\n observer.current.observe(videoTileRef.current);\n }\n const currentObserver = observer.current;\n return () => currentObserver.disconnect();\n }, [videoTileRef]);\n\n if (overlayMode === 'grid-tiles') {\n return (\n <div ref={videoTileRef} style={{ width: '100%', height: '100%' }}>\n <ParticipantVideoTileOverlay\n emojiSize={emojiSizePx}\n reaction={reaction}\n reactionResources={reactionResources}\n />\n </div>\n );\n } else if (props.overlayMode === 'screen-share' || props.overlayMode === 'content-share') {\n return (\n <div ref={videoTileRef} style={{ width: '100%', height: '100%' }}>\n <RemoteContentShareReactionOverlay\n hostDivHeight={divHeight}\n hostDivWidth={divWidth}\n reactionResources={reactionResources}\n localParticipant={localParticipant}\n remoteParticipants={remoteParticipants}\n />\n </div>\n );\n } else {\n return <></>;\n }\n};\n"]}
1
+ {"version":3,"file":"MeetingReactionOverlay.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/MeetingReactionOverlay.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAUlC,2CAA2C;AAC3C,OAAO,KAAK,EAAE,EAAE,eAAe,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjE,2CAA2C;AAC3C,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AACzF,2CAA2C;AAC3C,OAAO,EAAE,iCAAiC,EAAE,MAAM,kDAAkD,CAAC;AAiCrG,2CAA2C;AAC3C;;;GAGG;AACH,MAAM,yBAAyB,GAAG,EAAE,CAAC;AACrC,2CAA2C;AAC3C;;;GAGG;AACH,MAAM,yBAAyB,GAAG,EAAE,CAAC;AACrC,2CAA2C;AAC3C;;;GAGG;AACH,MAAM,oCAAoC,GAAG,CAAC,CAAC;AAE/C,2CAA2C;AAC3C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAAkC,EAAe,EAAE;IACxF,MAAM,EAAE,WAAW,EAAE,QAA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H,CAAC,CAAC,CACH,CAAC;IAEF,eAAe,CAAC,GAAG,EAAE;QACnB,IAAI,YAAY,CAAC,OAAO,EAAE,CAAC;YACzB,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QACjD,CAAC;QACD,MAAM,eAAe,GAAG,QAAQ,CAAC,OAAO,CAAC;QACzC,OAAO,GAAG,EAAE,CAAC,eAAe,CAAC,UAAU,EAAE,CAAC;IAC5C,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAC;IAEnB,IAAI,WAAW,KAAK,YAAY,EAAE,CAAC;QACjC,OAAO,CACL,6BAAK,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;YAC9D,oBAAC,2BAA2B,IAC1B,SAAS,EAAE,WAAW,EACtB,QAAQ,EAAE,QAAQ,EAClB,iBAAiB,EAAE,iBAAiB,GACpC,CACE,CACP,CAAC;IACJ,CAAC;SAAM,IAAI,KAAK,CAAC,WAAW,KAAK,cAAc,IAAI,KAAK,CAAC,WAAW,KAAK,eAAe,EAAE,CAAC;QACzF,OAAO,CACL,6BAAK,GAAG,EAAE,YAAY,EAAE,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE;YAC9D,oBAAC,iCAAiC,IAChC,aAAa,EAAE,SAAS,EACxB,YAAY,EAAE,QAAQ,EACtB,iBAAiB,EAAE,iBAAiB,EACpC,gBAAgB,EAAE,gBAAgB,EAClC,kBAAkB,EAAE,kBAAkB,GACtC,CACE,CACP,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,OAAO,yCAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(reaction) */\nimport {\n OverlayModeTypes,\n Reaction,\n ReactionResources,\n VideoGalleryLocalParticipant,\n VideoGalleryRemoteParticipant\n} from '../types';\n/* @conditional-compile-remove(reaction) */\nimport React, { useLayoutEffect, useRef, useState } from 'react';\n/* @conditional-compile-remove(reaction) */\nimport { ParticipantVideoTileOverlay } from './VideoGallery/ParticipantVideoTileOverlay';\n/* @conditional-compile-remove(reaction) */\nimport { RemoteContentShareReactionOverlay } from './VideoGallery/RemoteContentShareReactionOverlay';\n\n/* @conditional-compile-remove(reaction) */\n/**\n * Reaction overlay component props\n *\n * Can be used with {@link VideoTile}.\n *\n * @internal\n */\nexport interface MeetingReactionOverlayProps {\n /**\n * Reaction rendering overlay type. i.e. single reaction rendering on grid-tile, screen share mode overlay\n */\n overlayMode: OverlayModeTypes;\n /**\n * Received reaction when overlay mode is grid-tile\n */\n reaction?: Reaction;\n /**\n * Reactions resources' url and metadata.\n */\n reactionResources: ReactionResources;\n /**\n * Local participant's reaction event that comes from participant object.\n */\n localParticipant?: VideoGalleryLocalParticipant;\n /**\n * Remote participant's reaction event.\n */\n remoteParticipants?: VideoGalleryRemoteParticipant[];\n}\n\n/* @conditional-compile-remove(reaction) */\n/**\n * Emoji max size\n * @internal\n */\nconst DEFAULT_EMOJI_MAX_SIZE_PX = 70;\n/* @conditional-compile-remove(reaction) */\n/**\n * Emoji min size\n * @internal\n */\nconst DEFAULT_EMOJI_MIN_SIZE_PX = 32;\n/* @conditional-compile-remove(reaction) */\n/**\n * Emoji resize scale constant\n * @internal\n */\nconst REACTION_EMOJI_RESIZE_SCALE_CONSTANT = 3;\n\n/* @conditional-compile-remove(reaction) */\n/**\n * Reaction overlay component\n *\n * Can be used with {@link VideoTile}.\n *\n * @internal\n */\nexport const MeetingReactionOverlay = (props: MeetingReactionOverlayProps): JSX.Element => {\n const { overlayMode, reaction, reactionResources, localParticipant, remoteParticipants } = props;\n const [emojiSizePx, setEmojiSizePx] = useState(0);\n const [divHeight, setDivHeight] = useState(0);\n const [divWidth, setDivWidth] = useState(0);\n const videoTileRef = useRef<HTMLDivElement>(null);\n\n const observer = useRef(\n new ResizeObserver((entries): void => {\n const domRect = entries.at(0)?.contentRect;\n const width = domRect !== undefined ? domRect.width : 0;\n const height = domRect !== undefined ? domRect.height : 0;\n const reactionEmojiCalcSize = Math.min(width, height) / REACTION_EMOJI_RESIZE_SCALE_CONSTANT;\n // we only want to set the persona size if it has changed\n if (reactionEmojiCalcSize !== emojiSizePx) {\n setEmojiSizePx(Math.max(Math.min(reactionEmojiCalcSize, DEFAULT_EMOJI_MAX_SIZE_PX), DEFAULT_EMOJI_MIN_SIZE_PX));\n }\n\n if (height !== divHeight) {\n setDivHeight(height);\n }\n\n if (width !== divWidth) {\n setDivWidth(width);\n }\n })\n );\n\n useLayoutEffect(() => {\n if (videoTileRef.current) {\n observer.current.observe(videoTileRef.current);\n }\n const currentObserver = observer.current;\n return () => currentObserver.disconnect();\n }, [videoTileRef]);\n\n if (overlayMode === 'grid-tiles') {\n return (\n <div ref={videoTileRef} style={{ width: '100%', height: '100%' }}>\n <ParticipantVideoTileOverlay\n emojiSize={emojiSizePx}\n reaction={reaction}\n reactionResources={reactionResources}\n />\n </div>\n );\n } else if (props.overlayMode === 'screen-share' || props.overlayMode === 'content-share') {\n return (\n <div ref={videoTileRef} style={{ width: '100%', height: '100%' }}>\n <RemoteContentShareReactionOverlay\n hostDivHeight={divHeight}\n hostDivWidth={divWidth}\n reactionResources={reactionResources}\n localParticipant={localParticipant}\n remoteParticipants={remoteParticipants}\n />\n </div>\n );\n } else {\n return <></>;\n }\n};\n"]}
@@ -298,6 +298,12 @@ export type MessageThreadProps = {
298
298
  * @beta
299
299
  */
300
300
  inlineImageOptions?: InlineImageOptions;
301
+ /**
302
+ * enables rich text editor for the edit box
303
+ *
304
+ * @defaultValue `false`
305
+ */
306
+ richTextEditor?: boolean;
301
307
  };
302
308
  /**
303
309
  * Props to render a single message.
@@ -176,7 +176,9 @@ export const MessageThreadWrapper = (props) => {
176
176
  /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
177
177
  attachmentOptions,
178
178
  /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
179
- onRenderAttachmentDownloads } = props;
179
+ onRenderAttachmentDownloads,
180
+ /* @conditional-compile-remove(rich-text-editor) */
181
+ richTextEditor = false } = props;
180
182
  // We need this state to wait for one tick and scroll to bottom after messages have been initialized.
181
183
  // Otherwise chatScrollDivRef.current.clientHeight is wrong if we scroll to bottom before messages are initialized.
182
184
  const [chatMessagesInitialized, setChatMessagesInitialized] = useState(false);
@@ -519,7 +521,9 @@ export const MessageThreadWrapper = (props) => {
519
521
  /* @conditional-compile-remove(mention) */
520
522
  mentionOptions: mentionOptions,
521
523
  /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
522
- onRenderAttachmentDownloads: onRenderAttachmentDownloads })));
524
+ onRenderAttachmentDownloads: onRenderAttachmentDownloads,
525
+ /* @conditional-compile-remove(rich-text-editor) */
526
+ richTextEditor: richTextEditor })));
523
527
  }))))));
524
528
  };
525
529
  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,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EACL,aAAa,EACb,8BAA8B,EAC9B,2BAA2B,EAC3B,kCAAkC,EAClC,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACtB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,KA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AM,CAAE,aAAa,CAAC;oBAExD,sBAAsB,IAAI,CACzB,oBAAC,SAAS,IACR,GAAG,EAAE,sBAAsB,EAC3B,kBAAkB,EAAE,uBAAuB,EAC3C,QAAQ,EAAE,QAAQ,GAClB,CACH;oBACA,iBAAiB,CAAC,GAAG,CAAC,CAAC,OAA0B,EAAe,EAAE;;wBACjE,OAAO,CACL,oBAAC,+BAA+B,oBAC1B,OAAO,IACX,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,OAAO,CAAC,GAAG,EAChB,MAAM,EAAE,MAAM,EACd,6BAA6B,EAAE,QAAQ,EACvC,OAAO,EAAE,OAAO,EAChB,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,qBAAqB,EAAE,qBAAqB,EAC5C,qBAAqB,EAAE,qBAAqB,EAC5C,mBAAmB,EAAE,uBAAuB,EAC5C,SAAS,EAAE,4BAA4B,EACvC,gBAAgB,EAAE,gBAAgB;4BAClC,qGAAqG;4BACrG,oBAAoB,EAAE,MAAA,iBAAiB,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,eAAe,0CAAE,oBAAoB,EAC9E,kBAAkB,EAAE,kBAAkB;4BACtC,0DAA0D;4BAC1D,uBAAuB,EAAE,uBAAuB;4BAChD,0CAA0C;4BAC1C,cAAc,EAAE,cAAc;4BAC9B,qGAAqG;4BACrG,2BAA2B,EAAE,2BAA2B,IACxD,CACH,CAAC;oBACJ,CAAC,CAAC,CACG,CACe,CACV,CACZ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,+BAA+B,GAAG,KAAK,CAAC,IAAI,CAAC,CAAC,GAAqC,EAAe,EAAE;IACxG,OAAO,oBAAC,2BAA2B,oBAAK,GAAG,EAAI,CAAC;AAClD,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\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"]}
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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AqC,EAAe,EAAE;IACxG,OAAO,oBAAC,2BAA2B,oBAAK,GAAG,EAAI,CAAC;AAClD,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\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-upload) */\n options?: {\n /* @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 /* @conditional-compile-remove(rich-text-editor) */\n /**\n * enables rich text editor for the edit box\n *\n * @defaultValue `false`\n */\n richTextEditor?: boolean;\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 /* @conditional-compile-remove(rich-text-editor) */\n richTextEditor = false\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 /* @conditional-compile-remove(rich-text-editor) */\n richTextEditor={richTextEditor}\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"]}
@@ -3,7 +3,7 @@
3
3
  /* @conditional-compile-remove(reaction) */
4
4
  import { ContextualMenuItemType, DefaultPalette, IconButton, mergeStyles, TooltipHost, useTheme } from '@fluentui/react';
5
5
  /* @conditional-compile-remove(reaction) */
6
- import React, { useState } from 'react';
6
+ import React from 'react';
7
7
  /* @conditional-compile-remove(reaction) */
8
8
  import { ControlBarButton } from './ControlBarButton';
9
9
  /* @conditional-compile-remove(reaction) */
@@ -31,7 +31,6 @@ export const ReactionButton = (props) => {
31
31
  const theme = useTheme();
32
32
  const styles = reactionButtonStyles(theme);
33
33
  const onRenderIcon = () => (React.createElement(_HighContrastAwareIcon, { disabled: props.disabled, iconName: "ReactionButtonIcon" }));
34
- const [isHoveredMap, setIsHoveredMap] = useState(new Map());
35
34
  const emojis = ['like', 'heart', 'applause', 'laugh', 'surprised'];
36
35
  const emojiButtonTooltip = new Map([
37
36
  ['like', strings.likeReactionTooltipContent],
@@ -53,21 +52,16 @@ export const ReactionButton = (props) => {
53
52
  styles: calloutStyle,
54
53
  backgroundColor: isDarkThemed(theme) ? theme.palette.neutralLighter : ''
55
54
  };
56
- const renderEmoji = (item, dismissMenu) => (React.createElement("div", { style: reactionEmojiMenuStyles() }, emojis.map((emoji, index) => {
55
+ const classname = mergeStyles(reactionEmojiMenuStyles());
56
+ const renderEmoji = (item, dismissMenu) => (React.createElement("div", { "data-ui-id": "reaction-sub-menu", className: classname }, emojis.map((emoji, index) => {
57
57
  const resourceUrl = emojiResource.get(emoji);
58
58
  const frameCount = props.reactionResources !== undefined ? getEmojiFrameCount(emoji, props.reactionResources) : 0;
59
+ const classname = mergeStyles(emojiStyles(resourceUrl ? resourceUrl : '', frameCount));
59
60
  return (React.createElement(TooltipHost, { key: index, "data-ui-id": index, hidden: props.disableTooltip, content: emojiButtonTooltip.get(emoji), styles: reactionToolTipHostStyle(), calloutProps: Object.assign({}, calloutProps) },
60
61
  React.createElement(IconButton, { key: index, onClick: () => {
61
62
  props.onReactionClick(emoji);
62
- setIsHoveredMap((prevMap) => {
63
- return new Map(prevMap).set(emoji, false);
64
- });
65
63
  dismissMenu();
66
- }, style: emojiStyles(resourceUrl ? resourceUrl : '', isHoveredMap.get(emoji) ? 'running' : 'paused', frameCount), onMouseEnter: () => setIsHoveredMap((prevMap) => {
67
- return new Map(prevMap).set(emoji, true);
68
- }), onMouseLeave: () => setIsHoveredMap((prevMap) => {
69
- return new Map(prevMap).set(emoji, false);
70
- }) })));
64
+ }, className: classname })));
71
65
  })));
72
66
  const emojiList = [
73
67
  { key: 'reactions', itemType: ContextualMenuItemType.Normal, onRender: renderEmoji }
@@ -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,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,EAAE,MAAM,8CAA8C,CAAC;AAkDlF,2CAA2C;AAC3C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAA0B,EAAe,EAAE;;IACxE,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC,cA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,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"]}
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,MAAM,OAAO,CAAC;AAC1B,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,EAAE,MAAM,8CAA8C,CAAC;AAkDlF,2CAA2C;AAC3C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAA0B,EAAe,EAAE;;IACxE,MAAM,aAAa,GAAG,SAAS,EAAE,CAAC,OAAO,CAAC,cAAc,CAAC;IACzD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C,KAAK,CAAC,CAAC;oBAC7B,WAAW,EAAE,CAAC;gBAChB,CAAC,EACD,SAAS,EAAE,SAAS,GACpB,CACU,CACf,CAAC;IACJ,CAAC,CAAC,CACE,CACP,CAAC;IAEF,MAAM,SAAS,GAA0B;QACvC,EAAE,GAAG,EAAE,WAAW,EAAE,QAAQ,EAAE,sBAAsB,CAAC,MAAM,EAAE,QAAQ,EAAE,WAAW,EAAE;KACrF,CAAC;IAEF,OAAO,CACL,oBAAC,gBAAgB,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 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 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 classname = mergeStyles(reactionEmojiMenuStyles());\n\n const renderEmoji = (item: IContextualMenuItem, dismissMenu: () => void): React.JSX.Element => (\n <div data-ui-id=\"reaction-sub-menu\" className={classname}>\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 const classname = mergeStyles(emojiStyles(resourceUrl ? resourceUrl : '', frameCount));\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 dismissMenu();\n }}\n className={classname}\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"]}
@@ -68,8 +68,8 @@ export const ribbonButtons = (theme) => {
68
68
  dividerRibbonButton(theme, 'RichTextRibbonTextFormatDivider'),
69
69
  bulletListButton(theme),
70
70
  numberListButton(theme),
71
- indentIncreaseButton(theme),
72
71
  indentDecreaseButton(theme),
72
+ indentIncreaseButton(theme),
73
73
  dividerRibbonButton(theme, 'RichTextRibbonTableDivider'),
74
74
  insertTableButton(theme, MaxRowsNumber, MaxColumnsNumber)
75
75
  ].forEach((item) => {
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextRibbonButtons.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/RichTextEditor/Buttons/RichTextRibbonButtons.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,sBAAsB,EAAS,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AM,aAAa,GAAG,CAAC,KAAY,EAA0B,EAAE;IACpE,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C;QACE,UAAU,CAAC,KAAK,CAAC;QACjB,YAAY,CAAC,KAAK,CAAC;QACnB,eAAe,CAAC,KAAK,CAAC;QACtB,mBAAmB,CAAC,KAAK,EAAE,iCAAiC,CAAC;QAC7D,gBAAgB,CAAC,KAAK,CAAC;QACvB,gBAAgB,CAAC,KAAK,CAAC;QACvB,oBAAoB,CAAC,KAAK,CAAC;QAC3B,oBAAoB,CAAC,KAAK,CAAC;QAC3B,mBAAmB,CAAC,KAAK,EAAE,4BAA4B,CAAC;QACxD,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,gBAAgB,CAAC;KAC1D,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACjB,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ContextualMenuItemType, Theme } from '@fluentui/react';\nimport { KnownRibbonButtonKey, RibbonButton, getButtons } from 'roosterjs-react';\nimport { ribbonButtonStyle, ribbonDividerStyle } from '../../styles/RichTextEditor.styles';\nimport { insertTableButton } from './Table/RichTextInsertTableButton';\n\nconst MaxRowsNumber = 5;\nconst MaxColumnsNumber = 5;\n\nconst dividerRibbonButton = (theme: Theme, key: string): RibbonButton<string> => {\n return {\n key: key,\n iconName: 'RichTextDividerIcon',\n unlocalizedText: '',\n onClick: () => {},\n isDisabled: () => true,\n commandBarProperties: {\n // show the item correctly for the overflow menu\n itemType: ContextualMenuItemType.Divider,\n buttonStyles: ribbonDividerStyle(theme),\n // this is still needed to remove checkmark icon space even though it is a divider\n canCheck: false\n }\n };\n};\n\nconst boldButton = (theme: Theme): RibbonButton<string> | undefined => {\n return createKnownRibbonButton(KnownRibbonButtonKey.Bold, theme, 'RichTextBoldButtonIcon');\n};\n\nconst italicButton = (theme: Theme): RibbonButton<string> | undefined => {\n return createKnownRibbonButton(KnownRibbonButtonKey.Italic, theme, 'RichTextItalicButtonIcon');\n};\n\nconst underlineButton = (theme: Theme): RibbonButton<string> | undefined => {\n return createKnownRibbonButton(KnownRibbonButtonKey.Underline, theme, 'RichTextUnderlineButtonIcon');\n};\n\nconst bulletListButton = (theme: Theme): RibbonButton<string> | undefined => {\n return createKnownRibbonButton(KnownRibbonButtonKey.BulletedList, theme, 'RichTextBulletListButtonIcon');\n};\n\nconst numberListButton = (theme: Theme): RibbonButton<string> | undefined => {\n return createKnownRibbonButton(KnownRibbonButtonKey.NumberedList, theme, 'RichTextNumberListButtonIcon');\n};\n\nconst indentIncreaseButton = (theme: Theme): RibbonButton<string> | undefined => {\n return createKnownRibbonButton(KnownRibbonButtonKey.IncreaseIndent, theme, 'RichTextIndentIncreaseButtonIcon');\n};\n\nconst indentDecreaseButton = (theme: Theme): RibbonButton<string> | undefined => {\n return createKnownRibbonButton(KnownRibbonButtonKey.DecreaseIndent, theme, 'RichTextIndentDecreaseButtonIcon');\n};\n\nconst createKnownRibbonButton = (\n key: KnownRibbonButtonKey,\n theme: Theme,\n icon: string\n): RibbonButton<string> | undefined => {\n const buttons = getButtons([key]);\n if (buttons.length > 0) {\n const button = buttons[0];\n // AllButtonStringKeys is a union of all the string keys of all the buttons\n const result = buttons[0] as RibbonButton<typeof button.key>;\n button.iconName = icon;\n button.commandBarProperties = {\n ...button.commandBarProperties,\n buttonStyles: {\n ...button.commandBarProperties?.buttonStyles,\n ...ribbonButtonStyle(theme)\n },\n canCheck: false\n };\n return result;\n }\n return undefined;\n};\n\n/**\n * @private\n */\nexport const ribbonButtons = (theme: Theme): RibbonButton<string>[] => {\n const buttons: RibbonButton<string>[] = [];\n [\n boldButton(theme),\n italicButton(theme),\n underlineButton(theme),\n dividerRibbonButton(theme, 'RichTextRibbonTextFormatDivider'),\n bulletListButton(theme),\n numberListButton(theme),\n indentIncreaseButton(theme),\n indentDecreaseButton(theme),\n dividerRibbonButton(theme, 'RichTextRibbonTableDivider'),\n insertTableButton(theme, MaxRowsNumber, MaxColumnsNumber)\n ].forEach((item) => {\n if (item !== undefined) {\n buttons.push(item);\n }\n });\n\n return buttons;\n};\n"]}
1
+ {"version":3,"file":"RichTextRibbonButtons.js","sourceRoot":"","sources":["../../../../../../../../react-components/src/components/RichTextEditor/Buttons/RichTextRibbonButtons.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,sBAAsB,EAAS,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAE,oBAAoB,EAAgB,UAAU,EAAE,MAAM,iBAAiB,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAC3F,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,MAAM,aAAa,GAAG,CAAC,CAAC;AACxB,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAE3B,MAAM,mBAAmB,GAAG,CAAC,KAAY,EAAE,GAAW,EAAwB,EAAE;IAC9E,OAAO;QACL,GAAG,EAAE,GAAG;QACR,QAAQ,EAAE,qBAAqB;QAC/B,eAAe,EAAE,EAAE;QACnB,OAAO,EAAE,GAAG,EAAE,GAAE,CAAC;QACjB,UAAU,EAAE,GAAG,EAAE,CAAC,IAAI;QACtB,oBAAoB,EAAE;YACpB,gDAAgD;YAChD,QAAQ,EAAE,sBAAsB,CAAC,OAAO;YACxC,YAAY,EAAE,kBAAkB,CAAC,KAAK,CAAC;YACvC,kFAAkF;YAClF,QAAQ,EAAE,KAAK;SAChB;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,KAAY,EAAoC,EAAE;IACpE,OAAO,uBAAuB,CAAC,oBAAoB,CAAC,IAAI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,CAAC,CAAC;QAC1B,2EAA2E;QAC3E,MAAM,MAAM,GAAG,OAAO,CAAC,CAAC,CAAoC,CAAC;QAC7D,MAAM,CAAC,QAAQ,GAAG,IAAI,CAAC;QACvB,MAAM,CAAC,oBAAoB,mCACtB,MAAM,CAAC,oBAAoB,KAC9B,YAAY,kCACP,MAAA,MAAM,CAAC,oBAAoB,0CAAE,YAAY,GACzC,iBAAiB,CAAC,KAAK,CAAC,GAE7B,QAAQ,EAAE,KAAK,GAChB,CAAC;QACF,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAY,EAA0B,EAAE;IACpE,MAAM,OAAO,GAA2B,EAAE,CAAC;IAC3C;QACE,UAAU,CAAC,KAAK,CAAC;QACjB,YAAY,CAAC,KAAK,CAAC;QACnB,eAAe,CAAC,KAAK,CAAC;QACtB,mBAAmB,CAAC,KAAK,EAAE,iCAAiC,CAAC;QAC7D,gBAAgB,CAAC,KAAK,CAAC;QACvB,gBAAgB,CAAC,KAAK,CAAC;QACvB,oBAAoB,CAAC,KAAK,CAAC;QAC3B,oBAAoB,CAAC,KAAK,CAAC;QAC3B,mBAAmB,CAAC,KAAK,EAAE,4BAA4B,CAAC;QACxD,iBAAiB,CAAC,KAAK,EAAE,aAAa,EAAE,gBAAgB,CAAC;KAC1D,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE;QACjB,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;YACvB,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACrB,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ContextualMenuItemType, Theme } from '@fluentui/react';\nimport { KnownRibbonButtonKey, RibbonButton, getButtons } from 'roosterjs-react';\nimport { ribbonButtonStyle, ribbonDividerStyle } from '../../styles/RichTextEditor.styles';\nimport { insertTableButton } from './Table/RichTextInsertTableButton';\n\nconst MaxRowsNumber = 5;\nconst MaxColumnsNumber = 5;\n\nconst dividerRibbonButton = (theme: Theme, key: string): RibbonButton<string> => {\n return {\n key: key,\n iconName: 'RichTextDividerIcon',\n unlocalizedText: '',\n onClick: () => {},\n isDisabled: () => true,\n commandBarProperties: {\n // show the item correctly for the overflow menu\n itemType: ContextualMenuItemType.Divider,\n buttonStyles: ribbonDividerStyle(theme),\n // this is still needed to remove checkmark icon space even though it is a divider\n canCheck: false\n }\n };\n};\n\nconst boldButton = (theme: Theme): RibbonButton<string> | undefined => {\n return createKnownRibbonButton(KnownRibbonButtonKey.Bold, theme, 'RichTextBoldButtonIcon');\n};\n\nconst italicButton = (theme: Theme): RibbonButton<string> | undefined => {\n return createKnownRibbonButton(KnownRibbonButtonKey.Italic, theme, 'RichTextItalicButtonIcon');\n};\n\nconst underlineButton = (theme: Theme): RibbonButton<string> | undefined => {\n return createKnownRibbonButton(KnownRibbonButtonKey.Underline, theme, 'RichTextUnderlineButtonIcon');\n};\n\nconst bulletListButton = (theme: Theme): RibbonButton<string> | undefined => {\n return createKnownRibbonButton(KnownRibbonButtonKey.BulletedList, theme, 'RichTextBulletListButtonIcon');\n};\n\nconst numberListButton = (theme: Theme): RibbonButton<string> | undefined => {\n return createKnownRibbonButton(KnownRibbonButtonKey.NumberedList, theme, 'RichTextNumberListButtonIcon');\n};\n\nconst indentIncreaseButton = (theme: Theme): RibbonButton<string> | undefined => {\n return createKnownRibbonButton(KnownRibbonButtonKey.IncreaseIndent, theme, 'RichTextIndentIncreaseButtonIcon');\n};\n\nconst indentDecreaseButton = (theme: Theme): RibbonButton<string> | undefined => {\n return createKnownRibbonButton(KnownRibbonButtonKey.DecreaseIndent, theme, 'RichTextIndentDecreaseButtonIcon');\n};\n\nconst createKnownRibbonButton = (\n key: KnownRibbonButtonKey,\n theme: Theme,\n icon: string\n): RibbonButton<string> | undefined => {\n const buttons = getButtons([key]);\n if (buttons.length > 0) {\n const button = buttons[0];\n // AllButtonStringKeys is a union of all the string keys of all the buttons\n const result = buttons[0] as RibbonButton<typeof button.key>;\n button.iconName = icon;\n button.commandBarProperties = {\n ...button.commandBarProperties,\n buttonStyles: {\n ...button.commandBarProperties?.buttonStyles,\n ...ribbonButtonStyle(theme)\n },\n canCheck: false\n };\n return result;\n }\n return undefined;\n};\n\n/**\n * @private\n */\nexport const ribbonButtons = (theme: Theme): RibbonButton<string>[] => {\n const buttons: RibbonButton<string>[] = [];\n [\n boldButton(theme),\n italicButton(theme),\n underlineButton(theme),\n dividerRibbonButton(theme, 'RichTextRibbonTextFormatDivider'),\n bulletListButton(theme),\n numberListButton(theme),\n indentDecreaseButton(theme),\n indentIncreaseButton(theme),\n dividerRibbonButton(theme, 'RichTextRibbonTableDivider'),\n insertTableButton(theme, MaxRowsNumber, MaxColumnsNumber)\n ].forEach((item) => {\n if (item !== undefined) {\n buttons.push(item);\n }\n });\n\n return buttons;\n};\n"]}
@@ -37,8 +37,7 @@ export const insertTableButton = (theme, maxRowsNumber, maxColumnsNumber) => {
37
37
  menuIconProps: {
38
38
  hidden: true
39
39
  },
40
- onRenderIcon: (item) => {
41
- console.log('onRenderIcon', item);
40
+ onRenderIcon: () => {
42
41
  return React.createElement(TableIcon, null);
43
42
  },
44
43
  buttonStyles: ribbonTableButtonStyle(theme),
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextInsertTableButton.js","sourceRoot":"","sources":["../../../../../../../../../react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGvE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YACvB,CAAC;YACD,YAAY,EAAE,sBAAsB,CAAC,KAAK,CAAC;YAC3C,QAAQ,EAAE,KAAK;SAChB;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,GAAgB,EAAE;IAClC,OAAO;IACL,qGAAqG;IACrG,oBAAC,KAAK;QACJ,oBAAC,IAAI,IAAC,QAAQ,EAAC,+BAA+B,EAAC,SAAS,EAAE,iCAAiC,GAAI;QAC/F,oBAAC,IAAI,IAAC,QAAQ,EAAC,gCAAgC,EAAC,SAAS,EAAE,kCAAkC,GAAI,CAC3F,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { Icon, Stack } from '@fluentui/react';\nimport { insertTable as insertTableAction } from './insertTableAction';\nimport type { RibbonButton } from 'roosterjs-react';\nimport type { Theme } from '@fluentui/react';\nimport { insertTableMenuTablePane, ribbonTableButtonStyle } from '../../../styles/RichTextEditor.styles';\nimport { RichTextInsertTablePane } from './RichTextInsertTablePane';\nimport { ColumnRowReplaceString, parseKey } from '../../../utils/RichTextTableUtils';\n\n// This file uses RoosterJS React package implementation with updates to UI components and styles.\n\n/**\n * \"Insert table\" button for the RoosterJS ribbon\n */\nexport const insertTableButton = (\n theme: Theme,\n maxRowsNumber: number,\n maxColumnsNumber: number\n): RibbonButton<string> => {\n return {\n key: 'buttonNameInsertTable',\n unlocalizedText: 'Insert table',\n // Icon will be set in onRenderIcon callback\n iconName: '',\n onClick: (editor, key) => {\n const { row, column } = parseKey(key);\n insertTableAction(editor, column, row);\n },\n dropDownMenu: {\n items: {\n // the key of the item is also used as a key for localization\n insertTablePane: `Insert ${ColumnRowReplaceString} table`\n },\n itemRender: (item, onClick) => {\n return (\n <RichTextInsertTablePane\n item={item}\n onClick={onClick}\n theme={theme}\n maxColumnsNumber={maxColumnsNumber}\n maxRowsNumber={maxRowsNumber}\n />\n );\n },\n commandBarSubMenuProperties: {\n className: insertTableMenuTablePane\n }\n },\n commandBarProperties: {\n // hide the chevron icon\n menuIconProps: {\n hidden: true\n },\n onRenderIcon: (item) => {\n console.log('onRenderIcon', item);\n return <TableIcon />;\n },\n buttonStyles: ribbonTableButtonStyle(theme),\n canCheck: false\n }\n };\n};\n\nconst TableIcon = (): JSX.Element => {\n return (\n // update the visibility of the Table Icon with css classes that are triggered by command bar's state\n <Stack>\n <Icon iconName=\"RichTextInsertTableFilledIcon\" className={'ribbon-table-button-filled-icon'} />\n <Icon iconName=\"RichTextInsertTableRegularIcon\" className={'ribbon-table-button-regular-icon'} />\n </Stack>\n );\n};\n"]}
1
+ {"version":3,"file":"RichTextInsertTableButton.js","sourceRoot":"","sources":["../../../../../../../../../react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAGvE,OAAO,EAAE,wBAAwB,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACzG,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,sBAAsB,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAErF,kGAAkG;AAElG;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,KAAY,EACZ,aAAqB,EACrB,gBAAwB,EACF,EAAE;IACxB,OAAO;QACL,GAAG,EAAE,uBAAuB;QAC5B,eAAe,EAAE,cAAc;QAC/B,4CAA4C;QAC5C,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE,EAAE;YACvB,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;YACtC,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC;QACzC,CAAC;QACD,YAAY,EAAE;YACZ,KAAK,EAAE;gBACL,6DAA6D;gBAC7D,eAAe,EAAE,UAAU,sBAAsB,QAAQ;aAC1D;YACD,UAAU,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,EAAE;gBAC5B,OAAO,CACL,oBAAC,uBAAuB,IACtB,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,OAAO,EAChB,KAAK,EAAE,KAAK,EACZ,gBAAgB,EAAE,gBAAgB,EAClC,aAAa,EAAE,aAAa,GAC5B,CACH,CAAC;YACJ,CAAC;YACD,2BAA2B,EAAE;gBAC3B,SAAS,EAAE,wBAAwB;aACpC;SACF;QACD,oBAAoB,EAAE;YACpB,wBAAwB;YACxB,aAAa,EAAE;gBACb,MAAM,EAAE,IAAI;aACb;YACD,YAAY,EAAE,GAAG,EAAE;gBACjB,OAAO,oBAAC,SAAS,OAAG,CAAC;YACvB,CAAC;YACD,YAAY,EAAE,sBAAsB,CAAC,KAAK,CAAC;YAC3C,QAAQ,EAAE,KAAK;SAChB;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,GAAgB,EAAE;IAClC,OAAO;IACL,qGAAqG;IACrG,oBAAC,KAAK;QACJ,oBAAC,IAAI,IAAC,QAAQ,EAAC,+BAA+B,EAAC,SAAS,EAAE,iCAAiC,GAAI;QAC/F,oBAAC,IAAI,IAAC,QAAQ,EAAC,gCAAgC,EAAC,SAAS,EAAE,kCAAkC,GAAI,CAC3F,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { Icon, Stack } from '@fluentui/react';\nimport { insertTable as insertTableAction } from './insertTableAction';\nimport type { RibbonButton } from 'roosterjs-react';\nimport type { Theme } from '@fluentui/react';\nimport { insertTableMenuTablePane, ribbonTableButtonStyle } from '../../../styles/RichTextEditor.styles';\nimport { RichTextInsertTablePane } from './RichTextInsertTablePane';\nimport { ColumnRowReplaceString, parseKey } from '../../../utils/RichTextTableUtils';\n\n// This file uses RoosterJS React package implementation with updates to UI components and styles.\n\n/**\n * \"Insert table\" button for the RoosterJS ribbon\n */\nexport const insertTableButton = (\n theme: Theme,\n maxRowsNumber: number,\n maxColumnsNumber: number\n): RibbonButton<string> => {\n return {\n key: 'buttonNameInsertTable',\n unlocalizedText: 'Insert table',\n // Icon will be set in onRenderIcon callback\n iconName: '',\n onClick: (editor, key) => {\n const { row, column } = parseKey(key);\n insertTableAction(editor, column, row);\n },\n dropDownMenu: {\n items: {\n // the key of the item is also used as a key for localization\n insertTablePane: `Insert ${ColumnRowReplaceString} table`\n },\n itemRender: (item, onClick) => {\n return (\n <RichTextInsertTablePane\n item={item}\n onClick={onClick}\n theme={theme}\n maxColumnsNumber={maxColumnsNumber}\n maxRowsNumber={maxRowsNumber}\n />\n );\n },\n commandBarSubMenuProperties: {\n className: insertTableMenuTablePane\n }\n },\n commandBarProperties: {\n // hide the chevron icon\n menuIconProps: {\n hidden: true\n },\n onRenderIcon: () => {\n return <TableIcon />;\n },\n buttonStyles: ribbonTableButtonStyle(theme),\n canCheck: false\n }\n };\n};\n\nconst TableIcon = (): JSX.Element => {\n return (\n // update the visibility of the Table Icon with css classes that are triggered by command bar's state\n <Stack>\n <Icon iconName=\"RichTextInsertTableFilledIcon\" className={'ribbon-table-button-filled-icon'} />\n <Icon iconName=\"RichTextInsertTableRegularIcon\" className={'ribbon-table-button-regular-icon'} />\n </Stack>\n );\n};\n"]}
@@ -20,7 +20,7 @@ export interface RichTextInputBoxComponentProps {
20
20
  disabled: boolean;
21
21
  actionComponents: ReactNode;
22
22
  onRenderAttachmentUploads?: () => JSX.Element;
23
- hasFiles?: boolean;
23
+ hasAttachments?: boolean;
24
24
  richTextEditorStyleProps: (isExpanded: boolean) => RichTextEditorStyleProps;
25
25
  isHorizontalLayoutDisabled?: boolean;
26
26
  }