@azure/communication-react 1.30.0 → 1.31.0-beta.1

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 (381) hide show
  1. package/dist/communication-react.d.ts +1373 -24
  2. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-DdSFdo_m.js +213 -0
  3. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-DdSFdo_m.js.map +1 -0
  4. package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-C2HrwCVY.js +49 -0
  5. package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-C2HrwCVY.js.map +1 -0
  6. package/dist/dist-cjs/communication-react/index-CH39vOsT.js +46344 -0
  7. package/dist/dist-cjs/communication-react/index-CH39vOsT.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +174 -40373
  9. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/common.d.ts +13 -0
  11. package/dist/dist-esm/acs-ui-common/src/common.js.map +1 -1
  12. package/dist/dist-esm/acs-ui-common/src/constants.d.ts +5 -0
  13. package/dist/dist-esm/acs-ui-common/src/constants.js +5 -0
  14. package/dist/dist-esm/acs-ui-common/src/constants.js.map +1 -1
  15. package/dist/dist-esm/acs-ui-common/src/dataConversion.d.ts +6 -0
  16. package/dist/dist-esm/acs-ui-common/src/dataConversion.js +20 -0
  17. package/dist/dist-esm/acs-ui-common/src/dataConversion.js.map +1 -0
  18. package/dist/dist-esm/acs-ui-common/src/index.d.ts +4 -0
  19. package/dist/dist-esm/acs-ui-common/src/index.js +3 -0
  20. package/dist/dist-esm/acs-ui-common/src/index.js.map +1 -1
  21. package/dist/dist-esm/acs-ui-common/src/removeImageTags.d.ts +7 -0
  22. package/dist/dist-esm/acs-ui-common/src/removeImageTags.js +18 -0
  23. package/dist/dist-esm/acs-ui-common/src/removeImageTags.js.map +1 -0
  24. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  25. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  26. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +2 -0
  27. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  28. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +2 -0
  29. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +6 -0
  30. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  31. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js +25 -1
  32. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map +1 -1
  33. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.d.ts +1 -0
  34. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +3 -1
  35. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
  36. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js +4 -0
  37. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js.map +1 -1
  38. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +42 -2
  39. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  40. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +6 -0
  41. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +35 -0
  42. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  43. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +4 -0
  44. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +24 -4
  45. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  46. package/dist/dist-esm/calling-stateful-client/src/Converter.js +3 -0
  47. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  48. package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.d.ts +17 -0
  49. package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.js +33 -0
  50. package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.js.map +1 -0
  51. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.d.ts +1 -0
  52. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.js +7 -1
  53. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.js.map +1 -1
  54. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js +17 -0
  55. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js.map +1 -1
  56. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +1 -0
  57. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  58. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.d.ts +6 -2
  59. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js +36 -2
  60. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
  61. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.d.ts +2 -1
  62. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js +4 -0
  63. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js.map +1 -1
  64. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +25 -2
  65. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  66. package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.d.ts +6 -0
  67. package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.js +20 -0
  68. package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.js.map +1 -0
  69. package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js +3 -3
  70. package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js.map +1 -1
  71. package/dist/dist-esm/chat-stateful-client/src/ChatClientState.d.ts +15 -1
  72. package/dist/dist-esm/chat-stateful-client/src/ChatClientState.js.map +1 -1
  73. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js +2 -1
  74. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js.map +1 -1
  75. package/dist/dist-esm/chat-stateful-client/src/index.d.ts +1 -0
  76. package/dist/dist-esm/chat-stateful-client/src/index.js.map +1 -1
  77. package/dist/dist-esm/communication-react/src/index.d.ts +21 -0
  78. package/dist/dist-esm/communication-react/src/index.js +3 -0
  79. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  80. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.d.ts +2 -0
  81. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js +1 -0
  82. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js.map +1 -1
  83. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +13 -1
  84. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js +9 -3
  85. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
  86. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +11 -0
  87. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +32 -2
  88. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  89. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.d.ts +10 -0
  90. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js +15 -0
  91. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js.map +1 -0
  92. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.d.ts +8 -1
  93. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js +9 -5
  94. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
  95. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.d.ts +2 -1
  96. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js +4 -4
  97. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js.map +1 -1
  98. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.d.ts +4 -1
  99. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js +31 -6
  100. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js.map +1 -1
  101. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.d.ts +15 -1
  102. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js +9 -0
  103. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js.map +1 -1
  104. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.d.ts +24 -0
  105. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +203 -0
  106. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +1 -0
  107. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +23 -2
  108. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js +17 -6
  109. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
  110. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.d.ts +8 -1
  111. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js +10 -6
  112. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
  113. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +5 -5
  114. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
  115. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.d.ts +69 -0
  116. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js +36 -0
  117. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js.map +1 -0
  118. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.d.ts +75 -0
  119. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js +67 -0
  120. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js.map +1 -0
  121. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.d.ts +105 -0
  122. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js +51 -0
  123. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js.map +1 -0
  124. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.d.ts +86 -0
  125. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js +40 -0
  126. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js.map +1 -0
  127. package/dist/dist-esm/react-components/src/components/ImageOverlay.js +2 -0
  128. package/dist/dist-esm/react-components/src/components/ImageOverlay.js.map +1 -1
  129. package/dist/dist-esm/react-components/src/components/InputBoxComponent.d.ts +2 -0
  130. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +15 -0
  131. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
  132. package/dist/dist-esm/react-components/src/components/MentionPopover.d.ts +121 -0
  133. package/dist/dist-esm/react-components/src/components/MentionPopover.js +119 -0
  134. package/dist/dist-esm/react-components/src/components/MentionPopover.js.map +1 -0
  135. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +81 -5
  136. package/dist/dist-esm/react-components/src/components/MessageThread.js +13 -3
  137. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  138. package/dist/dist-esm/react-components/src/components/ParticipantList.d.ts +15 -0
  139. package/dist/dist-esm/react-components/src/components/ParticipantList.js +12 -3
  140. package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
  141. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.d.ts +9 -0
  142. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.js +29 -0
  143. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.js.map +1 -0
  144. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.d.ts +30 -0
  145. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js +98 -0
  146. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js.map +1 -0
  147. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.d.ts +19 -0
  148. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.js +43 -0
  149. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.js.map +1 -0
  150. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.d.ts +15 -0
  151. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js +42 -0
  152. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js.map +1 -0
  153. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.d.ts +24 -0
  154. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.js +64 -0
  155. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.js.map +1 -0
  156. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.d.ts +20 -0
  157. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.js +45 -0
  158. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.js.map +1 -0
  159. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.d.ts +14 -0
  160. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.js +42 -0
  161. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.js.map +1 -0
  162. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.d.ts +30 -0
  163. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.js +99 -0
  164. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.js.map +1 -0
  165. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.d.ts +59 -0
  166. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +334 -0
  167. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -0
  168. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.d.ts +37 -0
  169. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +78 -0
  170. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +1 -0
  171. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +215 -0
  172. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +184 -0
  173. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -0
  174. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.d.ts +16 -0
  175. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js +75 -0
  176. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js.map +1 -0
  177. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxUtils.d.ts +9 -0
  178. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxUtils.js +16 -0
  179. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxUtils.js.map +1 -0
  180. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.d.ts +19 -0
  181. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js +229 -0
  182. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js.map +1 -0
  183. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.d.ts +7 -0
  184. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.js +51 -0
  185. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.js.map +1 -0
  186. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.d.ts +15 -0
  187. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js +64 -0
  188. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js.map +1 -0
  189. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.d.ts +6 -0
  190. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.js +13 -0
  191. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.js.map +1 -0
  192. package/dist/dist-esm/react-components/src/components/SendBox.d.ts +51 -1
  193. package/dist/dist-esm/react-components/src/components/SendBox.js +58 -6
  194. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  195. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.d.ts +56 -0
  196. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.js +75 -0
  197. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.js.map +1 -0
  198. package/dist/dist-esm/react-components/src/components/SendBoxErrors.d.ts +14 -0
  199. package/dist/dist-esm/react-components/src/components/SendBoxErrors.js +18 -0
  200. package/dist/dist-esm/react-components/src/components/SendBoxErrors.js.map +1 -0
  201. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.d.ts +24 -0
  202. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +550 -0
  203. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +1 -0
  204. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.d.ts +152 -0
  205. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js +819 -0
  206. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js.map +1 -0
  207. package/dist/dist-esm/react-components/src/components/index.d.ts +21 -0
  208. package/dist/dist-esm/react-components/src/components/index.js +8 -0
  209. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  210. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.d.ts +1 -1
  211. package/dist/dist-esm/react-components/src/components/styles/AttachmentCardGroup.styles.d.ts +1 -1
  212. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.d.ts +58 -0
  213. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js +144 -0
  214. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js.map +1 -0
  215. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.d.ts +26 -0
  216. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js +69 -0
  217. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js.map +1 -0
  218. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +3 -3
  219. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +8 -0
  220. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  221. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.d.ts +82 -0
  222. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +328 -0
  223. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +1 -0
  224. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.d.ts +21 -0
  225. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js +38 -0
  226. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js.map +1 -0
  227. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.d.ts +38 -0
  228. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js +99 -0
  229. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js.map +1 -0
  230. package/dist/dist-esm/react-components/src/components/styles/Stack.style.d.ts +5 -0
  231. package/dist/dist-esm/react-components/src/components/styles/Stack.style.js +32 -0
  232. package/dist/dist-esm/react-components/src/components/styles/Stack.style.js.map +1 -0
  233. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.d.ts +38 -1
  234. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js +30 -3
  235. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js.map +1 -1
  236. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.d.ts +4 -2
  237. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js +9 -2
  238. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
  239. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.d.ts +73 -0
  240. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js +178 -0
  241. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js.map +1 -0
  242. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.d.ts +33 -0
  243. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js +119 -0
  244. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js.map +1 -0
  245. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +47 -1
  246. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +154 -4
  247. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  248. package/dist/dist-esm/react-components/src/components/utils/common.js +2 -0
  249. package/dist/dist-esm/react-components/src/components/utils/common.js.map +1 -1
  250. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.d.ts +2 -1
  251. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.js.map +1 -1
  252. package/dist/dist-esm/react-components/src/components/utils/merge.d.ts +7 -0
  253. package/dist/dist-esm/react-components/src/components/utils/merge.js +16 -0
  254. package/dist/dist-esm/react-components/src/components/utils/merge.js.map +1 -0
  255. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.d.ts +4 -0
  256. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js +3 -1
  257. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js.map +1 -1
  258. package/dist/dist-esm/react-components/src/index.d.ts +1 -0
  259. package/dist/dist-esm/react-components/src/index.js.map +1 -1
  260. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +45 -0
  261. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
  262. package/dist/dist-esm/react-components/src/theming/icons.d.ts +24 -0
  263. package/dist/dist-esm/react-components/src/theming/icons.js +67 -0
  264. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  265. package/dist/dist-esm/react-components/src/theming/icons.styles.d.ts +6 -0
  266. package/dist/dist-esm/react-components/src/theming/icons.styles.js +25 -0
  267. package/dist/dist-esm/react-components/src/theming/icons.styles.js.map +1 -0
  268. package/dist/dist-esm/react-components/src/theming/themes.d.ts +6 -0
  269. package/dist/dist-esm/react-components/src/theming/themes.js +9 -0
  270. package/dist/dist-esm/react-components/src/theming/themes.js.map +1 -1
  271. package/dist/dist-esm/react-components/src/types/Attachment.d.ts +13 -0
  272. package/dist/dist-esm/react-components/src/types/Attachment.js.map +1 -1
  273. package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +20 -1
  274. package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
  275. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +59 -0
  276. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +15 -10
  277. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  278. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +38 -6
  279. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +12 -1
  280. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  281. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +2 -0
  282. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  283. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.d.ts +46 -0
  284. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js +200 -0
  285. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js.map +1 -0
  286. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.d.ts +2 -0
  287. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js +19 -0
  288. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js.map +1 -1
  289. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js +10 -2
  290. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js.map +1 -1
  291. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.d.ts +2 -0
  292. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js +19 -0
  293. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js.map +1 -1
  294. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.d.ts +1 -0
  295. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +5 -3
  296. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
  297. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +3 -0
  298. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  299. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +3 -0
  300. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  301. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +2 -2
  302. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  303. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.d.ts +7 -0
  304. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +43 -5
  305. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  306. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js +2 -2
  307. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js.map +1 -1
  308. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js +2 -2
  309. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js.map +1 -1
  310. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js +2 -2
  311. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js.map +1 -1
  312. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +8 -0
  313. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +68 -0
  314. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  315. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +52 -0
  316. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +10 -4
  317. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  318. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +10 -3
  319. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +20 -2
  320. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  321. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +16 -2
  322. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  323. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.d.ts +10 -4
  324. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +14 -2
  325. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
  326. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.d.ts +15 -0
  327. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.js +23 -0
  328. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.js.map +1 -0
  329. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts +27 -0
  330. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js +2 -1
  331. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
  332. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.d.ts +2 -0
  333. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +189 -11
  334. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  335. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.d.ts +18 -0
  336. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js +18 -0
  337. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js.map +1 -0
  338. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.d.ts +49 -0
  339. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.js +44 -0
  340. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.js.map +1 -0
  341. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.d.ts +39 -0
  342. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js +267 -0
  343. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js.map +1 -0
  344. package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.d.ts +20 -0
  345. package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.js.map +1 -1
  346. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +6 -2
  347. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +36 -0
  348. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  349. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts +12 -2
  350. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
  351. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.d.ts +80 -0
  352. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js +36 -0
  353. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js.map +1 -0
  354. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.d.ts +38 -0
  355. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js +66 -0
  356. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js.map +1 -0
  357. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.d.ts +5 -0
  358. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js +5 -0
  359. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js.map +1 -0
  360. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js +13 -2
  361. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js.map +1 -1
  362. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.d.ts +2 -0
  363. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
  364. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.d.ts +4 -0
  365. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js +4 -0
  366. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js.map +1 -1
  367. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js +2 -1
  368. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js.map +1 -1
  369. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.d.ts +10 -0
  370. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js +16 -0
  371. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js.map +1 -0
  372. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.d.ts +41 -2
  373. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js +21 -0
  374. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js.map +1 -1
  375. package/dist/dist-esm/react-composites/src/composites/common/constants.d.ts +5 -0
  376. package/dist/dist-esm/react-composites/src/composites/common/constants.js +5 -0
  377. package/dist/dist-esm/react-composites/src/composites/common/constants.js.map +1 -1
  378. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +26 -1
  379. package/dist/dist-esm/react-composites/src/composites/common/icons.js +2 -0
  380. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  381. package/package.json +4 -4
