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