@azure/communication-react 1.26.0-beta.1 → 1.26.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 (523) hide show
  1. package/dist/communication-react.d.ts +70 -1840
  2. package/dist/dist-cjs/communication-react/index.js +38777 -177
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/common.d.ts +0 -13
  5. package/dist/dist-esm/acs-ui-common/src/common.js.map +1 -1
  6. package/dist/dist-esm/acs-ui-common/src/constants.d.ts +0 -5
  7. package/dist/dist-esm/acs-ui-common/src/constants.js +0 -5
  8. package/dist/dist-esm/acs-ui-common/src/constants.js.map +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/index.d.ts +0 -4
  10. package/dist/dist-esm/acs-ui-common/src/index.js +0 -3
  11. package/dist/dist-esm/acs-ui-common/src/index.js.map +1 -1
  12. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  13. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  14. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +0 -5
  15. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +0 -6
  16. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  17. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +0 -19
  18. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +0 -59
  19. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  20. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js +1 -30
  21. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map +1 -1
  22. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js +1 -16
  23. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js.map +1 -1
  24. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.d.ts +0 -1
  25. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +1 -3
  26. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
  27. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.d.ts +0 -5
  28. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +3 -8
  29. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
  30. package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.js +2 -0
  31. package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.js.map +1 -1
  32. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js +0 -4
  33. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js.map +1 -1
  34. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +6 -127
  35. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  36. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +1 -20
  37. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +4 -136
  38. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  39. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js +3 -0
  40. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -1
  41. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +2 -5
  42. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +15 -27
  43. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  44. package/dist/dist-esm/calling-stateful-client/src/Converter.d.ts +0 -6
  45. package/dist/dist-esm/calling-stateful-client/src/Converter.js +0 -22
  46. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  47. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.d.ts +0 -9
  48. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js +1 -45
  49. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js.map +1 -1
  50. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.d.ts +0 -1
  51. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.js +1 -7
  52. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.js.map +1 -1
  53. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.d.ts +2 -3
  54. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +0 -7
  55. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
  56. package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js +0 -8
  57. package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js.map +1 -1
  58. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js +0 -17
  59. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js.map +1 -1
  60. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +0 -2
  61. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  62. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.d.ts +2 -6
  63. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js +2 -35
  64. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
  65. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.d.ts +1 -2
  66. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js +0 -4
  67. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js.map +1 -1
  68. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +2 -25
  69. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  70. package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js +3 -3
  71. package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js.map +1 -1
  72. package/dist/dist-esm/chat-stateful-client/src/ChatClientState.d.ts +1 -15
  73. package/dist/dist-esm/chat-stateful-client/src/ChatClientState.js.map +1 -1
  74. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js +1 -2
  75. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js.map +1 -1
  76. package/dist/dist-esm/chat-stateful-client/src/index.d.ts +0 -1
  77. package/dist/dist-esm/chat-stateful-client/src/index.js.map +1 -1
  78. package/dist/dist-esm/communication-react/src/index.d.ts +0 -28
  79. package/dist/dist-esm/communication-react/src/index.js +0 -6
  80. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  81. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.d.ts +0 -2
  82. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js +0 -1
  83. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js.map +1 -1
  84. package/dist/dist-esm/react-components/src/components/CaptionsBanner.d.ts +1 -1
  85. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +7 -9
  86. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
  87. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +1 -13
  88. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js +3 -9
  89. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
  90. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +0 -11
  91. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +2 -32
  92. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  93. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.d.ts +1 -8
  94. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js +5 -9
  95. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
  96. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.d.ts +1 -2
  97. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js +4 -4
  98. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js.map +1 -1
  99. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.d.ts +1 -4
  100. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js +6 -31
  101. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js.map +1 -1
  102. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.d.ts +1 -15
  103. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js +0 -9
  104. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js.map +1 -1
  105. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +2 -23
  106. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js +6 -17
  107. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
  108. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.d.ts +1 -8
  109. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js +6 -10
  110. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
  111. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +5 -5
  112. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
  113. package/dist/dist-esm/react-components/src/components/ImageOverlay.js +0 -2
  114. package/dist/dist-esm/react-components/src/components/ImageOverlay.js.map +1 -1
  115. package/dist/dist-esm/react-components/src/components/InputBoxComponent.d.ts +0 -2
  116. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +0 -15
  117. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
  118. package/dist/dist-esm/react-components/src/components/MeetingReactionOverlay.d.ts +0 -2
  119. package/dist/dist-esm/react-components/src/components/MeetingReactionOverlay.js +1 -5
  120. package/dist/dist-esm/react-components/src/components/MeetingReactionOverlay.js.map +1 -1
  121. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +5 -81
  122. package/dist/dist-esm/react-components/src/components/MessageThread.js +3 -13
  123. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  124. package/dist/dist-esm/react-components/src/components/NotificationStack.d.ts +4 -4
  125. package/dist/dist-esm/react-components/src/components/NotificationStack.js.map +1 -1
  126. package/dist/dist-esm/react-components/src/components/ParticipantList.d.ts +0 -15
  127. package/dist/dist-esm/react-components/src/components/ParticipantList.js +3 -12
  128. package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
  129. package/dist/dist-esm/react-components/src/components/RealTimeText.d.ts +3 -3
  130. package/dist/dist-esm/react-components/src/components/RealTimeText.js +1 -1
  131. package/dist/dist-esm/react-components/src/components/RealTimeText.js.map +1 -1
  132. package/dist/dist-esm/react-components/src/components/RealTimeTextModal.d.ts +3 -3
  133. package/dist/dist-esm/react-components/src/components/RealTimeTextModal.js +2 -2
  134. package/dist/dist-esm/react-components/src/components/RealTimeTextModal.js.map +1 -1
  135. package/dist/dist-esm/react-components/src/components/SendBox.d.ts +1 -47
  136. package/dist/dist-esm/react-components/src/components/SendBox.js +6 -57
  137. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  138. package/dist/dist-esm/react-components/src/components/StartRealTimeTextButton.d.ts +3 -3
  139. package/dist/dist-esm/react-components/src/components/StartRealTimeTextButton.js +1 -1
  140. package/dist/dist-esm/react-components/src/components/StartRealTimeTextButton.js.map +1 -1
  141. package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js +0 -1
  142. package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js.map +1 -1
  143. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js +0 -1
  144. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js.map +1 -1
  145. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js +0 -19
  146. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js.map +1 -1
  147. package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js +0 -1
  148. package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js.map +1 -1
  149. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +1 -1
  150. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
  151. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.d.ts +0 -5
  152. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.js.map +1 -1
  153. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +1 -34
  154. package/dist/dist-esm/react-components/src/components/VideoGallery.js +5 -18
  155. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  156. package/dist/dist-esm/react-components/src/components/index.d.ts +0 -21
  157. package/dist/dist-esm/react-components/src/components/index.js +0 -8
  158. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  159. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.d.ts +1 -1
  160. package/dist/dist-esm/react-components/src/components/styles/AttachmentCardGroup.styles.d.ts +1 -1
  161. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +3 -3
  162. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +4 -10
  163. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  164. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.d.ts +1 -37
  165. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js +3 -30
  166. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js.map +1 -1
  167. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.d.ts +2 -4
  168. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js +2 -9
  169. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
  170. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +1 -38
  171. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +4 -131
  172. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  173. package/dist/dist-esm/react-components/src/components/utils/common.js +0 -2
  174. package/dist/dist-esm/react-components/src/components/utils/common.js.map +1 -1
  175. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.d.ts +1 -2
  176. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.js.map +1 -1
  177. package/dist/dist-esm/react-components/src/components/utils.js +2 -2
  178. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  179. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.d.ts +0 -4
  180. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js +1 -3
  181. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js.map +1 -1
  182. package/dist/dist-esm/react-components/src/index.d.ts +0 -2
  183. package/dist/dist-esm/react-components/src/index.js.map +1 -1
  184. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +0 -54
  185. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
  186. package/dist/dist-esm/react-components/src/localization/locales/ar-SA/strings.json +10 -0
  187. package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/strings.json +10 -0
  188. package/dist/dist-esm/react-components/src/localization/locales/cy-GB/strings.json +10 -0
  189. package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +10 -0
  190. package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +10 -0
  191. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +10 -0
  192. package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +10 -0
  193. package/dist/dist-esm/react-components/src/localization/locales/es-MX/strings.json +10 -0
  194. package/dist/dist-esm/react-components/src/localization/locales/fi-FI/strings.json +10 -0
  195. package/dist/dist-esm/react-components/src/localization/locales/fr-CA/strings.json +10 -0
  196. package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +10 -0
  197. package/dist/dist-esm/react-components/src/localization/locales/he-IL/strings.json +10 -0
  198. package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +10 -0
  199. package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +10 -0
  200. package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +10 -0
  201. package/dist/dist-esm/react-components/src/localization/locales/nb-NO/strings.json +10 -0
  202. package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +10 -0
  203. package/dist/dist-esm/react-components/src/localization/locales/pl-PL/strings.json +10 -0
  204. package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +10 -0
  205. package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +10 -0
  206. package/dist/dist-esm/react-components/src/localization/locales/sv-SE/strings.json +10 -0
  207. package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +10 -0
  208. package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +10 -0
  209. package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +10 -0
  210. package/dist/dist-esm/react-components/src/theming/icons.d.ts +2 -26
  211. package/dist/dist-esm/react-components/src/theming/icons.js +3 -87
  212. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  213. package/dist/dist-esm/react-components/src/theming/themes.d.ts +0 -6
  214. package/dist/dist-esm/react-components/src/theming/themes.js +0 -9
  215. package/dist/dist-esm/react-components/src/theming/themes.js.map +1 -1
  216. package/dist/dist-esm/react-components/src/types/Attachment.d.ts +0 -13
  217. package/dist/dist-esm/react-components/src/types/Attachment.js.map +1 -1
  218. package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +1 -20
  219. package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
  220. package/dist/dist-esm/react-components/src/types/index.d.ts +0 -1
  221. package/dist/dist-esm/react-components/src/types/index.js +0 -1
  222. package/dist/dist-esm/react-components/src/types/index.js.map +1 -1
  223. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +15 -72
  224. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +10 -23
  225. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  226. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +5 -43
  227. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +15 -52
  228. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  229. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +3 -49
  230. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js +1 -1
  231. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  232. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +0 -2
  233. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  234. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.js.map +1 -1
  235. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.d.ts +3 -1
  236. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +9 -8
  237. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  238. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.d.ts +0 -2
  239. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js +0 -19
  240. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js.map +1 -1
  241. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js +2 -10
  242. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js.map +1 -1
  243. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.d.ts +0 -2
  244. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js +0 -19
  245. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js.map +1 -1
  246. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.d.ts +0 -1
  247. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +3 -5
  248. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
  249. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.d.ts +1 -0
  250. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +5 -7
  251. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  252. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js +9 -7
  253. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js.map +1 -1
  254. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useCompositeStringsForNotificationStack.js +2 -0
  255. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useCompositeStringsForNotificationStack.js.map +1 -1
  256. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +0 -15
  257. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  258. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +1 -3
  259. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  260. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.d.ts +2 -1
  261. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +16 -6
  262. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  263. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.d.ts +0 -7
  264. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +5 -40
  265. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  266. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js +2 -2
  267. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js.map +1 -1
  268. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js +2 -2
  269. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js.map +1 -1
  270. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js +2 -2
  271. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js.map +1 -1
  272. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +1 -17
  273. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +0 -14
  274. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  275. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +1 -12
  276. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +0 -55
  277. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  278. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +0 -65
  279. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +6 -12
  280. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  281. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +4 -17
  282. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +2 -42
  283. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  284. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +2 -63
  285. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  286. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +0 -6
  287. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +0 -7
  288. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  289. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.d.ts +4 -10
  290. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +2 -14
  291. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
  292. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +0 -8
  293. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  294. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js.map +1 -1
  295. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts +0 -27
  296. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js +1 -2
  297. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
  298. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.d.ts +0 -2
  299. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +11 -189
  300. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  301. package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.d.ts +0 -20
  302. package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.js.map +1 -1
  303. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +2 -6
  304. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +0 -36
  305. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  306. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts +2 -12
  307. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
  308. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js +2 -13
  309. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js.map +1 -1
  310. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.d.ts +0 -2
  311. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
  312. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.d.ts +0 -4
  313. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js +0 -4
  314. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js.map +1 -1
  315. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +1 -2
  316. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  317. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js +3 -33
  318. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -1
  319. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +6 -33
  320. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
  321. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js +1 -2
  322. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js.map +1 -1
  323. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.d.ts +2 -41
  324. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js +0 -21
  325. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js.map +1 -1
  326. package/dist/dist-esm/react-composites/src/composites/common/adapters.js.map +1 -1
  327. package/dist/dist-esm/react-composites/src/composites/common/constants.d.ts +0 -5
  328. package/dist/dist-esm/react-composites/src/composites/common/constants.js +0 -5
  329. package/dist/dist-esm/react-composites/src/composites/common/constants.js.map +1 -1
  330. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +3 -36
  331. package/dist/dist-esm/react-composites/src/composites/common/icons.js +1 -5
  332. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  333. package/dist/dist-esm/react-composites/src/composites/common/utils.js.map +1 -1
  334. package/package.json +4 -4
  335. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-_ut2lrbr.js +0 -205
  336. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-_ut2lrbr.js.map +0 -1
  337. package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-7nvSQdDx.js +0 -49
  338. package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-7nvSQdDx.js.map +0 -1
  339. package/dist/dist-cjs/communication-react/index-BHwWI_Bx.js +0 -45874
  340. package/dist/dist-cjs/communication-react/index-BHwWI_Bx.js.map +0 -1
  341. package/dist/dist-esm/acs-ui-common/src/dataConversion.d.ts +0 -6
  342. package/dist/dist-esm/acs-ui-common/src/dataConversion.js +0 -20
  343. package/dist/dist-esm/acs-ui-common/src/dataConversion.js.map +0 -1
  344. package/dist/dist-esm/acs-ui-common/src/removeImageTags.d.ts +0 -7
  345. package/dist/dist-esm/acs-ui-common/src/removeImageTags.js +0 -18
  346. package/dist/dist-esm/acs-ui-common/src/removeImageTags.js.map +0 -1
  347. package/dist/dist-esm/calling-stateful-client/src/CallFeatureStreamUtils.d.ts +0 -14
  348. package/dist/dist-esm/calling-stateful-client/src/CallFeatureStreamUtils.js +0 -204
  349. package/dist/dist-esm/calling-stateful-client/src/CallFeatureStreamUtils.js.map +0 -1
  350. package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.d.ts +0 -17
  351. package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.js +0 -33
  352. package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.js.map +0 -1
  353. package/dist/dist-esm/calling-stateful-client/src/TogetherModeSubscriber.d.ts +0 -24
  354. package/dist/dist-esm/calling-stateful-client/src/TogetherModeSubscriber.js +0 -60
  355. package/dist/dist-esm/calling-stateful-client/src/TogetherModeSubscriber.js.map +0 -1
  356. package/dist/dist-esm/calling-stateful-client/src/TogetherModeVideoStreamSubscriber.d.ts +0 -18
  357. package/dist/dist-esm/calling-stateful-client/src/TogetherModeVideoStreamSubscriber.js +0 -31
  358. package/dist/dist-esm/calling-stateful-client/src/TogetherModeVideoStreamSubscriber.js.map +0 -1
  359. package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.d.ts +0 -6
  360. package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.js +0 -20
  361. package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.js.map +0 -1
  362. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.d.ts +0 -10
  363. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js +0 -15
  364. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js.map +0 -1
  365. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.d.ts +0 -24
  366. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +0 -196
  367. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +0 -1
  368. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.d.ts +0 -69
  369. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js +0 -36
  370. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js.map +0 -1
  371. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.d.ts +0 -75
  372. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js +0 -67
  373. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js.map +0 -1
  374. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.d.ts +0 -105
  375. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js +0 -51
  376. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js.map +0 -1
  377. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.d.ts +0 -86
  378. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js +0 -40
  379. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js.map +0 -1
  380. package/dist/dist-esm/react-components/src/components/MentionPopover.d.ts +0 -121
  381. package/dist/dist-esm/react-components/src/components/MentionPopover.js +0 -119
  382. package/dist/dist-esm/react-components/src/components/MentionPopover.js.map +0 -1
  383. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.d.ts +0 -9
  384. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.js +0 -29
  385. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.js.map +0 -1
  386. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.d.ts +0 -30
  387. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js +0 -98
  388. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js.map +0 -1
  389. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.d.ts +0 -19
  390. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.js +0 -43
  391. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.js.map +0 -1
  392. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.d.ts +0 -15
  393. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js +0 -42
  394. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js.map +0 -1
  395. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.d.ts +0 -24
  396. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.js +0 -64
  397. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.js.map +0 -1
  398. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.d.ts +0 -20
  399. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.js +0 -45
  400. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.js.map +0 -1
  401. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.d.ts +0 -14
  402. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.js +0 -42
  403. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.js.map +0 -1
  404. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.d.ts +0 -30
  405. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.js +0 -99
  406. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.js.map +0 -1
  407. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.d.ts +0 -59
  408. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +0 -332
  409. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +0 -1
  410. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.d.ts +0 -37
  411. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +0 -78
  412. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +0 -1
  413. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +0 -215
  414. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +0 -177
  415. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +0 -1
  416. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.d.ts +0 -16
  417. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js +0 -75
  418. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js.map +0 -1
  419. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxUtils.d.ts +0 -9
  420. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxUtils.js +0 -16
  421. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxUtils.js.map +0 -1
  422. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.d.ts +0 -19
  423. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js +0 -229
  424. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js.map +0 -1
  425. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.d.ts +0 -7
  426. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.js +0 -51
  427. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.js.map +0 -1
  428. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.d.ts +0 -15
  429. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js +0 -64
  430. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js.map +0 -1
  431. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.d.ts +0 -6
  432. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.js +0 -13
  433. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.js.map +0 -1
  434. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.d.ts +0 -56
  435. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.js +0 -75
  436. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.js.map +0 -1
  437. package/dist/dist-esm/react-components/src/components/SendBoxErrors.d.ts +0 -14
  438. package/dist/dist-esm/react-components/src/components/SendBoxErrors.js +0 -18
  439. package/dist/dist-esm/react-components/src/components/SendBoxErrors.js.map +0 -1
  440. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.d.ts +0 -24
  441. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +0 -550
  442. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +0 -1
  443. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.d.ts +0 -152
  444. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js +0 -819
  445. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js.map +0 -1
  446. package/dist/dist-esm/react-components/src/components/TogetherModeOverlay.d.ts +0 -15
  447. package/dist/dist-esm/react-components/src/components/TogetherModeOverlay.js +0 -91
  448. package/dist/dist-esm/react-components/src/components/TogetherModeOverlay.js.map +0 -1
  449. package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeLayout.d.ts +0 -10
  450. package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeLayout.js +0 -14
  451. package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeLayout.js.map +0 -1
  452. package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeStream.d.ts +0 -23
  453. package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeStream.js +0 -47
  454. package/dist/dist-esm/react-components/src/components/VideoGallery/TogetherModeStream.js.map +0 -1
  455. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.d.ts +0 -58
  456. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js +0 -144
  457. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js.map +0 -1
  458. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.d.ts +0 -26
  459. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js +0 -69
  460. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js.map +0 -1
  461. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.d.ts +0 -82
  462. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +0 -324
  463. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +0 -1
  464. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.d.ts +0 -21
  465. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js +0 -38
  466. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js.map +0 -1
  467. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.d.ts +0 -38
  468. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js +0 -99
  469. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js.map +0 -1
  470. package/dist/dist-esm/react-components/src/components/styles/Stack.style.d.ts +0 -5
  471. package/dist/dist-esm/react-components/src/components/styles/Stack.style.js +0 -32
  472. package/dist/dist-esm/react-components/src/components/styles/Stack.style.js.map +0 -1
  473. package/dist/dist-esm/react-components/src/components/styles/TogetherMode.styles.d.ts +0 -98
  474. package/dist/dist-esm/react-components/src/components/styles/TogetherMode.styles.js +0 -181
  475. package/dist/dist-esm/react-components/src/components/styles/TogetherMode.styles.js.map +0 -1
  476. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.d.ts +0 -26
  477. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js +0 -69
  478. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js.map +0 -1
  479. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.d.ts +0 -73
  480. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js +0 -178
  481. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js.map +0 -1
  482. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.d.ts +0 -33
  483. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js +0 -119
  484. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js.map +0 -1
  485. package/dist/dist-esm/react-components/src/components/utils/merge.d.ts +0 -7
  486. package/dist/dist-esm/react-components/src/components/utils/merge.js +0 -16
  487. package/dist/dist-esm/react-components/src/components/utils/merge.js.map +0 -1
  488. package/dist/dist-esm/react-components/src/theming/icons.styles.d.ts +0 -6
  489. package/dist/dist-esm/react-components/src/theming/icons.styles.js +0 -25
  490. package/dist/dist-esm/react-components/src/theming/icons.styles.js.map +0 -1
  491. package/dist/dist-esm/react-components/src/types/TogetherModeTypes.d.ts +0 -59
  492. package/dist/dist-esm/react-components/src/types/TogetherModeTypes.js +0 -2
  493. package/dist/dist-esm/react-components/src/types/TogetherModeTypes.js.map +0 -1
  494. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.d.ts +0 -49
  495. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js +0 -203
  496. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js.map +0 -1
  497. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.d.ts +0 -15
  498. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js +0 -41
  499. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js.map +0 -1
  500. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.d.ts +0 -15
  501. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.js +0 -23
  502. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.js.map +0 -1
  503. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.d.ts +0 -18
  504. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js +0 -18
  505. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js.map +0 -1
  506. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.d.ts +0 -49
  507. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.js +0 -44
  508. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.js.map +0 -1
  509. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.d.ts +0 -39
  510. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js +0 -265
  511. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js.map +0 -1
  512. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.d.ts +0 -80
  513. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js +0 -36
  514. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js.map +0 -1
  515. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.d.ts +0 -38
  516. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js +0 -67
  517. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js.map +0 -1
  518. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.d.ts +0 -5
  519. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js +0 -5
  520. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js.map +0 -1
  521. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.d.ts +0 -10
  522. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js +0 -16
  523. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js.map +0 -1