@@ -0,0 +1,64 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import React, { useMemo } from 'react';
4
+ import { FocusZone, FocusZoneDirection, mergeStyles } from '@fluentui/react';
5
+ import { insertTableMenuCellButtonSelectedStyles, insertTableMenuCellButtonStyles, insertTableMenuFocusZone, insertTableMenuTitleStyles } from '../../../styles/RichTextEditor.styles';
6
+ import { ColumnRowReplaceString, createKey } from '../../../utils/RichTextTableUtils';
7
+ import { useTheme } from '../../../../theming';
8
+ // This file uses RoosterJS React package implementation with updates to UI components and styles.
9
+ const RowColumnInitialValue = 0;
10
+ /**
11
+ * @private
12
+ * Component for the insert table pane
13
+ */
14
+ export const RichTextInsertTablePane = (props) => {
15
+ const { item, onClick, maxColumnsNumber, maxRowsNumber } = props;
16
+ const [column, setColumn] = React.useState(RowColumnInitialValue);
17
+ const [row, setRow] = React.useState(RowColumnInitialValue);
18
+ const theme = useTheme();
19
+ const updateSize = React.useCallback((target) => {
20
+ if (target !== undefined && target.dataset.column !== undefined && target.dataset.row !== undefined) {
21
+ const column = parseInt(target.dataset.column);
22
+ const row = parseInt(target.dataset.row);
23
+ if (column >= RowColumnInitialValue && column < maxColumnsNumber && row >= RowColumnInitialValue && row < maxRowsNumber) {
24
+ setColumn(column);
25
+ setRow(row);
26
+ }
27
+ }
28
+ }, [maxColumnsNumber, maxRowsNumber]);
29
+ const onMouseEnter = React.useCallback((e) => {
30
+ updateSize(e.target);
31
+ }, [updateSize]);
32
+ const onTouchStart = React.useCallback((e) => {
33
+ updateSize(e.target);
34
+ }, [updateSize]);
35
+ const onClickButton = React.useCallback(() => {
36
+ onClick(createKey(formatRowColumnText(row), formatRowColumnText(column)));
37
+ }, [row, column, onClick]);
38
+ const items = React.useMemo(() => {
39
+ var _a;
40
+ const items = [];
41
+ for (let i = 0; i < maxRowsNumber; i++) {
42
+ for (let j = 0; j < maxColumnsNumber; j++) {
43
+ const key = `cell_${i}_${j}`;
44
+ const isSelected = j <= column && i <= row;
45
+ items.push(React.createElement("button", { className: mergeStyles(insertTableMenuCellButtonStyles(theme), isSelected ? insertTableMenuCellButtonSelectedStyles(theme) : undefined), onClick: onClickButton, key: key, id: key, "data-column": j, "data-row": i, "data-is-focusable": true, onMouseEnter: onMouseEnter, onTouchStart: onTouchStart, "aria-label": formatText((_a = item.text) !== null && _a !== void 0 ? _a : '', formatRowColumnText(i), formatRowColumnText(j)), "data-testid": key }));
46
+ }
47
+ }
48
+ return items;
49
+ }, [maxRowsNumber, maxColumnsNumber, column, row, theme, onClickButton, onMouseEnter, onTouchStart, item.text]);
50
+ const text = useMemo(() => {
51
+ var _a;
52
+ return formatText((_a = item.text) !== null && _a !== void 0 ? _a : '', formatRowColumnText(row), formatRowColumnText(column));
53
+ }, [column, item.text, row]);
54
+ return React.createElement("div", null,
55
+ React.createElement("div", { className: insertTableMenuTitleStyles }, text),
56
+ React.createElement(FocusZone, { defaultTabbableElement: `cell_${RowColumnInitialValue}_${RowColumnInitialValue}`, direction: FocusZoneDirection.bidirectional, onActiveElementChanged: updateSize, className: insertTableMenuFocusZone(theme) }, items));
57
+ };
58
+ const formatText = (text, row, column) => {
59
+ return text.replace(`${ColumnRowReplaceString}`, `${column.toString()} x ${row.toString()}`);
60
+ };
61
+ const formatRowColumnText = (value) => {
62
+ return value + 1;
63
+ };
64
+ //# sourceMappingURL=RichTextInsertTablePane.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RichTextInsertTablePane.js","sourceRoot":"","sources":["../../../../../../../../preprocess-dist/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE7E,OAAO,EAAE,uCAAuC,EAAE,+BAA+B,EAAE,wBAAwB,EAAE,0BAA0B,EAAE,MAAM,uCAAuC,CAAC;AACvL,OAAO,EAAE,sBAAsB,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AACtF,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,kGAAkG;AAClG,MAAM,qBAAqB,GAAG,CAAC,CAAC;AAQhC;;;GAGG;AACH,MAAM,CAAC,MAA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FocusZone, FocusZoneDirection, mergeStyles } from '@fluentui/react';\nimport type { IContextualMenuItem } from '@fluentui/react';\nimport { insertTableMenuCellButtonSelectedStyles, insertTableMenuCellButtonStyles, insertTableMenuFocusZone, insertTableMenuTitleStyles } from '../../../styles/RichTextEditor.styles';\nimport { ColumnRowReplaceString, createKey } from '../../../utils/RichTextTableUtils';\nimport { useTheme } from '../../../../theming';\n\n// This file uses RoosterJS React package implementation with updates to UI components and styles.\nconst RowColumnInitialValue = 0;\ninterface RichTextInsertTablePaneProps {\n item: IContextualMenuItem;\n onClick: (key: string) => void;\n maxRowsNumber: number;\n maxColumnsNumber: number;\n}\n\n/**\n * @private\n * Component for the insert table pane\n */\nexport const RichTextInsertTablePane = (props: RichTextInsertTablePaneProps): JSX.Element => {\n const {\n item,\n onClick,\n maxColumnsNumber,\n maxRowsNumber\n } = props;\n const [column, setColumn] = React.useState(RowColumnInitialValue);\n const [row, setRow] = React.useState(RowColumnInitialValue);\n const theme = useTheme();\n const updateSize = React.useCallback((target?: HTMLElement) => {\n if (target !== undefined && target.dataset.column !== undefined && target.dataset.row !== undefined) {\n const column = parseInt(target.dataset.column);\n const row = parseInt(target.dataset.row);\n if (column >= RowColumnInitialValue && column < maxColumnsNumber && row >= RowColumnInitialValue && row < maxRowsNumber) {\n setColumn(column);\n setRow(row);\n }\n }\n }, [maxColumnsNumber, maxRowsNumber]);\n const onMouseEnter = React.useCallback((e: React.MouseEvent<HTMLButtonElement>) => {\n updateSize(e.target as HTMLElement);\n }, [updateSize]);\n const onTouchStart = React.useCallback((e: React.TouchEvent<HTMLButtonElement>) => {\n updateSize(e.target as HTMLElement);\n }, [updateSize]);\n const onClickButton = React.useCallback(() => {\n onClick(createKey(formatRowColumnText(row), formatRowColumnText(column)));\n }, [row, column, onClick]);\n const items = React.useMemo(() => {\n const items: JSX.Element[] = [];\n for (let i = 0; i < maxRowsNumber; i++) {\n for (let j = 0; j < maxColumnsNumber; j++) {\n const key = `cell_${i}_${j}`;\n const isSelected = j <= column && i <= row;\n items.push(<button className={mergeStyles(insertTableMenuCellButtonStyles(theme), isSelected ? insertTableMenuCellButtonSelectedStyles(theme) : undefined)} onClick={onClickButton} key={key} id={key} data-column={j} data-row={i} data-is-focusable={true} onMouseEnter={onMouseEnter} onTouchStart={onTouchStart} aria-label={formatText(item.text ?? '', formatRowColumnText(i), formatRowColumnText(j))} data-testid={key} />);\n }\n }\n return items;\n }, [maxRowsNumber, maxColumnsNumber, column, row, theme, onClickButton, onMouseEnter, onTouchStart, item.text]);\n const text = useMemo(() => {\n return formatText(item.text ?? '', formatRowColumnText(row), formatRowColumnText(column));\n }, [column, item.text, row]);\n return <div>\n <div className={insertTableMenuTitleStyles}>{text}</div>\n <FocusZone defaultTabbableElement={`cell_${RowColumnInitialValue}_${RowColumnInitialValue}`} direction={FocusZoneDirection.bidirectional} onActiveElementChanged={updateSize} className={insertTableMenuFocusZone(theme)}>\n {items}\n </FocusZone>\n </div>;\n};\nconst formatText = (text: string, row: number, column: number): string => {\n return text.replace(`${ColumnRowReplaceString}`, `${column.toString()} x ${row.toString()}`);\n};\nconst formatRowColumnText = (value: number): number => {\n return value + 1;\n};"]}
@@ -0,0 +1,6 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * Renders the icon component for the insert table button in the rich text editor toolbar.
4
+ */
5
+ export declare const RichTextToolbarTableIcon: () => JSX.Element;
6
+ //# sourceMappingURL=RichTextToolbarTableIcon.d.ts.map
@@ -0,0 +1,13 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import React from 'react';
4
+ import { Icon, Stack } from '@fluentui/react';
5
+ /**
6
+ * Renders the icon component for the insert table button in the rich text editor toolbar.
7
+ */
8
+ export const RichTextToolbarTableIcon = () => {
9
+ return React.createElement(Stack, null,
10
+ React.createElement(Icon, { iconName: "RichTextInsertTableFilledIcon", className: 'ribbon-table-button-filled-icon' }),
11
+ React.createElement(Icon, { iconName: "RichTextInsertTableRegularIcon", className: 'ribbon-table-button-regular-icon' }));
12
+ };
13
+ //# sourceMappingURL=RichTextToolbarTableIcon.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RichTextToolbarTableIcon.js","sourceRoot":"","sources":["../../../../../../../../preprocess-dist/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAgB,EAAE;IACxD,OAAO,oBAAC,KAAK;QACT,oBAAC,IAAI,IAAC,QAAQ,EAAC,+BAA+B,EAAC,SAAS,EAAE,iCAAiC,GAAI;QAC/F,oBAAC,IAAI,IAAC,QAAQ,EAAC,gCAAgC,EAAC,SAAS,EAAE,kCAAkC,GAAI,CAC3F,CAAC;AACb,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { Icon, Stack } from '@fluentui/react';\n\n/**\n * Renders the icon component for the insert table button in the rich text editor toolbar.\n */\nexport const RichTextToolbarTableIcon = (): JSX.Element => {\n return <Stack>\n <Icon iconName=\"RichTextInsertTableFilledIcon\" className={'ribbon-table-button-filled-icon'} />\n <Icon iconName=\"RichTextInsertTableRegularIcon\" className={'ribbon-table-button-regular-icon'} />\n </Stack>;\n};"]}
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { IStyle } from '@fluentui/react';
3
3
  import { BaseCustomStyles } from '../types';
