@azure/communication-react 1.20.0-beta.1 → 1.20.0

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 (634) hide show
  1. package/README.md +2 -2
  2. package/dist/communication-react.d.ts +245 -1703
  3. package/dist/dist-cjs/communication-react/index.js +36159 -165
  4. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/common.d.ts +0 -13
  6. package/dist/dist-esm/acs-ui-common/src/common.js.map +1 -1
  7. package/dist/dist-esm/acs-ui-common/src/constants.d.ts +0 -5
  8. package/dist/dist-esm/acs-ui-common/src/constants.js +0 -5
  9. package/dist/dist-esm/acs-ui-common/src/constants.js.map +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/index.d.ts +0 -4
  11. package/dist/dist-esm/acs-ui-common/src/index.js +0 -3
  12. package/dist/dist-esm/acs-ui-common/src/index.js.map +1 -1
  13. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  14. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  15. package/dist/dist-esm/acs-ui-javascript-loaders/src/callCompositeLoader.d.ts +16 -7
  16. package/dist/dist-esm/acs-ui-javascript-loaders/src/callCompositeLoader.js +10 -10
  17. package/dist/dist-esm/acs-ui-javascript-loaders/src/callCompositeLoader.js.map +1 -1
  18. package/dist/dist-esm/acs-ui-javascript-loaders/src/callWithChatCompositeLoader.d.ts +17 -7
  19. package/dist/dist-esm/acs-ui-javascript-loaders/src/callWithChatCompositeLoader.js +12 -10
  20. package/dist/dist-esm/acs-ui-javascript-loaders/src/callWithChatCompositeLoader.js.map +1 -1
  21. package/dist/dist-esm/acs-ui-javascript-loaders/src/chatCompositeLoader.d.ts +13 -7
  22. package/dist/dist-esm/acs-ui-javascript-loaders/src/chatCompositeLoader.js +10 -9
  23. package/dist/dist-esm/acs-ui-javascript-loaders/src/chatCompositeLoader.js.map +1 -1
  24. package/dist/dist-esm/acs-ui-javascript-loaders/src/outboundCallCompositeLoader.d.ts +16 -7
  25. package/dist/dist-esm/acs-ui-javascript-loaders/src/outboundCallCompositeLoader.js +10 -9
  26. package/dist/dist-esm/acs-ui-javascript-loaders/src/outboundCallCompositeLoader.js.map +1 -1
  27. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +3 -12
  28. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +0 -12
  29. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  30. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js +1 -1
  31. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js.map +1 -1
  32. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js +0 -2
  33. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js.map +1 -1
  34. package/dist/dist-esm/calling-component-bindings/src/getRemoteParticipantsExcludingConsumers.js +2 -1
  35. package/dist/dist-esm/calling-component-bindings/src/getRemoteParticipantsExcludingConsumers.js.map +1 -1
  36. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +12 -2
  37. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +26 -6
  38. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  39. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.d.ts +6 -0
  40. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +1 -5
  41. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
  42. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.d.ts +2 -0
  43. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js +2 -19
  44. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map +1 -1
  45. package/dist/dist-esm/calling-component-bindings/src/index.d.ts +2 -2
  46. package/dist/dist-esm/calling-component-bindings/src/index.js +1 -2
  47. package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
  48. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js +1 -35
  49. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js.map +1 -1
  50. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.d.ts +0 -1
  51. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +1 -3
  52. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
  53. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.d.ts +1 -2
  54. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js +3 -3
  55. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js.map +1 -1
  56. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js +0 -4
  57. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js.map +1 -1
  58. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +2 -79
  59. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  60. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +0 -15
  61. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +32 -107
  62. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  63. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -1
  64. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +0 -5
  65. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +4 -27
  66. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  67. package/dist/dist-esm/calling-stateful-client/src/CaptionsSubscriber.js.map +1 -1
  68. package/dist/dist-esm/calling-stateful-client/src/Converter.js +0 -3
  69. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  70. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js +58 -52
  71. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js.map +1 -1
  72. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.d.ts +0 -1
  73. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.js +1 -7
  74. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.js.map +1 -1
  75. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +5 -3
  76. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
  77. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js +0 -17
  78. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js.map +1 -1
  79. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +0 -3
  80. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  81. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.d.ts +2 -6
  82. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js +2 -35
  83. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
  84. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.d.ts +1 -2
  85. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js +0 -3
  86. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js.map +1 -1
  87. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +2 -25
  88. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  89. package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js +3 -3
  90. package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js.map +1 -1
  91. package/dist/dist-esm/chat-stateful-client/src/ChatClientState.d.ts +1 -15
  92. package/dist/dist-esm/chat-stateful-client/src/ChatClientState.js.map +1 -1
  93. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js +1 -2
  94. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js.map +1 -1
  95. package/dist/dist-esm/chat-stateful-client/src/index.d.ts +0 -1
  96. package/dist/dist-esm/chat-stateful-client/src/index.js.map +1 -1
  97. package/dist/dist-esm/communication-react/src/index.d.ts +1 -27
  98. package/dist/dist-esm/communication-react/src/index.js +0 -6
  99. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  100. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCard.js +3 -2
  101. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCard.js.map +1 -1
  102. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.d.ts +0 -2
  103. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js +0 -2
  104. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js.map +1 -1
  105. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +1 -13
  106. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js +3 -9
  107. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
  108. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +0 -11
  109. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +7 -34
  110. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  111. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.d.ts +1 -8
  112. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js +5 -9
  113. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
  114. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.d.ts +1 -2
  115. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js +4 -4
  116. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js.map +1 -1
  117. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.d.ts +1 -4
  118. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js +6 -31
  119. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js.map +1 -1
  120. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.d.ts +1 -15
  121. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js +0 -9
  122. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js.map +1 -1
  123. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +2 -23
  124. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js +6 -17
  125. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
  126. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.d.ts +1 -8
  127. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js +6 -10
  128. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
  129. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +5 -5
  130. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
  131. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +6 -4
  132. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
  133. package/dist/dist-esm/react-components/src/components/GridLayout.js +3 -0
  134. package/dist/dist-esm/react-components/src/components/GridLayout.js.map +1 -1
  135. package/dist/dist-esm/react-components/src/components/HorizontalGallery.js +4 -5
  136. package/dist/dist-esm/react-components/src/components/HorizontalGallery.js.map +1 -1
  137. package/dist/dist-esm/react-components/src/components/ImageOverlay.js +0 -2
  138. package/dist/dist-esm/react-components/src/components/ImageOverlay.js.map +1 -1
  139. package/dist/dist-esm/react-components/src/components/InputBoxComponent.d.ts +0 -2
  140. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +0 -15
  141. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
  142. package/dist/dist-esm/react-components/src/components/LocalVideoCameraButton.js +3 -0
  143. package/dist/dist-esm/react-components/src/components/LocalVideoCameraButton.js.map +1 -1
  144. package/dist/dist-esm/react-components/src/components/LocalVideoTile.d.ts +1 -0
  145. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js +4 -4
  146. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js.map +1 -1
  147. package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.js +2 -1
  148. package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.js.map +1 -1
  149. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +5 -81
  150. package/dist/dist-esm/react-components/src/components/MessageThread.js +6 -16
  151. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  152. package/dist/dist-esm/react-components/src/components/MicrophoneButton.d.ts +24 -0
  153. package/dist/dist-esm/react-components/src/components/MicrophoneButton.js +25 -0
  154. package/dist/dist-esm/react-components/src/components/MicrophoneButton.js.map +1 -1
  155. package/dist/dist-esm/react-components/src/components/ModalClone/ModalClone.js +2 -1
  156. package/dist/dist-esm/react-components/src/components/ModalClone/ModalClone.js.map +1 -1
  157. package/dist/dist-esm/react-components/src/components/Notification.js +3 -1
  158. package/dist/dist-esm/react-components/src/components/Notification.js.map +1 -1
  159. package/dist/dist-esm/react-components/src/components/NotificationStack.d.ts +0 -20
  160. package/dist/dist-esm/react-components/src/components/NotificationStack.js +0 -5
  161. package/dist/dist-esm/react-components/src/components/NotificationStack.js.map +1 -1
  162. package/dist/dist-esm/react-components/src/components/ParticipantItem.js +1 -1
  163. package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
  164. package/dist/dist-esm/react-components/src/components/ParticipantList.d.ts +0 -15
  165. package/dist/dist-esm/react-components/src/components/ParticipantList.js +3 -12
  166. package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
  167. package/dist/dist-esm/react-components/src/components/ReactionButton.js +31 -41
  168. package/dist/dist-esm/react-components/src/components/ReactionButton.js.map +1 -1
  169. package/dist/dist-esm/react-components/src/components/SendBox.d.ts +1 -47
  170. package/dist/dist-esm/react-components/src/components/SendBox.js +6 -57
  171. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  172. package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.js +7 -3
  173. package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.js.map +1 -1
  174. package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js +0 -1
  175. package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js.map +1 -1
  176. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js +0 -1
  177. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js.map +1 -1
  178. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js +0 -19
  179. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js.map +1 -1
  180. package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js +0 -1
  181. package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js.map +1 -1
  182. package/dist/dist-esm/react-components/src/components/VerticalGallery.js +2 -1
  183. package/dist/dist-esm/react-components/src/components/VerticalGallery.js.map +1 -1
  184. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js +3 -3
  185. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js.map +1 -1
  186. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js +6 -2
  187. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js.map +1 -1
  188. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteContentShareReactionOverlay.js +5 -4
  189. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteContentShareReactionOverlay.js.map +1 -1
  190. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js +1 -1
  191. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js.map +1 -1
  192. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +23 -17
  193. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
  194. package/dist/dist-esm/react-components/src/components/VideoGallery.js +3 -3
  195. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  196. package/dist/dist-esm/react-components/src/components/VideoTile.js +3 -0
  197. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  198. package/dist/dist-esm/react-components/src/components/index.d.ts +0 -20
  199. package/dist/dist-esm/react-components/src/components/index.js +0 -7
  200. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  201. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.d.ts +1 -1
  202. package/dist/dist-esm/react-components/src/components/styles/AttachmentCardGroup.styles.d.ts +1 -1
  203. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +3 -3
  204. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +0 -8
  205. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  206. package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.d.ts +13 -6
  207. package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.js +49 -19
  208. package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.js.map +1 -1
  209. package/dist/dist-esm/react-components/src/components/styles/ReactionOverlay.style.d.ts +0 -6
  210. package/dist/dist-esm/react-components/src/components/styles/ReactionOverlay.style.js +6 -35
  211. package/dist/dist-esm/react-components/src/components/styles/ReactionOverlay.style.js.map +1 -1
  212. package/dist/dist-esm/react-components/src/components/styles/StreamMedia.styles.js +5 -2
  213. package/dist/dist-esm/react-components/src/components/styles/StreamMedia.styles.js.map +1 -1
  214. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js +2 -1
  215. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js.map +1 -1
  216. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.d.ts +1 -37
  217. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js +3 -30
  218. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js.map +1 -1
  219. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.d.ts +2 -4
  220. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js +2 -9
  221. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
  222. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +1 -38
  223. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +4 -131
  224. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  225. package/dist/dist-esm/react-components/src/components/utils/common.js +0 -2
  226. package/dist/dist-esm/react-components/src/components/utils/common.js.map +1 -1
  227. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.d.ts +1 -2
  228. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.js.map +1 -1
  229. package/dist/dist-esm/react-components/src/components/utils/responsive.js +6 -0
  230. package/dist/dist-esm/react-components/src/components/utils/responsive.js.map +1 -1
  231. package/dist/dist-esm/react-components/src/components/utils.js +1 -6
  232. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  233. package/dist/dist-esm/react-components/src/gallery/dominantSpeaker.js.map +1 -1
  234. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.d.ts +0 -4
  235. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js +1 -3
  236. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js.map +1 -1
  237. package/dist/dist-esm/react-components/src/index.d.ts +0 -1
  238. package/dist/dist-esm/react-components/src/index.js.map +1 -1
  239. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +0 -54
  240. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
  241. package/dist/dist-esm/react-components/src/localization/locales/cy-GB/strings.json +1 -1
  242. package/dist/dist-esm/react-components/src/theming/generateTheme.js +10 -2
  243. package/dist/dist-esm/react-components/src/theming/generateTheme.js.map +1 -1
  244. package/dist/dist-esm/react-components/src/theming/icons.d.ts +0 -30
  245. package/dist/dist-esm/react-components/src/theming/icons.js +0 -91
  246. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  247. package/dist/dist-esm/react-components/src/theming/themes.d.ts +0 -6
  248. package/dist/dist-esm/react-components/src/theming/themes.js +0 -9
  249. package/dist/dist-esm/react-components/src/theming/themes.js.map +1 -1
  250. package/dist/dist-esm/react-components/src/types/Attachment.d.ts +0 -13
  251. package/dist/dist-esm/react-components/src/types/Attachment.js.map +1 -1
  252. package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +1 -20
  253. package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
  254. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +0 -72
  255. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +13 -23
  256. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  257. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +4 -34
  258. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  259. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +17 -47
  260. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +68 -137
  261. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  262. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +26 -24
  263. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js +1 -1
  264. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  265. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.d.ts +2 -2
  266. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.js +6 -7
  267. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.js.map +1 -1
  268. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/OnFetchProfileCallback.js +9 -4
  269. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/OnFetchProfileCallback.js.map +1 -1
  270. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.d.ts +2 -0
  271. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.js.map +1 -1
  272. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +0 -2
  273. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  274. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +21 -24
  275. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  276. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.d.ts +0 -3
  277. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +50 -13
  278. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  279. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.d.ts +0 -2
  280. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js +0 -19
  281. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js.map +1 -1
  282. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js +2 -10
  283. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js.map +1 -1
  284. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.d.ts +0 -2
  285. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js +0 -19
  286. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js.map +1 -1
  287. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.d.ts +0 -1
  288. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +41 -25
  289. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
  290. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +12 -10
  291. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  292. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js +1 -1
  293. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js.map +1 -1
  294. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.d.ts +1 -0
  295. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.js +1 -1
  296. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.js.map +1 -1
  297. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.d.ts +1 -0
  298. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js +1 -1
  299. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js.map +1 -1
  300. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +7 -4
  301. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
  302. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js +5 -2
  303. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js.map +1 -1
  304. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js +7 -6
  305. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js.map +1 -1
  306. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js +4 -4
  307. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js.map +1 -1
  308. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.d.ts +0 -1
  309. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.js +7 -23
  310. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.js.map +1 -1
  311. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.d.ts +3 -0
  312. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js +6 -7
  313. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js.map +1 -1
  314. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js +5 -5
  315. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js.map +1 -1
  316. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js +1 -2
  317. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js.map +1 -1
  318. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +9 -5
  319. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  320. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +0 -3
  321. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  322. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +2 -2
  323. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  324. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.d.ts +0 -7
  325. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +16 -53
  326. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  327. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js +7 -9
  328. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js.map +1 -1
  329. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js +2 -2
  330. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js.map +1 -1
  331. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js +2 -2
  332. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js.map +1 -1
  333. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js +5 -2
  334. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js.map +1 -1
  335. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +21 -25
  336. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +16 -16
  337. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  338. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js +1 -1
  339. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js.map +1 -1
  340. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localPreviewSelector.js +2 -1
  341. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localPreviewSelector.js.map +1 -1
  342. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js +10 -11
  343. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js.map +1 -1
  344. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +2 -14
  345. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +12 -68
  346. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  347. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +0 -65
  348. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +5 -24
  349. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  350. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.d.ts +0 -8
  351. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.js.map +1 -1
  352. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +5 -22
  353. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +14 -139
  354. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  355. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +11 -28
  356. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  357. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +2 -2
  358. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +13 -9
  359. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  360. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.d.ts +4 -10
  361. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +2 -14
  362. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
  363. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +11 -11
  364. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +2 -2
  365. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  366. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.d.ts +0 -5
  367. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js +0 -13
  368. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js.map +1 -1
  369. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts +0 -27
  370. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js +1 -2
  371. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
  372. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.d.ts +0 -2
  373. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +49 -234
  374. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  375. package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.d.ts +0 -20
  376. package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.js.map +1 -1
  377. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +2 -6
  378. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +0 -36
  379. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  380. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts +2 -12
  381. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
  382. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js +2 -13
  383. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js.map +1 -1
  384. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useSelector.d.ts +6 -0
  385. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useSelector.js +11 -0
  386. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useSelector.js.map +1 -0
  387. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.d.ts +0 -2
  388. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
  389. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.d.ts +12 -0
  390. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js +9 -0
  391. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js.map +1 -0
  392. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +28 -15
  393. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  394. package/dist/dist-esm/react-composites/src/composites/common/HiddenFocusStartPoint.js +4 -1
  395. package/dist/dist-esm/react-composites/src/composites/common/HiddenFocusStartPoint.js.map +1 -1
  396. package/dist/dist-esm/react-composites/src/composites/common/MeetingPhoneInfoPaneContent.js +1 -1
  397. package/dist/dist-esm/react-composites/src/composites/common/MeetingPhoneInfoPaneContent.js.map +1 -1
  398. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js +5 -6
  399. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js.map +1 -1
  400. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js +1 -2
  401. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js.map +1 -1
  402. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.d.ts +3 -0
  403. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +4 -7
  404. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
  405. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.d.ts +2 -41
  406. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js +0 -21
  407. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js.map +1 -1
  408. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.d.ts +2 -0
  409. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +3 -4
  410. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  411. package/dist/dist-esm/react-composites/src/composites/common/adapters.d.ts +0 -23
  412. package/dist/dist-esm/react-composites/src/composites/common/adapters.js.map +1 -1
  413. package/dist/dist-esm/react-composites/src/composites/common/constants.d.ts +0 -5
  414. package/dist/dist-esm/react-composites/src/composites/common/constants.js +0 -5
  415. package/dist/dist-esm/react-composites/src/composites/common/constants.js.map +1 -1
  416. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +6 -32
  417. package/dist/dist-esm/react-composites/src/composites/common/icons.js +0 -2
  418. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  419. package/dist/dist-esm/react-composites/src/composites/common/resolveDeepNoiseSuppressionDependency.d.ts +8 -0
  420. package/dist/dist-esm/react-composites/src/composites/common/resolveDeepNoiseSuppressionDependency.js +24 -0
  421. package/dist/dist-esm/react-composites/src/composites/common/resolveDeepNoiseSuppressionDependency.js.map +1 -0
  422. package/dist/dist-esm/react-composites/src/composites/common/resolveDeepNoiseSuppressionDependencyLazy.d.ts +8 -0
  423. package/dist/dist-esm/react-composites/src/composites/common/resolveDeepNoiseSuppressionDependencyLazy.js +24 -0
  424. package/dist/dist-esm/react-composites/src/composites/common/resolveDeepNoiseSuppressionDependencyLazy.js.map +1 -0
  425. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.js.map +1 -1
  426. package/dist/dist-esm/react-composites/src/composites/common/utils.d.ts +0 -4
  427. package/dist/dist-esm/react-composites/src/composites/common/utils.js +0 -22
  428. package/dist/dist-esm/react-composites/src/composites/common/utils.js.map +1 -1
  429. package/dist/dist-esm/react-composites/src/composites/index.d.ts +2 -1
  430. package/dist/dist-esm/react-composites/src/composites/index.js +2 -0
  431. package/dist/dist-esm/react-composites/src/composites/index.js.map +1 -1
  432. package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json +2 -1
  433. package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +2 -1
  434. package/dist/dist-esm/react-composites/src/composites/localization/locales/cy-GB/strings.json +2 -1
  435. package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +2 -1
  436. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +2 -1
  437. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +2 -1
  438. package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +2 -1
  439. package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json +2 -1
  440. package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +2 -1
  441. package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/strings.json +2 -1
  442. package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +2 -1
  443. package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +2 -1
  444. package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +1 -0
  445. package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/strings.json +2 -1
  446. package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +2 -1
  447. package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/strings.json +2 -1
  448. package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +2 -1
  449. package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +2 -1
  450. package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/strings.json +2 -1
  451. package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +2 -1
  452. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +2 -1
  453. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +2 -1
  454. package/package.json +8 -9
  455. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-CK3wKmiQ.js +0 -202
  456. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-CK3wKmiQ.js.map +0 -1
  457. package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-Duh89Mej.js +0 -50
  458. package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-Duh89Mej.js.map +0 -1
  459. package/dist/dist-cjs/communication-react/index-XC7Z08jO.js +0 -42425
  460. package/dist/dist-cjs/communication-react/index-XC7Z08jO.js.map +0 -1
  461. package/dist/dist-esm/acs-ui-common/src/dataConversion.d.ts +0 -6
  462. package/dist/dist-esm/acs-ui-common/src/dataConversion.js +0 -16
  463. package/dist/dist-esm/acs-ui-common/src/dataConversion.js.map +0 -1
  464. package/dist/dist-esm/acs-ui-common/src/removeImageTags.d.ts +0 -7
  465. package/dist/dist-esm/acs-ui-common/src/removeImageTags.js +0 -18
  466. package/dist/dist-esm/acs-ui-common/src/removeImageTags.js.map +0 -1
  467. package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.d.ts +0 -20
  468. package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.js +0 -118
  469. package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.js.map +0 -1
  470. package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.d.ts +0 -17
  471. package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.js +0 -33
  472. package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.js.map +0 -1
  473. package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.d.ts +0 -6
  474. package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.js +0 -20
  475. package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.js.map +0 -1
  476. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.d.ts +0 -10
  477. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js +0 -15
  478. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js.map +0 -1
  479. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.d.ts +0 -24
  480. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +0 -192
  481. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +0 -1
  482. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.d.ts +0 -69
  483. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js +0 -36
  484. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js.map +0 -1
  485. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.d.ts +0 -75
  486. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js +0 -67
  487. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js.map +0 -1
  488. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.d.ts +0 -105
  489. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js +0 -51
  490. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js.map +0 -1
  491. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.d.ts +0 -86
  492. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js +0 -39
  493. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js.map +0 -1
  494. package/dist/dist-esm/react-components/src/components/MentionPopover.d.ts +0 -121
  495. package/dist/dist-esm/react-components/src/components/MentionPopover.js +0 -119
  496. package/dist/dist-esm/react-components/src/components/MentionPopover.js.map +0 -1
  497. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.d.ts +0 -9
  498. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.js +0 -29
  499. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.js.map +0 -1
  500. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.d.ts +0 -30
  501. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js +0 -98
  502. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js.map +0 -1
  503. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.d.ts +0 -12
  504. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.js +0 -23
  505. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.js.map +0 -1
  506. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.d.ts +0 -15
  507. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js +0 -42
  508. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js.map +0 -1
  509. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.d.ts +0 -24
  510. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.js +0 -64
  511. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.js.map +0 -1
  512. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.d.ts +0 -20
  513. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.js +0 -45
  514. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.js.map +0 -1
  515. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.d.ts +0 -14
  516. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.js +0 -42
  517. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.js.map +0 -1
  518. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.d.ts +0 -29
  519. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.js +0 -87
  520. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.js.map +0 -1
  521. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.d.ts +0 -58
  522. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +0 -314
  523. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +0 -1
  524. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.d.ts +0 -37
  525. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +0 -78
  526. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +0 -1
  527. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +0 -211
  528. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +0 -168
  529. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +0 -1
  530. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.d.ts +0 -16
  531. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js +0 -75
  532. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js.map +0 -1
  533. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.d.ts +0 -19
  534. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js +0 -221
  535. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js.map +0 -1
  536. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.d.ts +0 -7
  537. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.js +0 -51
  538. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.js.map +0 -1
  539. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.d.ts +0 -15
  540. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js +0 -64
  541. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js.map +0 -1
  542. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.d.ts +0 -6
  543. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.js +0 -13
  544. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.js.map +0 -1
  545. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.d.ts +0 -56
  546. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.js +0 -75
  547. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.js.map +0 -1
  548. package/dist/dist-esm/react-components/src/components/SendBoxErrors.d.ts +0 -14
  549. package/dist/dist-esm/react-components/src/components/SendBoxErrors.js +0 -18
  550. package/dist/dist-esm/react-components/src/components/SendBoxErrors.js.map +0 -1
  551. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.d.ts +0 -24
  552. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +0 -550
  553. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +0 -1
  554. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.d.ts +0 -152
  555. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js +0 -816
  556. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js.map +0 -1
  557. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.d.ts +0 -58
  558. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js +0 -144
  559. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js.map +0 -1
  560. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.d.ts +0 -26
  561. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js +0 -69
  562. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js.map +0 -1
  563. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.d.ts +0 -82
  564. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +0 -320
  565. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +0 -1
  566. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.d.ts +0 -21
  567. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js +0 -38
  568. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js.map +0 -1
  569. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.d.ts +0 -38
  570. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js +0 -99
  571. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js.map +0 -1
  572. package/dist/dist-esm/react-components/src/components/styles/Stack.style.d.ts +0 -5
  573. package/dist/dist-esm/react-components/src/components/styles/Stack.style.js +0 -32
  574. package/dist/dist-esm/react-components/src/components/styles/Stack.style.js.map +0 -1
  575. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.d.ts +0 -26
  576. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js +0 -69
  577. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js.map +0 -1
  578. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.d.ts +0 -72
  579. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js +0 -174
  580. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js.map +0 -1
  581. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.d.ts +0 -33
  582. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js +0 -116
  583. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js.map +0 -1
  584. package/dist/dist-esm/react-components/src/components/utils/merge.d.ts +0 -7
  585. package/dist/dist-esm/react-components/src/components/utils/merge.js +0 -16
  586. package/dist/dist-esm/react-components/src/components/utils/merge.js.map +0 -1
  587. package/dist/dist-esm/react-components/src/theming/icons.styles.d.ts +0 -6
  588. package/dist/dist-esm/react-components/src/theming/icons.styles.js +0 -25
  589. package/dist/dist-esm/react-components/src/theming/icons.styles.js.map +0 -1
  590. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Banner.d.ts +0 -47
  591. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Banner.js +0 -48
  592. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Banner.js.map +0 -1
  593. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.d.ts +0 -11
  594. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.js +0 -36
  595. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.js.map +0 -1
  596. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.d.ts +0 -49
  597. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js +0 -196
  598. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js.map +0 -1
  599. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useCompositeStringsForNotificationStack.d.ts +0 -7
  600. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useCompositeStringsForNotificationStack.js +0 -14
  601. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useCompositeStringsForNotificationStack.js.map +0 -1
  602. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.d.ts +0 -15
  603. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js +0 -41
  604. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js.map +0 -1
  605. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.d.ts +0 -8
  606. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.js +0 -25
  607. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.js.map +0 -1
  608. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.d.ts +0 -15
  609. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.js +0 -23
  610. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.js.map +0 -1
  611. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.d.ts +0 -18
  612. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js +0 -18
  613. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js.map +0 -1
  614. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.d.ts +0 -49
  615. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.js +0 -44
  616. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.js.map +0 -1
  617. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.d.ts +0 -39
  618. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js +0 -253
  619. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js.map +0 -1
  620. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.d.ts +0 -80
  621. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js +0 -36
  622. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js.map +0 -1
  623. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.d.ts +0 -38
  624. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js +0 -67
  625. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js.map +0 -1
  626. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.d.ts +0 -5
  627. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js +0 -5
  628. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js.map +0 -1
  629. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/Timer.d.ts +0 -12
  630. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/Timer.js +0 -52
  631. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/Timer.js.map +0 -1
  632. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.d.ts +0 -10
  633. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js +0 -16
  634. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js.map +0 -1
