@azure/communication-react 1.14.1-alpha-202403210013 → 1.14.1-alpha-202403261958

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 (358) hide show
  1. package/dist/communication-react.d.ts +44 -38
  2. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BgK9tOAk.js → RichTextSendBoxWrapper-BRqOsupu.js} +2 -2
  3. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BgK9tOAk.js.map → RichTextSendBoxWrapper-BRqOsupu.js.map} +1 -1
  4. package/dist/dist-cjs/communication-react/{index-B_kqOVlM.js → index-Ba2HAv_Y.js} +1304 -920
  5. package/dist/dist-cjs/communication-react/index-Ba2HAv_Y.js.map +1 -0
  6. package/dist/dist-cjs/communication-react/index.js +1 -1
  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 -2
  10. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  11. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js +0 -1
  12. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js.map +1 -1
  13. package/dist/dist-esm/calling-component-bindings/src/getRemoteParticipantsExcludingConsumers.js +0 -2
  14. package/dist/dist-esm/calling-component-bindings/src/getRemoteParticipantsExcludingConsumers.js.map +1 -1
  15. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +17 -16
  16. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  17. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +2 -4
  18. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
  19. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js +0 -2
  20. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js.map +1 -1
  21. package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
  22. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +0 -6
  23. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
  24. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.d.ts +0 -4
  25. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js +1 -9
  26. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js.map +1 -1
  27. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +12 -7
  28. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
  29. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +3 -10
  30. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
  31. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +1 -2
  32. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  33. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +1 -2
  34. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +0 -5
  35. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  36. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +2 -1
  37. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +19 -13
  38. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  39. package/dist/dist-esm/calling-stateful-client/src/Converter.js +0 -5
  40. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  41. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js +0 -1
  42. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js.map +1 -1
  43. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js +0 -5
  44. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js.map +1 -1
  45. package/dist/dist-esm/calling-stateful-client/src/LocalVideoStreamVideoEffectsSubscriber.js +0 -2
  46. package/dist/dist-esm/calling-stateful-client/src/LocalVideoStreamVideoEffectsSubscriber.js.map +1 -1
  47. package/dist/dist-esm/calling-stateful-client/src/ParticipantSubscriber.js +0 -3
  48. package/dist/dist-esm/calling-stateful-client/src/ParticipantSubscriber.js.map +1 -1
  49. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  50. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js +4 -1
  51. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
  52. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +5 -8
  53. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  54. package/dist/dist-esm/communication-react/src/index.js +0 -1
  55. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  56. package/dist/dist-esm/react-components/src/components/AttachmentCard.d.ts +39 -0
  57. package/dist/dist-esm/react-components/src/components/{FileCard.js → AttachmentCard.js} +17 -17
  58. package/dist/dist-esm/react-components/src/components/AttachmentCard.js.map +1 -0
  59. package/dist/dist-esm/react-components/src/components/AttachmentCardGroup.d.ts +16 -0
  60. package/dist/dist-esm/react-components/src/components/{FileCardGroup.js → AttachmentCardGroup.js} +5 -5
  61. package/dist/dist-esm/react-components/src/components/AttachmentCardGroup.js.map +1 -0
  62. package/dist/dist-esm/react-components/src/components/AttachmentDownloadCards.d.ts +49 -0
  63. package/dist/dist-esm/react-components/src/components/{FileDownloadCards.js → AttachmentDownloadCards.js} +19 -19
  64. package/dist/dist-esm/react-components/src/components/AttachmentDownloadCards.js.map +1 -0
  65. package/dist/dist-esm/react-components/src/components/{FileUploadCards.d.ts → AttachmentUploadCards.d.ts} +15 -15
  66. package/dist/dist-esm/react-components/src/components/AttachmentUploadCards.js +34 -0
  67. package/dist/dist-esm/react-components/src/components/AttachmentUploadCards.js.map +1 -0
  68. package/dist/dist-esm/react-components/src/components/CameraButton.js +0 -1
  69. package/dist/dist-esm/react-components/src/components/CameraButton.js.map +1 -1
  70. package/dist/dist-esm/react-components/src/components/Caption.js.map +1 -1
  71. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
  72. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.d.ts +1 -1
  73. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js +2 -2
  74. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js.map +1 -1
  75. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsRichTextEditBox.d.ts +1 -1
  76. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsRichTextEditBox.js +1 -1
  77. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsRichTextEditBox.js.map +1 -1
  78. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +1 -1
  79. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
  80. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.d.ts +1 -1
  81. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
  82. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +1 -1
  83. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
  84. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.d.ts +1 -1
  85. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
  86. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +1 -10
  87. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
  88. package/dist/dist-esm/react-components/src/components/ErrorBar.js.map +1 -1
  89. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js +5 -3
  90. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js.map +1 -1
  91. package/dist/dist-esm/react-components/src/components/MeetingReactionOverlay.d.ts +40 -0
  92. package/dist/dist-esm/react-components/src/components/MeetingReactionOverlay.js +77 -0
  93. package/dist/dist-esm/react-components/src/components/MeetingReactionOverlay.js.map +1 -0
  94. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +4 -5
  95. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  96. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +6 -4
  97. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
  98. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +1 -1
  99. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
  100. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.d.ts +3 -1
  101. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +20 -6
  102. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +1 -1
  103. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +1 -8
  104. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +42 -17
  105. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
  106. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.d.ts +2 -2
  107. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js +8 -8
  108. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js.map +1 -1
  109. package/dist/dist-esm/react-components/src/components/SendBox.d.ts +10 -10
  110. package/dist/dist-esm/react-components/src/components/SendBox.js +13 -13
  111. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  112. package/dist/dist-esm/react-components/src/components/SendBoxErrors.d.ts +2 -2
  113. package/dist/dist-esm/react-components/src/components/SendBoxErrors.js +7 -5
  114. package/dist/dist-esm/react-components/src/components/SendBoxErrors.js.map +1 -1
  115. package/dist/dist-esm/react-components/src/components/VideoGallery/ParticipantVideoTileOverlay.d.ts +15 -0
  116. package/dist/dist-esm/react-components/src/components/VideoGallery/ParticipantVideoTileOverlay.js +58 -0
  117. package/dist/dist-esm/react-components/src/components/VideoGallery/ParticipantVideoTileOverlay.js.map +1 -0
  118. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteContentShareReactionOverlay.d.ts +14 -0
  119. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteContentShareReactionOverlay.js +149 -0
  120. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteContentShareReactionOverlay.js.map +1 -0
  121. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.d.ts +4 -0
  122. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.js +14 -2
  123. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.js.map +1 -1
  124. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/reactionUtils.d.ts +11 -0
  125. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/reactionUtils.js +23 -0
  126. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/reactionUtils.js.map +1 -0
  127. package/dist/dist-esm/react-components/src/components/VideoGallery.js +7 -3
  128. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  129. package/dist/dist-esm/react-components/src/components/VideoTile.d.ts +5 -6
  130. package/dist/dist-esm/react-components/src/components/VideoTile.js +3 -51
  131. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  132. package/dist/dist-esm/react-components/src/components/index.d.ts +7 -5
  133. package/dist/dist-esm/react-components/src/components/index.js +3 -3
  134. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  135. package/dist/dist-esm/react-components/src/components/styles/ReactionOverlay.style.d.ts +70 -0
  136. package/dist/dist-esm/react-components/src/components/styles/ReactionOverlay.style.js +259 -0
  137. package/dist/dist-esm/react-components/src/components/styles/ReactionOverlay.style.js.map +1 -0
  138. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.d.ts +1 -1
  139. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +2 -2
  140. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +1 -1
  141. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.d.ts +4 -0
  142. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js +5 -1
  143. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js.map +1 -1
  144. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.d.ts +2 -2
  145. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js +2 -2
  146. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js.map +1 -1
  147. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.d.ts +2 -2
  148. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js +8 -1
  149. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js.map +1 -1
  150. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.d.ts +1 -1
  151. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js.map +1 -1
  152. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.d.ts +1 -1
  153. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js +6 -3
  154. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
  155. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +1 -1
  156. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +3 -1
  157. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  158. package/dist/dist-esm/react-components/src/components/utils/common.d.ts +3 -3
  159. package/dist/dist-esm/react-components/src/components/utils/common.js +3 -3
  160. package/dist/dist-esm/react-components/src/components/utils/common.js.map +1 -1
  161. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
  162. package/dist/dist-esm/react-components/src/localization/locales/ar-SA/strings.json +6 -6
  163. package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/strings.json +6 -6
  164. package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +6 -6
  165. package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +6 -6
  166. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +6 -6
  167. package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +6 -6
  168. package/dist/dist-esm/react-components/src/localization/locales/fi-FI/strings.json +6 -6
  169. package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +6 -6
  170. package/dist/dist-esm/react-components/src/localization/locales/he-IL/strings.json +6 -6
  171. package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +6 -6
  172. package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +6 -6
  173. package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +6 -6
  174. package/dist/dist-esm/react-components/src/localization/locales/nb-NO/strings.json +6 -6
  175. package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +6 -6
  176. package/dist/dist-esm/react-components/src/localization/locales/pl-PL/strings.json +6 -6
  177. package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +6 -6
  178. package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +6 -6
  179. package/dist/dist-esm/react-components/src/localization/locales/sv-SE/strings.json +6 -6
  180. package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +6 -6
  181. package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +6 -6
  182. package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +6 -6
  183. package/dist/dist-esm/react-components/src/theming/icons.js +0 -7
  184. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  185. package/dist/dist-esm/react-components/src/types/Attachment.d.ts +142 -0
  186. package/dist/dist-esm/{react-composites/src/composites/ChatComposite/file-sharing/FileUploadHandler.js → react-components/src/types/Attachment.js} +1 -1
  187. package/dist/dist-esm/react-components/src/types/Attachment.js.map +1 -0
  188. package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +1 -1
  189. package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
  190. package/dist/dist-esm/react-components/src/types/ReactionTypes.d.ts +5 -0
  191. package/dist/dist-esm/react-components/src/types/ReactionTypes.js.map +1 -1
  192. package/dist/dist-esm/react-components/src/types/index.d.ts +1 -0
  193. package/dist/dist-esm/react-components/src/types/index.js +1 -0
  194. package/dist/dist-esm/react-components/src/types/index.js.map +1 -1
  195. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +3 -3
  196. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  197. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  198. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -3
  199. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +18 -60
  200. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  201. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  202. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.js +0 -2
  203. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.js.map +1 -1
  204. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.js +3 -9
  205. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.js.map +1 -1
  206. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  207. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +14 -65
  208. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  209. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +2 -9
  210. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  211. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.d.ts +1 -1
  212. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.js +10 -10
  213. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.js.map +1 -1
  214. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +0 -9
  215. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
  216. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.d.ts +2 -0
  217. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +25 -13
  218. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  219. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.d.ts +10 -2
  220. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.js +3 -3
  221. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.js.map +1 -1
  222. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.d.ts +0 -1
  223. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js +1 -2
  224. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js.map +1 -1
  225. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +12 -7
  226. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
  227. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js +4 -18
  228. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js.map +1 -1
  229. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js +2 -9
  230. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js.map +1 -1
  231. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js +2 -22
  232. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js.map +1 -1
  233. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js +1 -6
  234. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js.map +1 -1
  235. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js +1 -6
  236. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js.map +1 -1
  237. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +6 -9
  238. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  239. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  240. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.d.ts +2 -0
  241. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +2 -2
  242. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  243. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +5 -27
  244. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  245. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/activeVideoBackgroundEffectSelector.js +0 -3
  246. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/activeVideoBackgroundEffectSelector.js.map +1 -1
  247. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +5 -0
  248. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +5 -1
  249. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  250. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.d.ts +2 -2
  251. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js +3 -12
  252. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js.map +1 -1
  253. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/getFirstSpotlightedRemoteParticipantSelector.d.ts +15 -0
  254. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/getFirstSpotlightedRemoteParticipantSelector.js +32 -0
  255. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/getFirstSpotlightedRemoteParticipantSelector.js.map +1 -0
  256. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localAndRemotePIPSelector.d.ts +10 -9
  257. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localAndRemotePIPSelector.js +28 -3
  258. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localAndRemotePIPSelector.js.map +1 -1
  259. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localVideoStreamSelector.js +0 -1
  260. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localVideoStreamSelector.js.map +1 -1
  261. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +0 -8
  262. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  263. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/spotlightUtils.d.ts +6 -0
  264. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/spotlightUtils.js +36 -0
  265. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/spotlightUtils.js.map +1 -1
  266. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/useConsoleErrors.js +0 -3
  267. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/useConsoleErrors.js.map +1 -1
  268. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +1 -2
  269. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +7 -20
  270. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  271. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +1 -1
  272. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  273. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +0 -8
  274. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  275. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.d.ts +1 -1
  276. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
  277. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +1 -10
  278. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  279. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.d.ts +1 -1
  280. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +2 -3
  281. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  282. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +1 -1
  283. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  284. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.d.ts +2 -2
  285. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js +5 -2
  286. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js.map +1 -1
  287. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapterProvider.js.map +1 -1
  288. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUpload.d.ts +2 -69
  289. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUpload.js.map +1 -1
  290. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.d.ts +0 -1
  291. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js +0 -1
  292. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js.map +1 -1
  293. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +5 -10
  294. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  295. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +7 -8
  296. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
  297. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js +11 -15
  298. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js.map +1 -1
  299. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.d.ts +4 -0
  300. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js +14 -3
  301. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js.map +1 -1
  302. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.d.ts +2 -0
  303. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +16 -17
  304. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
  305. package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.d.ts +0 -3
  306. package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.js +1 -6
  307. package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.js.map +1 -1
  308. package/dist/dist-esm/react-composites/src/composites/common/TabHeader.d.ts +0 -1
  309. package/dist/dist-esm/react-composites/src/composites/common/TabHeader.js +1 -4
  310. package/dist/dist-esm/react-composites/src/composites/common/TabHeader.js.map +1 -1
  311. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +2 -29
  312. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  313. package/dist/dist-esm/react-composites/src/composites/common/icons.js +0 -8
  314. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  315. package/dist/dist-esm/react-composites/src/composites/common/resolveVideoEffectDependency.js +0 -1
  316. package/dist/dist-esm/react-composites/src/composites/common/resolveVideoEffectDependency.js.map +1 -1
  317. package/dist/dist-esm/react-composites/src/composites/common/resolveVideoEffectDependencyLazy.js +0 -1
  318. package/dist/dist-esm/react-composites/src/composites/common/resolveVideoEffectDependencyLazy.js.map +1 -1
  319. package/dist/dist-esm/react-composites/src/composites/common/styles/ParticipantContainer.styles.d.ts +5 -1
  320. package/dist/dist-esm/react-composites/src/composites/common/styles/ParticipantContainer.styles.js +29 -0
  321. package/dist/dist-esm/react-composites/src/composites/common/styles/ParticipantContainer.styles.js.map +1 -1
  322. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.d.ts +5 -0
  323. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.js.map +1 -1
  324. package/dist/dist-esm/react-composites/src/composites/index.js +0 -2
  325. package/dist/dist-esm/react-composites/src/composites/index.js.map +1 -1
  326. package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json +2 -0
  327. package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +2 -0
  328. package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +2 -0
  329. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +2 -0
  330. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +2 -0
  331. package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +2 -0
  332. package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json +2 -0
  333. package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +2 -0
  334. package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/strings.json +2 -0
  335. package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +2 -0
  336. package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +2 -0
  337. package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +2 -0
  338. package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/strings.json +2 -0
  339. package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +2 -0
  340. package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/strings.json +2 -0
  341. package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +2 -0
  342. package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +2 -0
  343. package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/strings.json +2 -0
  344. package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +2 -0
  345. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +2 -0
  346. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +2 -0
  347. package/package.json +1 -1
  348. package/dist/dist-cjs/communication-react/index-B_kqOVlM.js.map +0 -1
  349. package/dist/dist-esm/react-components/src/components/FileCard.d.ts +0 -39
  350. package/dist/dist-esm/react-components/src/components/FileCard.js.map +0 -1
  351. package/dist/dist-esm/react-components/src/components/FileCardGroup.d.ts +0 -16
  352. package/dist/dist-esm/react-components/src/components/FileCardGroup.js.map +0 -1
  353. package/dist/dist-esm/react-components/src/components/FileDownloadCards.d.ts +0 -114
  354. package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +0 -1
  355. package/dist/dist-esm/react-components/src/components/FileUploadCards.js +0 -34
  356. package/dist/dist-esm/react-components/src/components/FileUploadCards.js.map +0 -1
  357. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadHandler.d.ts +0 -10
  358. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadHandler.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteVideoTile.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/RemoteVideoTile.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAwB,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAiB,WAAW,EAAE,MAAM,OAAO,CAAC;AASnD,OAAO,EAAE,WAAW,EAAwB,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AACpH,OAAO,EAEL,uCAAuC,EACxC,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,+BAA+B,EAAE,MAAM,gDAAgD,CAAC;AACjG,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,qDAAqD;AACrD,OAAO,EAAE,aAAa,EAAE,mCAAgC;AAIxD;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,KAAK,CAAC,IAAI,CACxC,CAAC,KAiCA,EAAE,EAAE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AC,IAAI;YACf,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,WAAW,EAAE,GAAG,EAAE;;gBAChB,MAAA,IAAI,CAAC,OAAO,oDAAI,CAAC;gBACjB,cAAc,aAAd,cAAc,uBAAd,cAAc,EAAI,CAAC;YACrB,CAAC;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IContextualMenuProps, Layer, Stack } from '@fluentui/react';\nimport React, { useMemo } from 'react';\nimport { KeyboardEvent, useCallback } from 'react';\nimport {\n CreateVideoStreamViewResult,\n OnRenderAvatarCallback,\n ParticipantState,\n VideoGalleryRemoteParticipant,\n VideoStreamOptions,\n ViewScalingMode\n} from '../types';\nimport { _DrawerMenu, _DrawerMenuItemProps } from './Drawer';\nimport { StreamMedia } from './StreamMedia';\nimport { VideoGalleryStrings } from './VideoGallery';\nimport { drawerMenuWrapperStyles, remoteVideoTileWrapperStyle } from './VideoGallery/styles/RemoteVideoTile.styles';\nimport {\n RemoteVideoStreamLifecycleMaintainerProps,\n useRemoteVideoStreamLifecycleMaintainer\n} from './VideoGallery/useVideoStreamLifecycleMaintainer';\nimport { useVideoTileContextualMenuProps } from './VideoGallery/useVideoTileContextualMenuProps';\nimport { VideoTile } from './VideoTile';\n/* @conditional-compile-remove(hide-attendee-name) */\nimport { _formatString } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(reaction) */\nimport { ReactionResources } from '../types/ReactionTypes';\n\n/**\n * A memoized version of VideoTile for rendering remote participants. React.memo is used for a performance\n * boost by memoizing the same rendered component to avoid rerendering a VideoTile when its position in the\n * array changes causing a rerender in the parent component. https://reactjs.org/docs/react-api.html#reactmemo\n *\n * @internal\n */\nexport const _RemoteVideoTile = React.memo(\n (props: {\n userId: string;\n remoteParticipant: VideoGalleryRemoteParticipant;\n onCreateRemoteStreamView?: (\n userId: string,\n options?: VideoStreamOptions\n ) => Promise<void | CreateVideoStreamViewResult>;\n onDisposeRemoteStreamView?: (userId: string) => Promise<void>;\n isAvailable?: boolean;\n isReceiving?: boolean;\n isScreenSharingOn?: boolean; // TODO: Remove this once onDisposeRemoteStreamView no longer disposes of screen share stream\n renderElement?: HTMLElement;\n remoteVideoViewOptions?: VideoStreamOptions;\n onRenderAvatar?: OnRenderAvatarCallback;\n showMuteIndicator?: boolean;\n showLabel?: boolean;\n personaMinSize?: number;\n strings: VideoGalleryStrings;\n participantState?: ParticipantState;\n menuKind?: 'contextual' | 'drawer';\n drawerMenuHostId?: string;\n onPinParticipant?: (userId: string) => void;\n onUnpinParticipant?: (userId: string) => void;\n onUpdateScalingMode?: (userId: string, scalingMode: ViewScalingMode) => void;\n isPinned?: boolean;\n /* @conditional-compile-remove(spotlight) */ spotlightedParticipantUserIds?: string[];\n /* @conditional-compile-remove(spotlight) */ isSpotlighted?: boolean;\n /* @conditional-compile-remove(spotlight) */ onStartSpotlight?: (userIds: string[]) => void;\n /* @conditional-compile-remove(spotlight) */ onStopSpotlight?: (userIds: string[]) => void;\n /* @conditional-compile-remove(spotlight) */ maxParticipantsToSpotlight?: number;\n disablePinMenuItem?: boolean;\n toggleAnnouncerString?: (announcerString: string) => void;\n /* @conditional-compile-remove(reaction) */ reactionResources?: ReactionResources;\n }) => {\n const {\n isAvailable,\n isReceiving = true, // default to true to prevent any breaking change\n isScreenSharingOn,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteVideoViewOptions,\n renderElement,\n userId,\n onRenderAvatar,\n showMuteIndicator,\n remoteParticipant,\n participantState,\n menuKind,\n isPinned,\n onPinParticipant,\n onUnpinParticipant,\n /* @conditional-compile-remove(spotlight) */ spotlightedParticipantUserIds,\n /* @conditional-compile-remove(spotlight) */ isSpotlighted,\n /* @conditional-compile-remove(spotlight) */ onStartSpotlight,\n /* @conditional-compile-remove(spotlight) */ onStopSpotlight,\n /* @conditional-compile-remove(spotlight) */ maxParticipantsToSpotlight,\n onUpdateScalingMode,\n disablePinMenuItem,\n toggleAnnouncerString,\n strings,\n /* @conditional-compile-remove(reaction) */ reactionResources\n } = props;\n\n const remoteVideoStreamProps: RemoteVideoStreamLifecycleMaintainerProps = useMemo(\n () => ({\n isMirrored: remoteVideoViewOptions?.isMirrored,\n isScreenSharingOn,\n isStreamAvailable: isAvailable,\n isStreamReceiving: isReceiving,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteParticipantId: userId,\n renderElementExists: !!renderElement,\n scalingMode: remoteVideoViewOptions?.scalingMode\n }),\n [\n isAvailable,\n isReceiving,\n isScreenSharingOn,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteVideoViewOptions?.isMirrored,\n remoteVideoViewOptions?.scalingMode,\n renderElement,\n userId\n ]\n );\n\n // Handle creating, destroying and updating the video stream as necessary\n const createVideoStreamResult = useRemoteVideoStreamLifecycleMaintainer(remoteVideoStreamProps);\n const contextualMenuProps = useVideoTileContextualMenuProps({\n participant: remoteParticipant,\n view: createVideoStreamResult?.view,\n strings: { ...props.strings },\n isPinned,\n onPinParticipant,\n onUnpinParticipant,\n onUpdateScalingMode,\n disablePinMenuItem,\n toggleAnnouncerString,\n /* @conditional-compile-remove(spotlight) */ spotlightedParticipantUserIds,\n /* @conditional-compile-remove(spotlight) */ isSpotlighted,\n /* @conditional-compile-remove(spotlight) */ onStartSpotlight,\n /* @conditional-compile-remove(spotlight) */ onStopSpotlight,\n /* @conditional-compile-remove(spotlight) */ maxParticipantsToSpotlight\n });\n\n const videoTileContextualMenuProps = useMemo(() => {\n if (menuKind !== 'contextual' || !contextualMenuProps) {\n return {};\n }\n return {\n contextualMenu: contextualMenuProps\n };\n }, [contextualMenuProps, menuKind]);\n\n const showLoadingIndicator = isAvailable && isReceiving === false && participantState !== 'Disconnected';\n\n const [drawerMenuItemProps, setDrawerMenuItemProps] = React.useState<_DrawerMenuItemProps[]>([]);\n\n const renderVideoStreamElement = useMemo(() => {\n // Checking if renderElement is well defined or not as calling SDK has a number of video streams limitation which\n // implies that, after their threshold, all streams have no child (blank video)\n if (!renderElement || !renderElement.childElementCount) {\n // Returning `undefined` results in the placeholder with avatar being shown\n return undefined;\n }\n\n return (\n <StreamMedia videoStreamElement={renderElement} loadingState={showLoadingIndicator ? 'loading' : 'none'} />\n );\n }, [renderElement, showLoadingIndicator]);\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === 'Enter') {\n setDrawerMenuItemProps(\n convertContextualMenuItemsToDrawerMenuItemProps(contextualMenuProps, () => setDrawerMenuItemProps([]))\n );\n }\n },\n [setDrawerMenuItemProps, contextualMenuProps]\n );\n\n let displayName = remoteParticipant.displayName || strings.displayNamePlaceholder;\n /* @conditional-compile-remove(hide-attendee-name) */\n const attendeeRoleString = props.strings?.attendeeRole;\n\n /* @conditional-compile-remove(hide-attendee-name) */\n const formatDisplayName = (): string => {\n if (displayName && attendeeRoleString) {\n return _formatString(displayName, { AttendeeRole: attendeeRoleString });\n }\n return displayName;\n };\n\n /* @conditional-compile-remove(hide-attendee-name) */\n displayName = formatDisplayName();\n return (\n <Stack\n tabIndex={menuKind === 'drawer' ? 0 : undefined}\n onKeyDown={menuKind === 'drawer' ? onKeyDown : undefined}\n style={remoteVideoTileWrapperStyle}\n >\n <VideoTile\n key={userId}\n userId={userId}\n initialsName={remoteParticipant.displayName ?? ''}\n renderElement={renderVideoStreamElement}\n displayName={displayName}\n onRenderPlaceholder={onRenderAvatar}\n isMuted={remoteParticipant.isMuted}\n raisedHand={remoteParticipant.raisedHand}\n /* @conditional-compile-remove(reaction) */\n reaction={remoteParticipant.reaction}\n isSpeaking={remoteParticipant.isSpeaking}\n showMuteIndicator={showMuteIndicator}\n personaMinSize={props.personaMinSize}\n showLabel={props.showLabel}\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n participantState={participantState}\n {...videoTileContextualMenuProps}\n isPinned={props.isPinned}\n onLongTouch={() =>\n setDrawerMenuItemProps(\n convertContextualMenuItemsToDrawerMenuItemProps(contextualMenuProps, () => setDrawerMenuItemProps([]))\n )\n }\n /* @conditional-compile-remove(spotlight) */\n isSpotlighted={isSpotlighted}\n /* @conditional-compile-remove(reaction) */\n reactionResources={reactionResources}\n />\n {drawerMenuItemProps.length > 0 && (\n <Layer hostId={props.drawerMenuHostId}>\n <Stack styles={drawerMenuWrapperStyles}>\n <_DrawerMenu\n onLightDismiss={() => setDrawerMenuItemProps([])}\n items={drawerMenuItemProps}\n heading={remoteParticipant.displayName}\n />\n </Stack>\n </Layer>\n )}\n </Stack>\n );\n }\n);\n\nconst convertContextualMenuItemsToDrawerMenuItemProps = (\n contextualMenuProps?: IContextualMenuProps,\n onLightDismiss?: () => void\n): _DrawerMenuItemProps[] => {\n if (!contextualMenuProps) {\n return [];\n }\n return contextualMenuProps.items.map((item) => {\n return {\n itemKey: item.key,\n text: item.text,\n iconProps: item.iconProps,\n disabled: item.disabled,\n onItemClick: () => {\n item.onClick?.();\n onLightDismiss?.();\n }\n };\n });\n};\n"]}
1
+ {"version":3,"file":"RemoteVideoTile.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/RemoteVideoTile.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAwB,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAiB,WAAW,EAAE,MAAM,OAAO,CAAC;AASnD,OAAO,EAAE,WAAW,EAAwB,MAAM,UAAU,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,uBAAuB,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AACpH,OAAO,EAEL,uCAAuC,EACxC,MAAM,kDAAkD,CAAC;AAC1D,OAAO,EAAE,+BAA+B,EAAE,MA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EAAE,mBAAmB,EAC1B,OAAO,EAAE,iBAAiB,CAAC,WAAW,GACtC,CACI,CACF,CACT,CACK,CACT,CAAC;AACJ,CAAC,CACF,CAAC;AAEF,MAAM,+CAA+C,GAAG,CACtD,mBAA0C,EAC1C,cAA2B,EACH,EAAE;IAC1B,IAAI,CAAC,mBAAmB,EAAE,CAAC;QACzB,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,OAAO,mBAAmB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC5C,OAAO;YACL,OAAO,EAAE,IAAI,CAAC,GAAG;YACjB,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,WAAW,EAAE,GAAG,EAAE;;gBAChB,MAAA,IAAI,CAAC,OAAO,oDAAI,CAAC;gBACjB,cAAc,aAAd,cAAc,uBAAd,cAAc,EAAI,CAAC;YACrB,CAAC;SACF,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { IContextualMenuProps, Layer, Stack } from '@fluentui/react';\nimport React, { useMemo } from 'react';\nimport { KeyboardEvent, useCallback } from 'react';\nimport {\n CreateVideoStreamViewResult,\n OnRenderAvatarCallback,\n ParticipantState,\n VideoGalleryRemoteParticipant,\n VideoStreamOptions,\n ViewScalingMode\n} from '../types';\nimport { _DrawerMenu, _DrawerMenuItemProps } from './Drawer';\nimport { StreamMedia } from './StreamMedia';\nimport { VideoGalleryStrings } from './VideoGallery';\nimport { drawerMenuWrapperStyles, remoteVideoTileWrapperStyle } from './VideoGallery/styles/RemoteVideoTile.styles';\nimport {\n RemoteVideoStreamLifecycleMaintainerProps,\n useRemoteVideoStreamLifecycleMaintainer\n} from './VideoGallery/useVideoStreamLifecycleMaintainer';\nimport { useVideoTileContextualMenuProps } from './VideoGallery/useVideoTileContextualMenuProps';\nimport { VideoTile } from './VideoTile';\n/* @conditional-compile-remove(hide-attendee-name) */\nimport { _formatString } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(reaction) */\nimport { ReactionResources } from '../types/ReactionTypes';\n/* @conditional-compile-remove(reaction) */\nimport { MeetingReactionOverlay } from './MeetingReactionOverlay';\n\n/**\n * A memoized version of VideoTile for rendering remote participants. React.memo is used for a performance\n * boost by memoizing the same rendered component to avoid rerendering a VideoTile when its position in the\n * array changes causing a rerender in the parent component. https://reactjs.org/docs/react-api.html#reactmemo\n *\n * @internal\n */\nexport const _RemoteVideoTile = React.memo(\n (props: {\n userId: string;\n remoteParticipant: VideoGalleryRemoteParticipant;\n onCreateRemoteStreamView?: (\n userId: string,\n options?: VideoStreamOptions\n ) => Promise<void | CreateVideoStreamViewResult>;\n onDisposeRemoteStreamView?: (userId: string) => Promise<void>;\n isAvailable?: boolean;\n isReceiving?: boolean;\n isScreenSharingOn?: boolean; // TODO: Remove this once onDisposeRemoteStreamView no longer disposes of screen share stream\n renderElement?: HTMLElement;\n remoteVideoViewOptions?: VideoStreamOptions;\n onRenderAvatar?: OnRenderAvatarCallback;\n showMuteIndicator?: boolean;\n showLabel?: boolean;\n personaMinSize?: number;\n strings: VideoGalleryStrings;\n participantState?: ParticipantState;\n menuKind?: 'contextual' | 'drawer';\n drawerMenuHostId?: string;\n onPinParticipant?: (userId: string) => void;\n onUnpinParticipant?: (userId: string) => void;\n onUpdateScalingMode?: (userId: string, scalingMode: ViewScalingMode) => void;\n isPinned?: boolean;\n /* @conditional-compile-remove(spotlight) */ spotlightedParticipantUserIds?: string[];\n /* @conditional-compile-remove(spotlight) */ isSpotlighted?: boolean;\n /* @conditional-compile-remove(spotlight) */ onStartSpotlight?: (userIds: string[]) => void;\n /* @conditional-compile-remove(spotlight) */ onStopSpotlight?: (userIds: string[]) => void;\n /* @conditional-compile-remove(spotlight) */ maxParticipantsToSpotlight?: number;\n disablePinMenuItem?: boolean;\n toggleAnnouncerString?: (announcerString: string) => void;\n /* @conditional-compile-remove(reaction) */ reactionResources?: ReactionResources;\n }) => {\n const {\n isAvailable,\n isReceiving = true, // default to true to prevent any breaking change\n isScreenSharingOn,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteVideoViewOptions,\n renderElement,\n userId,\n onRenderAvatar,\n showMuteIndicator,\n remoteParticipant,\n participantState,\n menuKind,\n isPinned,\n onPinParticipant,\n onUnpinParticipant,\n /* @conditional-compile-remove(spotlight) */ spotlightedParticipantUserIds,\n /* @conditional-compile-remove(spotlight) */ isSpotlighted,\n /* @conditional-compile-remove(spotlight) */ onStartSpotlight,\n /* @conditional-compile-remove(spotlight) */ onStopSpotlight,\n /* @conditional-compile-remove(spotlight) */ maxParticipantsToSpotlight,\n onUpdateScalingMode,\n disablePinMenuItem,\n toggleAnnouncerString,\n strings,\n /* @conditional-compile-remove(reaction) */ reactionResources\n } = props;\n\n const remoteVideoStreamProps: RemoteVideoStreamLifecycleMaintainerProps = useMemo(\n () => ({\n isMirrored: remoteVideoViewOptions?.isMirrored,\n isScreenSharingOn,\n isStreamAvailable: isAvailable,\n isStreamReceiving: isReceiving,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteParticipantId: userId,\n renderElementExists: !!renderElement,\n scalingMode: remoteVideoViewOptions?.scalingMode\n }),\n [\n isAvailable,\n isReceiving,\n isScreenSharingOn,\n onCreateRemoteStreamView,\n onDisposeRemoteStreamView,\n remoteVideoViewOptions?.isMirrored,\n remoteVideoViewOptions?.scalingMode,\n renderElement,\n userId\n ]\n );\n\n // Handle creating, destroying and updating the video stream as necessary\n const createVideoStreamResult = useRemoteVideoStreamLifecycleMaintainer(remoteVideoStreamProps);\n const contextualMenuProps = useVideoTileContextualMenuProps({\n participant: remoteParticipant,\n view: createVideoStreamResult?.view,\n strings: { ...props.strings },\n isPinned,\n onPinParticipant,\n onUnpinParticipant,\n onUpdateScalingMode,\n disablePinMenuItem,\n toggleAnnouncerString,\n /* @conditional-compile-remove(spotlight) */ spotlightedParticipantUserIds,\n /* @conditional-compile-remove(spotlight) */ isSpotlighted,\n /* @conditional-compile-remove(spotlight) */ onStartSpotlight,\n /* @conditional-compile-remove(spotlight) */ onStopSpotlight,\n /* @conditional-compile-remove(spotlight) */ maxParticipantsToSpotlight\n });\n\n const videoTileContextualMenuProps = useMemo(() => {\n if (menuKind !== 'contextual' || !contextualMenuProps) {\n return {};\n }\n return {\n contextualMenu: contextualMenuProps\n };\n }, [contextualMenuProps, menuKind]);\n\n const showLoadingIndicator = isAvailable && isReceiving === false && participantState !== 'Disconnected';\n\n const [drawerMenuItemProps, setDrawerMenuItemProps] = React.useState<_DrawerMenuItemProps[]>([]);\n\n const renderVideoStreamElement = useMemo(() => {\n // Checking if renderElement is well defined or not as calling SDK has a number of video streams limitation which\n // implies that, after their threshold, all streams have no child (blank video)\n if (!renderElement || !renderElement.childElementCount) {\n // Returning `undefined` results in the placeholder with avatar being shown\n return undefined;\n }\n\n return (\n <StreamMedia videoStreamElement={renderElement} loadingState={showLoadingIndicator ? 'loading' : 'none'} />\n );\n }, [renderElement, showLoadingIndicator]);\n\n const onKeyDown = useCallback(\n (e: KeyboardEvent) => {\n if (e.key === 'Enter') {\n setDrawerMenuItemProps(\n convertContextualMenuItemsToDrawerMenuItemProps(contextualMenuProps, () => setDrawerMenuItemProps([]))\n );\n }\n },\n [setDrawerMenuItemProps, contextualMenuProps]\n );\n\n let displayName = remoteParticipant.displayName || strings.displayNamePlaceholder;\n /* @conditional-compile-remove(hide-attendee-name) */\n const attendeeRoleString = props.strings?.attendeeRole;\n\n /* @conditional-compile-remove(hide-attendee-name) */\n const formatDisplayName = (): string => {\n if (displayName && attendeeRoleString) {\n return _formatString(displayName, { AttendeeRole: attendeeRoleString });\n }\n return displayName;\n };\n\n /* @conditional-compile-remove(reaction) */\n const reactionOverlay = (\n <MeetingReactionOverlay\n overlayMode=\"grid-tiles\"\n reaction={remoteParticipant.reaction}\n reactionResources={reactionResources!}\n />\n );\n\n /* @conditional-compile-remove(hide-attendee-name) */\n displayName = formatDisplayName();\n return (\n <Stack\n tabIndex={menuKind === 'drawer' ? 0 : undefined}\n onKeyDown={menuKind === 'drawer' ? onKeyDown : undefined}\n style={remoteVideoTileWrapperStyle}\n >\n <VideoTile\n key={userId}\n userId={userId}\n initialsName={remoteParticipant.displayName ?? ''}\n renderElement={renderVideoStreamElement}\n displayName={displayName}\n onRenderPlaceholder={onRenderAvatar}\n isMuted={remoteParticipant.isMuted}\n raisedHand={remoteParticipant.raisedHand}\n isSpeaking={remoteParticipant.isSpeaking}\n showMuteIndicator={showMuteIndicator}\n personaMinSize={props.personaMinSize}\n showLabel={props.showLabel}\n /* @conditional-compile-remove(one-to-n-calling) */\n /* @conditional-compile-remove(PSTN-calls) */\n participantState={participantState}\n {...videoTileContextualMenuProps}\n isPinned={props.isPinned}\n onLongTouch={() =>\n setDrawerMenuItemProps(\n convertContextualMenuItemsToDrawerMenuItemProps(contextualMenuProps, () => setDrawerMenuItemProps([]))\n )\n }\n /* @conditional-compile-remove(spotlight) */\n isSpotlighted={isSpotlighted}\n /* @conditional-compile-remove(reaction) */\n overlay={reactionOverlay}\n />\n {drawerMenuItemProps.length > 0 && (\n <Layer hostId={props.drawerMenuHostId}>\n <Stack styles={drawerMenuWrapperStyles}>\n <_DrawerMenu\n onLightDismiss={() => setDrawerMenuItemProps([])}\n items={drawerMenuItemProps}\n heading={remoteParticipant.displayName}\n />\n </Stack>\n </Layer>\n )}\n </Stack>\n );\n }\n);\n\nconst convertContextualMenuItemsToDrawerMenuItemProps = (\n contextualMenuProps?: IContextualMenuProps,\n onLightDismiss?: () => void\n): _DrawerMenuItemProps[] => {\n if (!contextualMenuProps) {\n return [];\n }\n return contextualMenuProps.items.map((item) => {\n return {\n itemKey: item.key,\n text: item.text,\n iconProps: item.iconProps,\n disabled: item.disabled,\n onItemClick: () => {\n item.onClick?.();\n onLightDismiss?.();\n }\n };\n });\n};\n"]}
@@ -71,7 +71,7 @@ export const RichTextEditor = React.forwardRef((props, ref) => {
71
71
  }, [strings, ribbonPlugin, theme]);
72
72
  return (React.createElement("div", { "data-testid": 'rich-text-editor-wrapper' },
73
73
  showRichTextEditorFormatting && ribbon,
74
- React.createElement("div", { className: richTextEditorWrapperStyle(theme, !showRichTextEditorFormatting, showRichTextEditorFormatting) },
74
+ React.createElement("div", { className: richTextEditorWrapperStyle(theme, !showRichTextEditorFormatting) },
75
75
  React.createElement(Rooster, { initialContent: initialContent, inDarkMode: isDarkThemed(theme), plugins: plugins, className: richTextEditorStyle(props.styles), editorCreator: editorCreator,
76
76
  // TODO: confirm the color during inline images implementation
77
77
  imageSelectionBorderColor: 'blue',
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextEditor.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/RichTextEditor/RichTextEditor.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC7G,OAAO,EACL,iBAAiB,EACjB,yBAAyB,EACzB,WAAW,EACX,0BAA0B,EAC1B,mBAAmB,EACpB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAE9E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAqCxD;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG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CAAC,CAAC,CAAC;IAEnC,OAAO,CACL,4CAAkB,0BAA0B;QACzC,4BAA4B,IAAI,MAAM;QACvC,6BAAK,SAAS,EAAE,0BAA0B,CAAC,KAAK,EAAE,CAAC,4BAA4B,EAAE,4BAA4B,CAAC;YAC5G,oBAAC,OAAO,IACN,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,YAAY,CAAC,KAAK,CAAC,EAC/B,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,mBAAmB,CAAC,KAAK,CAAC,MAAM,CAAC,EAC5C,aAAa,EAAE,aAAa;gBAC5B,8DAA8D;gBAC9D,yBAAyB,EAAE,MAAM;gBACjC,2FAA2F;gBAC3F,sBAAsB,EAAE,IAAI,iBACf,0BAA0B;gBACvC,+EAA+E;gBAC/E,SAAS,EAAE,KAAK,CAAC,SAAS,GAC1B,CACE,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';\nimport { ContentEdit, Watermark } from 'roosterjs-editor-plugins';\nimport { Editor } from 'roosterjs-editor-core';\nimport type { EditorOptions, IEditor } from 'roosterjs-editor-types-compatible';\nimport { Rooster, createUpdateContentPlugin, UpdateMode, createRibbonPlugin, Ribbon } from 'roosterjs-react';\nimport {\n ribbonButtonStyle,\n ribbonOverflowButtonStyle,\n ribbonStyle,\n richTextEditorWrapperStyle,\n richTextEditorStyle\n} from '../styles/RichTextEditor.styles';\nimport { useTheme } from '../../theming';\nimport { ribbonButtons, ribbonButtonsStrings } from './RichTextRibbonButtons';\nimport { RichTextSendBoxStrings } from './RichTextSendBox';\nimport { isDarkThemed } from '../../theming/themeUtils';\n\n/**\n * Props for {@link RichTextEditor}.\n *\n * @private\n */\nexport interface RichTextEditorStyleProps {\n minHeight: string;\n maxHeight: string;\n}\n\n/**\n * Props for {@link RichTextEditor}.\n *\n * @private\n */\nexport interface RichTextEditorProps {\n initialContent?: string;\n onChange: (newValue?: string) => void;\n onKeyDown?: (ev: React.KeyboardEvent<HTMLElement>) => void;\n placeholderText?: string;\n strings: Partial<RichTextSendBoxStrings>;\n showRichTextEditorFormatting: boolean;\n styles: RichTextEditorStyleProps;\n}\n\n/**\n * Props for {@link RichTextEditor}.\n *\n * @beta\n */\nexport interface RichTextEditorComponentRef {\n focus: () => void;\n setEmptyContent: () => void;\n}\n\n/**\n * A component to wrap RoosterJS Rich Text Editor.\n *\n * @beta\n */\nexport const RichTextEditor = React.forwardRef<RichTextEditorComponentRef, RichTextEditorProps>((props, ref) => {\n const { initialContent, onChange, placeholderText, strings, showRichTextEditorFormatting } = props;\n const editor = useRef<IEditor | null>(null);\n const theme = useTheme();\n useImperativeHandle(\n ref,\n () => {\n return {\n focus() {\n if (editor.current) {\n editor.current.focus();\n }\n },\n setEmptyContent() {\n if (editor.current) {\n editor.current.setContent('');\n }\n }\n };\n },\n []\n );\n\n const ribbonPlugin = React.useMemo(() => {\n return createRibbonPlugin();\n }, []);\n\n const editorCreator = useCallback((div: HTMLDivElement, options: EditorOptions) => {\n editor.current = new Editor(div, options);\n // Remove default values for background color and color\n // setBackgroundColor and setTextColor can't be used here as they cause the editor to be focused\n // color will be set in richTextEditorWrapperStyle instead of inline styles\n div.style.backgroundColor = '';\n div.style.color = '';\n\n return editor.current;\n }, []);\n\n const placeholderPlugin = React.useMemo(() => {\n return new Watermark('');\n }, []);\n\n useEffect(() => {\n if (placeholderText !== undefined) {\n placeholderPlugin.updateWatermark(placeholderText);\n }\n }, [placeholderPlugin, placeholderText]);\n\n const plugins = useMemo(() => {\n const contentEdit = new ContentEdit();\n const updateContentPlugin = createUpdateContentPlugin(\n UpdateMode.OnContentChangedEvent | UpdateMode.OnUserInput,\n (content: string) => {\n onChange && onChange(content);\n }\n );\n return [contentEdit, placeholderPlugin, updateContentPlugin, ribbonPlugin];\n }, [onChange, placeholderPlugin, ribbonPlugin]);\n\n const ribbon = useMemo(() => {\n const buttons = ribbonButtons(theme);\n\n return (\n <Ribbon\n styles={ribbonStyle}\n buttons={buttons}\n plugin={ribbonPlugin}\n overflowButtonProps={{\n styles: ribbonButtonStyle(theme),\n menuProps: {\n items: [], // CommandBar will determine items rendered in overflow\n isBeakVisible: false,\n styles: ribbonOverflowButtonStyle(theme)\n }\n }}\n strings={ribbonButtonsStrings(strings)}\n data-testid={'rich-text-editor-ribbon'}\n />\n );\n }, [strings, ribbonPlugin, theme]);\n\n return (\n <div data-testid={'rich-text-editor-wrapper'}>\n {showRichTextEditorFormatting && ribbon}\n <div className={richTextEditorWrapperStyle(theme, !showRichTextEditorFormatting, showRichTextEditorFormatting)}>\n <Rooster\n initialContent={initialContent}\n inDarkMode={isDarkThemed(theme)}\n plugins={plugins}\n className={richTextEditorStyle(props.styles)}\n editorCreator={editorCreator}\n // TODO: confirm the color during inline images implementation\n imageSelectionBorderColor={'blue'}\n // doNotAdjustEditorColor is used to fix the default background color for Rooster component\n doNotAdjustEditorColor={true}\n data-testid={'rooster-rich-text-editor'}\n // if we don't use 'allowKeyboardEventPropagation' only the enter key is caught\n onKeyDown={props.onKeyDown}\n />\n </div>\n </div>\n );\n});\n"]}
1
+ {"version":3,"file":"RichTextEditor.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/RichTextEditor/RichTextEditor.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAE/C,OAAO,EAAE,OAAO,EAAE,yBAAyB,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAC7G,OAAO,EACL,iBAAiB,EACjB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AAiB,CAAC,KAAK,CAAC;gBAChC,SAAS,EAAE;oBACT,KAAK,EAAE,EAAE,EAAE,uDAAuD;oBAClE,aAAa,EAAE,KAAK;oBACpB,MAAM,EAAE,yBAAyB,CAAC,KAAK,CAAC;iBACzC;aACF,EACD,OAAO,EAAE,oBAAoB,CAAC,OAAO,CAAC,iBACzB,yBAAyB,GACtC,CACH,CAAC;IACJ,CAAC,EAAE,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC,CAAC;IAEnC,OAAO,CACL,4CAAkB,0BAA0B;QACzC,4BAA4B,IAAI,MAAM;QACvC,6BAAK,SAAS,EAAE,0BAA0B,CAAC,KAAK,EAAE,CAAC,4BAA4B,CAAC;YAC9E,oBAAC,OAAO,IACN,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,YAAY,CAAC,KAAK,CAAC,EAC/B,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,mBAAmB,CAAC,KAAK,CAAC,MAAM,CAAC,EAC5C,aAAa,EAAE,aAAa;gBAC5B,8DAA8D;gBAC9D,yBAAyB,EAAE,MAAM;gBACjC,2FAA2F;gBAC3F,sBAAsB,EAAE,IAAI,iBACf,0BAA0B;gBACvC,+EAA+E;gBAC/E,SAAS,EAAE,KAAK,CAAC,SAAS,GAC1B,CACE,CACF,CACP,CAAC;AACJ,CAAC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';\nimport { ContentEdit, Watermark } from 'roosterjs-editor-plugins';\nimport { Editor } from 'roosterjs-editor-core';\nimport type { EditorOptions, IEditor } from 'roosterjs-editor-types-compatible';\nimport { Rooster, createUpdateContentPlugin, UpdateMode, createRibbonPlugin, Ribbon } from 'roosterjs-react';\nimport {\n ribbonButtonStyle,\n ribbonOverflowButtonStyle,\n ribbonStyle,\n richTextEditorWrapperStyle,\n richTextEditorStyle\n} from '../styles/RichTextEditor.styles';\nimport { useTheme } from '../../theming';\nimport { ribbonButtons, ribbonButtonsStrings } from './RichTextRibbonButtons';\nimport { RichTextSendBoxStrings } from './RichTextSendBox';\nimport { isDarkThemed } from '../../theming/themeUtils';\n\n/**\n * Props for {@link RichTextEditor}.\n *\n * @private\n */\nexport interface RichTextEditorStyleProps {\n minHeight: string;\n maxHeight: string;\n}\n\n/**\n * Props for {@link RichTextEditor}.\n *\n * @private\n */\nexport interface RichTextEditorProps {\n initialContent?: string;\n onChange: (newValue?: string) => void;\n onKeyDown?: (ev: React.KeyboardEvent<HTMLElement>) => void;\n placeholderText?: string;\n strings: Partial<RichTextSendBoxStrings>;\n showRichTextEditorFormatting: boolean;\n styles: RichTextEditorStyleProps;\n}\n\n/**\n * Props for {@link RichTextEditor}.\n *\n * @beta\n */\nexport interface RichTextEditorComponentRef {\n focus: () => void;\n setEmptyContent: () => void;\n}\n\n/**\n * A component to wrap RoosterJS Rich Text Editor.\n *\n * @beta\n */\nexport const RichTextEditor = React.forwardRef<RichTextEditorComponentRef, RichTextEditorProps>((props, ref) => {\n const { initialContent, onChange, placeholderText, strings, showRichTextEditorFormatting } = props;\n const editor = useRef<IEditor | null>(null);\n const theme = useTheme();\n useImperativeHandle(\n ref,\n () => {\n return {\n focus() {\n if (editor.current) {\n editor.current.focus();\n }\n },\n setEmptyContent() {\n if (editor.current) {\n editor.current.setContent('');\n }\n }\n };\n },\n []\n );\n\n const ribbonPlugin = React.useMemo(() => {\n return createRibbonPlugin();\n }, []);\n\n const editorCreator = useCallback((div: HTMLDivElement, options: EditorOptions) => {\n editor.current = new Editor(div, options);\n // Remove default values for background color and color\n // setBackgroundColor and setTextColor can't be used here as they cause the editor to be focused\n // color will be set in richTextEditorWrapperStyle instead of inline styles\n div.style.backgroundColor = '';\n div.style.color = '';\n\n return editor.current;\n }, []);\n\n const placeholderPlugin = React.useMemo(() => {\n return new Watermark('');\n }, []);\n\n useEffect(() => {\n if (placeholderText !== undefined) {\n placeholderPlugin.updateWatermark(placeholderText);\n }\n }, [placeholderPlugin, placeholderText]);\n\n const plugins = useMemo(() => {\n const contentEdit = new ContentEdit();\n const updateContentPlugin = createUpdateContentPlugin(\n UpdateMode.OnContentChangedEvent | UpdateMode.OnUserInput,\n (content: string) => {\n onChange && onChange(content);\n }\n );\n return [contentEdit, placeholderPlugin, updateContentPlugin, ribbonPlugin];\n }, [onChange, placeholderPlugin, ribbonPlugin]);\n\n const ribbon = useMemo(() => {\n const buttons = ribbonButtons(theme);\n\n return (\n <Ribbon\n styles={ribbonStyle}\n buttons={buttons}\n plugin={ribbonPlugin}\n overflowButtonProps={{\n styles: ribbonButtonStyle(theme),\n menuProps: {\n items: [], // CommandBar will determine items rendered in overflow\n isBeakVisible: false,\n styles: ribbonOverflowButtonStyle(theme)\n }\n }}\n strings={ribbonButtonsStrings(strings)}\n data-testid={'rich-text-editor-ribbon'}\n />\n );\n }, [strings, ribbonPlugin, theme]);\n\n return (\n <div data-testid={'rich-text-editor-wrapper'}>\n {showRichTextEditorFormatting && ribbon}\n <div className={richTextEditorWrapperStyle(theme, !showRichTextEditorFormatting)}>\n <Rooster\n initialContent={initialContent}\n inDarkMode={isDarkThemed(theme)}\n plugins={plugins}\n className={richTextEditorStyle(props.styles)}\n editorCreator={editorCreator}\n // TODO: confirm the color during inline images implementation\n imageSelectionBorderColor={'blue'}\n // doNotAdjustEditorColor is used to fix the default background color for Rooster component\n doNotAdjustEditorColor={true}\n data-testid={'rooster-rich-text-editor'}\n // if we don't use 'allowKeyboardEventPropagation' only the enter key is caught\n onKeyDown={props.onKeyDown}\n />\n </div>\n </div>\n );\n});\n"]}
@@ -19,8 +19,10 @@ export interface RichTextInputBoxComponentProps {
19
19
  strings: Partial<RichTextSendBoxStrings>;
20
20
  disabled: boolean;
21
21
  actionComponents: ReactNode;
22
+ onRenderFileUploads?: () => JSX.Element;
23
+ hasFiles?: boolean;
22
24
  richTextEditorStyleProps: (isExpanded: boolean) => RichTextEditorStyleProps;
23
- supportHorizontalLayout?: boolean;
25
+ isHorizontalLayoutDisabled?: boolean;
24
26
  }
25
27
  /**
26
28
  * @private
@@ -2,18 +2,21 @@
2
2
  // Licensed under the MIT License.
3
3
  import React, { useCallback, useMemo, useState } from 'react';
4
4
  import { RichTextEditor } from './RichTextEditor';
5
- import { richTextBorderBoxStyle } from '../styles/RichTextInputBoxComponent.styles';
6
5
  import { useTheme } from '../../theming';
7
6
  import { Icon, Stack } from '@fluentui/react';
8
7
  import { InputBoxButton } from '../InputBoxButton';
9
- import { richTextActionButtonsDividerStyle, richTextActionButtonsStackStyle, richTextActionButtonsStyle, richTextFormatButtonIconStyle } from '../styles/RichTextEditor.styles';
10
- import { inputBoxContentStackStyle, inputBoxRichTextStackStyle } from '../styles/RichTextInputBoxComponent.styles';
11
8
  import { isEnterKeyEventFromCompositionSession } from '../utils';
9
+ import { richTextActionButtonsDividerStyle, richTextActionButtonsStackStyle, richTextActionButtonsStyle, richTextFormatButtonIconStyle } from '../styles/RichTextEditor.styles';
10
+ import { inputBoxContentStackStyle, inputBoxRichTextStackItemStyle, inputBoxRichTextStackStyle, richTextBorderBoxStyle } from '../styles/RichTextInputBoxComponent.styles';
12
11
  /**
13
12
  * @private
14
13
  */
15
14
  export const RichTextInputBoxComponent = (props) => {
16
- const { placeholderText, initialContent, onChange, onEnterKeyDown, editorComponentRef, disabled, strings, actionComponents, richTextEditorStyleProps, supportHorizontalLayout = true } = props;
15
+ const { placeholderText, initialContent, onChange, onEnterKeyDown, editorComponentRef, disabled, strings, actionComponents,
16
+ /* @conditional-compile-remove(file-sharing) */
17
+ onRenderFileUploads,
18
+ /* @conditional-compile-remove(file-sharing) */
19
+ hasFiles, richTextEditorStyleProps, isHorizontalLayoutDisabled = false } = props;
17
20
  const theme = useTheme();
18
21
  const [showRichTextEditorFormatting, setShowRichTextEditorFormatting] = useState(false);
19
22
  const onRenderRichTextEditorIcon = useCallback((isHover) => (React.createElement(Icon, { iconName: isHover || showRichTextEditorFormatting ? 'RichTextEditorButtonIconFilled' : 'RichTextEditorButtonIcon', className: richTextFormatButtonIconStyle(theme, !disabled && (isHover || showRichTextEditorFormatting)) })), [disabled, showRichTextEditorFormatting, theme]);
@@ -48,13 +51,24 @@ export const RichTextInputBoxComponent = (props) => {
48
51
  onEnterKeyDown && onEnterKeyDown();
49
52
  }
50
53
  }, [onEnterKeyDown, showRichTextEditorFormatting]);
54
+ const useHorizontalLayout = useMemo(() => {
55
+ return (!isHorizontalLayoutDisabled &&
56
+ !showRichTextEditorFormatting &&
57
+ /* @conditional-compile-remove(file-sharing) */ !hasFiles);
58
+ }, [
59
+ isHorizontalLayoutDisabled,
60
+ showRichTextEditorFormatting,
61
+ /* @conditional-compile-remove(file-sharing) */ hasFiles
62
+ ]);
51
63
  return (React.createElement("div", { className: richTextBorderBoxStyle({
52
64
  theme: theme,
53
65
  disabled: !!disabled
54
66
  }) },
55
- React.createElement(Stack, { grow: true, horizontal: supportHorizontalLayout && !showRichTextEditorFormatting, className: inputBoxContentStackStyle },
67
+ React.createElement(Stack, { grow: true, horizontal: useHorizontalLayout, horizontalAlign: useHorizontalLayout ? 'end' : 'space-between', className: inputBoxContentStackStyle, wrap: useHorizontalLayout },
56
68
  React.createElement(Stack, { grow: true, className: inputBoxRichTextStackStyle },
57
- React.createElement(RichTextEditor, { initialContent: initialContent, placeholderText: placeholderText, onChange: onChange, onKeyDown: onKeyDown, ref: editorComponentRef, strings: strings, showRichTextEditorFormatting: showRichTextEditorFormatting, styles: richTextEditorStyle })),
69
+ React.createElement(Stack.Item, { className: inputBoxRichTextStackItemStyle },
70
+ React.createElement(RichTextEditor, { initialContent: initialContent, placeholderText: placeholderText, onChange: onChange, onKeyDown: onKeyDown, ref: editorComponentRef, strings: strings, showRichTextEditorFormatting: showRichTextEditorFormatting, styles: richTextEditorStyle })), /* @conditional-compile-remove(file-sharing) */
71
+ onRenderFileUploads && onRenderFileUploads()),
58
72
  actionButtons)));
59
73
  };
60
74
  //# sourceMappingURL=RichTextInputBoxComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextInputBoxComponent.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/RichTextEditor/RichTextInputBoxComponent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAa,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,cAAc,EAAwD,MAAM,kBAAkB,CAAC;AAExG,OAAO,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AACpF,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACL,iCAAiC,EACjC,+BAA+B,EAC/B,0BAA0B,EAC1B,6BAA6B,EAC9B,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,MAAM,4CAA4C,CAAC;AACnH,OAAO,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;AAyBjE;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,KAAqC,EAAe,EAAE;IAC9F,MAAM,EACJ,eAAe,EACf,cAAc,EACd,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,QAAQ,EACR,OAAO,EACP,gBAAgB,EAChB,wBAAwB,EACxB,uBAAuB,GAAG,IAAI,EAC/B,GAAG,KAAK,CAAC;IACV,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,CAAC,4BAA4B,EAAE,+BAA+B,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAExF,MAAM,0BAA0B,GAAG,WAAW,CAC5C,CAAC,OAAgB,EAAE,EAAE,CAAC,CACpB,oBAAC,IAAI,IACH,QAAQ,EACN,OAAO,IAAI,4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AAM,SAAS,GAAG,WAAW,CAC3B,CAAC,EAAoC,EAAE,EAAE;QACvC,IAAI,qCAAqC,CAAC,EAAE,CAAC,EAAE,CAAC;YAC9C,OAAO;QACT,CAAC;QACD,IAAI,EAAE,CAAC,GAAG,KAAK,OAAO,IAAI,EAAE,CAAC,QAAQ,KAAK,KAAK,IAAI,CAAC,4BAA4B,EAAE,CAAC;YACjF,EAAE,CAAC,cAAc,EAAE,CAAC;YACpB,cAAc,IAAI,cAAc,EAAE,CAAC;QACrC,CAAC;IACH,CAAC,EACD,CAAC,cAAc,EAAE,4BAA4B,CAAC,CAC/C,CAAC;IAEF,OAAO,CACL,6BACE,SAAS,EAAE,sBAAsB,CAAC;YAChC,KAAK,EAAE,KAAK;YACZ,QAAQ,EAAE,CAAC,CAAC,QAAQ;SACrB,CAAC;QAEF,oBAAC,KAAK,IACJ,IAAI,QACJ,UAAU,EAAE,uBAAuB,IAAI,CAAC,4BAA4B,EACpE,SAAS,EAAE,yBAAyB;YAGpC,oBAAC,KAAK,IAAC,IAAI,QAAC,SAAS,EAAE,0BAA0B;gBAC/C,oBAAC,cAAc,IACb,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,QAAQ,EAAE,QAAQ,EAClB,SAAS,EAAE,SAAS,EACpB,GAAG,EAAE,kBAAkB,EACvB,OAAO,EAAE,OAAO,EAChB,4BAA4B,EAAE,4BAA4B,EAC1D,MAAM,EAAE,mBAAmB,GAC3B,CAEI;YACP,aAAa,CACR,CACJ,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { ReactNode, useCallback, useMemo, useState } from 'react';\nimport { BaseCustomStyles } from '../../types';\nimport { RichTextEditor, RichTextEditorComponentRef, RichTextEditorStyleProps } from './RichTextEditor';\nimport { RichTextSendBoxStrings } from './RichTextSendBox';\nimport { richTextBorderBoxStyle } from '../styles/RichTextInputBoxComponent.styles';\nimport { useTheme } from '../../theming';\nimport { Icon, Stack } from '@fluentui/react';\nimport { InputBoxButton } from '../InputBoxButton';\nimport {\n richTextActionButtonsDividerStyle,\n richTextActionButtonsStackStyle,\n richTextActionButtonsStyle,\n richTextFormatButtonIconStyle\n} from '../styles/RichTextEditor.styles';\nimport { inputBoxContentStackStyle, inputBoxRichTextStackStyle } from '../styles/RichTextInputBoxComponent.styles';\nimport { isEnterKeyEventFromCompositionSession } from '../utils';\n\n/**\n * @private\n */\nexport interface RichTextInputBoxComponentStylesProps extends BaseCustomStyles {}\n\n/**\n * @private\n */\nexport interface RichTextInputBoxComponentProps {\n placeholderText?: string;\n initialContent?: string;\n onChange: (newValue?: string) => void;\n onEnterKeyDown?: () => void;\n editorComponentRef: React.RefObject<RichTextEditorComponentRef>;\n strings: Partial<RichTextSendBoxStrings>;\n disabled: boolean;\n actionComponents: ReactNode;\n // props for min and max height for the rich text editor\n // otherwise the editor will grow to fit the content\n richTextEditorStyleProps: (isExpanded: boolean) => RichTextEditorStyleProps;\n supportHorizontalLayout?: boolean;\n}\n\n/**\n * @private\n */\nexport const RichTextInputBoxComponent = (props: RichTextInputBoxComponentProps): JSX.Element => {\n const {\n placeholderText,\n initialContent,\n onChange,\n onEnterKeyDown,\n editorComponentRef,\n disabled,\n strings,\n actionComponents,\n richTextEditorStyleProps,\n supportHorizontalLayout = true\n } = props;\n const theme = useTheme();\n const [showRichTextEditorFormatting, setShowRichTextEditorFormatting] = useState(false);\n\n const onRenderRichTextEditorIcon = useCallback(\n (isHover: boolean) => (\n <Icon\n iconName={\n isHover || showRichTextEditorFormatting ? 'RichTextEditorButtonIconFilled' : 'RichTextEditorButtonIcon'\n }\n className={richTextFormatButtonIconStyle(theme, !disabled && (isHover || showRichTextEditorFormatting))}\n />\n ),\n [disabled, showRichTextEditorFormatting, theme]\n );\n\n const actionButtons = useMemo(() => {\n return (\n <Stack.Item align=\"end\" className={richTextActionButtonsStackStyle}>\n <Stack horizontal>\n <InputBoxButton\n onRenderIcon={onRenderRichTextEditorIcon}\n onClick={(e) => {\n setShowRichTextEditorFormatting(!showRichTextEditorFormatting);\n editorComponentRef.current?.focus();\n e.stopPropagation(); // Prevents the click from bubbling up and triggering a focus event on the chat.\n }}\n ariaLabel={strings.richTextFormatButtonTooltip}\n tooltipContent={strings.richTextFormatButtonTooltip}\n className={richTextActionButtonsStyle}\n data-testId={'rich-text-input-box-format-button'}\n />\n <Icon iconName=\"RichTextDividerIcon\" className={richTextActionButtonsDividerStyle(theme)} />\n {actionComponents}\n </Stack>\n </Stack.Item>\n );\n }, [\n actionComponents,\n editorComponentRef,\n onRenderRichTextEditorIcon,\n showRichTextEditorFormatting,\n strings.richTextFormatButtonTooltip,\n theme\n ]);\n\n const richTextEditorStyle = useMemo(() => {\n return richTextEditorStyleProps(showRichTextEditorFormatting);\n }, [richTextEditorStyleProps, showRichTextEditorFormatting]);\n\n const onKeyDown = useCallback(\n (ev: React.KeyboardEvent<HTMLElement>) => {\n if (isEnterKeyEventFromCompositionSession(ev)) {\n return;\n }\n if (ev.key === 'Enter' && ev.shiftKey === false && !showRichTextEditorFormatting) {\n ev.preventDefault();\n onEnterKeyDown && onEnterKeyDown();\n }\n },\n [onEnterKeyDown, showRichTextEditorFormatting]\n );\n\n return (\n <div\n className={richTextBorderBoxStyle({\n theme: theme,\n disabled: !!disabled\n })}\n >\n <Stack\n grow\n horizontal={supportHorizontalLayout && !showRichTextEditorFormatting}\n className={inputBoxContentStackStyle}\n >\n {/* fixes the issue when flex box can grow to be bigger than parent */}\n <Stack grow className={inputBoxRichTextStackStyle}>\n <RichTextEditor\n initialContent={initialContent}\n placeholderText={placeholderText}\n onChange={onChange}\n onKeyDown={onKeyDown}\n ref={editorComponentRef}\n strings={strings}\n showRichTextEditorFormatting={showRichTextEditorFormatting}\n styles={richTextEditorStyle}\n />\n {/* File Upload */}\n </Stack>\n {actionButtons}\n </Stack>\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"RichTextInputBoxComponent.js","sourceRoot":"","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AC1D,MAAM,EAAE,mBAAmB,GAC3B,CACS,EACZ,+CAA+C;gBAAC,mBAAmB,IAAI,mBAAmB,EAAE,CACvF;YACP,aAAa,CACR,CACJ,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { ReactNode, useCallback, useMemo, useState } from 'react';\nimport { BaseCustomStyles } from '../../types';\nimport { RichTextEditor, RichTextEditorComponentRef, RichTextEditorStyleProps } from './RichTextEditor';\nimport { RichTextSendBoxStrings } from './RichTextSendBox';\nimport { useTheme } from '../../theming';\nimport { Icon, Stack } from '@fluentui/react';\nimport { InputBoxButton } from '../InputBoxButton';\nimport { isEnterKeyEventFromCompositionSession } from '../utils';\nimport {\n richTextActionButtonsDividerStyle,\n richTextActionButtonsStackStyle,\n richTextActionButtonsStyle,\n richTextFormatButtonIconStyle\n} from '../styles/RichTextEditor.styles';\nimport {\n inputBoxContentStackStyle,\n inputBoxRichTextStackItemStyle,\n inputBoxRichTextStackStyle,\n richTextBorderBoxStyle\n} from '../styles/RichTextInputBoxComponent.styles';\n\n/**\n * @private\n */\nexport interface RichTextInputBoxComponentStylesProps extends BaseCustomStyles {}\n\n/**\n * @private\n */\nexport interface RichTextInputBoxComponentProps {\n placeholderText?: string;\n initialContent?: string;\n onChange: (newValue?: string) => void;\n onEnterKeyDown?: () => void;\n editorComponentRef: React.RefObject<RichTextEditorComponentRef>;\n strings: Partial<RichTextSendBoxStrings>;\n disabled: boolean;\n actionComponents: ReactNode;\n /* @conditional-compile-remove(file-sharing) */\n onRenderFileUploads?: () => JSX.Element;\n /* @conditional-compile-remove(file-sharing) */\n hasFiles?: boolean;\n // props for min and max height for the rich text editor\n // otherwise the editor will grow to fit the content\n richTextEditorStyleProps: (isExpanded: boolean) => RichTextEditorStyleProps;\n isHorizontalLayoutDisabled?: boolean;\n}\n\n/**\n * @private\n */\nexport const RichTextInputBoxComponent = (props: RichTextInputBoxComponentProps): JSX.Element => {\n const {\n placeholderText,\n initialContent,\n onChange,\n onEnterKeyDown,\n editorComponentRef,\n disabled,\n strings,\n actionComponents,\n /* @conditional-compile-remove(file-sharing) */\n onRenderFileUploads,\n /* @conditional-compile-remove(file-sharing) */\n hasFiles,\n richTextEditorStyleProps,\n isHorizontalLayoutDisabled = false\n } = props;\n const theme = useTheme();\n const [showRichTextEditorFormatting, setShowRichTextEditorFormatting] = useState(false);\n\n const onRenderRichTextEditorIcon = useCallback(\n (isHover: boolean) => (\n <Icon\n iconName={\n isHover || showRichTextEditorFormatting ? 'RichTextEditorButtonIconFilled' : 'RichTextEditorButtonIcon'\n }\n className={richTextFormatButtonIconStyle(theme, !disabled && (isHover || showRichTextEditorFormatting))}\n />\n ),\n [disabled, showRichTextEditorFormatting, theme]\n );\n\n const actionButtons = useMemo(() => {\n return (\n <Stack.Item align=\"end\" className={richTextActionButtonsStackStyle}>\n <Stack horizontal>\n <InputBoxButton\n onRenderIcon={onRenderRichTextEditorIcon}\n onClick={(e) => {\n setShowRichTextEditorFormatting(!showRichTextEditorFormatting);\n editorComponentRef.current?.focus();\n e.stopPropagation(); // Prevents the click from bubbling up and triggering a focus event on the chat.\n }}\n ariaLabel={strings.richTextFormatButtonTooltip}\n tooltipContent={strings.richTextFormatButtonTooltip}\n className={richTextActionButtonsStyle}\n data-testId={'rich-text-input-box-format-button'}\n />\n <Icon iconName=\"RichTextDividerIcon\" className={richTextActionButtonsDividerStyle(theme)} />\n {actionComponents}\n </Stack>\n </Stack.Item>\n );\n }, [\n actionComponents,\n editorComponentRef,\n onRenderRichTextEditorIcon,\n showRichTextEditorFormatting,\n strings.richTextFormatButtonTooltip,\n theme\n ]);\n\n const richTextEditorStyle = useMemo(() => {\n return richTextEditorStyleProps(showRichTextEditorFormatting);\n }, [richTextEditorStyleProps, showRichTextEditorFormatting]);\n\n const onKeyDown = useCallback(\n (ev: React.KeyboardEvent<HTMLElement>) => {\n if (isEnterKeyEventFromCompositionSession(ev)) {\n return;\n }\n if (ev.key === 'Enter' && ev.shiftKey === false && !showRichTextEditorFormatting) {\n ev.preventDefault();\n onEnterKeyDown && onEnterKeyDown();\n }\n },\n [onEnterKeyDown, showRichTextEditorFormatting]\n );\n\n const useHorizontalLayout = useMemo(() => {\n return (\n !isHorizontalLayoutDisabled &&\n !showRichTextEditorFormatting &&\n /* @conditional-compile-remove(file-sharing) */ !hasFiles\n );\n }, [\n isHorizontalLayoutDisabled,\n showRichTextEditorFormatting,\n /* @conditional-compile-remove(file-sharing) */ hasFiles\n ]);\n\n return (\n <div\n className={richTextBorderBoxStyle({\n theme: theme,\n disabled: !!disabled\n })}\n >\n {/* This layout is used for the compact view when formatting options are not shown */}\n <Stack\n grow\n horizontal={useHorizontalLayout}\n horizontalAlign={useHorizontalLayout ? 'end' : 'space-between'}\n className={inputBoxContentStackStyle}\n wrap={useHorizontalLayout}\n >\n {/* Fixes the issue when flex box can grow to be bigger than parent */}\n <Stack grow className={inputBoxRichTextStackStyle}>\n <Stack.Item className={inputBoxRichTextStackItemStyle}>\n <RichTextEditor\n initialContent={initialContent}\n placeholderText={placeholderText}\n onChange={onChange}\n onKeyDown={onKeyDown}\n ref={editorComponentRef}\n strings={strings}\n showRichTextEditorFormatting={showRichTextEditorFormatting}\n styles={richTextEditorStyle}\n />\n </Stack.Item>\n {/* @conditional-compile-remove(file-sharing) */ onRenderFileUploads && onRenderFileUploads()}\n </Stack>\n {actionButtons}\n </Stack>\n </div>\n );\n};\n"]}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { SendBoxStrings } from '../SendBox';
3
- import { ActiveFileUpload } from '../FileUploadCards';
3
+ import { ActiveFileUpload } from '../AttachmentUploadCards';
4
4
  /**
5
5
  * Strings of {@link RichTextSendBox} that can be overridden.
6
6
  *
@@ -59,13 +59,6 @@ export interface RichTextSendBoxProps {
59
59
  * Optional text for system message above the text box
60
60
  */
61
61
  systemMessage?: string;
62
- /**
63
- * Optional callback to render uploaded files in the SendBox. The sendBox will expand
64
- * vertically to accommodate the uploaded files. File uploads will
65
- * be rendered below the text area in sendBox.
66
- * @beta
67
- */
68
- onRenderFileUploads?: () => JSX.Element;
69
62
  /**
70
63
  * Optional array of active file uploads where each object has attributes
71
64
  * of a file upload like name, progress, errorMessage etc.
@@ -8,10 +8,14 @@ import { sendIconStyle } from '../styles/SendBox.styles';
8
8
  import { InputBoxButton } from '../InputBoxButton';
9
9
  import { RichTextSendBoxErrors } from './RichTextSendBoxErrors';
10
10
  import { isMessageTooLong, sanitizeText } from '../utils/SendBoxUtils';
11
- /* @conditional-compile-remove(file-sharing) */
12
- import { hasCompletedFileUploads } from '../utils/SendBoxUtils';
13
11
  import { useTheme } from '../../theming';
14
12
  import { richTextActionButtonsStyle, sendBoxRichTextEditorStyle } from '../styles/RichTextEditor.styles';
13
+ /* @conditional-compile-remove(file-sharing) */
14
+ import { _AttachmentUploadCards } from '../AttachmentUploadCards';
15
+ /* @conditional-compile-remove(file-sharing) */
16
+ import { hasCompletedFileUploads, hasIncompleteFileUploads } from '../utils/SendBoxUtils';
17
+ /* @conditional-compile-remove(file-sharing) */
18
+ import { attachmentUploadCardsStyles } from '../styles/SendBox.styles';
15
19
  /**
16
20
  * A component to render SendBox with Rich Text Editor support.
17
21
  *
@@ -20,7 +24,9 @@ import { richTextActionButtonsStyle, sendBoxRichTextEditorStyle } from '../style
20
24
  export const RichTextSendBox = (props) => {
21
25
  const { disabled = false, systemMessage, onSendMessage,
22
26
  /* @conditional-compile-remove(file-sharing) */
23
- activeFileUploads } = props;
27
+ activeFileUploads,
28
+ /* @conditional-compile-remove(file-sharing) */
29
+ onCancelFileUpload } = props;
24
30
  const theme = useTheme();
25
31
  const locale = useLocale();
26
32
  const localeStrings = useMemo(() => {
@@ -34,7 +40,7 @@ export const RichTextSendBox = (props) => {
34
40
  const [contentValue, setContentValue] = useState('');
35
41
  const [contentValueOverflow, setContentValueOverflow] = useState(false);
36
42
  /* @conditional-compile-remove(file-sharing) */
37
- const [fileUploadsPendingError, setFileUploadsPendingError] = useState(undefined);
43
+ const [attachmentUploadsPendingError, setFileUploadsPendingError] = useState(undefined);
38
44
  const editorComponentRef = useRef(null);
39
45
  const contentTooLongMessage = useMemo(() => (contentValueOverflow ? strings.textTooLong : undefined), [contentValueOverflow, strings.textTooLong]);
40
46
  const setContent = useCallback((newValue) => {
@@ -52,10 +58,11 @@ export const RichTextSendBox = (props) => {
52
58
  // Don't send message until all files have been uploaded successfully
53
59
  /* @conditional-compile-remove(file-sharing) */
54
60
  setFileUploadsPendingError(undefined);
55
- // if (hasIncompleteFileUploads(activeFileUploads)) {
56
- // setFileUploadsPendingError({ message: strings.fileUploadsPendingError, timestamp: Date.now() });
57
- // return;
58
- // }
61
+ /* @conditional-compile-remove(file-sharing) */
62
+ if (hasIncompleteFileUploads(activeFileUploads)) {
63
+ setFileUploadsPendingError({ message: strings.attachmentUploadsPendingError, timestamp: Date.now() });
64
+ return;
65
+ }
59
66
  const message = contentValue;
60
67
  // we don't want to send empty messages including spaces, newlines, tabs
61
68
  // Message can be empty if there is a valid file upload
@@ -67,26 +74,27 @@ export const RichTextSendBox = (props) => {
67
74
  }
68
75
  (_b = editorComponentRef.current) === null || _b === void 0 ? void 0 : _b.focus();
69
76
  }, [
70
- /* @conditional-compile-remove(file-sharing) */ activeFileUploads,
71
77
  contentValue,
72
78
  contentValueOverflow,
73
79
  disabled,
74
- onSendMessage
80
+ onSendMessage,
81
+ /* @conditional-compile-remove(file-sharing) */ activeFileUploads,
82
+ /* @conditional-compile-remove(file-sharing) */ strings.attachmentUploadsPendingError
75
83
  ]);
76
84
  const hasErrorMessage = useMemo(() => {
77
85
  var _a;
78
86
  return (!!systemMessage ||
79
87
  !!contentTooLongMessage ||
80
88
  /* @conditional-compile-remove(file-sharing) */
81
- !!fileUploadsPendingError ||
89
+ !!attachmentUploadsPendingError ||
82
90
  /* @conditional-compile-remove(file-sharing) */
83
- !!((_a = activeFileUploads === null || activeFileUploads === void 0 ? void 0 : activeFileUploads.filter((fileUpload) => fileUpload.error).pop()) === null || _a === void 0 ? void 0 : _a.error));
91
+ !!((_a = activeFileUploads === null || activeFileUploads === void 0 ? void 0 : activeFileUploads.filter((attachmentUpload) => attachmentUpload.error).pop()) === null || _a === void 0 ? void 0 : _a.error));
84
92
  }, [
85
93
  /* @conditional-compile-remove(file-sharing) */
86
94
  activeFileUploads,
87
95
  contentTooLongMessage,
88
96
  /* @conditional-compile-remove(file-sharing) */
89
- fileUploadsPendingError,
97
+ attachmentUploadsPendingError,
90
98
  systemMessage
91
99
  ]);
92
100
  const onRenderSendIcon = useCallback((isHover) => (React.createElement(Icon, { iconName: isHover && contentValue ? 'SendBoxSendHovered' : 'SendBoxSend', className: sendIconStyle({
@@ -102,9 +110,9 @@ export const RichTextSendBox = (props) => {
102
110
  var _a;
103
111
  return {
104
112
  /* @conditional-compile-remove(file-sharing) */
105
- fileUploadsPendingError: fileUploadsPendingError,
113
+ attachmentUploadsPendingError: attachmentUploadsPendingError,
106
114
  /* @conditional-compile-remove(file-sharing) */
107
- fileUploadError: (_a = activeFileUploads === null || activeFileUploads === void 0 ? void 0 : activeFileUploads.filter((fileUpload) => fileUpload.error).pop()) === null || _a === void 0 ? void 0 : _a.error,
115
+ attachmentUploadError: (_a = activeFileUploads === null || activeFileUploads === void 0 ? void 0 : activeFileUploads.filter((attachmentUpload) => attachmentUpload.error).pop()) === null || _a === void 0 ? void 0 : _a.error,
108
116
  systemMessage: systemMessage,
109
117
  textTooLongMessage: contentTooLongMessage
110
118
  };
@@ -113,17 +121,34 @@ export const RichTextSendBox = (props) => {
113
121
  activeFileUploads,
114
122
  contentTooLongMessage,
115
123
  /* @conditional-compile-remove(file-sharing) */
116
- fileUploadsPendingError,
124
+ attachmentUploadsPendingError,
117
125
  systemMessage
118
126
  ]);
127
+ /* @conditional-compile-remove(file-sharing) */
128
+ const onRenderFileUploads = useCallback(() => {
129
+ return (React.createElement(Stack, { className: attachmentUploadCardsStyles },
130
+ React.createElement(_AttachmentUploadCards, { activeFileUploads: activeFileUploads, onCancelFileUpload: onCancelFileUpload, strings: {
131
+ removeAttachment: strings.removeAttachment,
132
+ uploading: strings.uploading,
133
+ uploadCompleted: strings.uploadCompleted
134
+ } })));
135
+ }, [activeFileUploads, onCancelFileUpload, strings.removeAttachment, strings.uploadCompleted, strings.uploading]);
119
136
  const sendButton = useMemo(() => {
120
137
  return (React.createElement(InputBoxButton, { onRenderIcon: onRenderSendIcon, onClick: (e) => {
121
138
  sendMessageOnClick();
122
139
  e.stopPropagation(); // Prevents the click from bubbling up and triggering a focus event on the chat.
123
140
  }, className: richTextActionButtonsStyle, ariaLabel: localeStrings.sendButtonAriaLabel, tooltipContent: localeStrings.sendButtonAriaLabel }));
124
141
  }, [localeStrings.sendButtonAriaLabel, onRenderSendIcon, sendMessageOnClick]);
142
+ /* @conditional-compile-remove(file-sharing) */
143
+ const hasFileUploads = useMemo(() => {
144
+ return hasCompletedFileUploads(activeFileUploads) || hasIncompleteFileUploads(activeFileUploads);
145
+ }, [activeFileUploads]);
125
146
  return (React.createElement(Stack, null,
126
147
  React.createElement(RichTextSendBoxErrors, Object.assign({}, sendBoxErrorsProps)),
127
- React.createElement(RichTextInputBoxComponent, { placeholderText: strings.placeholderText, onChange: setContent, onEnterKeyDown: sendMessageOnClick, editorComponentRef: editorComponentRef, strings: strings, disabled: disabled, actionComponents: sendButton, richTextEditorStyleProps: sendBoxRichTextEditorStyle })));
148
+ React.createElement(RichTextInputBoxComponent, { placeholderText: strings.placeholderText, onChange: setContent, onEnterKeyDown: sendMessageOnClick, editorComponentRef: editorComponentRef, strings: strings, disabled: disabled, actionComponents: sendButton, richTextEditorStyleProps: sendBoxRichTextEditorStyle,
149
+ /* @conditional-compile-remove(file-sharing) */
150
+ onRenderFileUploads: onRenderFileUploads,
151
+ /* @conditional-compile-remove(file-sharing) */
152
+ hasFiles: hasFileUploads })));
128
153
  };
129
154
  //# sourceMappingURL=RichTextSendBox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextSendBox.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/RichTextEditor/RichTextSendBox.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAA8B,MAAM,yBAAyB,CAAC;AAK5F,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACvE,+CAA+C;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAyFzG;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAe,EAAE;IAC1E,MAAM,EACJ,QAAQ,GAAG,KAAK,EAChB,aAAa,EACb,aAAa;IACb,+CAA+C;IAC/C,iBAAiB,EAClB,GAAG,KAAK,CAAC;IAEV,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAE3B,MAAM,aAAa,GAAG,OAAO,CAAC,GAAG,EAAE;QACjC,mDAAmD;QACnD,OAAO,MAAM,CAAC,OAAO,CAAC,eAAe,CAAC;QACtC,OAAO,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC;IAChC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kBAAkB,CAAC,CAAC,CAAC;IAE9E,OAAO,CACL,oBAAC,KAAK;QACJ,oBAAC,qBAAqB,oBAAK,kBAAkB,EAAI;QACjD,oBAAC,yBAAyB,IACxB,eAAe,EAAE,OAAO,CAAC,eAAe,EACxC,QAAQ,EAAE,UAAU,EACpB,cAAc,EAAE,kBAAkB,EAClC,kBAAkB,EAAE,kBAAkB,EACtC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,UAAU,EAC5B,wBAAwB,EAAE,0BAA0B,GACpD,CACI,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { RichTextInputBoxComponent } from './RichTextInputBoxComponent';\nimport { Icon, Stack } from '@fluentui/react';\nimport { useLocale } from '../../localization';\nimport { SendBoxStrings } from '../SendBox';\nimport { sendIconStyle } from '../styles/SendBox.styles';\nimport { InputBoxButton } from '../InputBoxButton';\nimport { RichTextSendBoxErrors, RichTextSendBoxErrorsProps } from './RichTextSendBoxErrors';\n/* @conditional-compile-remove(file-sharing) */\nimport { ActiveFileUpload } from '../FileUploadCards';\n/* @conditional-compile-remove(file-sharing) */\nimport { SendBoxErrorBarError } from '../SendBoxErrorBar';\nimport { isMessageTooLong, sanitizeText } from '../utils/SendBoxUtils';\n/* @conditional-compile-remove(file-sharing) */\nimport { hasCompletedFileUploads } from '../utils/SendBoxUtils';\nimport { RichTextEditorComponentRef } from './RichTextEditor';\nimport { useTheme } from '../../theming';\nimport { richTextActionButtonsStyle, sendBoxRichTextEditorStyle } from '../styles/RichTextEditor.styles';\n\n/**\n * Strings of {@link RichTextSendBox} that can be overridden.\n *\n * @beta\n */\nexport interface RichTextSendBoxStrings extends SendBoxStrings {\n /**\n * Tooltip text for the bold button.\n */\n boldTooltip: string;\n /**\n * Tooltip text for the italic button.\n */\n italicTooltip: string;\n /**\n * Tooltip text for the underline button.\n */\n underlineTooltip: string;\n /**\n * Tooltip text for the bullet list button.\n */\n bulletListTooltip: string;\n /**\n * Tooltip text for the number list button.\n */\n numberListTooltip: string;\n /**\n * Tooltip text for the increase indent button.\n */\n increaseIndentTooltip: string;\n /**\n * Tooltip text for the decrease indent button.\n */\n decreaseIndentTooltip: string;\n /**\n * Tooltip text for the rich text format button button.\n */\n richTextFormatButtonTooltip: string;\n}\n\n/**\n * Props for {@link RichTextSendBox}.\n *\n * @beta\n */\nexport interface RichTextSendBoxProps {\n /**\n * Optional boolean to disable text box\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<RichTextSendBoxStrings>;\n /**\n * Optional text for system message above the text box\n */\n systemMessage?: string;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optional callback to render uploaded files in the SendBox. The sendBox will expand\n * vertically to accommodate the uploaded files. File uploads will\n * be rendered below the text area in sendBox.\n * @beta\n */\n onRenderFileUploads?: () => JSX.Element;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optional array of active file uploads where each object has attributes\n * of a file upload like name, progress, errorMessage etc.\n * @beta\n */\n activeFileUploads?: ActiveFileUpload[];\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optional callback to remove the file upload before sending by clicking on\n * cancel icon.\n * @beta\n */\n onCancelFileUpload?: (fileId: string) => void;\n /**\n * Callback function used when the send button is clicked.\n */\n onSendMessage: (content: string) => Promise<void>;\n}\n\n/**\n * A component to render SendBox with Rich Text Editor support.\n *\n * @beta\n */\nexport const RichTextSendBox = (props: RichTextSendBoxProps): JSX.Element => {\n const {\n disabled = false,\n systemMessage,\n onSendMessage,\n /* @conditional-compile-remove(file-sharing) */\n activeFileUploads\n } = props;\n\n const theme = useTheme();\n const locale = useLocale();\n\n const localeStrings = useMemo(() => {\n /* @conditional-compile-remove(rich-text-editor) */\n return locale.strings.richTextSendBox;\n return locale.strings.sendBox;\n }, [/* @conditional-compile-remove(rich-text-editor) */ locale.strings.richTextSendBox, locale.strings.sendBox]);\n\n const strings = useMemo(() => {\n return { ...localeStrings, ...props.strings };\n }, [localeStrings, props.strings]);\n\n const [contentValue, setContentValue] = useState('');\n const [contentValueOverflow, setContentValueOverflow] = useState(false);\n /* @conditional-compile-remove(file-sharing) */\n const [fileUploadsPendingError, setFileUploadsPendingError] = useState<SendBoxErrorBarError | undefined>(undefined);\n const editorComponentRef = useRef<RichTextEditorComponentRef>(null);\n\n const contentTooLongMessage = useMemo(\n () => (contentValueOverflow ? strings.textTooLong : undefined),\n [contentValueOverflow, strings.textTooLong]\n );\n\n const setContent = useCallback((newValue?: string): void => {\n if (newValue === undefined) {\n return;\n }\n\n setContentValueOverflow(isMessageTooLong(newValue.length));\n setContentValue(newValue);\n }, []);\n\n const sendMessageOnClick = useCallback((): void => {\n if (disabled || contentValueOverflow) {\n return;\n }\n // Don't send message until all files have been uploaded successfully\n /* @conditional-compile-remove(file-sharing) */\n setFileUploadsPendingError(undefined);\n\n // if (hasIncompleteFileUploads(activeFileUploads)) {\n // setFileUploadsPendingError({ message: strings.fileUploadsPendingError, timestamp: Date.now() });\n // return;\n // }\n\n const message = contentValue;\n // we don't want to send empty messages including spaces, newlines, tabs\n // Message can be empty if there is a valid file upload\n if (\n sanitizeText(message).length > 0 ||\n /* @conditional-compile-remove(file-sharing) */ hasCompletedFileUploads(activeFileUploads)\n ) {\n onSendMessage(message);\n setContentValue('');\n editorComponentRef.current?.setEmptyContent();\n }\n editorComponentRef.current?.focus();\n }, [\n /* @conditional-compile-remove(file-sharing) */ activeFileUploads,\n contentValue,\n contentValueOverflow,\n disabled,\n onSendMessage\n ]);\n\n const hasErrorMessage = useMemo(() => {\n return (\n !!systemMessage ||\n !!contentTooLongMessage ||\n /* @conditional-compile-remove(file-sharing) */\n !!fileUploadsPendingError ||\n /* @conditional-compile-remove(file-sharing) */\n !!activeFileUploads?.filter((fileUpload) => fileUpload.error).pop()?.error\n );\n }, [\n /* @conditional-compile-remove(file-sharing) */\n activeFileUploads,\n contentTooLongMessage,\n /* @conditional-compile-remove(file-sharing) */\n fileUploadsPendingError,\n systemMessage\n ]);\n\n const onRenderSendIcon = useCallback(\n (isHover: boolean) => (\n <Icon\n iconName={isHover && contentValue ? 'SendBoxSendHovered' : 'SendBoxSend'}\n className={sendIconStyle({\n theme,\n hasText: !!contentValue,\n /* @conditional-compile-remove(file-sharing) */\n hasFile: false,\n hasErrorMessage: hasErrorMessage,\n defaultTextColor: theme.palette.neutralSecondary,\n disabled: disabled\n })}\n />\n ),\n [contentValue, disabled, hasErrorMessage, theme]\n );\n\n const sendBoxErrorsProps: RichTextSendBoxErrorsProps = useMemo(() => {\n return {\n /* @conditional-compile-remove(file-sharing) */\n fileUploadsPendingError: fileUploadsPendingError,\n /* @conditional-compile-remove(file-sharing) */\n fileUploadError: activeFileUploads?.filter((fileUpload) => fileUpload.error).pop()?.error,\n systemMessage: systemMessage,\n textTooLongMessage: contentTooLongMessage\n };\n }, [\n /* @conditional-compile-remove(file-sharing) */\n activeFileUploads,\n contentTooLongMessage,\n /* @conditional-compile-remove(file-sharing) */\n fileUploadsPendingError,\n systemMessage\n ]);\n\n const sendButton = useMemo(() => {\n return (\n <InputBoxButton\n onRenderIcon={onRenderSendIcon}\n onClick={(e) => {\n sendMessageOnClick();\n e.stopPropagation(); // Prevents the click from bubbling up and triggering a focus event on the chat.\n }}\n className={richTextActionButtonsStyle}\n ariaLabel={localeStrings.sendButtonAriaLabel}\n tooltipContent={localeStrings.sendButtonAriaLabel}\n />\n );\n }, [localeStrings.sendButtonAriaLabel, onRenderSendIcon, sendMessageOnClick]);\n\n return (\n <Stack>\n <RichTextSendBoxErrors {...sendBoxErrorsProps} />\n <RichTextInputBoxComponent\n placeholderText={strings.placeholderText}\n onChange={setContent}\n onEnterKeyDown={sendMessageOnClick}\n editorComponentRef={editorComponentRef}\n strings={strings}\n disabled={disabled}\n actionComponents={sendButton}\n richTextEditorStyleProps={sendBoxRichTextEditorStyle}\n />\n </Stack>\n );\n};\n"]}
1
+ {"version":3,"file":"RichTextSendBox.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/RichTextEditor/RichTextSendBox.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,qBAAqB,EAA8B,MAAM,yBAAyB,CAAC;AAC5F,OAAO,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAEvE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,0BAA0B,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AACzG,+CAA+C;AAC/C,OAAO,EAAoB,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AACpF,+CAA+C;AAC/C,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAG1F,+CAA+C;AAC/C,OAAO,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAiFvE;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAe,EAAE;IAC1E,MAAM,EACJ,QAAQ,GAAG,KAAK,EAChB,aAAa,EACb,aAAa;IACb,+CAA+C;IAC/C,iBAAiB;IACjB,+CAA+C;IAC/C,kBAAkB,EACnB,GAAG,KAAK,CAAC;IAEV,MAAM,KAAK,GAAG,QAAQ,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I;QACjD,oBAAC,yBAAyB,IACxB,eAAe,EAAE,OAAO,CAAC,eAAe,EACxC,QAAQ,EAAE,UAAU,EACpB,cAAc,EAAE,kBAAkB,EAClC,kBAAkB,EAAE,kBAAkB,EACtC,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,QAAQ,EAClB,gBAAgB,EAAE,UAAU,EAC5B,wBAAwB,EAAE,0BAA0B;YACpD,+CAA+C;YAC/C,mBAAmB,EAAE,mBAAmB;YACxC,+CAA+C;YAC/C,QAAQ,EAAE,cAAc,GACxB,CACI,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useCallback, useMemo, useRef, useState } from 'react';\nimport { RichTextInputBoxComponent } from './RichTextInputBoxComponent';\nimport { Icon, Stack } from '@fluentui/react';\nimport { useLocale } from '../../localization';\nimport { SendBoxStrings } from '../SendBox';\nimport { sendIconStyle } from '../styles/SendBox.styles';\nimport { InputBoxButton } from '../InputBoxButton';\nimport { RichTextSendBoxErrors, RichTextSendBoxErrorsProps } from './RichTextSendBoxErrors';\nimport { isMessageTooLong, sanitizeText } from '../utils/SendBoxUtils';\nimport { RichTextEditorComponentRef } from './RichTextEditor';\nimport { useTheme } from '../../theming';\nimport { richTextActionButtonsStyle, sendBoxRichTextEditorStyle } from '../styles/RichTextEditor.styles';\n/* @conditional-compile-remove(file-sharing) */\nimport { ActiveFileUpload, _AttachmentUploadCards } from '../AttachmentUploadCards';\n/* @conditional-compile-remove(file-sharing) */\nimport { hasCompletedFileUploads, hasIncompleteFileUploads } from '../utils/SendBoxUtils';\n/* @conditional-compile-remove(file-sharing) */\nimport { SendBoxErrorBarError } from '../SendBoxErrorBar';\n/* @conditional-compile-remove(file-sharing) */\nimport { attachmentUploadCardsStyles } from '../styles/SendBox.styles';\n\n/**\n * Strings of {@link RichTextSendBox} that can be overridden.\n *\n * @beta\n */\nexport interface RichTextSendBoxStrings extends SendBoxStrings {\n /**\n * Tooltip text for the bold button.\n */\n boldTooltip: string;\n /**\n * Tooltip text for the italic button.\n */\n italicTooltip: string;\n /**\n * Tooltip text for the underline button.\n */\n underlineTooltip: string;\n /**\n * Tooltip text for the bullet list button.\n */\n bulletListTooltip: string;\n /**\n * Tooltip text for the number list button.\n */\n numberListTooltip: string;\n /**\n * Tooltip text for the increase indent button.\n */\n increaseIndentTooltip: string;\n /**\n * Tooltip text for the decrease indent button.\n */\n decreaseIndentTooltip: string;\n /**\n * Tooltip text for the rich text format button button.\n */\n richTextFormatButtonTooltip: string;\n}\n\n/**\n * Props for {@link RichTextSendBox}.\n *\n * @beta\n */\nexport interface RichTextSendBoxProps {\n /**\n * Optional boolean to disable text box\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<RichTextSendBoxStrings>;\n /**\n * Optional text for system message above the text box\n */\n systemMessage?: string;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optional array of active file uploads where each object has attributes\n * of a file upload like name, progress, errorMessage etc.\n * @beta\n */\n activeFileUploads?: ActiveFileUpload[];\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optional callback to remove the file upload before sending by clicking on\n * cancel icon.\n * @beta\n */\n onCancelFileUpload?: (fileId: string) => void;\n /**\n * Callback function used when the send button is clicked.\n */\n onSendMessage: (content: string) => Promise<void>;\n}\n\n/**\n * A component to render SendBox with Rich Text Editor support.\n *\n * @beta\n */\nexport const RichTextSendBox = (props: RichTextSendBoxProps): JSX.Element => {\n const {\n disabled = false,\n systemMessage,\n onSendMessage,\n /* @conditional-compile-remove(file-sharing) */\n activeFileUploads,\n /* @conditional-compile-remove(file-sharing) */\n onCancelFileUpload\n } = props;\n\n const theme = useTheme();\n const locale = useLocale();\n\n const localeStrings = useMemo(() => {\n /* @conditional-compile-remove(rich-text-editor) */\n return locale.strings.richTextSendBox;\n return locale.strings.sendBox;\n }, [/* @conditional-compile-remove(rich-text-editor) */ locale.strings.richTextSendBox, locale.strings.sendBox]);\n\n const strings = useMemo(() => {\n return { ...localeStrings, ...props.strings };\n }, [localeStrings, props.strings]);\n\n const [contentValue, setContentValue] = useState('');\n const [contentValueOverflow, setContentValueOverflow] = useState(false);\n /* @conditional-compile-remove(file-sharing) */\n const [attachmentUploadsPendingError, setFileUploadsPendingError] = useState<SendBoxErrorBarError | undefined>(\n undefined\n );\n const editorComponentRef = useRef<RichTextEditorComponentRef>(null);\n\n const contentTooLongMessage = useMemo(\n () => (contentValueOverflow ? strings.textTooLong : undefined),\n [contentValueOverflow, strings.textTooLong]\n );\n\n const setContent = useCallback((newValue?: string): void => {\n if (newValue === undefined) {\n return;\n }\n\n setContentValueOverflow(isMessageTooLong(newValue.length));\n setContentValue(newValue);\n }, []);\n\n const sendMessageOnClick = useCallback((): void => {\n if (disabled || contentValueOverflow) {\n return;\n }\n // Don't send message until all files have been uploaded successfully\n /* @conditional-compile-remove(file-sharing) */\n setFileUploadsPendingError(undefined);\n\n /* @conditional-compile-remove(file-sharing) */\n if (hasIncompleteFileUploads(activeFileUploads)) {\n setFileUploadsPendingError({ message: strings.attachmentUploadsPendingError, timestamp: Date.now() });\n return;\n }\n\n const message = contentValue;\n // we don't want to send empty messages including spaces, newlines, tabs\n // Message can be empty if there is a valid file upload\n if (\n sanitizeText(message).length > 0 ||\n /* @conditional-compile-remove(file-sharing) */ hasCompletedFileUploads(activeFileUploads)\n ) {\n onSendMessage(message);\n setContentValue('');\n editorComponentRef.current?.setEmptyContent();\n }\n editorComponentRef.current?.focus();\n }, [\n contentValue,\n contentValueOverflow,\n disabled,\n onSendMessage,\n /* @conditional-compile-remove(file-sharing) */ activeFileUploads,\n /* @conditional-compile-remove(file-sharing) */ strings.attachmentUploadsPendingError\n ]);\n\n const hasErrorMessage = useMemo(() => {\n return (\n !!systemMessage ||\n !!contentTooLongMessage ||\n /* @conditional-compile-remove(file-sharing) */\n !!attachmentUploadsPendingError ||\n /* @conditional-compile-remove(file-sharing) */\n !!activeFileUploads?.filter((attachmentUpload) => attachmentUpload.error).pop()?.error\n );\n }, [\n /* @conditional-compile-remove(file-sharing) */\n activeFileUploads,\n contentTooLongMessage,\n /* @conditional-compile-remove(file-sharing) */\n attachmentUploadsPendingError,\n systemMessage\n ]);\n\n const onRenderSendIcon = useCallback(\n (isHover: boolean) => (\n <Icon\n iconName={isHover && contentValue ? 'SendBoxSendHovered' : 'SendBoxSend'}\n className={sendIconStyle({\n theme,\n hasText: !!contentValue,\n /* @conditional-compile-remove(file-sharing) */\n hasFile: false,\n hasErrorMessage: hasErrorMessage,\n defaultTextColor: theme.palette.neutralSecondary,\n disabled: disabled\n })}\n />\n ),\n [contentValue, disabled, hasErrorMessage, theme]\n );\n\n const sendBoxErrorsProps: RichTextSendBoxErrorsProps = useMemo(() => {\n return {\n /* @conditional-compile-remove(file-sharing) */\n attachmentUploadsPendingError: attachmentUploadsPendingError,\n /* @conditional-compile-remove(file-sharing) */\n attachmentUploadError: activeFileUploads?.filter((attachmentUpload) => attachmentUpload.error).pop()?.error,\n systemMessage: systemMessage,\n textTooLongMessage: contentTooLongMessage\n };\n }, [\n /* @conditional-compile-remove(file-sharing) */\n activeFileUploads,\n contentTooLongMessage,\n /* @conditional-compile-remove(file-sharing) */\n attachmentUploadsPendingError,\n systemMessage\n ]);\n\n /* @conditional-compile-remove(file-sharing) */\n const onRenderFileUploads = useCallback(() => {\n return (\n <Stack className={attachmentUploadCardsStyles}>\n <_AttachmentUploadCards\n activeFileUploads={activeFileUploads}\n onCancelFileUpload={onCancelFileUpload}\n strings={{\n removeAttachment: strings.removeAttachment,\n uploading: strings.uploading,\n uploadCompleted: strings.uploadCompleted\n }}\n />\n </Stack>\n );\n }, [activeFileUploads, onCancelFileUpload, strings.removeAttachment, strings.uploadCompleted, strings.uploading]);\n\n const sendButton = useMemo(() => {\n return (\n <InputBoxButton\n onRenderIcon={onRenderSendIcon}\n onClick={(e) => {\n sendMessageOnClick();\n e.stopPropagation(); // Prevents the click from bubbling up and triggering a focus event on the chat.\n }}\n className={richTextActionButtonsStyle}\n ariaLabel={localeStrings.sendButtonAriaLabel}\n tooltipContent={localeStrings.sendButtonAriaLabel}\n />\n );\n }, [localeStrings.sendButtonAriaLabel, onRenderSendIcon, sendMessageOnClick]);\n\n /* @conditional-compile-remove(file-sharing) */\n const hasFileUploads = useMemo(() => {\n return hasCompletedFileUploads(activeFileUploads) || hasIncompleteFileUploads(activeFileUploads);\n }, [activeFileUploads]);\n\n return (\n <Stack>\n <RichTextSendBoxErrors {...sendBoxErrorsProps} />\n <RichTextInputBoxComponent\n placeholderText={strings.placeholderText}\n onChange={setContent}\n onEnterKeyDown={sendMessageOnClick}\n editorComponentRef={editorComponentRef}\n strings={strings}\n disabled={disabled}\n actionComponents={sendButton}\n richTextEditorStyleProps={sendBoxRichTextEditorStyle}\n /* @conditional-compile-remove(file-sharing) */\n onRenderFileUploads={onRenderFileUploads}\n /* @conditional-compile-remove(file-sharing) */\n hasFiles={hasFileUploads}\n />\n </Stack>\n );\n};\n"]}
@@ -4,8 +4,8 @@ import { SendBoxErrorBarError } from '../SendBoxErrorBar';
4
4
  * @private
5
5
  */
6
6
  export interface RichTextSendBoxErrorsProps {
7
- fileUploadsPendingError?: SendBoxErrorBarError;
8
- fileUploadError?: SendBoxErrorBarError;
7
+ attachmentUploadsPendingError?: SendBoxErrorBarError;
8
+ attachmentUploadError?: SendBoxErrorBarError;
9
9
  systemMessage?: string;
10
10
  textTooLongMessage?: string;
11
11
  }
@@ -8,9 +8,9 @@ import { SendBoxErrorBar } from '../SendBoxErrorBar';
8
8
  export const RichTextSendBoxErrors = (props) => {
9
9
  const {
10
10
  /* @conditional-compile-remove(file-sharing) */
11
- fileUploadError,
11
+ attachmentUploadError,
12
12
  /* @conditional-compile-remove(file-sharing) */
13
- fileUploadsPendingError, systemMessage, textTooLongMessage } = props;
13
+ attachmentUploadsPendingError, systemMessage, textTooLongMessage } = props;
14
14
  const [sendBoxError, setSendBoxError] = useState(undefined);
15
15
  useEffect(() => {
16
16
  if (systemMessage && !isMessageEmpty(systemMessage)) {
@@ -35,12 +35,12 @@ export const RichTextSendBoxErrors = (props) => {
35
35
  errors.push(prev);
36
36
  }
37
37
  /* @conditional-compile-remove(file-sharing) */
38
- if (fileUploadsPendingError) {
39
- errors.push(fileUploadsPendingError);
38
+ if (attachmentUploadsPendingError) {
39
+ errors.push(attachmentUploadsPendingError);
40
40
  }
41
41
  /* @conditional-compile-remove(file-sharing) */
42
- if (fileUploadError) {
43
- errors.push(fileUploadError);
42
+ if (attachmentUploadError) {
43
+ errors.push(attachmentUploadError);
44
44
  }
45
45
  if (errors.length === 0) {
46
46
  return undefined;
@@ -50,8 +50,8 @@ export const RichTextSendBoxErrors = (props) => {
50
50
  return sortedErrors[0];
51
51
  });
52
52
  }, [
53
- /* @conditional-compile-remove(file-sharing) */ fileUploadError,
54
- /* @conditional-compile-remove(file-sharing) */ fileUploadsPendingError
53
+ /* @conditional-compile-remove(file-sharing) */ attachmentUploadError,
54
+ /* @conditional-compile-remove(file-sharing) */ attachmentUploadsPendingError
55
55
  ]);
56
56
  const onDismiss = useCallback(() => {
57
57
  if (systemMessage && !isMessageEmpty(systemMessage)) {
@@ -1 +1 @@
1
- {"version":3,"file":"RichTextSendBoxErrors.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/RichTextEditor/RichTextSendBoxErrors.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,eAAe,EAAwB,MAAM,oBAAoB,CAAC;AAc3E;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAiC,EAAe,EAAE;IACtF,MAAM;IACJ,+CAA+C;IAC/C,eAAe;IACf,+CAA+C;IAC/C,uBAAuB,EACvB,aAAa,EACb,kBAAkB,EACnB,GAAG,KAAK,CAAC;IACV,MAAM,CAAC,YAAY,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useCallback, useEffect, useState } from 'react';\nimport { SendBoxErrorBar, SendBoxErrorBarError } from '../SendBoxErrorBar';\n\n/**\n * @private\n */\nexport interface RichTextSendBoxErrorsProps {\n /* @conditional-compile-remove(file-sharing) */\n fileUploadsPendingError?: SendBoxErrorBarError;\n /* @conditional-compile-remove(file-sharing) */\n fileUploadError?: SendBoxErrorBarError;\n systemMessage?: string;\n textTooLongMessage?: string;\n}\n\n/**\n * @private\n */\nexport const RichTextSendBoxErrors = (props: RichTextSendBoxErrorsProps): JSX.Element => {\n const {\n /* @conditional-compile-remove(file-sharing) */\n fileUploadError,\n /* @conditional-compile-remove(file-sharing) */\n fileUploadsPendingError,\n systemMessage,\n textTooLongMessage\n } = props;\n const [sendBoxError, setSendBoxError] = useState<SendBoxErrorBarError | undefined>(undefined);\n\n useEffect(() => {\n if (systemMessage && !isMessageEmpty(systemMessage)) {\n setSendBoxError({ message: systemMessage, timestamp: Date.now() });\n }\n }, [systemMessage]);\n\n useEffect(() => {\n if (textTooLongMessage && !isMessageEmpty(textTooLongMessage)) {\n setSendBoxError({ message: textTooLongMessage, timestamp: Date.now() });\n }\n }, [textTooLongMessage]);\n\n useEffect(() => {\n if (\n (textTooLongMessage === undefined || isMessageEmpty(textTooLongMessage)) &&\n (systemMessage === undefined || isMessageEmpty(systemMessage))\n ) {\n setSendBoxError(undefined);\n }\n }, [systemMessage, textTooLongMessage]);\n\n useEffect(() => {\n setSendBoxError((prev) => {\n const errors: SendBoxErrorBarError[] = [];\n if (prev) {\n errors.push(prev);\n }\n /* @conditional-compile-remove(file-sharing) */\n if (fileUploadsPendingError) {\n errors.push(fileUploadsPendingError);\n }\n /* @conditional-compile-remove(file-sharing) */\n if (fileUploadError) {\n errors.push(fileUploadError);\n }\n if (errors.length === 0) {\n return undefined;\n }\n // sort to get the latest error\n const sortedErrors = errors.sort((a, b) => b.timestamp - a.timestamp);\n return sortedErrors[0];\n });\n }, [\n /* @conditional-compile-remove(file-sharing) */ fileUploadError,\n /* @conditional-compile-remove(file-sharing) */ fileUploadsPendingError\n ]);\n\n const onDismiss = useCallback(() => {\n if (systemMessage && !isMessageEmpty(systemMessage)) {\n setSendBoxError({ message: systemMessage, timestamp: Date.now() });\n }\n }, [systemMessage]);\n\n return (\n <SendBoxErrorBar\n error={sendBoxError}\n dismissAfterMs={\n // don't dismiss the system message\n systemMessage !== undefined && sendBoxError?.message !== systemMessage ? 10 * 1000 : undefined\n }\n onDismiss={onDismiss}\n />\n );\n};\n\nconst isMessageEmpty = (message: string): boolean => {\n return message.trim().length === 0;\n};\n"]}
1
+ {"version":3,"file":"RichTextSendBoxErrors.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/RichTextEditor/RichTextSendBoxErrors.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAChE,OAAO,EAAE,eAAe,EAAwB,MAAM,oBAAoB,CAAC;AAc3E;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,CAAC,KAAiC,EAAe,EAAE;IACtF,MAAM;IACJ,+CAA+C;IAC/C,qBAAqB;IACrB,+CAA+C;IAC/C,6BAA6B,EAC7B,aAAa,EACb,kBAAkB,EACnB,GAAG,KAAK,CAAC;IACV,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAmC,SAAS,CAAC,CAAC;IAE9F,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,aAAa,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,CAAC;YACpD,eAAe,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACrE,CAAC;IACH,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,SAAS,CAAC,GAAG,EAAE;QACb,IAAI,kBAAkB,IAAI,CAAC,c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,CAAC;IACL,CAAC,EAAE;QACD,+CAA+C,CAAC,qBAAqB;QACrE,+CAA+C,CAAC,6BAA6B;KAC9E,CAAC,CAAC;IAEH,MAAM,SAAS,GAAG,WAAW,CAAC,GAAG,EAAE;QACjC,IAAI,aAAa,IAAI,CAAC,cAAc,CAAC,aAAa,CAAC,EAAE,CAAC;YACpD,eAAe,CAAC,EAAE,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACrE,CAAC;IACH,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,OAAO,CACL,oBAAC,eAAe,IACd,KAAK,EAAE,YAAY,EACnB,cAAc;QACZ,mCAAmC;QACnC,aAAa,KAAK,SAAS,IAAI,CAAA,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,OAAO,MAAK,aAAa,CAAC,CAAC,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,CAAC,SAAS,EAEhG,SAAS,EAAE,SAAS,GACpB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,cAAc,GAAG,CAAC,OAAe,EAAW,EAAE;IAClD,OAAO,OAAO,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,CAAC;AACrC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useCallback, useEffect, useState } from 'react';\nimport { SendBoxErrorBar, SendBoxErrorBarError } from '../SendBoxErrorBar';\n\n/**\n * @private\n */\nexport interface RichTextSendBoxErrorsProps {\n /* @conditional-compile-remove(file-sharing) */\n attachmentUploadsPendingError?: SendBoxErrorBarError;\n /* @conditional-compile-remove(file-sharing) */\n attachmentUploadError?: SendBoxErrorBarError;\n systemMessage?: string;\n textTooLongMessage?: string;\n}\n\n/**\n * @private\n */\nexport const RichTextSendBoxErrors = (props: RichTextSendBoxErrorsProps): JSX.Element => {\n const {\n /* @conditional-compile-remove(file-sharing) */\n attachmentUploadError,\n /* @conditional-compile-remove(file-sharing) */\n attachmentUploadsPendingError,\n systemMessage,\n textTooLongMessage\n } = props;\n const [sendBoxError, setSendBoxError] = useState<SendBoxErrorBarError | undefined>(undefined);\n\n useEffect(() => {\n if (systemMessage && !isMessageEmpty(systemMessage)) {\n setSendBoxError({ message: systemMessage, timestamp: Date.now() });\n }\n }, [systemMessage]);\n\n useEffect(() => {\n if (textTooLongMessage && !isMessageEmpty(textTooLongMessage)) {\n setSendBoxError({ message: textTooLongMessage, timestamp: Date.now() });\n }\n }, [textTooLongMessage]);\n\n useEffect(() => {\n if (\n (textTooLongMessage === undefined || isMessageEmpty(textTooLongMessage)) &&\n (systemMessage === undefined || isMessageEmpty(systemMessage))\n ) {\n setSendBoxError(undefined);\n }\n }, [systemMessage, textTooLongMessage]);\n\n useEffect(() => {\n setSendBoxError((prev) => {\n const errors: SendBoxErrorBarError[] = [];\n if (prev) {\n errors.push(prev);\n }\n /* @conditional-compile-remove(file-sharing) */\n if (attachmentUploadsPendingError) {\n errors.push(attachmentUploadsPendingError);\n }\n /* @conditional-compile-remove(file-sharing) */\n if (attachmentUploadError) {\n errors.push(attachmentUploadError);\n }\n if (errors.length === 0) {\n return undefined;\n }\n // sort to get the latest error\n const sortedErrors = errors.sort((a, b) => b.timestamp - a.timestamp);\n return sortedErrors[0];\n });\n }, [\n /* @conditional-compile-remove(file-sharing) */ attachmentUploadError,\n /* @conditional-compile-remove(file-sharing) */ attachmentUploadsPendingError\n ]);\n\n const onDismiss = useCallback(() => {\n if (systemMessage && !isMessageEmpty(systemMessage)) {\n setSendBoxError({ message: systemMessage, timestamp: Date.now() });\n }\n }, [systemMessage]);\n\n return (\n <SendBoxErrorBar\n error={sendBoxError}\n dismissAfterMs={\n // don't dismiss the system message\n systemMessage !== undefined && sendBoxError?.message !== systemMessage ? 10 * 1000 : undefined\n }\n onDismiss={onDismiss}\n />\n );\n};\n\nconst isMessageEmpty = (message: string): boolean => {\n return message.trim().length === 0;\n};\n"]}