4
+ import { AttachmentMetadataInProgress, MessageOptions } from "../../../acs-ui-common/src";
5
+ import { MentionLookupOptions } from './MentionPopover';
4
6
  /**
5
7
  * Fluent styles for {@link Sendbox}.
6
8
  *
@@ -36,6 +38,30 @@ export interface SendBoxStrings {
36
38
  * Aria label for send message button
37
39
  */
38
40
  sendButtonAriaLabel: string;
41
+ /**
42
+ * Error message indicating that all attachment uploads are not complete.
43
+ */
44
+ attachmentUploadsPendingError: string;
45
+ /**
46
+ * Aria label to notify user when focus is on cancel attachment upload button.
47
+ */
48
+ removeAttachment: string;
49
+ /**
50
+ * Aria label to notify user attachment uploading starts.
51
+ */
52
+ uploading: string;
53
+ /**
54
+ * Aria label to notify user attachment upload progress.
55
+ */
56
+ uploadProgress: string;
57
+ /**
58
+ * Aria label to notify user attachment is uploaded.
59
+ */
60
+ uploadCompleted: string;
61
+ /**
62
+ * Aria label to notify user more attachment action menu.
63
+ */
64
+ attachmentMoreMenu: string;
39
65
  }
40
66
  /**
41
67
  * Props for {@link SendBox}.
@@ -55,7 +81,12 @@ export interface SendBoxProps {
55
81
  /**
56
82
  * Optional override behavior on send button click
57
83
  */
58
- onSendMessage?: (content: string) => Promise<void>;
84
+ onSendMessage?: (content: string, options?: MessageOptions) => Promise<void>;
85
+ /**
86
+ * Optional props needed to lookup suggestions in the mention scenario.
87
+ * @beta
88
+ */
89
+ mentionLookupOptions?: MentionLookupOptions;
59
90
  /**
60
91
  * Optional callback called when user is typing
61
92
  */
@@ -92,6 +123,25 @@ export interface SendBoxProps {
92
123
  * When undefined nothing has focus on render
93
124
  */
94
125
  autoFocus?: 'sendBoxTextField';
126
+ /**
127
+ * Optional callback to render uploaded attachments in the SendBox. The sendBox will expand
128
+ * vertically to accommodate the uploaded attachments. Attachment uploads will
129
+ * be rendered below the text area in sendBox.
130
+ * @beta
131
+ */
132
+ onRenderAttachmentUploads?: () => JSX.Element;
133
+ /**
134
+ * Optional array of type {@link AttachmentMetadataInProgress}
135
+ * to render attachments being uploaded in the SendBox.
136
+ * @beta
137
+ */
138
+ attachments?: AttachmentMetadataInProgress[];
139
+ /**
140
+ * Optional callback to remove the attachment upload before sending by clicking on
141
+ * cancel icon.
142
+ * @beta
143
+ */
144
+ onCancelAttachmentUpload?: (attachmentId: string) => void;
95
145
  }