@@ -1,314 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
4
- import { richTextEditorWrapperStyle, richTextEditorStyle } from '../styles/RichTextEditor.styles';
5
- import { useTheme } from '../../theming';
6
- import { isDarkThemed } from '../../theming/themeUtils';
7
- import CopyPastePlugin from './Plugins/CopyPastePlugin';
8
- import { createModelFromHtml, Editor, exportContent } from 'roosterjs-content-model-core';
9
- import { createBr, createEmptyModel, createParagraph, createSelectionMarker, setSelection } from 'roosterjs-content-model-dom';
10
- import { KeyboardInputPlugin } from './Plugins/KeyboardInputPlugin';
11
- import { AutoFormatPlugin, EditPlugin, PastePlugin, ShortcutPlugin, DefaultSanitizers } from 'roosterjs-content-model-plugins';
12
- import { UpdateContentPlugin, UpdateEvent } from './Plugins/UpdateContentPlugin';
13
- import { RichTextToolbar } from './Toolbar/RichTextToolbar';
14
- import { RichTextToolbarPlugin } from './Plugins/RichTextToolbarPlugin';
15
- import { ContextMenuPlugin } from './Plugins/ContextMenuPlugin';
16
- import { TableEditContextMenuProvider } from './Plugins/TableEditContextMenuProvider';
17
- import { borderApplier, dataSetApplier } from '../utils/RichTextEditorUtils';
18
- import { getPreviousInlineImages, getRemovedInlineImages, removeLocalBlobs, cleanAllLocalBlobs } from '../utils/RichTextEditorUtils';
19
- import { ContextualMenu } from '@fluentui/react';
20
- import { PlaceholderPlugin } from './Plugins/PlaceholderPlugin';
21
- import { getFormatState, setDirection } from 'roosterjs-content-model-api';
22
- import UndoRedoPlugin from './Plugins/UndoRedoPlugin';
23
- /**
24
- * A component to wrap RoosterJS Rich Text Editor.
25
- *
26
- * @beta
27
- */
28
- export const RichTextEditor = React.forwardRef((props, ref) => {
29
- const { initialContent, onChange, placeholderText, strings, showRichTextEditorFormatting, autoFocus, onKeyDown, onContentModelUpdate, contentModel, onPaste, onInsertInlineImage } = props;
30
- const editor = useRef(null);
31
- const editorDiv = useRef(null);
32
- const theme = useTheme();
33
- const [contextMenuProps, setContextMenuProps] = useState(null);
34
- const previousThemeDirection = useRef(themeDirection(theme)); // This will be set when the editor is initialized and when the content is updated.
35
- const [previousInlineImages, setPreviousInlineImages] = useState([]);
36
- const [inlineImageLocalBlobs, setInlineImageLocalBlobs] = useState({});
37
- useEffect(() => {
38
- return () => {
39
- // Cleanup Local Blob URLs when the component is unmounted
40
- cleanAllLocalBlobs(inlineImageLocalBlobs);
41
- };
42
- // This effect should only run once when the component is unmounted, so we don't need to add any dependencies
43
- // eslint-disable-next-line react-hooks/exhaustive-deps
44
- }, []);
45
- useImperativeHandle(ref, () => {
46
- return {
47
- focus() {
48
- if (editor.current) {
49
- editor.current.focus();
50
- }
51
- },
52
- setEmptyContent() {
53
- setPreviousInlineImages([]);
54
- cleanAllLocalBlobs(inlineImageLocalBlobs);
55
- if (editor.current) {
56
- // remove all content from the editor and update the model
57
- // ContentChanged event will be sent by RoosterJS automatically
58
- editor.current.formatContentModel((model) => {
59
- // Create a new empty paragraph with selection marker
60
- // this is needed for correct processing of images after the content is deleted
61
- const newModel = createEmptyModel();
62
- model.blocks = newModel.blocks;
63
- return true;
64
- });
65
- //reset content model
66
- onContentModelUpdate && onContentModelUpdate(editor.current.getContentModelCopy('disconnected'));
67
- }
68
- },
69
- getPlainContent() {
70
- if (editor.current) {
71
- return exportContent(editor.current, 'PlainTextFast');
72
- }
73
- else {
74
- return undefined;
75
- }
76
- }
77
- };
78
- }, [inlineImageLocalBlobs, onContentModelUpdate]);
79
- const toolbarPlugin = React.useMemo(() => {
80
- return new RichTextToolbarPlugin();
81
- }, []);
82
- const placeholderPlugin = useMemo(() => {
83
- var _a;
84
- const textColor = (_a = theme.palette) === null || _a === void 0 ? void 0 : _a.neutralSecondary;
85
- return new PlaceholderPlugin('', textColor ? {
86
- textColor: textColor
87
- } : undefined);
88
- }, [theme]);
89
- useEffect(() => {
90
- if (placeholderText !== undefined) {
91
- placeholderPlugin.updatePlaceholder(placeholderText);
92
- }
93
- }, [placeholderPlugin, placeholderText]);
94
- const toolbar = useMemo(() => {
95
- return React.createElement(RichTextToolbar, { plugin: toolbarPlugin, strings: strings });
96
- }, [strings, toolbarPlugin]);
97
- const updatePlugin = useMemo(() => {
98
- return new UpdateContentPlugin();
99
- }, []);
100
- const copyPastePlugin = useMemo(() => {
101
- return new CopyPastePlugin();
102
- }, []);
103
- const onChangeContent = useCallback((shouldUpdateInlineImages) => {
104
- if (editor.current === null) {
105
- return;
106
- }
107
- const content = exportContent(editor.current);
108
- let removedInlineImages = [];
109
- if (shouldUpdateInlineImages) {
110
- removedInlineImages = getRemovedInlineImages(content, previousInlineImages);
111
- }
112
- onChange && onChange(content, removedInlineImages);
113
- setPreviousInlineImages(getPreviousInlineImages(content));
114
- }, [onChange, previousInlineImages]);
115
- useEffect(() => {
116
- // don't set callback in plugin constructor to update callback without plugin recreation
117
- updatePlugin.onUpdate = (event, shouldRemoveInlineImages) => {
118
- if (editor.current === null) {
119
- return;
120
- }
121
- if (event === UpdateEvent.Blur || event === UpdateEvent.Dispose) {
122
- onContentModelUpdate && onContentModelUpdate(editor.current.getContentModelCopy('disconnected'));
123
- }
124
- else {
125
- const content = exportContent(editor.current);
126
- let removedInlineImages = [];
127
- if (shouldRemoveInlineImages) {
128
- removedInlineImages = getRemovedInlineImages(content, previousInlineImages);
129
- if (removedInlineImages.length > 0) {
130
- removeLocalBlobs(inlineImageLocalBlobs, removedInlineImages);
131
- }
132
- }
133
- onChange && onChange(content, removedInlineImages);
134
- setPreviousInlineImages(getPreviousInlineImages(content));
135
- }
136
- };
137
- }, [onChange, onContentModelUpdate, updatePlugin, previousInlineImages, inlineImageLocalBlobs]);
138
- const undoRedoPlugin = useMemo(() => {
139
- return new UndoRedoPlugin();
140
- }, []);
141
- useEffect(() => {
142
- if (onInsertInlineImage) {
143
- copyPastePlugin.onInsertInlineImage = (imageAttributes) => {
144
- const { id, src } = imageAttributes;
145
- setInlineImageLocalBlobs(Object.assign(Object.assign({}, inlineImageLocalBlobs), { [id]: src }));
146
- onInsertInlineImage(imageAttributes);
147
- };
148
- }
149
- else {
150
- copyPastePlugin.onInsertInlineImage = undefined;
151
- }
152
- undoRedoPlugin.onInsertInlineImage = onInsertInlineImage;
153
- }, [copyPastePlugin, inlineImageLocalBlobs, onInsertInlineImage, undoRedoPlugin]);
154
- useEffect(() => {
155
- undoRedoPlugin.onUpdateContent = () => {
156
- onChangeContent(true);
157
- };
158
- }, [onChangeContent, undoRedoPlugin]);
159
- const keyboardInputPlugin = useMemo(() => {
160
- return new KeyboardInputPlugin();
161
- }, []);
162
- useEffect(() => {
163
- // don't set callback in plugin constructor to update callback without plugin recreation
164
- keyboardInputPlugin.onKeyDown = onKeyDown;
165
- }, [keyboardInputPlugin, onKeyDown]);
166
- const tableContextMenuPlugin = useMemo(() => {
167
- return new TableEditContextMenuProvider();
168
- }, []);
169
- useEffect(() => {
170
- tableContextMenuPlugin.updateStrings(strings);
171
- }, [tableContextMenuPlugin, strings]);
172
- const onContextMenuRender = useCallback((container, items, onDismiss) => {
173
- setContextMenuProps({
174
- items: items,
175
- target: container,
176
- onDismiss: onDismiss
177
- });
178
- }, []);
179
- const onContextMenuDismiss = useCallback(() => {
180
- setContextMenuProps(null);
181
- }, []);
182
- useEffect(() => {
183
- copyPastePlugin.onPaste = onPaste;
184
- }, [copyPastePlugin, onPaste]);
185
- const plugins = useMemo(() => {
186
- const contentEdit = new EditPlugin({
187
- handleTabKey: false
188
- });
189
- // AutoFormatPlugin previously was a part of the edit plugin
190
- const autoFormatPlugin = new AutoFormatPlugin({
191
- autoBullet: true,
192
- autoNumbering: true,
193
- autoLink: true
194
- });
195
- const roosterPastePlugin = new PastePlugin(false, {
196
- additionalDisallowedTags: ['head', '!doctype', '!cdata', '#comment'],
197
- additionalAllowedTags: [],
198
- styleSanitizers: DefaultSanitizers,
199
- attributeSanitizers: {}
200
- });
201
- const shortcutPlugin = new ShortcutPlugin();
202
- const contextMenuPlugin = new ContextMenuPlugin(onContextMenuRender, onContextMenuDismiss);
203
- return [placeholderPlugin, keyboardInputPlugin, contentEdit, autoFormatPlugin, updatePlugin, copyPastePlugin, roosterPastePlugin, toolbarPlugin, shortcutPlugin,
204
- // contextPlugin and tableEditMenuProvider allow to show insert/delete menu for the table
205
- contextMenuPlugin, tableContextMenuPlugin, undoRedoPlugin];
206
- }, [onContextMenuRender, onContextMenuDismiss, placeholderPlugin, keyboardInputPlugin, updatePlugin, copyPastePlugin, toolbarPlugin, tableContextMenuPlugin, undoRedoPlugin]);
207
- const announcerStringGetter = useCallback((key) => {
208
- var _a, _b;
209
- switch (key) {
210
- case 'announceListItemBullet':
211
- return (_a = strings.richTextNewBulletedListItemAnnouncement) !== null && _a !== void 0 ? _a : '';
212
- case 'announceListItemNumbering':
213
- return (_b = strings.richTextNewNumberedListItemAnnouncement) !== null && _b !== void 0 ? _b : '';
214
- case 'announceOnFocusLastCell':
215
- return '';
216
- }
217
- }, [strings.richTextNewBulletedListItemAnnouncement, strings.richTextNewNumberedListItemAnnouncement]);
218
- useEffect(() => {
219
- var _a;
220
- const prevInlineImage = getPreviousInlineImages(initialContent);
221
- setPreviousInlineImages(prevInlineImage);
222
- const initialModel = createEditorInitialModel(initialContent, contentModel);
223
- if (editorDiv.current) {
224
- editor.current = new Editor(editorDiv.current, {
225
- inDarkMode: isDarkThemed(theme),
226
- // doNotAdjustEditorColor is used to disable default color and background color for Rooster component
227
- doNotAdjustEditorColor: true,
228
- imageSelectionBorderColor: theme.palette.themePrimary,
229
- tableCellSelectionBackgroundColor: theme.palette.neutralLight,
230
- plugins: plugins,
231
- initialModel: initialModel,
232
- defaultModelToDomOptions: {
233
- formatApplierOverride: {
234
- // apply border and dataset formats for table
235
- border: borderApplier,
236
- dataset: dataSetApplier
237
- }
238
- },
239
- announcerStringGetter: announcerStringGetter
240
- });
241
- }
242
- if (autoFocus === 'sendBoxTextField') {
243
- (_a = editor.current) === null || _a === void 0 ? void 0 : _a.focus();
244
- }
245
- return () => {
246
- if (editor.current) {
247
- editor.current.dispose();
248
- editor.current = null;
249
- }
250
- };
251
- // don't update the editor on deps update as everything is handled in separate hooks or plugins
252
- // eslint-disable-next-line react-hooks/exhaustive-deps
253
- }, [theme, plugins, announcerStringGetter]);
254
- useEffect(() => {
255
- const themeDirectionValue = themeDirection(theme);
256
- // check that editor exists and theme was actually changed
257
- // as format.direction will be undefined if setDirection is not called
258
- if (editor.current && previousThemeDirection.current !== themeDirectionValue) {
259
- const format = getFormatState(editor.current);
260
- if (format.direction !== themeDirectionValue) {
261
- // should be set after the hook where editor is created as the editor might be null
262
- // setDirection will cause the focus change back to the editor and this might not be what we want to do (autoFocus prop)
263
- // that's why it's not part of the create editor hook
264
- setDirection(editor.current, theme.rtl ? 'rtl' : 'ltr');
265
- }
266
- previousThemeDirection.current = themeDirectionValue;
267
- }
268
- }, [theme]);
269
- return React.createElement("div", { "data-testid": 'rich-text-editor-wrapper' },
270
- showRichTextEditorFormatting && toolbar,
271
- React.createElement("div", { className: richTextEditorWrapperStyle(theme) },
272
- React.createElement("div", { id: "richTextSendBox", ref: editorDiv, tabIndex: 0, role: "textbox", "aria-multiline": "true", "data-testid": 'rooster-rich-text-editor', className: richTextEditorStyle(props.styles), "aria-label": placeholderText })),
273
- contextMenuProps && React.createElement(ContextualMenu, Object.assign({}, contextMenuProps, { calloutProps: {
274
- isBeakVisible: false
275
- } })));
276
- });
277
- const createEditorInitialModel = (initialContent, contentModel) => {
278
- if (contentModel) {
279
- // contentModel is the current content of the editor
280
- return contentModel;
281
- }
282
- else {
283
- const initialContentValue = initialContent;
284
- const initialModel = initialContentValue && initialContentValue.length > 0 ? createModelFromHtml(initialContentValue) : undefined;
285
- if (initialModel && initialModel.blocks.length > 0) {
286
- // lastBlock should have blockType = paragraph, otherwise add a new paragraph
287
- // to set focus to the end of the content
288
- const lastBlock = initialModel.blocks[initialModel.blocks.length - 1];
289
- if ((lastBlock === null || lastBlock === void 0 ? void 0 : lastBlock.blockType) === 'Paragraph') {
290
- // now lastBlock is paragraph
291
- setSelectionAfterLastSegment(initialModel, lastBlock);
292
- }
293
- else {
294
- const block = createParagraph(false);
295
- initialModel.blocks.push(block);
296
- setSelectionAfterLastSegment(initialModel, block);
297
- // add content to the paragraph, otherwise height might be calculated incorrectly
298
- block.segments.push(createBr());
299
- }
300
- }
301
- return initialModel;
302
- }
303
- };
304
- const setSelectionAfterLastSegment = (model, block) => {
305
- //selection marker should have the same format as the last segment if any
306
- const format = block.segments.length > 0 ? block.segments[block.segments.length - 1].format : undefined;
307
- const marker = createSelectionMarker(format);
308
- block.segments.push(marker);
309
- setSelection(model, marker);
310
- };
311
- const themeDirection = (theme) => {
312
- return theme.rtl ? 'rtl' : 'ltr';
313
- };
314
- //# sourceMappingURL=RichTextEditor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RichTextEditor.js","sourceRoot":"","sources":["../../../../../../preprocess-dist/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,QAAQ,EAAE,MAAM,OAAO,CAAC;AACtG,OAAO,EAAE,0BAA0B,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AAClG,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEzC,OAAO,E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,EAAQ,EAAE;IACjH,yEAAyE;IACzE,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACxG,MAAM,MAAM,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAC7C,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAC5B,YAAY,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC9B,CAAC,CAAC;AACF,MAAM,cAAc,GAAG,CAAC,KAAY,EAAiB,EAAE;IACrD,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AACnC,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';\nimport { richTextEditorWrapperStyle, richTextEditorStyle } from '../styles/RichTextEditor.styles';\nimport { useTheme } from '../../theming';\nimport { RichTextStrings } from './RichTextSendBox';\nimport { isDarkThemed } from '../../theming/themeUtils';\nimport CopyPastePlugin from './Plugins/CopyPastePlugin';\nimport type { ContentModelDocument, ContentModelParagraph, EditorPlugin, IEditor, ReadonlyContentModelBlockGroup, ShallowMutableContentModelDocument, KnownAnnounceStrings } from 'roosterjs-content-model-types';\nimport { createModelFromHtml, Editor, exportContent } from 'roosterjs-content-model-core';\nimport { createBr, createEmptyModel, createParagraph, createSelectionMarker, setSelection } from 'roosterjs-content-model-dom';\nimport { KeyboardInputPlugin } from './Plugins/KeyboardInputPlugin';\nimport { AutoFormatPlugin, EditPlugin, PastePlugin, ShortcutPlugin, DefaultSanitizers } from 'roosterjs-content-model-plugins';\nimport { UpdateContentPlugin, UpdateEvent } from './Plugins/UpdateContentPlugin';\nimport { RichTextToolbar } from './Toolbar/RichTextToolbar';\nimport { RichTextToolbarPlugin } from './Plugins/RichTextToolbarPlugin';\nimport { ContextMenuPlugin } from './Plugins/ContextMenuPlugin';\nimport { TableEditContextMenuProvider } from './Plugins/TableEditContextMenuProvider';\nimport { borderApplier, dataSetApplier } from '../utils/RichTextEditorUtils';\nimport { getPreviousInlineImages, getRemovedInlineImages, removeLocalBlobs, cleanAllLocalBlobs } from '../utils/RichTextEditorUtils';\nimport { ContextualMenu, IContextualMenuItem, IContextualMenuProps, Theme } from '@fluentui/react';\nimport { PlaceholderPlugin } from './Plugins/PlaceholderPlugin';\nimport { getFormatState, setDirection } from 'roosterjs-content-model-api';\nimport UndoRedoPlugin from './Plugins/UndoRedoPlugin';\n\n/**\n * Style 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 // the initial content of editor that is set when editor is created (e.g. when editing a message)\n initialContent?: string;\n onChange: (newValue?: string, removedInlineImages?: Record<string, string>[]) => void;\n onKeyDown?: (ev: KeyboardEvent) => void;\n // update the current content of the rich text editor\n onContentModelUpdate?: (contentModel: ContentModelDocument | undefined) => void;\n contentModel?: ContentModelDocument | undefined;\n placeholderText?: string;\n strings: Partial<RichTextStrings>;\n showRichTextEditorFormatting: boolean;\n styles: RichTextEditorStyleProps;\n autoFocus?: 'sendBoxTextField';\n onPaste?: (event: {\n content: DocumentFragment;\n }) => void;\n onInsertInlineImage?: (imageAttributes: Record<string, string>) => void;\n}\n\n/**\n * Represents a reference to the RichTextEditor component.\n */\nexport interface RichTextEditorComponentRef {\n /**\n * Sets focus on the RichTextEditor component.\n */\n focus: () => void;\n\n /**\n * Sets the content of the RichTextEditor component to an empty string.\n */\n setEmptyContent: () => void;\n\n /**\n * Retrieves the plain text content of the RichTextEditor component.\n * @returns The plain text content of the RichTextEditor component, or undefined if the editor isn't available.\n */\n getPlainContent: () => string | undefined;\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 {\n initialContent,\n onChange,\n placeholderText,\n strings,\n showRichTextEditorFormatting,\n autoFocus,\n onKeyDown,\n onContentModelUpdate,\n contentModel,\n onPaste,\n onInsertInlineImage\n } = props;\n const editor = useRef<IEditor | null>(null);\n const editorDiv = useRef<HTMLDivElement>(null);\n const theme = useTheme();\n const [contextMenuProps, setContextMenuProps] = useState<IContextualMenuProps | null>(null);\n const previousThemeDirection = useRef(themeDirection(theme)); // This will be set when the editor is initialized and when the content is updated.\n const [previousInlineImages, setPreviousInlineImages] = useState<Record<string, string>[]>([]);\n const [inlineImageLocalBlobs, setInlineImageLocalBlobs] = useState<Record<string, string>>({});\n useEffect(() => {\n return () => {\n // Cleanup Local Blob URLs when the component is unmounted\n cleanAllLocalBlobs(inlineImageLocalBlobs);\n };\n // This effect should only run once when the component is unmounted, so we don't need to add any dependencies\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n useImperativeHandle(ref, () => {\n return {\n focus() {\n if (editor.current) {\n editor.current.focus();\n }\n },\n setEmptyContent() {\n setPreviousInlineImages([]);\n cleanAllLocalBlobs(inlineImageLocalBlobs);\n if (editor.current) {\n // remove all content from the editor and update the model\n // ContentChanged event will be sent by RoosterJS automatically\n editor.current.formatContentModel((model: ShallowMutableContentModelDocument): boolean => {\n // Create a new empty paragraph with selection marker\n // this is needed for correct processing of images after the content is deleted\n const newModel = createEmptyModel();\n model.blocks = newModel.blocks;\n return true;\n });\n //reset content model\n onContentModelUpdate && onContentModelUpdate(editor.current.getContentModelCopy('disconnected'));\n }\n },\n getPlainContent() {\n if (editor.current) {\n return exportContent(editor.current, 'PlainTextFast');\n } else {\n return undefined;\n }\n }\n };\n }, [inlineImageLocalBlobs, onContentModelUpdate]);\n const toolbarPlugin = React.useMemo(() => {\n return new RichTextToolbarPlugin();\n }, []);\n const placeholderPlugin = useMemo(() => {\n const textColor = theme.palette?.neutralSecondary;\n return new PlaceholderPlugin('', textColor ? {\n textColor: textColor\n } : undefined);\n }, [theme]);\n useEffect(() => {\n if (placeholderText !== undefined) {\n placeholderPlugin.updatePlaceholder(placeholderText);\n }\n }, [placeholderPlugin, placeholderText]);\n const toolbar = useMemo(() => {\n return <RichTextToolbar plugin={toolbarPlugin} strings={strings} />;\n }, [strings, toolbarPlugin]);\n const updatePlugin = useMemo(() => {\n return new UpdateContentPlugin();\n }, []);\n const copyPastePlugin = useMemo(() => {\n return new CopyPastePlugin();\n }, []);\n const onChangeContent = useCallback((shouldUpdateInlineImages?: boolean) => {\n if (editor.current === null) {\n return;\n }\n const content = exportContent(editor.current);\n let removedInlineImages: Record<string, string>[] = [];\n if (shouldUpdateInlineImages) {\n removedInlineImages = getRemovedInlineImages(content, previousInlineImages);\n }\n onChange && onChange(content, removedInlineImages);\n setPreviousInlineImages(getPreviousInlineImages(content));\n }, [onChange, previousInlineImages]);\n useEffect(() => {\n // don't set callback in plugin constructor to update callback without plugin recreation\n updatePlugin.onUpdate = (event: string, shouldRemoveInlineImages?: boolean) => {\n if (editor.current === null) {\n return;\n }\n if (event === UpdateEvent.Blur || event === UpdateEvent.Dispose) {\n onContentModelUpdate && onContentModelUpdate(editor.current.getContentModelCopy('disconnected'));\n } else {\n const content = exportContent(editor.current);\n let removedInlineImages: Record<string, string>[] = [];\n if (shouldRemoveInlineImages) {\n removedInlineImages = getRemovedInlineImages(content, previousInlineImages);\n if (removedInlineImages.length > 0) {\n removeLocalBlobs(inlineImageLocalBlobs, removedInlineImages);\n }\n }\n onChange && onChange(content, removedInlineImages);\n setPreviousInlineImages(getPreviousInlineImages(content));\n }\n };\n }, [onChange, onContentModelUpdate, updatePlugin, previousInlineImages, inlineImageLocalBlobs]);\n const undoRedoPlugin = useMemo(() => {\n return new UndoRedoPlugin();\n }, []);\n useEffect(() => {\n if (onInsertInlineImage) {\n copyPastePlugin.onInsertInlineImage = (imageAttributes: Record<string, string>) => {\n const {\n id,\n src\n } = imageAttributes;\n setInlineImageLocalBlobs({\n ...inlineImageLocalBlobs,\n [id]: src\n });\n onInsertInlineImage(imageAttributes);\n };\n } else {\n copyPastePlugin.onInsertInlineImage = undefined;\n }\n undoRedoPlugin.onInsertInlineImage = onInsertInlineImage;\n }, [copyPastePlugin, inlineImageLocalBlobs, onInsertInlineImage, undoRedoPlugin]);\n useEffect(() => {\n undoRedoPlugin.onUpdateContent = () => {\n onChangeContent(true);\n };\n }, [onChangeContent, undoRedoPlugin]);\n const keyboardInputPlugin = useMemo(() => {\n return new KeyboardInputPlugin();\n }, []);\n useEffect(() => {\n // don't set callback in plugin constructor to update callback without plugin recreation\n keyboardInputPlugin.onKeyDown = onKeyDown;\n }, [keyboardInputPlugin, onKeyDown]);\n const tableContextMenuPlugin = useMemo(() => {\n return new TableEditContextMenuProvider();\n }, []);\n useEffect(() => {\n tableContextMenuPlugin.updateStrings(strings);\n }, [tableContextMenuPlugin, strings]);\n const onContextMenuRender = useCallback((container: HTMLElement, items: IContextualMenuItem[], onDismiss: () => void): void => {\n setContextMenuProps({\n items: items,\n target: container,\n onDismiss: onDismiss\n });\n }, []);\n const onContextMenuDismiss = useCallback((): void => {\n setContextMenuProps(null);\n }, []);\n useEffect(() => {\n copyPastePlugin.onPaste = onPaste;\n }, [copyPastePlugin, onPaste]);\n const plugins: EditorPlugin[] = useMemo(() => {\n const contentEdit = new EditPlugin({\n handleTabKey: false\n });\n // AutoFormatPlugin previously was a part of the edit plugin\n const autoFormatPlugin = new AutoFormatPlugin({\n autoBullet: true,\n autoNumbering: true,\n autoLink: true\n });\n const roosterPastePlugin = new PastePlugin(false, {\n additionalDisallowedTags: ['head', '!doctype', '!cdata', '#comment'],\n additionalAllowedTags: [],\n styleSanitizers: DefaultSanitizers,\n attributeSanitizers: {}\n });\n const shortcutPlugin = new ShortcutPlugin();\n const contextMenuPlugin = new ContextMenuPlugin(onContextMenuRender, onContextMenuDismiss);\n return [placeholderPlugin, keyboardInputPlugin, contentEdit, autoFormatPlugin, updatePlugin, copyPastePlugin, roosterPastePlugin, toolbarPlugin, shortcutPlugin,\n // contextPlugin and tableEditMenuProvider allow to show insert/delete menu for the table\n contextMenuPlugin, tableContextMenuPlugin, undoRedoPlugin];\n }, [onContextMenuRender, onContextMenuDismiss, placeholderPlugin, keyboardInputPlugin, updatePlugin, copyPastePlugin, toolbarPlugin, tableContextMenuPlugin, undoRedoPlugin]);\n const announcerStringGetter = useCallback((key: KnownAnnounceStrings): string => {\n switch (key) {\n case 'announceListItemBullet':\n return strings.richTextNewBulletedListItemAnnouncement ?? '';\n case 'announceListItemNumbering':\n return strings.richTextNewNumberedListItemAnnouncement ?? '';\n case 'announceOnFocusLastCell':\n return '';\n }\n }, [strings.richTextNewBulletedListItemAnnouncement, strings.richTextNewNumberedListItemAnnouncement]);\n useEffect(() => {\n const prevInlineImage = getPreviousInlineImages(initialContent);\n setPreviousInlineImages(prevInlineImage);\n const initialModel = createEditorInitialModel(initialContent, contentModel);\n if (editorDiv.current) {\n editor.current = new Editor(editorDiv.current, {\n inDarkMode: isDarkThemed(theme),\n // doNotAdjustEditorColor is used to disable default color and background color for Rooster component\n doNotAdjustEditorColor: true,\n imageSelectionBorderColor: theme.palette.themePrimary,\n tableCellSelectionBackgroundColor: theme.palette.neutralLight,\n plugins: plugins,\n initialModel: initialModel,\n defaultModelToDomOptions: {\n formatApplierOverride: {\n // apply border and dataset formats for table\n border: borderApplier,\n dataset: dataSetApplier\n }\n },\n announcerStringGetter: announcerStringGetter\n });\n }\n if (autoFocus === 'sendBoxTextField') {\n editor.current?.focus();\n }\n return () => {\n if (editor.current) {\n editor.current.dispose();\n editor.current = null;\n }\n };\n // don't update the editor on deps update as everything is handled in separate hooks or plugins\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [theme, plugins, announcerStringGetter]);\n useEffect(() => {\n const themeDirectionValue = themeDirection(theme);\n // check that editor exists and theme was actually changed\n // as format.direction will be undefined if setDirection is not called\n if (editor.current && previousThemeDirection.current !== themeDirectionValue) {\n const format = getFormatState(editor.current);\n if (format.direction !== themeDirectionValue) {\n // should be set after the hook where editor is created as the editor might be null\n // setDirection will cause the focus change back to the editor and this might not be what we want to do (autoFocus prop)\n // that's why it's not part of the create editor hook\n setDirection(editor.current, theme.rtl ? 'rtl' : 'ltr');\n }\n previousThemeDirection.current = themeDirectionValue;\n }\n }, [theme]);\n return <div data-testid={'rich-text-editor-wrapper'}>\n {showRichTextEditorFormatting && toolbar}\n <div className={richTextEditorWrapperStyle(theme)}>\n {/* div that is used by Rooster JS as a parent of the editor */}\n <div id=\"richTextSendBox\" ref={editorDiv} tabIndex={0} role=\"textbox\" aria-multiline=\"true\" data-testid={'rooster-rich-text-editor'} className={richTextEditorStyle(props.styles)} aria-label={placeholderText} />\n </div>\n {contextMenuProps && <ContextualMenu {...contextMenuProps} calloutProps={{\n isBeakVisible: false\n }} />}\n </div>;\n});\nconst createEditorInitialModel = (initialContent?: string, contentModel?: ContentModelDocument): ContentModelDocument | undefined => {\n if (contentModel) {\n // contentModel is the current content of the editor\n return contentModel;\n } else {\n const initialContentValue = initialContent;\n const initialModel = initialContentValue && initialContentValue.length > 0 ? createModelFromHtml(initialContentValue) : undefined;\n if (initialModel && initialModel.blocks.length > 0) {\n // lastBlock should have blockType = paragraph, otherwise add a new paragraph\n // to set focus to the end of the content\n const lastBlock = initialModel.blocks[initialModel.blocks.length - 1];\n if (lastBlock?.blockType === 'Paragraph') {\n // now lastBlock is paragraph\n setSelectionAfterLastSegment(initialModel, lastBlock);\n } else {\n const block = createParagraph(false);\n initialModel.blocks.push(block);\n setSelectionAfterLastSegment(initialModel, block);\n // add content to the paragraph, otherwise height might be calculated incorrectly\n block.segments.push(createBr());\n }\n }\n return initialModel;\n }\n};\nconst setSelectionAfterLastSegment = (model: ReadonlyContentModelBlockGroup, block: ContentModelParagraph): void => {\n //selection marker should have the same format as the last segment if any\n const format = block.segments.length > 0 ? block.segments[block.segments.length - 1].format : undefined;\n const marker = createSelectionMarker(format);\n block.segments.push(marker);\n setSelection(model, marker);\n};\nconst themeDirection = (theme: Theme): 'rtl' | 'ltr' => {\n return theme.rtl ? 'rtl' : 'ltr';\n};"]}
@@ -1,37 +0,0 @@
1
- import React, { ReactNode } from 'react';
2
- import { BaseCustomStyles } from '../../types';
3
- import { RichTextEditorComponentRef, RichTextEditorStyleProps } from './RichTextEditor';
4
- import { RichTextSendBoxStrings } from './RichTextSendBox';
5
- /**
6
- * @private
7
- */
8
- export interface RichTextInputBoxComponentStylesProps extends BaseCustomStyles {
9
- }
10
- /**
11
- * @private
12
- */
13
- export interface RichTextInputBoxComponentProps {
14
- placeholderText?: string;
15
- initialContent?: string;
16
- onChange: (newValue?: string, removedInlineImages?: Record<string, string>[]) => void;
17
- onEnterKeyDown?: () => void;
18
- editorComponentRef: React.RefObject<RichTextEditorComponentRef>;
19
- strings: Partial<RichTextSendBoxStrings>;
20
- disabled: boolean;
21
- actionComponents: ReactNode;
22
- onRenderAttachmentUploads?: () => JSX.Element;
23
- hasAttachments?: boolean;
24
- richTextEditorStyleProps: (isExpanded: boolean) => RichTextEditorStyleProps;
25
- isHorizontalLayoutDisabled?: boolean;
26
- autoFocus?: 'sendBoxTextField';
27
- onTyping?: () => Promise<void>;
28
- onPaste?: (event: {
29
- content: DocumentFragment;
30
- }) => void;
31
- onInsertInlineImage?: (imageAttributes: Record<string, string>) => void;
32
- }
33
- /**
34
- * @private
35
- */
36
- export declare const RichTextInputBoxComponent: (props: RichTextInputBoxComponentProps) => JSX.Element;
37
- //# sourceMappingURL=RichTextInputBoxComponent.d.ts.map
@@ -1,78 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import React, { useCallback, useEffect, useMemo, useState } from 'react';
4
- import { RichTextEditor } from './RichTextEditor';
5
- import { useTheme } from '../../theming';
6
- import { Icon, Stack } from '@fluentui/react';
7
- import { InputBoxButton } from '../InputBoxButton';
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';
11
- /**
12
- * @private
13
- */
14
- export const RichTextInputBoxComponent = (props) => {
15
- const { placeholderText, initialContent, onChange, onEnterKeyDown, editorComponentRef, disabled, strings, actionComponents, onRenderAttachmentUploads, hasAttachments, richTextEditorStyleProps, isHorizontalLayoutDisabled = false, autoFocus, onTyping, onInsertInlineImage } = props;
16
- const theme = useTheme();
17
- // undefined is used to indicate that the rich text editor toolbar state wasn't changed yet
18
- const [showRichTextEditorFormatting, setShowRichTextEditorFormatting] = useState(undefined);
19
- const [contentModel, setContentModel] = useState(undefined);
20
- const onRenderRichTextEditorIcon = useCallback((isHover) => {
21
- const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;
22
- return React.createElement(Icon, { iconName: isHover || isRichTextEditorToolbarShown ? 'RichTextEditorButtonIconFilled' : 'RichTextEditorButtonIcon', className: richTextFormatButtonIconStyle(theme, !disabled && (isHover || isRichTextEditorToolbarShown)) });
23
- }, [disabled, showRichTextEditorFormatting, theme]);
24
- useEffect(() => {
25
- var _a;
26
- if (showRichTextEditorFormatting !== undefined) {
27
- // Focus the editor when toolbar shown/hidden
28
- (_a = editorComponentRef.current) === null || _a === void 0 ? void 0 : _a.focus();
29
- }
30
- // we don't need execute this useEffect if editorComponentRef is changed
31
- // eslint-disable-next-line react-hooks/exhaustive-deps
32
- }, [showRichTextEditorFormatting]);
33
- const actionButtons = useMemo(() => {
34
- return React.createElement(Stack.Item, { align: "end", className: richTextActionButtonsStackStyle },
35
- React.createElement(Stack, { horizontal: true },
36
- React.createElement(InputBoxButton, { onRenderIcon: onRenderRichTextEditorIcon, onClick: e => {
37
- const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;
38
- setShowRichTextEditorFormatting(!isRichTextEditorToolbarShown);
39
- e.stopPropagation(); // Prevents the click from bubbling up and triggering a focus event on the chat.
40
- }, ariaLabel: strings.richTextFormatButtonTooltip, tooltipContent: strings.richTextFormatButtonTooltip, className: richTextActionButtonsStyle, "data-testId": 'rich-text-input-box-format-button', ariaExpanded: showRichTextEditorFormatting }),
41
- React.createElement(Icon, { iconName: "RichTextDividerIcon", className: richTextActionButtonsDividerStyle(theme) }),
42
- actionComponents));
43
- }, [actionComponents, onRenderRichTextEditorIcon, showRichTextEditorFormatting, strings.richTextFormatButtonTooltip, theme]);
44
- const richTextEditorStyle = useMemo(() => {
45
- return richTextEditorStyleProps(showRichTextEditorFormatting === true);
46
- }, [richTextEditorStyleProps, showRichTextEditorFormatting]);
47
- const onKeyDown = useCallback((ev) => {
48
- if (isEnterKeyEventFromCompositionSession(ev)) {
49
- return;
50
- }
51
- const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;
52
- if (ev.key === 'Enter' && ev.shiftKey === false && !isRichTextEditorToolbarShown) {
53
- ev.preventDefault();
54
- onEnterKeyDown && onEnterKeyDown();
55
- }
56
- else {
57
- onTyping === null || onTyping === void 0 ? void 0 : onTyping();
58
- }
59
- }, [onEnterKeyDown, showRichTextEditorFormatting, onTyping]);
60
- const useHorizontalLayout = useMemo(() => {
61
- const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;
62
- return !isHorizontalLayoutDisabled && !isRichTextEditorToolbarShown && !hasAttachments;
63
- }, [isHorizontalLayoutDisabled, showRichTextEditorFormatting, hasAttachments]);
64
- const onContentModelUpdate = useCallback((contentModel) => {
65
- setContentModel(contentModel);
66
- }, []);
67
- return React.createElement("div", { className: richTextBorderBoxStyle({
68
- theme: theme,
69
- disabled: !!disabled
70
- }) },
71
- React.createElement(Stack, { grow: true, horizontal: useHorizontalLayout, horizontalAlign: useHorizontalLayout ? 'end' : 'space-between', className: inputBoxContentStackStyle, wrap: useHorizontalLayout },
72
- React.createElement(Stack, { grow: true, className: inputBoxRichTextStackStyle },
73
- React.createElement(Stack.Item, { className: inputBoxRichTextStackItemStyle },
74
- React.createElement(RichTextEditor, { contentModel: contentModel, initialContent: initialContent, placeholderText: placeholderText, onChange: onChange, onKeyDown: onKeyDown, ref: editorComponentRef, strings: strings, showRichTextEditorFormatting: showRichTextEditorFormatting === true, styles: richTextEditorStyle, autoFocus: autoFocus, onContentModelUpdate: onContentModelUpdate, onPaste: props.onPaste, onInsertInlineImage: onInsertInlineImage })),
75
- onRenderAttachmentUploads && onRenderAttachmentUploads()),
76
- actionButtons));
77
- };
78
- //# sourceMappingURL=RichTextInputBoxComponent.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"RichTextInputBoxComponent.js","sourceRoot":"","sources":["../../../../../../preprocess-dist/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAa,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEpF,OAAO,EAAE,cAAc,EAAwD,MAAM,kBAAkB,CAAC;AAExG,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,EAAE,qCAAqC,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,EAAE,iCAAiC,EAAE,+BAA+B,EAAE,0BAA0B,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;AAChL,OAAO,EAAE,yBAAyB,EAAE,8BAA8B,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,4CAA4C,CAAC;AAoC3K;;GAEG;AACH,MA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AAkB,EAAE,OAAO,EAAE,OAAO,EAAE,4BAA4B,EAAE,4BAA4B,KAAK,IAAI,EAAE,MAAM,EAAE,mBAAmB,EAAE,SAAS,EAAE,SAAS,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,GAAI,CACha;gBACZ,yBAAyB,IAAI,yBAAyB,EAAE,CACnD;YACP,aAAa,CACR,CACJ,CAAC;AACX,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { ReactNode, useCallback, useEffect, 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 { richTextActionButtonsDividerStyle, richTextActionButtonsStackStyle, richTextActionButtonsStyle, richTextFormatButtonIconStyle } from '../styles/RichTextEditor.styles';\nimport { inputBoxContentStackStyle, inputBoxRichTextStackItemStyle, inputBoxRichTextStackStyle, richTextBorderBoxStyle } from '../styles/RichTextInputBoxComponent.styles';\nimport type { ContentModelDocument } from 'roosterjs-content-model-types';\n\n/**\n * @private\n */\nexport interface RichTextInputBoxComponentStylesProps extends BaseCustomStyles {}\n\n/**\n * @private\n */\nexport interface RichTextInputBoxComponentProps {\n placeholderText?: string;\n // the initial content of editor that is set when editor is created (e.g. when editing a message)\n initialContent?: string;\n onChange: (newValue?: string, removedInlineImages?: Record<string, string>[]) => void;\n onEnterKeyDown?: () => void;\n editorComponentRef: React.RefObject<RichTextEditorComponentRef>;\n // Partial needs to be removed when the rich text editor feature goes to GA\n strings: Partial<RichTextSendBoxStrings>;\n disabled: boolean;\n actionComponents: ReactNode;\n onRenderAttachmentUploads?: () => JSX.Element;\n hasAttachments?: 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 autoFocus?: 'sendBoxTextField';\n onTyping?: () => Promise<void>;\n onPaste?: (event: {\n content: DocumentFragment;\n }) => void;\n onInsertInlineImage?: (imageAttributes: Record<string, string>) => void;\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 onRenderAttachmentUploads,\n hasAttachments,\n richTextEditorStyleProps,\n isHorizontalLayoutDisabled = false,\n autoFocus,\n onTyping,\n onInsertInlineImage\n } = props;\n const theme = useTheme();\n // undefined is used to indicate that the rich text editor toolbar state wasn't changed yet\n const [showRichTextEditorFormatting, setShowRichTextEditorFormatting] = useState<boolean | undefined>(undefined);\n const [contentModel, setContentModel] = useState<ContentModelDocument | undefined>(undefined);\n const onRenderRichTextEditorIcon = useCallback((isHover: boolean) => {\n const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;\n return <Icon iconName={isHover || isRichTextEditorToolbarShown ? 'RichTextEditorButtonIconFilled' : 'RichTextEditorButtonIcon'} className={richTextFormatButtonIconStyle(theme, !disabled && (isHover || isRichTextEditorToolbarShown))} />;\n }, [disabled, showRichTextEditorFormatting, theme]);\n useEffect(() => {\n if (showRichTextEditorFormatting !== undefined) {\n // Focus the editor when toolbar shown/hidden\n editorComponentRef.current?.focus();\n }\n // we don't need execute this useEffect if editorComponentRef is changed\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [showRichTextEditorFormatting]);\n const actionButtons = useMemo(() => {\n return <Stack.Item align=\"end\" className={richTextActionButtonsStackStyle}>\n <Stack horizontal>\n <InputBoxButton onRenderIcon={onRenderRichTextEditorIcon} onClick={e => {\n const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;\n setShowRichTextEditorFormatting(!isRichTextEditorToolbarShown);\n e.stopPropagation(); // Prevents the click from bubbling up and triggering a focus event on the chat.\n }} ariaLabel={strings.richTextFormatButtonTooltip} tooltipContent={strings.richTextFormatButtonTooltip} className={richTextActionButtonsStyle} data-testId={'rich-text-input-box-format-button'} ariaExpanded={showRichTextEditorFormatting} />\n <Icon iconName=\"RichTextDividerIcon\" className={richTextActionButtonsDividerStyle(theme)} />\n {actionComponents}\n </Stack>\n </Stack.Item>;\n }, [actionComponents, onRenderRichTextEditorIcon, showRichTextEditorFormatting, strings.richTextFormatButtonTooltip, theme]);\n const richTextEditorStyle = useMemo(() => {\n return richTextEditorStyleProps(showRichTextEditorFormatting === true);\n }, [richTextEditorStyleProps, showRichTextEditorFormatting]);\n const onKeyDown = useCallback((ev: KeyboardEvent) => {\n if (isEnterKeyEventFromCompositionSession(ev)) {\n return;\n }\n const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;\n if (ev.key === 'Enter' && ev.shiftKey === false && !isRichTextEditorToolbarShown) {\n ev.preventDefault();\n onEnterKeyDown && onEnterKeyDown();\n } else {\n onTyping?.();\n }\n }, [onEnterKeyDown, showRichTextEditorFormatting, onTyping]);\n const useHorizontalLayout = useMemo(() => {\n const isRichTextEditorToolbarShown = showRichTextEditorFormatting === true;\n return !isHorizontalLayoutDisabled && !isRichTextEditorToolbarShown && !hasAttachments;\n }, [isHorizontalLayoutDisabled, showRichTextEditorFormatting, hasAttachments]);\n const onContentModelUpdate = useCallback((contentModel: ContentModelDocument | undefined) => {\n setContentModel(contentModel);\n }, []);\n return <div className={richTextBorderBoxStyle({\n theme: theme,\n disabled: !!disabled\n })}>\n {/* This layout is used for the compact view when formatting options are not shown */}\n <Stack grow horizontal={useHorizontalLayout} horizontalAlign={useHorizontalLayout ? 'end' : 'space-between'} className={inputBoxContentStackStyle} wrap={useHorizontalLayout}>\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 contentModel={contentModel} initialContent={initialContent} placeholderText={placeholderText} onChange={onChange} onKeyDown={onKeyDown} ref={editorComponentRef} strings={strings} showRichTextEditorFormatting={showRichTextEditorFormatting === true} styles={richTextEditorStyle} autoFocus={autoFocus} onContentModelUpdate={onContentModelUpdate} onPaste={props.onPaste} onInsertInlineImage={onInsertInlineImage} />\n </Stack.Item>\n {onRenderAttachmentUploads && onRenderAttachmentUploads()}\n </Stack>\n {actionButtons}\n </Stack>\n </div>;\n};"]}