@@ -1,99 +0,0 @@
1
- // Copyright (c) Microsoft Corporation.
2
- // Licensed under the MIT License.
3
- import { PluginEventType } from '../../utils/RichTextEditorUtils';
4
- import { ChangeSource } from 'roosterjs-content-model-dom';
5
- /**
6
- * An update mode to indicate when the content update happens
7
- */
8
- export var UpdateEvent;
9
- (function (UpdateEvent) {
10
- UpdateEvent["Init"] = "Init";
11
- UpdateEvent["Dispose"] = "Dispose";
12
- UpdateEvent["ContentChanged"] = "ContentChanged";
13
- UpdateEvent["UserInput"] = "UserInput";
14
- UpdateEvent["Blur"] = "Blur";
15
- })(UpdateEvent || (UpdateEvent = {}));
16
- var Keys;
17
- (function (Keys) {
18
- Keys[Keys["BACKSPACE"] = 8] = "BACKSPACE";
19
- Keys[Keys["DELETE"] = 46] = "DELETE";
20
- })(Keys || (Keys = {}));
21
- /**
22
- * A plugin to handle content update
23
- */
24
- export class UpdateContentPlugin {
25
- constructor() {
26
- this.editor = null;
27
- this.disposer = null;
28
- // don't set callback in constructor to be able to update callback without plugin recreation
29
- this.onUpdate = null;
30
- this.onCompositionUpdate = () => {
31
- if (this.onUpdate === null) {
32
- return;
33
- }
34
- this.onUpdate(UpdateEvent.ContentChanged);
35
- };
36
- this.onBlur = () => {
37
- if (this.onUpdate === null) {
38
- return;
39
- }
40
- this.onUpdate(UpdateEvent.Blur);
41
- };
42
- }
43
- getName() {
44
- return 'UpdateContentPlugin';
45
- }
46
- /**
47
- * Initialize this plugin
48
- * @param editor The editor instance
49
- */
50
- initialize(editor) {
51
- this.editor = editor;
52
- this.disposer = this.editor.attachDomEvent({
53
- blur: {
54
- beforeDispatch: this.onBlur
55
- },
56
- compositionupdate: {
57
- beforeDispatch: this.onCompositionUpdate
58
- }
59
- });
60
- }
61
- dispose() {
62
- this.editor = null;
63
- if (this.disposer) {
64
- this.disposer();
65
- this.disposer = null;
66
- }
67
- }
68
- onPluginEvent(event) {
69
- if (this.onUpdate === null) {
70
- return;
71
- }
72
- switch (event.eventType) {
73
- case PluginEventType.EditorReady:
74
- this.onUpdate(UpdateEvent.Init);
75
- break;
76
- case PluginEventType.BeforeDispose:
77
- this.onUpdate(UpdateEvent.Dispose);
78
- break;
79
- case PluginEventType.CompositionEnd:
80
- this.onUpdate(UpdateEvent.ContentChanged);
81
- break;
82
- case PluginEventType.ContentChanged:
83
- if (event.source === ChangeSource.Cut ||
84
- // We need to add the paste source here for an edge case:
85
- // when user select an image that's already in the editor, then paste in an image to replace the selected one,
86
- // we will only get a paste event.
87
- // In this case, we need to update the removedInlineImage array to include the replaced image.
88
- event.source === ChangeSource.Paste || event.source === ChangeSource.Keyboard && (event.data === Keys.BACKSPACE || event.data === Keys.DELETE)) {
89
- this.onUpdate(UpdateEvent.ContentChanged, true);
90
- }
91
- this.onUpdate(UpdateEvent.ContentChanged);
92
- break;
93
- case PluginEventType.Input:
94
- this.onUpdate(UpdateEvent.UserInput);
95
- break;
96
- }
97
- }
98
- }
99
- //# sourceMappingURL=UpdateContentPlugin.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UpdateContentPlugin.js","sourceRoot":"","sources":["../../../../../../../preprocess-dist/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,eAAe,EAAE,MAAM,iCAAiC,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D;;GAEG;AACH,MAAM,CAAN,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,4BAAa,CAAA;IACb,kCAAmB,CAAA;IACnB,gDAAiC,CAAA;IACjC,sCAAuB,CAAA;IACvB,4BAAa,CAAA;AACf,CAAC,EANW,WAAW,KAAX,WAAW,QAMtB;AACD,IAAW,IAGV;AAHD,WAAW,IAAI;IACb,yCAAa,CAAA;IACb,oCAAW,CAAA;AACb,CAAC,EAHU,IAAI,KAAJ,IAAI,QAGd;AAED;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAAhC;QAC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;gBAC9B,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBAChC,MAAM;YACR,KAAK,eAAe,CAAC,aAAa;gBAChC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,OAAO,CAAC,CAAC;gBACnC,MAAM;YACR,KAAK,eAAe,CAAC,cAAc;gBACjC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;gBAC1C,MAAM;YACR,KAAK,eAAe,CAAC,cAAc;gBACjC,IAAI,KAAK,CAAC,MAAM,KAAK,YAAY,CAAC,GAAG;oBACrC,yDAAyD;oBACzD,8GAA8G;oBAC9G,kCAAkC;oBAClC,8FAA8F;oBAC9F,KAAK,CAAC,MAAM,KAAK,YAAY,CAAC,KAAK,IAAI,KAAK,CAAC,MAAM,KAAK,YAAY,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;oBAC/I,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,cAAc,EAAE,IAAI,CAAC,CAAC;gBAClD,CAAC;gBACD,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;gBAC1C,MAAM;YACR,KAAK,eAAe,CAAC,KAAK;gBACxB,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;gBACrC,MAAM;QACV,CAAC;IACH,CAAC;CAaF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { EditorPlugin, IEditor, PluginEvent } from 'roosterjs-content-model-types';\nimport { PluginEventType } from '../../utils/RichTextEditorUtils';\nimport { ChangeSource } from 'roosterjs-content-model-dom';\n\n/**\n * An update mode to indicate when the content update happens\n */\nexport enum UpdateEvent {\n Init = 'Init',\n Dispose = 'Dispose',\n ContentChanged = 'ContentChanged',\n UserInput = 'UserInput',\n Blur = 'Blur',\n}\nconst enum Keys {\n BACKSPACE = 8,\n DELETE = 46,\n}\n\n/**\n * A plugin to handle content update\n */\nexport class UpdateContentPlugin implements EditorPlugin {\n private editor: IEditor | null = null;\n private disposer: (() => void) | null = null;\n // don't set callback in constructor to be able to update callback without plugin recreation\n onUpdate: ((event: UpdateEvent, shouldRemoveInlineImages?: boolean) => void) | null = null;\n getName(): string {\n return 'UpdateContentPlugin';\n }\n\n /**\n * Initialize this plugin\n * @param editor The editor instance\n */\n initialize(editor: IEditor): void {\n this.editor = editor;\n this.disposer = this.editor.attachDomEvent({\n blur: {\n beforeDispatch: this.onBlur\n },\n compositionupdate: {\n beforeDispatch: this.onCompositionUpdate\n }\n });\n }\n dispose(): void {\n this.editor = null;\n if (this.disposer) {\n this.disposer();\n this.disposer = null;\n }\n }\n onPluginEvent(event: PluginEvent): void {\n if (this.onUpdate === null) {\n return;\n }\n switch (event.eventType) {\n case PluginEventType.EditorReady:\n this.onUpdate(UpdateEvent.Init);\n break;\n case PluginEventType.BeforeDispose:\n this.onUpdate(UpdateEvent.Dispose);\n break;\n case PluginEventType.CompositionEnd:\n this.onUpdate(UpdateEvent.ContentChanged);\n break;\n case PluginEventType.ContentChanged:\n if (event.source === ChangeSource.Cut ||\n // We need to add the paste source here for an edge case:\n // when user select an image that's already in the editor, then paste in an image to replace the selected one,\n // we will only get a paste event.\n // In this case, we need to update the removedInlineImage array to include the replaced image.\n event.source === ChangeSource.Paste || event.source === ChangeSource.Keyboard && (event.data === Keys.BACKSPACE || event.data === Keys.DELETE)) {\n this.onUpdate(UpdateEvent.ContentChanged, true);\n }\n this.onUpdate(UpdateEvent.ContentChanged);\n break;\n case PluginEventType.Input:\n this.onUpdate(UpdateEvent.UserInput);\n break;\n }\n }\n private onCompositionUpdate = (): void => {\n if (this.onUpdate === null) {\n return;\n }\n this.onUpdate(UpdateEvent.ContentChanged);\n };\n private onBlur = (): void => {\n if (this.onUpdate === null) {\n return;\n }\n this.onUpdate(UpdateEvent.Blur);\n };\n}"]}
@@ -1,59 +0,0 @@
1
- import React from 'react';
2
- import { RichTextStrings } from './RichTextSendBox';
3
- import type { ContentModelDocument } from 'roosterjs-content-model-types';
4
- /**
5
- * Style props for {@link RichTextEditor}.
6
- *
7
- * @private
8
- */
9
- export interface RichTextEditorStyleProps {
10
- minHeight: string;
11
- maxHeight: string;
12
- }
13
- /**
14
- * Props for {@link RichTextEditor}.
15
- *
16
- * @private
17
- */
18
- export interface RichTextEditorProps {
19
- initialContent?: string;
20
- onChange: (newValue?: string, removedInlineImages?: Record<string, string>[]) => void;
21
- onKeyDown?: (ev: KeyboardEvent) => void;
22
- onCompositionUpdate?: () => void;
23
- onContentModelUpdate?: (contentModel: ContentModelDocument | undefined) => void;
24
- contentModel?: ContentModelDocument | undefined;
25
- placeholderText?: string;
26
- strings: Partial<RichTextStrings>;
27
- showRichTextEditorFormatting: boolean;
28
- styles: RichTextEditorStyleProps;
29
- autoFocus?: 'sendBoxTextField';
30
- onPaste?: (event: {
31
- content: DocumentFragment;
32
- }) => void;
33
- onInsertInlineImage?: (imageAttributes: Record<string, string>) => void;
34
- }
35
- /**
36
- * Represents a reference to the RichTextEditor component.
37
- */
38
- export interface RichTextEditorComponentRef {
39
- /**
40
- * Sets focus on the RichTextEditor component.
41
- */
42
- focus: () => void;
43
- /**
44
- * Sets the content of the RichTextEditor component to an empty string.
45
- */
46
- setEmptyContent: () => void;
47
- /**
48
- * Retrieves the plain text content of the RichTextEditor component.
49
- * @returns The plain text content of the RichTextEditor component, or undefined if the editor isn't available.
50
- */
51
- getPlainContent: () => string | undefined;
52
- }
53
- /**
54
- * A component to wrap RoosterJS Rich Text Editor.
55
- *
56
- * @beta
57
- */
58
- export declare const RichTextEditor: React.ForwardRefExoticComponent<RichTextEditorProps & React.RefAttributes<RichTextEditorComponentRef>>;
59
- //# sourceMappingURL=RichTextEditor.d.ts.map
@@ -1,332 +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, onCompositionUpdate, 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
- useEffect(() => {
46
- var _a;
47
- if (editor.current) {
48
- if (!showRichTextEditorFormatting) {
49
- (_a = editor.current) === null || _a === void 0 ? void 0 : _a.focus();
50
- }
51
- }
52
- }, [showRichTextEditorFormatting]);
53
- useImperativeHandle(ref, () => {
54
- return {
55
- focus() {
56
- if (editor.current) {
57
- editor.current.focus();
58
- }
59
- },
60
- setEmptyContent() {
61
- setPreviousInlineImages([]);
62
- cleanAllLocalBlobs(inlineImageLocalBlobs);
63
- if (editor.current) {
64
- // remove all content from the editor and update the model
65
- // ContentChanged event will be sent by RoosterJS automatically
66
- editor.current.formatContentModel((model) => {
67
- // Create a new empty paragraph with selection marker
68
- // this is needed for correct processing of images after the content is deleted
69
- const newModel = createEmptyModel();
70
- model.blocks = newModel.blocks;
71
- return true;
72
- });
73
- //reset content model
74
- onContentModelUpdate && onContentModelUpdate(editor.current.getContentModelCopy('disconnected'));
75
- }
76
- },
77
- getPlainContent() {
78
- if (editor.current) {
79
- return exportContent(editor.current, 'PlainTextFast');
80
- }
81
- else {
82
- return undefined;
83
- }
84
- }
85
- };
86
- }, [inlineImageLocalBlobs, onContentModelUpdate]);
87
- const toolbarPlugin = React.useMemo(() => {
88
- return new RichTextToolbarPlugin();
89
- }, []);
90
- const placeholderPlugin = useMemo(() => {
91
- var _a;
92
- const textColor = (_a = theme.palette) === null || _a === void 0 ? void 0 : _a.neutralSecondary;
93
- return new PlaceholderPlugin('', textColor ? {
94
- textColor: textColor
95
- } : undefined);
96
- }, [theme]);
97
- useEffect(() => {
98
- if (placeholderText !== undefined) {
99
- placeholderPlugin.updatePlaceholder(placeholderText);
100
- }
101
- }, [placeholderPlugin, placeholderText]);
102
- const toolbar = useMemo(() => {
103
- return React.createElement(RichTextToolbar, { plugin: toolbarPlugin, strings: strings });
104
- }, [strings, toolbarPlugin]);
105
- const updatePlugin = useMemo(() => {
106
- return new UpdateContentPlugin();
107
- }, []);
108
- const copyPastePlugin = useMemo(() => {
109
- return new CopyPastePlugin();
110
- }, []);
111
- const onChangeContent = useCallback((shouldUpdateInlineImages) => {
112
- if (editor.current === null) {
113
- return;
114
- }
115
- const content = exportContent(editor.current);
116
- let removedInlineImages = [];
117
- if (shouldUpdateInlineImages) {
118
- removedInlineImages = getRemovedInlineImages(content, previousInlineImages);
119
- }
120
- onChange && onChange(content, removedInlineImages);
121
- setPreviousInlineImages(getPreviousInlineImages(content));
122
- }, [onChange, previousInlineImages]);
123
- useEffect(() => {
124
- // don't set callback in plugin constructor to update callback without plugin recreation
125
- updatePlugin.onUpdate = (event, shouldRemoveInlineImages) => {
126
- if (editor.current === null) {
127
- return;
128
- }
129
- if (event === UpdateEvent.Blur || event === UpdateEvent.Dispose) {
130
- onContentModelUpdate && onContentModelUpdate(editor.current.getContentModelCopy('disconnected'));
131
- }
132
- else {
133
- const content = exportContent(editor.current);
134
- let removedInlineImages = [];
135
- if (shouldRemoveInlineImages) {
136
- removedInlineImages = getRemovedInlineImages(content, previousInlineImages);
137
- if (removedInlineImages.length > 0) {
138
- removeLocalBlobs(inlineImageLocalBlobs, removedInlineImages);
139
- }
140
- }
141
- onChange && onChange(content, removedInlineImages);
142
- setPreviousInlineImages(getPreviousInlineImages(content));
143
- }
144
- };
145
- }, [onChange, onContentModelUpdate, updatePlugin, previousInlineImages, inlineImageLocalBlobs]);
146
- const undoRedoPlugin = useMemo(() => {
147
- return new UndoRedoPlugin();
148
- }, []);
149
- useEffect(() => {
150
- if (onInsertInlineImage) {
151
- copyPastePlugin.onInsertInlineImage = (imageAttributes) => {
152
- const { id, src } = imageAttributes;
153
- setInlineImageLocalBlobs(prev => {
154
- if (!id || !src) {
155
- return prev;
156
- }
157
- return Object.assign(Object.assign({}, prev), { [id]: src });
158
- });
159
- onInsertInlineImage(imageAttributes);
160
- };
161
- }
162
- else {
163
- copyPastePlugin.onInsertInlineImage = undefined;
164
- }
165
- undoRedoPlugin.onInsertInlineImage = onInsertInlineImage;
166
- }, [copyPastePlugin, onInsertInlineImage, undoRedoPlugin]);
167
- useEffect(() => {
168
- undoRedoPlugin.onUpdateContent = () => {
169
- onChangeContent(true);
170
- };
171
- }, [onChangeContent, undoRedoPlugin]);
172
- const keyboardInputPlugin = useMemo(() => {
173
- return new KeyboardInputPlugin();
174
- }, []);
175
- useEffect(() => {
176
- // don't set callback in plugin constructor to update callback without plugin recreation
177
- keyboardInputPlugin.onKeyDown = onKeyDown;
178
- }, [keyboardInputPlugin, onKeyDown]);
179
- useEffect(() => {
180
- // don't set callback in plugin constructor to update callback without plugin recreation
181
- keyboardInputPlugin.onCompositionUpdate = onCompositionUpdate;
182
- }, [keyboardInputPlugin, onCompositionUpdate]);
183
- const tableContextMenuPlugin = useMemo(() => {
184
- return new TableEditContextMenuProvider();
185
- }, []);
186
- useEffect(() => {
187
- tableContextMenuPlugin.updateStrings(strings);
188
- }, [tableContextMenuPlugin, strings]);
189
- const onContextMenuRender = useCallback((container, items, onDismiss) => {
190
- setContextMenuProps({
191
- items: items,
192
- target: container,
193
- onDismiss: onDismiss
194
- });
195
- }, []);
196
- const onContextMenuDismiss = useCallback(() => {
197
- setContextMenuProps(null);
198
- }, []);
199
- useEffect(() => {
200
- copyPastePlugin.onPaste = onPaste;
201
- }, [copyPastePlugin, onPaste]);
202
- const plugins = useMemo(() => {
203
- const contentEdit = new EditPlugin({
204
- handleTabKey: false
205
- });
206
- // AutoFormatPlugin previously was a part of the edit plugin
207
- const autoFormatPlugin = new AutoFormatPlugin({
208
- autoBullet: true,
209
- autoNumbering: true,
210
- autoLink: true
211
- });
212
- const roosterPastePlugin = new PastePlugin(false, {
213
- additionalDisallowedTags: ['head', '!doctype', '!cdata', '#comment'],
214
- additionalAllowedTags: [],
215
- styleSanitizers: DefaultSanitizers,
216
- attributeSanitizers: {}
217
- });
218
- const shortcutPlugin = new ShortcutPlugin();
219
- const contextMenuPlugin = new ContextMenuPlugin(onContextMenuRender, onContextMenuDismiss);
220
- return [placeholderPlugin, keyboardInputPlugin, contentEdit, autoFormatPlugin, updatePlugin, copyPastePlugin, roosterPastePlugin, toolbarPlugin, shortcutPlugin,
221
- // contextPlugin and tableEditMenuProvider allow to show insert/delete menu for the table
222
- contextMenuPlugin, tableContextMenuPlugin, undoRedoPlugin];
223
- }, [onContextMenuRender, onContextMenuDismiss, placeholderPlugin, keyboardInputPlugin, updatePlugin, copyPastePlugin, toolbarPlugin, tableContextMenuPlugin, undoRedoPlugin]);
224
- const announcerStringGetter = useCallback((key) => {
225
- var _a, _b;
226
- switch (key) {
227
- case 'announceListItemBullet':
228
- return (_a = strings.richTextNewBulletedListItemAnnouncement) !== null && _a !== void 0 ? _a : '';
229
- case 'announceListItemNumbering':
230
- return (_b = strings.richTextNewNumberedListItemAnnouncement) !== null && _b !== void 0 ? _b : '';
231
- case 'announceOnFocusLastCell':
232
- return '';
233
- }
234
- }, [strings.richTextNewBulletedListItemAnnouncement, strings.richTextNewNumberedListItemAnnouncement]);
235
- useEffect(() => {
236
- var _a;
237
- const prevInlineImage = getPreviousInlineImages(initialContent);
238
- setPreviousInlineImages(prevInlineImage);
239
- const initialModel = createEditorInitialModel(initialContent, contentModel);
240
- if (editorDiv.current) {
241
- editor.current = new Editor(editorDiv.current, {
242
- inDarkMode: isDarkThemed(theme),
243
- // doNotAdjustEditorColor is used to disable default color and background color for Rooster component
244
- doNotAdjustEditorColor: true,
245
- imageSelectionBorderColor: theme.palette.themePrimary,
246
- tableCellSelectionBackgroundColor: theme.palette.neutralLight,
247
- plugins: plugins,
248
- initialModel: initialModel,
249
- defaultModelToDomOptions: {
250
- formatApplierOverride: {
251
- // apply border and dataset formats for table
252
- border: borderApplier,
253
- dataset: dataSetApplier
254
- }
255
- },
256
- announcerStringGetter: announcerStringGetter
257
- });
258
- }
259
- if (autoFocus === 'sendBoxTextField') {
260
- (_a = editor.current) === null || _a === void 0 ? void 0 : _a.focus();
261
- }
262
- return () => {
263
- if (editor.current) {
264
- editor.current.dispose();
265
- editor.current = null;
266
- }
267
- };
268
- // don't update the editor on deps update as everything is handled in separate hooks or plugins
269
- // eslint-disable-next-line react-hooks/exhaustive-deps
270
- }, [theme, plugins, announcerStringGetter]);
271
- useEffect(() => {
272
- const themeDirectionValue = themeDirection(theme);
273
- // check that editor exists and theme was actually changed
274
- // as format.direction will be undefined if setDirection is not called
275
- if (editor.current && previousThemeDirection.current !== themeDirectionValue) {
276
- const format = getFormatState(editor.current);
277
- if (format.direction !== themeDirectionValue) {
278
- // should be set after the hook where editor is created as the editor might be null
279
- // setDirection will cause the focus change back to the editor and this might not be what we want to do (autoFocus prop)
280
- // that's why it's not part of the create editor hook
281
- setDirection(editor.current, theme.rtl ? 'rtl' : 'ltr');
282
- }
283
- previousThemeDirection.current = themeDirectionValue;
284
- }
285
- }, [theme]);
286
- return React.createElement("div", { "data-testid": 'rich-text-editor-wrapper' },
287
- showRichTextEditorFormatting && toolbar,
288
- React.createElement("div", { className: richTextEditorWrapperStyle(theme) },
289
- 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 })),
290
- contextMenuProps && React.createElement(ContextualMenu, Object.assign({}, contextMenuProps, { calloutProps: {
291
- isBeakVisible: false
292
- } })));
293
- });
294
- const createEditorInitialModel = (initialContent, contentModel) => {
295
- if (contentModel) {
296
- // contentModel is the current content of the editor
297
- return contentModel;
298
- }
299
- else {
300
- const initialContentValue = initialContent;
301
- const initialModel = initialContentValue && initialContentValue.length > 0 ? createModelFromHtml(initialContentValue) : undefined;
302
- if (initialModel && initialModel.blocks.length > 0) {
303
- // lastBlock should have blockType = paragraph, otherwise add a new paragraph
304
- // to set focus to the end of the content
305
- const lastBlock = initialModel.blocks[initialModel.blocks.length - 1];
306
- if ((lastBlock === null || lastBlock === void 0 ? void 0 : lastBlock.blockType) === 'Paragraph') {
307
- // now lastBlock is paragraph
308
- setSelectionAfterLastSegment(initialModel, lastBlock);
309
- }
310
- else {
311
- const block = createParagraph(false);
312
- initialModel.blocks.push(block);
313
- setSelectionAfterLastSegment(initialModel, block);
314
- // add content to the paragraph, otherwise height might be calculated incorrectly
315
- block.segments.push(createBr());
316
- }
317
- }
318
- return initialModel;
319
- }
320
- };
321
- const setSelectionAfterLastSegment = (model, block) => {
322
- var _a;
323
- //selection marker should have the same format as the last segment if any
324
- const format = block.segments.length > 0 ? (_a = block.segments[block.segments.length - 1]) === null || _a === void 0 ? void 0 : _a.format : undefined;
325
- const marker = createSelectionMarker(format);
326
- block.segments.push(marker);
327
- setSelection(model, marker);
328
- };
329
- const themeDirection = (theme) => {
330
- return theme.rtl ? 'rtl' : 'ltr';
331
- };
332
- //# 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,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,e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AAW,EAAE,CAAC;gBACzC,6BAA6B;gBAC7B,4BAA4B,CAAC,YAAY,EAAE,SAAS,CAAC,CAAC;YACxD,CAAC;iBAAM,CAAC;gBACN,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,CAAC;gBACrC,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBAChC,4BAA4B,CAAC,YAAY,EAAE,KAAK,CAAC,CAAC;gBAClD,iFAAiF;gBACjF,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;QACD,OAAO,YAAY,CAAC;IACtB,CAAC;AACH,CAAC,CAAC;AACF,MAAM,4BAA4B,GAAG,CAAC,KAAqC,EAAE,KAA4B,EAAQ,EAAE;;IACjH,yEAAyE;IACzE,MAAM,MAAM,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAA,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,0CAAE,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC;IACzG,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 // OnKeyDown aren't called for composition events, so we need to handle them separately\n onCompositionUpdate?: () => 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 onCompositionUpdate,\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 useEffect(() => {\n if (editor.current) {\n if (!showRichTextEditorFormatting) {\n editor.current?.focus();\n }\n }\n }, [showRichTextEditorFormatting]);\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(prev => {\n if (!id || !src) {\n return prev;\n }\n return {\n ...prev,\n [id]: src\n };\n });\n onInsertInlineImage(imageAttributes);\n };\n } else {\n copyPastePlugin.onInsertInlineImage = undefined;\n }\n undoRedoPlugin.onInsertInlineImage = onInsertInlineImage;\n }, [copyPastePlugin, 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 useEffect(() => {\n // don't set callback in plugin constructor to update callback without plugin recreation\n keyboardInputPlugin.onCompositionUpdate = onCompositionUpdate;\n }, [keyboardInputPlugin, onCompositionUpdate]);\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