96
146
  /**
97
147
  * Component for typing and sending messages.
@@ -3,12 +3,18 @@
3
3
  import React, { useState, useMemo, useCallback } from 'react';
4
4
  import { mergeStyles, concatStyleSets, Icon, Stack } from '@fluentui/react';
5
5
  import { sendButtonStyle, sendIconStyle, sendBoxWrapperStyles, borderAndBoxShadowStyle } from './styles/SendBox.styles';
6
+ import { useV9CustomStyles } from './styles/SendBox.styles';
6
7
  import { useTheme } from '../theming';
7
8
  import { useLocale } from '../localization';
8
9
  import { useIdentifiers } from '../identifiers';
9
10
  import { InputBoxComponent } from './InputBoxComponent';
10
11
  import { InputBoxButton } from './InputBoxButton';
12
+ import { SendBoxErrors } from './SendBoxErrors';
13
+ import { _AttachmentUploadCards } from './Attachment/AttachmentUploadCards';
14
+ import { attachmentUploadCardsStyles } from './styles/SendBox.styles';
15
+ import { isAttachmentUploadCompleted, hasIncompleteAttachmentUploads, toAttachmentMetadata } from './utils/SendBoxUtils';
11
16
  import { MAXIMUM_LENGTH_OF_MESSAGE, isMessageTooLong, sanitizeText, isSendBoxButtonDisabled } from './utils/SendBoxUtils';
17
+ import { FluentV9ThemeProvider } from '../theming/FluentV9ThemeProvider';
12
18
  /**
13
19
  * Component for typing and sending messages.
14
20
  *
@@ -18,7 +24,7 @@ import { MAXIMUM_LENGTH_OF_MESSAGE, isMessageTooLong, sanitizeText, isSendBoxBut
18
24
  * @public
19
25
  */
20
26
  export const SendBox = (props) => {
21
- const { disabled, systemMessage, supportNewline, onSendMessage, onTyping, onRenderIcon, onRenderSystemMessage, styles, autoFocus } = props;
27
+ const { disabled, systemMessage, supportNewline, onSendMessage, onTyping, onRenderIcon, onRenderSystemMessage, styles, autoFocus, mentionLookupOptions, attachments } = props;
22
28
  const theme = useTheme();
23
29
  const localeStrings = useLocale().strings.sendBox;
24
30
  const strings = Object.assign(Object.assign({}, localeStrings), props.strings);
@@ -26,6 +32,8 @@ export const SendBox = (props) => {
26
32
  const [textValue, setTextValue] = useState('');
27
33
  const [textValueOverflow, setTextValueOverflow] = useState(false);
28
34
  const sendTextFieldRef = React.useRef(null);
35
+ const customV9Styles = useV9CustomStyles();
36
+ const [attachmentUploadsPendingError, setAttachmentUploadsPendingError] = useState(undefined);
29
37
  const sendMessageOnClick = () => {
30
38
  var _a;
31
39
  // don't send a message when disabled
@@ -33,11 +41,22 @@ export const SendBox = (props) => {
33
41
  return;
34
42
  }
35
43
  // Don't send message until all attachments have been uploaded successfully
44
+ setAttachmentUploadsPendingError(undefined);
45
+ if (hasIncompleteAttachmentUploads(attachments)) {
46
+ setAttachmentUploadsPendingError({
47
+ message: strings.attachmentUploadsPendingError,
48
+ timestamp: Date.now()
49
+ });
50
+ return;
51
+ }
36
52
  const message = textValue;
37
53
  // we don't want to send empty messages including spaces, newlines, tabs
38
54
  // Message can be empty if there is a valid attachment upload
39
- if (sanitizeText(message).length > 0) {
40
- onSendMessage && onSendMessage(message);
55
+ if (sanitizeText(message).length > 0 || isAttachmentUploadCompleted(attachments)) {
56
+ onSendMessage && onSendMessage(message, {
57
+ attachments: toAttachmentMetadata(attachments),
58
+ type: 'text'
59
+ });
41
60
  setTextValue('');
42
61
  (_a = sendTextFieldRef.current) === null || _a === void 0 ? void 0 : _a.focus();
43
62
  }
@@ -54,10 +73,11 @@ export const SendBox = (props) => {
54
73
  const isSendBoxButtonDisabledValue = useMemo(() => {
55
74
  return isSendBoxButtonDisabled({
56
75
  hasContent: sanitizeText(textValue).length > 0,
76
+ hasCompletedAttachmentUploads: isAttachmentUploadCompleted(attachments),
57
77
  hasError: !!errorMessage,
58
78
  disabled: !!disabled
59
79
  });
60
- }, [disabled, errorMessage, textValue]);
80
+ }, [attachments, disabled, errorMessage, textValue]);
61
81
  const mergedSendButtonStyle = useMemo(() => mergeStyles(sendButtonStyle, styles === null || styles === void 0 ? void 0 : styles.sendMessageIconContainer), [styles === null || styles === void 0 ? void 0 : styles.sendMessageIconContainer]);
62
82
  const mergedStyles = useMemo(() => concatStyleSets(styles), [styles]);
63
83
  const mergedSendIconStyle = useMemo(() => sendIconStyle({
@@ -67,10 +87,41 @@ export const SendBox = (props) => {
67
87
  }), [theme, isSendBoxButtonDisabledValue, styles === null || styles === void 0 ? void 0 : styles.sendMessageIcon]);
68
88
  const onRenderSendIcon = useCallback((isHover) => onRenderIcon ? onRenderIcon(isHover) : React.createElement(Icon, { iconName: isHover && textValue ? 'SendBoxSendHovered' : 'SendBoxSend', className: mergedSendIconStyle }), [mergedSendIconStyle, onRenderIcon, textValue]);
69
89
  // Ensure that errors are cleared when there are no attachments in sendBox
90
+ React.useEffect(() => {
91
+ if (!(attachments === null || attachments === void 0 ? void 0 : attachments.filter(upload => !upload.error).length)) {
92
+ setAttachmentUploadsPendingError(undefined);
93
+ }
94
+ }, [attachments]);
95
+ const sendBoxErrorsProps = useMemo(() => {
96
+ var _a;
97
+ return {
98
+ attachmentUploadsPendingError: attachmentUploadsPendingError,
99
+ attachmentProgressError: (_a = attachments === null || attachments === void 0 ? void 0 : attachments.filter(attachmentUpload => attachmentUpload.error).pop()) === null || _a === void 0 ? void 0 : _a.error
100
+ };
101
+ }, [attachments, attachmentUploadsPendingError]);
102
+ const onRenderAttachmentUploads = useCallback(() => {
103
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k;
104
+ if (!(attachments === null || attachments === void 0 ? void 0 : attachments.filter(upload => !upload.error).length)) {
105
+ return null;
106
+ }
107
+ return props.onRenderAttachmentUploads ? props.onRenderAttachmentUploads() : React.createElement(Stack, { className: attachmentUploadCardsStyles },
108
+ React.createElement(FluentV9ThemeProvider, { v8Theme: theme, className: customV9Styles.clearBackground },
109
+ React.createElement(_AttachmentUploadCards, { attachments: attachments, onCancelAttachmentUpload: props.onCancelAttachmentUpload, strings: {
110
+ removeAttachment: (_b = (_a = props.strings) === null || _a === void 0 ? void 0 : _a.removeAttachment) !== null && _b !== void 0 ? _b : localeStrings.removeAttachment,
111
+ uploading: (_d = (_c = props.strings) === null || _c === void 0 ? void 0 : _c.uploading) !== null && _d !== void 0 ? _d : localeStrings.uploading,
112
+ uploadProgress: (_f = (_e = props.strings) === null || _e === void 0 ? void 0 : _e.uploadProgress) !== null && _f !== void 0 ? _f : localeStrings.uploadProgress,
113
+ uploadCompleted: (_h = (_g = props.strings) === null || _g === void 0 ? void 0 : _g.uploadCompleted) !== null && _h !== void 0 ? _h : localeStrings.uploadCompleted,
114
+ attachmentMoreMenu: (_k = (_j = props.strings) === null || _j === void 0 ? void 0 : _j.attachmentMoreMenu) !== null && _k !== void 0 ? _k : localeStrings.attachmentMoreMenu
115
+ }, disabled: disabled })));
116
+ }, [attachments, props, theme, customV9Styles.clearBackground, localeStrings.removeAttachment, localeStrings.uploading, localeStrings.uploadProgress, localeStrings.uploadCompleted, localeStrings.attachmentMoreMenu, disabled]);
70
117
  return React.createElement(Stack, { className: mergeStyles(sendBoxWrapperStyles, {
71
118
  overflow: 'visible'
72
119
  } // This is needed for the mention popup to be visible
73
120
  ) },
121
+ React.createElement(SendBoxErrors, { attachmentProgressError: sendBoxErrorsProps.attachmentProgressError ? {
122
+ message: sendBoxErrorsProps.attachmentProgressError.message,
123
+ timestamp: Date.now()
124
+ } : undefined, attachmentUploadsPendingError: sendBoxErrorsProps.attachmentUploadsPendingError }),
74
125
  React.createElement(Stack, { className: borderAndBoxShadowStyle({
75
126
  theme,
76
127
  hasErrorMessage: !!errorMessage,
@@ -83,12 +134,13 @@ export const SendBox = (props) => {
83
134
  }
84
135
  }, onEnterKeyDown: () => {
85
136
  sendMessageOnClick();
86
- }, styles: mergedStyles, supportNewline: supportNewline, maxLength: MAXIMUM_LENGTH_OF_MESSAGE },
137
+ }, styles: mergedStyles, supportNewline: supportNewline, maxLength: MAXIMUM_LENGTH_OF_MESSAGE, mentionLookupOptions: mentionLookupOptions },
87
138
  React.createElement(InputBoxButton, { onRenderIcon: onRenderSendIcon, onClick: e => {
88
139
  if (!textValueOverflow) {
89
140
  sendMessageOnClick();
90
141
  }
91
142
  e.stopPropagation();
92
- }, id: 'sendIconWrapper', className: mergedSendButtonStyle, ariaLabel: localeStrings.sendButtonAriaLabel, tooltipContent: localeStrings.sendButtonAriaLabel, disabled: isSendBoxButtonDisabledValue }))));
143
+ }, id: 'sendIconWrapper', className: mergedSendButtonStyle, ariaLabel: localeStrings.sendButtonAriaLabel, tooltipContent: localeStrings.sendButtonAriaLabel, disabled: isSendBoxButtonDisabledValue })),
144
+ onRenderAttachmentUploads()));
93
145
  };
94
146
  //# sourceMappingURL=SendBox.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SendBox.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/SendBox.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAsB,WAAW,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAExH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAgG1H;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAmB,EAAe,EAAE;IAC1D,MAAM,EACJ,QAAQ,EACR,aAAa,EACb,cAAc,EACd,aAAa,EACb,QAAQ,EACR,YAAY,EACZ,qBAAqB,EACrB,MAAM,EACN,SAAS,EACV,GAAG,KAAK,CAAC;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BAAC,cAAc,IAAC,YAAY,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAC,CAAC,EAAE;wBAC7D,IAAI,CAAC,iBAAiB,EAAE,CAAC;4BACvB,kBAAkB,EAAE,CAAC;wBACvB,CAAC;wBACD,CAAC,CAAC,eAAe,EAAE,CAAC;oBACtB,CAAC,EAAE,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,qBAAqB,EAAE,SAAS,EAAE,aAAa,CAAC,mBAAmB,EAAE,cAAc,EAAE,aAAa,CAAC,mBAAmB,EAAE,QAAQ,EAAE,4BAA4B,GAAI,CACnL,CAEd,CACF,CAAC;AACb,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useState, useMemo, useCallback } from 'react';\nimport { IStyle, ITextField, mergeStyles, concatStyleSets, Icon, Stack } from '@fluentui/react';\nimport { sendButtonStyle, sendIconStyle, sendBoxWrapperStyles, borderAndBoxShadowStyle } from './styles/SendBox.styles';\nimport { BaseCustomStyles } from '../types';\nimport { useTheme } from '../theming';\nimport { useLocale } from '../localization';\nimport { useIdentifiers } from '../identifiers';\nimport { InputBoxComponent } from './InputBoxComponent';\nimport { InputBoxButton } from './InputBoxButton';\nimport { MAXIMUM_LENGTH_OF_MESSAGE, isMessageTooLong, sanitizeText, isSendBoxButtonDisabled } from './utils/SendBoxUtils';\n/**\n * Fluent styles for {@link Sendbox}.\n *\n * @public\n */\nexport interface SendBoxStylesProps extends BaseCustomStyles {\n /** Styles for the text field. */\n textField?: IStyle;\n /** styles for the text field container */\n textFieldContainer?: IStyle;\n /** Styles for the container of the send message icon. */\n sendMessageIconContainer?: IStyle;\n /** Styles for the send message icon; These styles will be ignored when a custom send message icon is provided. */\n sendMessageIcon?: IStyle;\n /** Styles for the system message; These styles will be ignored when a custom system message component is provided. */\n systemMessage?: IStyle;\n}\n\n/**\n * Strings of {@link SendBox} that can be overridden.\n *\n * @public\n */\nexport interface SendBoxStrings {\n /**\n * Placeholder text in SendBox when there is no user input\n */\n placeholderText: string;\n /**\n * The warning message when send box text length is more than max limit\n */\n textTooLong: string;\n /**\n * Aria label for send message button\n */\n sendButtonAriaLabel: string;\n}\n\n/**\n * Props for {@link SendBox}.\n *\n * @public\n */\nexport interface SendBoxProps {\n /**\n * Optional boolean to disable text box\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * Optional text for system message below text box\n */\n systemMessage?: string;\n /**\n * Optional override behavior on send button click\n */\n onSendMessage?: (content: string) => Promise<void>;\n /**\n * Optional callback called when user is typing\n */\n onTyping?: () => Promise<void>;\n /**\n * Optional callback to render system message below the SendBox.\n * @defaultValue MessageBar\n */\n onRenderSystemMessage?: (systemMessage: string | undefined) => React.ReactElement;\n /**\n * Optional boolean to support new line in SendBox.\n * @defaultValue false\n */\n supportNewline?: boolean;\n /**\n * Optional callback to render send button icon to the right of the SendBox.\n * @defaultValue SendBoxSendHovered icon when mouse over icon and SendBoxSend icon otherwise\n */\n onRenderIcon?: (isHover: boolean) => JSX.Element;\n /**\n * Allows users to pass in an object contains custom CSS styles.\n * @Example\n * ```\n * <SendBox styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: SendBoxStylesProps;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<SendBoxStrings>;\n /**\n * enumerable to determine if the input box has focus on render or not.\n * When undefined nothing has focus on render\n */\n autoFocus?: 'sendBoxTextField';\n}\n\n/**\n * Component for typing and sending messages.\n *\n * Supports sending typing notification when user starts entering text.\n * Supports an optional message below the text input field.\n *\n * @public\n */\nexport const SendBox = (props: SendBoxProps): JSX.Element => {\n const {\n disabled,\n systemMessage,\n supportNewline,\n onSendMessage,\n onTyping,\n onRenderIcon,\n onRenderSystemMessage,\n styles,\n autoFocus\n } = props;\n const theme = useTheme();\n const localeStrings = useLocale().strings.sendBox;\n const strings = {\n ...localeStrings,\n ...props.strings\n };\n const ids = useIdentifiers();\n const [textValue, setTextValue] = useState('');\n const [textValueOverflow, setTextValueOverflow] = useState(false);\n const sendTextFieldRef = React.useRef<ITextField>(null);\n const sendMessageOnClick = (): void => {\n // don't send a message when disabled\n if (disabled || textValueOverflow) {\n return;\n }\n\n // Don't send message until all attachments have been uploaded successfully\n const message = textValue;\n // we don't want to send empty messages including spaces, newlines, tabs\n // Message can be empty if there is a valid attachment upload\n if (sanitizeText(message).length > 0) {\n onSendMessage && onSendMessage(message);\n setTextValue('');\n sendTextFieldRef.current?.focus();\n }\n };\n const setText = (newValue?: string | undefined): void => {\n if (newValue === undefined) {\n return;\n }\n setTextValueOverflow(isMessageTooLong(newValue.length));\n setTextValue(newValue);\n };\n const textTooLongMessage = textValueOverflow ? strings.textTooLong : undefined;\n const errorMessage = systemMessage ?? textTooLongMessage;\n const isSendBoxButtonDisabledValue = useMemo(() => {\n return isSendBoxButtonDisabled({\n hasContent: sanitizeText(textValue).length > 0,\n hasError: !!errorMessage,\n disabled: !!disabled\n });\n }, [disabled, errorMessage, textValue]);\n const mergedSendButtonStyle = useMemo(() => mergeStyles(sendButtonStyle, styles?.sendMessageIconContainer), [styles?.sendMessageIconContainer]);\n const mergedStyles = useMemo(() => concatStyleSets(styles), [styles]);\n const mergedSendIconStyle = useMemo(() => sendIconStyle({\n theme,\n isSendBoxButtonDisabled: isSendBoxButtonDisabledValue,\n customSendIconStyle: styles?.sendMessageIcon\n }), [theme, isSendBoxButtonDisabledValue, styles?.sendMessageIcon]);\n const onRenderSendIcon = useCallback((isHover: boolean) => onRenderIcon ? onRenderIcon(isHover) : <Icon iconName={isHover && textValue ? 'SendBoxSendHovered' : 'SendBoxSend'} className={mergedSendIconStyle} />, [mergedSendIconStyle, onRenderIcon, textValue]);\n\n // Ensure that errors are cleared when there are no attachments in sendBox\n return <Stack className={mergeStyles(sendBoxWrapperStyles, {\n overflow: 'visible'\n } // This is needed for the mention popup to be visible\n )}>\n {}\n <Stack className={borderAndBoxShadowStyle({\n theme,\n hasErrorMessage: !!errorMessage,\n disabled: !!disabled\n })}>\n <InputBoxComponent autoFocus={autoFocus} data-ui-id={ids.sendboxTextField} disabled={disabled} errorMessage={onRenderSystemMessage ? onRenderSystemMessage(errorMessage) : errorMessage} textFieldRef={sendTextFieldRef} id=\"sendbox\" placeholderText={strings.placeholderText} textValue={textValue} onChange={(_, newValue) => setText(newValue)} onKeyDown={ev => {\n const keyWasSendingMessage = ev.key === 'Enter' && (ev.shiftKey === false || !supportNewline);\n if (!keyWasSendingMessage) {\n onTyping?.();\n }\n }} onEnterKeyDown={() => {\n sendMessageOnClick();\n }} styles={mergedStyles} supportNewline={supportNewline} maxLength={MAXIMUM_LENGTH_OF_MESSAGE}>\n <InputBoxButton onRenderIcon={onRenderSendIcon} onClick={e => {\n if (!textValueOverflow) {\n sendMessageOnClick();\n }\n e.stopPropagation();\n }} id={'sendIconWrapper'} className={mergedSendButtonStyle} ariaLabel={localeStrings.sendButtonAriaLabel} tooltipContent={localeStrings.sendButtonAriaLabel} disabled={isSendBoxButtonDisabledValue} />\n </InputBoxComponent>\n {}\n </Stack>\n </Stack>;\n};"]}
1
+ {"version":3,"file":"SendBox.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/SendBox.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAsB,WAAW,EAAE,eAAe,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AACxH,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAA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,EAAE,EAAE,EAAE,iBAAiB,EAAE,SAAS,EAAE,qBAAqB,EAAE,SAAS,EAAE,aAAa,CAAC,mBAAmB,EAAE,cAAc,EAAE,aAAa,CAAC,mBAAmB,EAAE,QAAQ,EAAE,4BAA4B,GAAI,CACnL;YACnB,yBAAyB,EAAE,CACtB,CACF,CAAC;AACb,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { useState, useMemo, useCallback } from 'react';\nimport { IStyle, ITextField, mergeStyles, concatStyleSets, Icon, Stack } from '@fluentui/react';\nimport { sendButtonStyle, sendIconStyle, sendBoxWrapperStyles, borderAndBoxShadowStyle } from './styles/SendBox.styles';\nimport { useV9CustomStyles } from './styles/SendBox.styles';\nimport { BaseCustomStyles } from '../types';\nimport { useTheme } from '../theming';\nimport { useLocale } from '../localization';\nimport { useIdentifiers } from '../identifiers';\nimport { InputBoxComponent } from './InputBoxComponent';\nimport { InputBoxButton } from './InputBoxButton';\nimport { SendBoxErrors } from './SendBoxErrors';\nimport { _AttachmentUploadCards } from './Attachment/AttachmentUploadCards';\nimport { AttachmentMetadataInProgress, MessageOptions } from '@internal/acs-ui-common';\nimport { attachmentUploadCardsStyles } from './styles/SendBox.styles';\nimport { SendBoxErrorBarError } from './SendBoxErrorBar';\nimport { isAttachmentUploadCompleted, hasIncompleteAttachmentUploads, toAttachmentMetadata } from './utils/SendBoxUtils';\nimport { MAXIMUM_LENGTH_OF_MESSAGE, isMessageTooLong, sanitizeText, isSendBoxButtonDisabled } from './utils/SendBoxUtils';\nimport { MentionLookupOptions } from './MentionPopover';\nimport { FluentV9ThemeProvider } from '../theming/FluentV9ThemeProvider';\n\n/**\n * Fluent styles for {@link Sendbox}.\n *\n * @public\n */\nexport interface SendBoxStylesProps extends BaseCustomStyles {\n /** Styles for the text field. */\n textField?: IStyle;\n /** styles for the text field container */\n textFieldContainer?: IStyle;\n /** Styles for the container of the send message icon. */\n sendMessageIconContainer?: IStyle;\n /** Styles for the send message icon; These styles will be ignored when a custom send message icon is provided. */\n sendMessageIcon?: IStyle;\n /** Styles for the system message; These styles will be ignored when a custom system message component is provided. */\n systemMessage?: IStyle;\n}\n\n/**\n * Strings of {@link SendBox} that can be overridden.\n *\n * @public\n */\nexport interface SendBoxStrings {\n /**\n * Placeholder text in SendBox when there is no user input\n */\n placeholderText: string;\n /**\n * The warning message when send box text length is more than max limit\n */\n textTooLong: string;\n /**\n * Aria label for send message button\n */\n sendButtonAriaLabel: string;\n /**\n * Error message indicating that all attachment uploads are not complete.\n */\n attachmentUploadsPendingError: string;\n /**\n * Aria label to notify user when focus is on cancel attachment upload button.\n */\n removeAttachment: string;\n /**\n * Aria label to notify user attachment uploading starts.\n */\n uploading: string;\n /**\n * Aria label to notify user attachment upload progress.\n */\n uploadProgress: string;\n /**\n * Aria label to notify user attachment is uploaded.\n */\n uploadCompleted: string;\n /**\n * Aria label to notify user more attachment action menu.\n */\n attachmentMoreMenu: string;\n}\n\n/**\n * Props for {@link SendBox}.\n *\n * @public\n */\nexport interface SendBoxProps {\n /**\n * Optional boolean to disable text box\n * @defaultValue false\n */\n disabled?: boolean;\n /**\n * Optional text for system message below text box\n */\n systemMessage?: string;\n /**\n * Optional override behavior on send button click\n */\n onSendMessage?: (content: string, options?: MessageOptions) => Promise<void>;\n /**\n * Optional props needed to lookup suggestions in the mention scenario.\n * @beta\n */\n mentionLookupOptions?: MentionLookupOptions;\n\n /**\n * Optional callback called when user is typing\n */\n onTyping?: () => Promise<void>;\n /**\n * Optional callback to render system message below the SendBox.\n * @defaultValue MessageBar\n */\n onRenderSystemMessage?: (systemMessage: string | undefined) => React.ReactElement;\n /**\n * Optional boolean to support new line in SendBox.\n * @defaultValue false\n */\n supportNewline?: boolean;\n /**\n * Optional callback to render send button icon to the right of the SendBox.\n * @defaultValue SendBoxSendHovered icon when mouse over icon and SendBoxSend icon otherwise\n */\n onRenderIcon?: (isHover: boolean) => JSX.Element;\n /**\n * Allows users to pass in an object contains custom CSS styles.\n * @Example\n * ```\n * <SendBox styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: SendBoxStylesProps;\n /**\n * Optional strings to override in component\n */\n strings?: Partial<SendBoxStrings>;\n /**\n * enumerable to determine if the input box has focus on render or not.\n * When undefined nothing has focus on render\n */\n autoFocus?: 'sendBoxTextField';\n /**\n * Optional callback to render uploaded attachments in the SendBox. The sendBox will expand\n * vertically to accommodate the uploaded attachments. Attachment uploads will\n * be rendered below the text area in sendBox.\n * @beta\n */\n onRenderAttachmentUploads?: () => JSX.Element;\n /**\n * Optional array of type {@link AttachmentMetadataInProgress}\n * to render attachments being uploaded in the SendBox.\n * @beta\n */\n attachments?: AttachmentMetadataInProgress[];\n /**\n * Optional callback to remove the attachment upload before sending by clicking on\n * cancel icon.\n * @beta\n */\n onCancelAttachmentUpload?: (attachmentId: string) => void;\n}\n\n/**\n * Component for typing and sending messages.\n *\n * Supports sending typing notification when user starts entering text.\n * Supports an optional message below the text input field.\n *\n * @public\n */\nexport const SendBox = (props: SendBoxProps): JSX.Element => {\n const {\n disabled,\n systemMessage,\n supportNewline,\n onSendMessage,\n onTyping,\n onRenderIcon,\n onRenderSystemMessage,\n styles,\n autoFocus,\n mentionLookupOptions,\n attachments\n } = props;\n const theme = useTheme();\n const localeStrings = useLocale().strings.sendBox;\n const strings = {\n ...localeStrings,\n ...props.strings\n };\n const ids = useIdentifiers();\n const [textValue, setTextValue] = useState('');\n const [textValueOverflow, setTextValueOverflow] = useState(false);\n const sendTextFieldRef = React.useRef<ITextField>(null);\n const customV9Styles = useV9CustomStyles();\n const [attachmentUploadsPendingError, setAttachmentUploadsPendingError] = useState<SendBoxErrorBarError | undefined>(undefined);\n const sendMessageOnClick = (): void => {\n // don't send a message when disabled\n if (disabled || textValueOverflow) {\n return;\n }\n\n // Don't send message until all attachments have been uploaded successfully\n setAttachmentUploadsPendingError(undefined);\n if (hasIncompleteAttachmentUploads(attachments)) {\n setAttachmentUploadsPendingError({\n message: strings.attachmentUploadsPendingError,\n timestamp: Date.now()\n });\n return;\n }\n const message = textValue;\n // we don't want to send empty messages including spaces, newlines, tabs\n // Message can be empty if there is a valid attachment upload\n if (sanitizeText(message).length > 0 || isAttachmentUploadCompleted(attachments)) {\n onSendMessage && onSendMessage(message, {\n attachments: toAttachmentMetadata(attachments),\n type: 'text'\n });\n setTextValue('');\n sendTextFieldRef.current?.focus();\n }\n };\n const setText = (newValue?: string | undefined): void => {\n if (newValue === undefined) {\n return;\n }\n setTextValueOverflow(isMessageTooLong(newValue.length));\n setTextValue(newValue);\n };\n const textTooLongMessage = textValueOverflow ? strings.textTooLong : undefined;\n const errorMessage = systemMessage ?? textTooLongMessage;\n const isSendBoxButtonDisabledValue = useMemo(() => {\n return isSendBoxButtonDisabled({\n hasContent: sanitizeText(textValue).length > 0,\n hasCompletedAttachmentUploads: isAttachmentUploadCompleted(attachments),\n hasError: !!errorMessage,\n disabled: !!disabled\n });\n }, [attachments, disabled, errorMessage, textValue]);\n const mergedSendButtonStyle = useMemo(() => mergeStyles(sendButtonStyle, styles?.sendMessageIconContainer), [styles?.sendMessageIconContainer]);\n const mergedStyles = useMemo(() => concatStyleSets(styles), [styles]);\n const mergedSendIconStyle = useMemo(() => sendIconStyle({\n theme,\n isSendBoxButtonDisabled: isSendBoxButtonDisabledValue,\n customSendIconStyle: styles?.sendMessageIcon\n }), [theme, isSendBoxButtonDisabledValue, styles?.sendMessageIcon]);\n const onRenderSendIcon = useCallback((isHover: boolean) => onRenderIcon ? onRenderIcon(isHover) : <Icon iconName={isHover && textValue ? 'SendBoxSendHovered' : 'SendBoxSend'} className={mergedSendIconStyle} />, [mergedSendIconStyle, onRenderIcon, textValue]);\n\n // Ensure that errors are cleared when there are no attachments in sendBox\n React.useEffect(() => {\n if (!attachments?.filter(upload => !upload.error).length) {\n setAttachmentUploadsPendingError(undefined);\n }\n }, [attachments]);\n const sendBoxErrorsProps = useMemo(() => {\n return {\n attachmentUploadsPendingError: attachmentUploadsPendingError,\n attachmentProgressError: attachments?.filter(attachmentUpload => attachmentUpload.error).pop()?.error\n };\n }, [attachments, attachmentUploadsPendingError]);\n const onRenderAttachmentUploads = useCallback(() => {\n if (!attachments?.filter(upload => !upload.error).length) {\n return null;\n }\n return props.onRenderAttachmentUploads ? props.onRenderAttachmentUploads() : <Stack className={attachmentUploadCardsStyles}>\n <FluentV9ThemeProvider v8Theme={theme} className={customV9Styles.clearBackground}>\n <_AttachmentUploadCards attachments={attachments} onCancelAttachmentUpload={props.onCancelAttachmentUpload} strings={{\n removeAttachment: props.strings?.removeAttachment ?? localeStrings.removeAttachment,\n uploading: props.strings?.uploading ?? localeStrings.uploading,\n uploadProgress: props.strings?.uploadProgress ?? localeStrings.uploadProgress,\n uploadCompleted: props.strings?.uploadCompleted ?? localeStrings.uploadCompleted,\n attachmentMoreMenu: props.strings?.attachmentMoreMenu ?? localeStrings.attachmentMoreMenu\n }} disabled={disabled} />\n </FluentV9ThemeProvider>\n </Stack>;\n }, [attachments, props, theme, customV9Styles.clearBackground, localeStrings.removeAttachment, localeStrings.uploading, localeStrings.uploadProgress, localeStrings.uploadCompleted, localeStrings.attachmentMoreMenu, disabled]);\n return <Stack className={mergeStyles(sendBoxWrapperStyles, {\n overflow: 'visible'\n } // This is needed for the mention popup to be visible\n )}>\n {<SendBoxErrors attachmentProgressError={sendBoxErrorsProps.attachmentProgressError ? {\n message: sendBoxErrorsProps.attachmentProgressError.message,\n timestamp: Date.now()\n } : undefined} attachmentUploadsPendingError={sendBoxErrorsProps.attachmentUploadsPendingError} />}\n <Stack className={borderAndBoxShadowStyle({\n theme,\n hasErrorMessage: !!errorMessage,\n disabled: !!disabled\n })}>\n <InputBoxComponent autoFocus={autoFocus} data-ui-id={ids.sendboxTextField} disabled={disabled} errorMessage={onRenderSystemMessage ? onRenderSystemMessage(errorMessage) : errorMessage} textFieldRef={sendTextFieldRef} id=\"sendbox\" placeholderText={strings.placeholderText} textValue={textValue} onChange={(_, newValue) => setText(newValue)} onKeyDown={ev => {\n const keyWasSendingMessage = ev.key === 'Enter' && (ev.shiftKey === false || !supportNewline);\n if (!keyWasSendingMessage) {\n onTyping?.();\n }\n }} onEnterKeyDown={() => {\n sendMessageOnClick();\n }} styles={mergedStyles} supportNewline={supportNewline} maxLength={MAXIMUM_LENGTH_OF_MESSAGE} mentionLookupOptions={mentionLookupOptions}>\n <InputBoxButton onRenderIcon={onRenderSendIcon} onClick={e => {\n if (!textValueOverflow) {\n sendMessageOnClick();\n }\n e.stopPropagation();\n }} id={'sendIconWrapper'} className={mergedSendButtonStyle} ariaLabel={localeStrings.sendButtonAriaLabel} tooltipContent={localeStrings.sendButtonAriaLabel} disabled={isSendBoxButtonDisabledValue} />\n </InputBoxComponent>\n {onRenderAttachmentUploads()}\n </Stack>\n </Stack>;\n};"]}
@@ -0,0 +1,56 @@
1
+ /// <reference types="react" />
2
+ /**
3
+ * @beta
4
+ * Error bar type for {@link SendBoxErrorBarError}
5
+ */
6
+ export declare enum SendBoxErrorBarType {
7
+ /** Info styled MessageBar */
8
+ info = 0,
9
+ /** Error styled MessageBar */
10
+ error = 1,
11
+ /** Blocked styled MessageBar */
12
+ blocked = 2,
13
+ /** SevereWarning styled MessageBar */
14
+ severeWarning = 3,
15
+ /** Success styled MessageBar */
16
+ success = 4,
17
+ /** Warning styled MessageBar */
18
+ warning = 5
19
+ }
20
+ /**
21
+ * @beta
22
+ * Error to be displayed to the user in an error bar above sendbox.
23
+ */
24
+ export interface SendBoxErrorBarError {
25
+ /** Error Message to be displayed */
26
+ message: string;
27
+ /**
28
+ * Unix Timestamp. Preferred generation using `Date.now()`
29
+ */
30
+ timestamp: number;
31
+ /**
32
+ * ErrorBar type. Defaults to `warning`.
33
+ */
34
+ errorBarType?: SendBoxErrorBarType;
35
+ }
36
+ /**
37
+ * @private
38
+ */
39
+ export interface SendBoxErrorBarProps {
40
+ /** Error to render */
41
+ error?: SendBoxErrorBarError;
42
+ /**
43
+ * Automatically dismisses the error bar after the specified delay in ms.
44
+ * Example: `10 * 1000` would be 10 seconds
45
+ */
46
+ dismissAfterMs?: number;
47
+ /**
48
+ * Callback to invoke when the error bar is dismissed
49
+ */
50
+ onDismiss?: () => void;
51
+ }
52
+ /**
53
+ * @private
54
+ */
55
+ export declare const SendBoxErrorBar: (props: SendBoxErrorBarProps) => JSX.Element;
56
+ //# sourceMappingURL=SendBoxErrorBar.d.ts.map
@@ -0,0 +1,75 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import { MessageBar } from '@fluentui/react';
4
+ import { MessageBarType } from '@fluentui/react';
5
+ import React, { useEffect } from 'react';
6
+ import { useMemo } from 'react';
7
+ import { useLocale } from '../localization';
8
+ /**
9
+ * @beta
10
+ * Error bar type for {@link SendBoxErrorBarError}
11
+ */
12
+ export var SendBoxErrorBarType;
13
+ (function (SendBoxErrorBarType) {
14
+ /** Info styled MessageBar */
15
+ SendBoxErrorBarType[SendBoxErrorBarType["info"] = 0] = "info";
16
+ /** Error styled MessageBar */
17
+ SendBoxErrorBarType[SendBoxErrorBarType["error"] = 1] = "error";
18
+ /** Blocked styled MessageBar */
19
+ SendBoxErrorBarType[SendBoxErrorBarType["blocked"] = 2] = "blocked";
20
+ /** SevereWarning styled MessageBar */
21
+ SendBoxErrorBarType[SendBoxErrorBarType["severeWarning"] = 3] = "severeWarning";
22
+ /** Success styled MessageBar */
23
+ SendBoxErrorBarType[SendBoxErrorBarType["success"] = 4] = "success";
24
+ /** Warning styled MessageBar */
25
+ SendBoxErrorBarType[SendBoxErrorBarType["warning"] = 5] = "warning";
26
+ })(SendBoxErrorBarType || (SendBoxErrorBarType = {}));
27
+ /**
28
+ * @private
29
+ */
30
+ export const SendBoxErrorBar = (props) => {
31
+ const { error, dismissAfterMs, onDismiss } = props;
32
+ const strings = useLocale().strings.errorBar;
33
+ const [errorMessage, setErrorMessage] = React.useState(error === null || error === void 0 ? void 0 : error.message);
34
+ // Using `any` because `NodeJS.Timeout` here will cause `declaration error` with jest.
35
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
+ const timeoutRef = React.useRef();
37
+ React.useEffect(() => {
38
+ setErrorMessage(error === null || error === void 0 ? void 0 : error.message);
39
+ }, [error]);
40
+ useEffect(() => {
41
+ if (error && dismissAfterMs !== undefined) {
42
+ timeoutRef.current = setTimeout(() => {
43
+ setErrorMessage(undefined);
44
+ onDismiss && onDismiss();
45
+ }, dismissAfterMs);
46
+ }
47
+ return () => {
48
+ timeoutRef.current && clearTimeout(timeoutRef.current);
49
+ };
50
+ }, [dismissAfterMs, onDismiss, error]);
51
+ const messageBarType = useMemo(() => {
52
+ switch (error === null || error === void 0 ? void 0 : error.errorBarType) {
53
+ case SendBoxErrorBarType.info:
54
+ return MessageBarType.info;
55
+ case SendBoxErrorBarType.error:
56
+ return MessageBarType.error;
57
+ case SendBoxErrorBarType.blocked:
58
+ return MessageBarType.blocked;
59
+ case SendBoxErrorBarType.severeWarning:
60
+ return MessageBarType.severeWarning;
61
+ case SendBoxErrorBarType.success:
62
+ return MessageBarType.success;
63
+ case SendBoxErrorBarType.warning:
64
+ default:
65
+ return MessageBarType.warning;
66
+ }
67
+ }, [error]);
68
+ if (errorMessage) {
69
+ return React.createElement(MessageBar, { role: "alert", "aria-label": errorMessage, "data-testid": 'send-box-message-bar', messageBarType: messageBarType, isMultiline: true, key: (error === null || error === void 0 ? void 0 : error.errorBarType) || SendBoxErrorBarType.warning, onDismiss: onDismiss, dismissButtonAriaLabel: strings.dismissButtonAriaLabel }, errorMessage);
70
+ }
71
+ else {
72
+ return React.createElement(React.Fragment, null);
73
+ }
74
+ };
75
+ //# sourceMappingURL=SendBoxErrorBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SendBoxErrorBar.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/SendBoxErrorBar.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;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B,EAAE,OAAO,CAAC,sBAAsB,IAClR,YAAY,CACF,CAAC;IAClB,CAAC;SAAM,CAAC;QACN,OAAO,yCAAK,CAAC;IACf,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { MessageBar } from '@fluentui/react';\nimport { MessageBarType } from '@fluentui/react';\nimport React, { useEffect } from 'react';\nimport { useMemo } from 'react';\nimport { useLocale } from '../localization';\n/**\n * @beta\n * Error bar type for {@link SendBoxErrorBarError}\n */\nexport enum SendBoxErrorBarType {\n /** Info styled MessageBar */\n info = 0,\n /** Error styled MessageBar */\n error = 1,\n /** Blocked styled MessageBar */\n blocked = 2,\n /** SevereWarning styled MessageBar */\n severeWarning = 3,\n /** Success styled MessageBar */\n success = 4,\n /** Warning styled MessageBar */\n warning = 5,\n}\n\n/**\n * @beta\n * Error to be displayed to the user in an error bar above sendbox.\n */\nexport interface SendBoxErrorBarError {\n /** Error Message to be displayed */\n message: string;\n /**\n * Unix Timestamp. Preferred generation using `Date.now()`\n */\n timestamp: number;\n /**\n * ErrorBar type. Defaults to `warning`.\n */\n errorBarType?: SendBoxErrorBarType;\n}\n\n/**\n * @private\n */\nexport interface SendBoxErrorBarProps {\n /** Error to render */\n error?: SendBoxErrorBarError;\n /**\n * Automatically dismisses the error bar after the specified delay in ms.\n * Example: `10 * 1000` would be 10 seconds\n */\n dismissAfterMs?: number;\n /**\n * Callback to invoke when the error bar is dismissed\n */\n onDismiss?: () => void;\n}\n\n/**\n * @private\n */\nexport const SendBoxErrorBar = (props: SendBoxErrorBarProps): JSX.Element => {\n const {\n error,\n dismissAfterMs,\n onDismiss\n } = props;\n const strings = useLocale().strings.errorBar;\n const [errorMessage, setErrorMessage] = React.useState(error?.message);\n // Using `any` because `NodeJS.Timeout` here will cause `declaration error` with jest.\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const timeoutRef = React.useRef<any>();\n React.useEffect(() => {\n setErrorMessage(error?.message);\n }, [error]);\n useEffect(() => {\n if (error && dismissAfterMs !== undefined) {\n timeoutRef.current = setTimeout(() => {\n setErrorMessage(undefined);\n onDismiss && onDismiss();\n }, dismissAfterMs);\n }\n return () => {\n timeoutRef.current && clearTimeout(timeoutRef.current);\n };\n }, [dismissAfterMs, onDismiss, error]);\n const messageBarType = useMemo(() => {\n switch (error?.errorBarType) {\n case SendBoxErrorBarType.info:\n return MessageBarType.info;\n case SendBoxErrorBarType.error:\n return MessageBarType.error;\n case SendBoxErrorBarType.blocked:\n return MessageBarType.blocked;\n case SendBoxErrorBarType.severeWarning:\n return MessageBarType.severeWarning;\n case SendBoxErrorBarType.success:\n return MessageBarType.success;\n case SendBoxErrorBarType.warning:\n default:\n return MessageBarType.warning;\n }\n }, [error]);\n if (errorMessage) {\n return <MessageBar role=\"alert\" aria-label={errorMessage} data-testid={'send-box-message-bar'} messageBarType={messageBarType} isMultiline={true} key={error?.errorBarType || SendBoxErrorBarType.warning} onDismiss={onDismiss} dismissButtonAriaLabel={strings.dismissButtonAriaLabel}>\n {errorMessage}\n </MessageBar>;\n } else {\n return <></>;\n }\n};"]}
@@ -0,0 +1,14 @@
1
+ /// <reference types="react" />
2
+ import { SendBoxErrorBarError } from './SendBoxErrorBar';
3
+ /**
4
+ * @private
5
+ */
6
+ export interface SendBoxErrorsProps {
7
+ attachmentUploadsPendingError?: SendBoxErrorBarError;
8
+ attachmentProgressError?: SendBoxErrorBarError;
9
+ }
10
+ /**
11
+ * @private
12
+ */
13
+ export declare const SendBoxErrors: (props: SendBoxErrorsProps) => JSX.Element;
14
+ //# sourceMappingURL=SendBoxErrors.d.ts.map
@@ -0,0 +1,18 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT License.
3
+ import React from 'react';
4
+ import { SendBoxErrorBar } from './SendBoxErrorBar';
5
+ /**
6
+ * @private
7
+ */
8
+ export const SendBoxErrors = (props) => {
9
+ const { attachmentProgressError, attachmentUploadsPendingError } = props;
10
+ const errorToDisplay = React.useMemo(() => {
11
+ if (attachmentProgressError && attachmentUploadsPendingError) {
12
+ return attachmentProgressError.timestamp > attachmentUploadsPendingError.timestamp ? attachmentProgressError : attachmentUploadsPendingError;
13
+ }
14
+ return attachmentProgressError || attachmentUploadsPendingError;
15
+ }, [attachmentProgressError, attachmentUploadsPendingError]);
16
+ return React.createElement(SendBoxErrorBar, { error: errorToDisplay, dismissAfterMs: 10 * 1000 });
17
+ };
18
+ //# sourceMappingURL=SendBoxErrors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SendBoxErrors.js","sourceRoot":"","sources":["../../../../../preprocess-dist/react-components/src/components/SendBoxErrors.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAwB,MAAM,mBAAmB,CAAC;AAU1E;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAyB,EAAe,EAAE;IACtE,MAAM,EACJ,uBAAuB,EACvB,6BAA6B,EAC9B,GAAG,KAAK,CAAC;IACV,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE;QACxC,IAAI,uBAAuB,IAAI,6BAA6B,EAAE,CAAC;YAC7D,OAAO,uBAAuB,CAAC,SAAS,GAAG,6BAA6B,CAAC,SAAS,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,6BAA6B,CAAC;QAC/I,CAAC;QACD,OAAO,uBAAuB,IAAI,6BAA6B,CAAC;IAClE,CAAC,EAAE,CAAC,uBAAuB,EAAE,6BAA6B,CAAC,CAAC,CAAC;IAC7D,OAAO,oBAAC,eAAe,IAAC,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,EAAE,GAAG,IAAI,GAAI,CAAC;AAC/E,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { SendBoxErrorBar, SendBoxErrorBarError } from './SendBoxErrorBar';\n\n/**\n * @private\n */\nexport interface SendBoxErrorsProps {\n attachmentUploadsPendingError?: SendBoxErrorBarError;\n attachmentProgressError?: SendBoxErrorBarError;\n}\n\n/**\n * @private\n */\nexport const SendBoxErrors = (props: SendBoxErrorsProps): JSX.Element => {\n const {\n attachmentProgressError,\n attachmentUploadsPendingError\n } = props;\n const errorToDisplay = React.useMemo(() => {\n if (attachmentProgressError && attachmentUploadsPendingError) {\n return attachmentProgressError.timestamp > attachmentUploadsPendingError.timestamp ? attachmentProgressError : attachmentUploadsPendingError;\n }\n return attachmentProgressError || attachmentUploadsPendingError;\n }, [attachmentProgressError, attachmentUploadsPendingError]);\n return <SendBoxErrorBar error={errorToDisplay} dismissAfterMs={10 * 1000} />;\n};"]}
@@ -0,0 +1,24 @@
1
+ import React, { FormEvent } from 'react';
2
+ import { ITextField, ITextFieldProps } from '@fluentui/react';
3
+ import { MentionLookupOptions } from '../MentionPopover';
4
+ /**
5
+ * Props for the TextFieldWithMention component.
6
+ *
7
+ * @private
8
+ */
9
+ export interface TextFieldWithMentionProps {
10
+ textFieldProps: ITextFieldProps;
11
+ dataUiId?: string;
12
+ textValue: string;
13
+ onChange: (event?: FormEvent<HTMLInputElement | HTMLTextAreaElement>, newValue?: string) => void;
14
+ onKeyDown?: (ev: React.KeyboardEvent<HTMLInputElement | HTMLTextAreaElement>) => void;
15
+ onEnterKeyDown?: () => void;
16
+ textFieldRef?: React.RefObject<ITextField>;
17
+ supportNewline?: boolean;
18
+ mentionLookupOptions?: MentionLookupOptions;
19
+ }
20
+ /**
21
+ * @private
22
+ */
23
+ export declare const TextFieldWithMention: (props: TextFieldWithMentionProps) => JSX.Element;
24
+ //# sourceMappingURL=TextFieldWithMention.d.ts.map