@azure/communication-react 1.19.0-beta.2 → 1.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (610) hide show
  1. package/dist/communication-react.d.ts +278 -1978
  2. package/dist/dist-cjs/communication-react/index.js +35542 -163
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/common.d.ts +0 -13
  5. package/dist/dist-esm/acs-ui-common/src/common.js.map +1 -1
  6. package/dist/dist-esm/acs-ui-common/src/constants.d.ts +0 -5
  7. package/dist/dist-esm/acs-ui-common/src/constants.js +0 -5
  8. package/dist/dist-esm/acs-ui-common/src/constants.js.map +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/index.d.ts +0 -4
  10. package/dist/dist-esm/acs-ui-common/src/index.js +0 -3
  11. package/dist/dist-esm/acs-ui-common/src/index.js.map +1 -1
  12. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  13. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  14. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +1 -10
  15. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +0 -12
  16. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  17. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js +4 -4
  18. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js.map +1 -1
  19. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js +0 -3
  20. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js.map +1 -1
  21. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +2 -4
  22. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +2 -22
  23. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  24. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.d.ts +0 -2
  25. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +1 -5
  26. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
  27. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.d.ts +0 -2
  28. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js +2 -19
  29. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map +1 -1
  30. package/dist/dist-esm/calling-component-bindings/src/incomingCallStackSelector.d.ts +5 -5
  31. package/dist/dist-esm/calling-component-bindings/src/incomingCallStackSelector.js +1 -1
  32. package/dist/dist-esm/calling-component-bindings/src/incomingCallStackSelector.js.map +1 -1
  33. package/dist/dist-esm/calling-component-bindings/src/index.d.ts +0 -1
  34. package/dist/dist-esm/calling-component-bindings/src/index.js +0 -1
  35. package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
  36. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js +1 -36
  37. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js.map +1 -1
  38. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.d.ts +0 -1
  39. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +1 -3
  40. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
  41. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.d.ts +0 -7
  42. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js +0 -10
  43. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js.map +1 -1
  44. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.d.ts +2 -2
  45. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarative.js.map +1 -1
  46. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js +0 -4
  47. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js.map +1 -1
  48. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +3 -85
  49. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  50. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +1 -18
  51. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +4 -104
  52. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  53. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +0 -5
  54. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +5 -34
  55. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  56. package/dist/dist-esm/calling-stateful-client/src/Converter.js +0 -3
  57. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  58. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.d.ts +0 -1
  59. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.js +1 -7
  60. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.js.map +1 -1
  61. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.d.ts +0 -9
  62. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +2 -18
  63. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
  64. package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.d.ts +1 -1
  65. package/dist/dist-esm/calling-stateful-client/src/TeamsCallAgentDeclarative.js.map +1 -1
  66. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.d.ts +1 -1
  67. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js +0 -17
  68. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js.map +1 -1
  69. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +0 -3
  70. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  71. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.d.ts +2 -6
  72. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js +2 -35
  73. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
  74. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.d.ts +1 -2
  75. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js +0 -3
  76. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js.map +1 -1
  77. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +2 -25
  78. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  79. package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js +3 -3
  80. package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js.map +1 -1
  81. package/dist/dist-esm/chat-stateful-client/src/ChatClientState.d.ts +1 -15
  82. package/dist/dist-esm/chat-stateful-client/src/ChatClientState.js.map +1 -1
  83. package/dist/dist-esm/chat-stateful-client/src/ChatContext.js +1 -1
  84. package/dist/dist-esm/chat-stateful-client/src/ChatContext.js.map +1 -1
  85. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js +1 -2
  86. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js.map +1 -1
  87. package/dist/dist-esm/chat-stateful-client/src/index.d.ts +0 -1
  88. package/dist/dist-esm/chat-stateful-client/src/index.js.map +1 -1
  89. package/dist/dist-esm/communication-react/src/api-summary.d.ts +11 -0
  90. package/dist/dist-esm/communication-react/src/api-summary.js +13 -0
  91. package/dist/dist-esm/communication-react/src/api-summary.js.map +1 -0
  92. package/dist/dist-esm/communication-react/src/index.d.ts +1 -28
  93. package/dist/dist-esm/communication-react/src/index.js +0 -6
  94. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  95. package/dist/dist-esm/communication-react/src/javascript-loaders.d.ts +2 -0
  96. package/dist/dist-esm/communication-react/src/javascript-loaders.js +3 -0
  97. package/dist/dist-esm/communication-react/src/javascript-loaders.js.map +1 -0
  98. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.d.ts +0 -2
  99. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js +0 -2
  100. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js.map +1 -1
  101. package/dist/dist-esm/react-components/src/components/CameraButton.d.ts +4 -0
  102. package/dist/dist-esm/react-components/src/components/CameraButton.js +1 -1
  103. package/dist/dist-esm/react-components/src/components/CameraButton.js.map +1 -1
  104. package/dist/dist-esm/react-components/src/components/CaptionsBanner.d.ts +3 -0
  105. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +9 -7
  106. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
  107. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +1 -13
  108. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js +3 -9
  109. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
  110. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +0 -11
  111. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +2 -32
  112. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  113. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.d.ts +1 -8
  114. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js +5 -9
  115. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
  116. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.d.ts +1 -2
  117. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js +4 -4
  118. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js.map +1 -1
  119. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.d.ts +1 -4
  120. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js +6 -31
  121. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js.map +1 -1
  122. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.d.ts +1 -15
  123. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js +0 -9
  124. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js.map +1 -1
  125. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +2 -23
  126. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js +6 -17
  127. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
  128. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.d.ts +1 -8
  129. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js +6 -10
  130. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
  131. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +5 -5
  132. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
  133. package/dist/dist-esm/react-components/src/components/ControlButtonTooltip.js +4 -0
  134. package/dist/dist-esm/react-components/src/components/ControlButtonTooltip.js.map +1 -1
  135. package/dist/dist-esm/react-components/src/components/ErrorBar.d.ts +0 -4
  136. package/dist/dist-esm/react-components/src/components/ErrorBar.js.map +1 -1
  137. package/dist/dist-esm/react-components/src/components/HoldButton.d.ts +7 -7
  138. package/dist/dist-esm/react-components/src/components/HoldButton.js +1 -1
  139. package/dist/dist-esm/react-components/src/components/HoldButton.js.map +1 -1
  140. package/dist/dist-esm/react-components/src/components/ImageOverlay.js +0 -2
  141. package/dist/dist-esm/react-components/src/components/ImageOverlay.js.map +1 -1
  142. package/dist/dist-esm/react-components/src/components/IncomingCallNotification.d.ts +8 -4
  143. package/dist/dist-esm/react-components/src/components/IncomingCallNotification.js +7 -10
  144. package/dist/dist-esm/react-components/src/components/IncomingCallNotification.js.map +1 -1
  145. package/dist/dist-esm/react-components/src/components/IncomingCallStack.d.ts +12 -15
  146. package/dist/dist-esm/react-components/src/components/IncomingCallStack.js +3 -3
  147. package/dist/dist-esm/react-components/src/components/IncomingCallStack.js.map +1 -1
  148. package/dist/dist-esm/react-components/src/components/InputBoxComponent.d.ts +0 -2
  149. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +0 -15
  150. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
  151. package/dist/dist-esm/react-components/src/components/LocalVideoTile.d.ts +1 -0
  152. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js +15 -5
  153. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js.map +1 -1
  154. package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.js.map +1 -1
  155. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +5 -81
  156. package/dist/dist-esm/react-components/src/components/MessageThread.js +3 -13
  157. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  158. package/dist/dist-esm/react-components/src/components/MicrophoneButton.d.ts +4 -0
  159. package/dist/dist-esm/react-components/src/components/MicrophoneButton.js +18 -16
  160. package/dist/dist-esm/react-components/src/components/MicrophoneButton.js.map +1 -1
  161. package/dist/dist-esm/react-components/src/components/NotificationStack.d.ts +0 -24
  162. package/dist/dist-esm/react-components/src/components/NotificationStack.js +0 -5
  163. package/dist/dist-esm/react-components/src/components/NotificationStack.js.map +1 -1
  164. package/dist/dist-esm/react-components/src/components/ParticipantItem.js +1 -1
  165. package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
  166. package/dist/dist-esm/react-components/src/components/ParticipantList.d.ts +0 -17
  167. package/dist/dist-esm/react-components/src/components/ParticipantList.js +3 -12
  168. package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
  169. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.d.ts +0 -1
  170. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +2 -3
  171. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
  172. package/dist/dist-esm/react-components/src/components/SendBox.d.ts +1 -47
  173. package/dist/dist-esm/react-components/src/components/SendBox.js +7 -59
  174. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  175. package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js +0 -1
  176. package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js.map +1 -1
  177. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js +0 -1
  178. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js.map +1 -1
  179. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js +0 -19
  180. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js.map +1 -1
  181. package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js +0 -1
  182. package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js.map +1 -1
  183. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js +13 -3
  184. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js.map +1 -1
  185. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.styles.js +2 -1
  186. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.styles.js.map +1 -1
  187. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +2 -10
  188. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
  189. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +6 -14
  190. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
  191. package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js +6 -14
  192. package/dist/dist-esm/react-components/src/components/VideoGallery/SpeakerVideoLayout.js.map +1 -1
  193. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.d.ts +0 -2
  194. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +3 -21
  195. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js.map +1 -1
  196. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.d.ts +8 -0
  197. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +29 -0
  198. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
  199. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +2 -6
  200. package/dist/dist-esm/react-components/src/components/VideoGallery.js +5 -5
  201. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  202. package/dist/dist-esm/react-components/src/components/VideoTile.js +2 -1
  203. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  204. package/dist/dist-esm/react-components/src/components/index.d.ts +0 -20
  205. package/dist/dist-esm/react-components/src/components/index.js +0 -7
  206. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  207. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.d.ts +1 -1
  208. package/dist/dist-esm/react-components/src/components/styles/AttachmentCardGroup.styles.d.ts +1 -1
  209. package/dist/dist-esm/react-components/src/components/styles/Captions.style.d.ts +9 -1
  210. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js +20 -0
  211. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js.map +1 -1
  212. package/dist/dist-esm/react-components/src/components/styles/ImageOverlay.style.js +1 -2
  213. package/dist/dist-esm/react-components/src/components/styles/ImageOverlay.style.js.map +1 -1
  214. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +3 -3
  215. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +0 -8
  216. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  217. package/dist/dist-esm/react-components/src/components/styles/ParticipantItem.styles.d.ts +2 -2
  218. package/dist/dist-esm/react-components/src/components/styles/ParticipantItem.styles.js +3 -2
  219. package/dist/dist-esm/react-components/src/components/styles/ParticipantItem.styles.js.map +1 -1
  220. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.d.ts +0 -1
  221. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js +2 -2
  222. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js.map +1 -1
  223. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.d.ts +14 -2
  224. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js +59 -18
  225. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js.map +1 -1
  226. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.d.ts +1 -37
  227. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js +3 -30
  228. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js.map +1 -1
  229. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.d.ts +2 -4
  230. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js +2 -9
  231. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
  232. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +1 -38
  233. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +4 -131
  234. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  235. package/dist/dist-esm/react-components/src/components/utils/common.js +0 -2
  236. package/dist/dist-esm/react-components/src/components/utils/common.js.map +1 -1
  237. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.d.ts +1 -2
  238. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.js.map +1 -1
  239. package/dist/dist-esm/react-components/src/components/utils.js +1 -7
  240. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  241. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.d.ts +0 -4
  242. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js +1 -3
  243. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js.map +1 -1
  244. package/dist/dist-esm/react-components/src/index.d.ts +0 -1
  245. package/dist/dist-esm/react-components/src/index.js.map +1 -1
  246. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +0 -54
  247. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
  248. package/dist/dist-esm/react-components/src/localization/locales/ar-SA/strings.json +17 -10
  249. package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/strings.json +15 -8
  250. package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +16 -9
  251. package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +17 -10
  252. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +17 -10
  253. package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +17 -10
  254. package/dist/dist-esm/react-components/src/localization/locales/fi-FI/strings.json +15 -8
  255. package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +17 -10
  256. package/dist/dist-esm/react-components/src/localization/locales/he-IL/strings.json +16 -9
  257. package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +15 -8
  258. package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +16 -9
  259. package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +15 -8
  260. package/dist/dist-esm/react-components/src/localization/locales/nb-NO/strings.json +15 -8
  261. package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +17 -10
  262. package/dist/dist-esm/react-components/src/localization/locales/pl-PL/strings.json +15 -8
  263. package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +17 -10
  264. package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +15 -8
  265. package/dist/dist-esm/react-components/src/localization/locales/sv-SE/strings.json +16 -9
  266. package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +16 -9
  267. package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +15 -8
  268. package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +18 -11
  269. package/dist/dist-esm/react-components/src/theming/icons.d.ts +0 -32
  270. package/dist/dist-esm/react-components/src/theming/icons.js +0 -93
  271. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  272. package/dist/dist-esm/react-components/src/theming/themes.d.ts +0 -6
  273. package/dist/dist-esm/react-components/src/theming/themes.js +0 -9
  274. package/dist/dist-esm/react-components/src/theming/themes.js.map +1 -1
  275. package/dist/dist-esm/react-components/src/types/Attachment.d.ts +0 -13
  276. package/dist/dist-esm/react-components/src/types/Attachment.js.map +1 -1
  277. package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +1 -20
  278. package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
  279. package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.d.ts +1 -1
  280. package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.js.map +1 -1
  281. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +3 -72
  282. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +9 -19
  283. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  284. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +17 -71
  285. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  286. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +14 -61
  287. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +84 -172
  288. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  289. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +36 -53
  290. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js +1 -1
  291. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  292. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/ParticipantSubcriber.d.ts +1 -1
  293. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/ParticipantSubcriber.js.map +1 -1
  294. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.js.map +1 -1
  295. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +1 -3
  296. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  297. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.d.ts +3 -0
  298. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +20 -25
  299. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  300. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  301. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.d.ts +0 -2
  302. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js +0 -19
  303. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js.map +1 -1
  304. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js +2 -10
  305. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js.map +1 -1
  306. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.d.ts +0 -2
  307. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js +0 -19
  308. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js.map +1 -1
  309. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/HoldPane.js +6 -5
  310. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/HoldPane.js.map +1 -1
  311. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.d.ts +0 -1
  312. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +7 -13
  313. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
  314. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.d.ts +3 -0
  315. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +10 -3
  316. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  317. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js +3 -2
  318. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js.map +1 -1
  319. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.d.ts +1 -0
  320. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js +1 -1
  321. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js.map +1 -1
  322. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useMeetingPhoneInfo.js.map +1 -1
  323. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.d.ts +0 -2
  324. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +4 -76
  325. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
  326. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SvgWithWordWrapping.d.ts +1 -0
  327. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SvgWithWordWrapping.js +2 -2
  328. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SvgWithWordWrapping.js.map +1 -1
  329. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.d.ts +0 -1
  330. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.js +4 -22
  331. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.js.map +1 -1
  332. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js +2 -4
  333. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js.map +1 -1
  334. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.d.ts +3 -1
  335. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +1 -10
  336. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  337. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +1 -4
  338. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  339. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +3 -3
  340. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  341. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.d.ts +0 -7
  342. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +9 -45
  343. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  344. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js +2 -2
  345. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js.map +1 -1
  346. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js +2 -2
  347. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js.map +1 -1
  348. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js +2 -2
  349. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js.map +1 -1
  350. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +0 -23
  351. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +0 -20
  352. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  353. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js +2 -1
  354. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js.map +1 -1
  355. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +2 -14
  356. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +10 -64
  357. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  358. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +0 -65
  359. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +5 -24
  360. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  361. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.d.ts +0 -8
  362. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.js.map +1 -1
  363. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +6 -28
  364. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +4 -148
  365. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  366. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +12 -46
  367. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  368. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +3 -8
  369. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +5 -25
  370. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  371. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.d.ts +4 -10
  372. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +2 -14
  373. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
  374. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +1 -15
  375. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +1 -3
  376. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  377. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.d.ts +0 -5
  378. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js +0 -13
  379. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js.map +1 -1
  380. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts +0 -27
  381. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js +1 -2
  382. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
  383. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.d.ts +0 -2
  384. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +11 -202
  385. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  386. package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.d.ts +0 -20
  387. package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.js.map +1 -1
  388. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +2 -6
  389. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +1 -37
  390. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  391. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts +2 -12
  392. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
  393. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js +2 -13
  394. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js.map +1 -1
  395. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.d.ts +0 -2
  396. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
  397. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js +1 -1
  398. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js.map +1 -1
  399. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.d.ts +5 -5
  400. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.js +3 -2
  401. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.js.map +1 -1
  402. package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.d.ts +4 -4
  403. package/dist/dist-esm/react-composites/src/composites/common/CallingDialpad.js.map +1 -1
  404. package/dist/dist-esm/react-composites/src/composites/common/CalloutWithIcon.d.ts +1 -1
  405. package/dist/dist-esm/react-composites/src/composites/common/CalloutWithIcon.js.map +1 -1
  406. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.d.ts +3 -0
  407. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.js +7 -2
  408. package/dist/dist-esm/react-composites/src/composites/common/CaptionsBanner.js.map +1 -1
  409. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +2 -25
  410. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  411. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.d.ts +0 -1
  412. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
  413. package/dist/dist-esm/react-composites/src/composites/common/MeetingPhoneInfoPaneContent.js.map +1 -1
  414. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js +1 -2
  415. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js.map +1 -1
  416. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.d.ts +2 -41
  417. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js +0 -21
  418. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js.map +1 -1
  419. package/dist/dist-esm/react-composites/src/composites/common/adapters.d.ts +0 -23
  420. package/dist/dist-esm/react-composites/src/composites/common/adapters.js.map +1 -1
  421. package/dist/dist-esm/react-composites/src/composites/common/constants.d.ts +0 -5
  422. package/dist/dist-esm/react-composites/src/composites/common/constants.js +0 -5
  423. package/dist/dist-esm/react-composites/src/composites/common/constants.js.map +1 -1
  424. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +6 -34
  425. package/dist/dist-esm/react-composites/src/composites/common/icons.js +0 -2
  426. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  427. package/dist/dist-esm/react-composites/src/composites/common/utils.d.ts +0 -4
  428. package/dist/dist-esm/react-composites/src/composites/common/utils.js +0 -22
  429. package/dist/dist-esm/react-composites/src/composites/common/utils.js.map +1 -1
  430. package/dist/dist-esm/react-composites/src/composites/index.d.ts +0 -1
  431. package/dist/dist-esm/react-composites/src/composites/index.js.map +1 -1
  432. package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +10 -10
  433. package/package.json +18 -3
  434. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-C1XJdavW.js +0 -202
  435. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-C1XJdavW.js.map +0 -1
  436. package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-31mhJoQR.js +0 -50
  437. package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-31mhJoQR.js.map +0 -1
  438. package/dist/dist-cjs/communication-react/index-NOtN6_TE.js +0 -42222
  439. package/dist/dist-cjs/communication-react/index-NOtN6_TE.js.map +0 -1
  440. package/dist/dist-esm/acs-ui-common/src/dataConversion.d.ts +0 -6
  441. package/dist/dist-esm/acs-ui-common/src/dataConversion.js +0 -16
  442. package/dist/dist-esm/acs-ui-common/src/dataConversion.js.map +0 -1
  443. package/dist/dist-esm/acs-ui-common/src/removeImageTags.d.ts +0 -7
  444. package/dist/dist-esm/acs-ui-common/src/removeImageTags.js +0 -18
  445. package/dist/dist-esm/acs-ui-common/src/removeImageTags.js.map +0 -1
  446. package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.d.ts +0 -20
  447. package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.js +0 -106
  448. package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.js.map +0 -1
  449. package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.d.ts +0 -17
  450. package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.js +0 -33
  451. package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.js.map +0 -1
  452. package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.d.ts +0 -6
  453. package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.js +0 -20
  454. package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.js.map +0 -1
  455. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.d.ts +0 -10
  456. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js +0 -15
  457. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js.map +0 -1
  458. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.d.ts +0 -24
  459. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +0 -192
  460. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +0 -1
  461. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.d.ts +0 -69
  462. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js +0 -36
  463. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js.map +0 -1
  464. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.d.ts +0 -75
  465. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js +0 -67
  466. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js.map +0 -1
  467. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.d.ts +0 -105
  468. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js +0 -51
  469. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js.map +0 -1
  470. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.d.ts +0 -86
  471. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js +0 -39
  472. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js.map +0 -1
  473. package/dist/dist-esm/react-components/src/components/MentionPopover.d.ts +0 -121
  474. package/dist/dist-esm/react-components/src/components/MentionPopover.js +0 -119
  475. package/dist/dist-esm/react-components/src/components/MentionPopover.js.map +0 -1
  476. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.d.ts +0 -9
  477. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.js +0 -29
  478. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.js.map +0 -1
  479. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.d.ts +0 -30
  480. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js +0 -98
  481. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js.map +0 -1
  482. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.d.ts +0 -12
  483. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.js +0 -23
  484. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.js.map +0 -1
  485. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.d.ts +0 -15
  486. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js +0 -42
  487. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js.map +0 -1
  488. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.d.ts +0 -24
  489. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.js +0 -64
  490. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.js.map +0 -1
  491. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.d.ts +0 -20
  492. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.js +0 -45
  493. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.js.map +0 -1
  494. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.d.ts +0 -14
  495. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.js +0 -42
  496. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.js.map +0 -1
  497. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.d.ts +0 -29
  498. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.js +0 -87
  499. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.js.map +0 -1
  500. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.d.ts +0 -58
  501. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +0 -309
  502. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +0 -1
  503. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.d.ts +0 -37
  504. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +0 -78
  505. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +0 -1
  506. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +0 -211
  507. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +0 -171
  508. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +0 -1
  509. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.d.ts +0 -16
  510. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js +0 -75
  511. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js.map +0 -1
  512. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.d.ts +0 -19
  513. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js +0 -221
  514. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js.map +0 -1
  515. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.d.ts +0 -7
  516. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.js +0 -51
  517. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.js.map +0 -1
  518. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.d.ts +0 -15
  519. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js +0 -64
  520. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js.map +0 -1
  521. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.d.ts +0 -6
  522. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.js +0 -13
  523. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.js.map +0 -1
  524. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.d.ts +0 -56
  525. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.js +0 -75
  526. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.js.map +0 -1
  527. package/dist/dist-esm/react-components/src/components/SendBoxErrors.d.ts +0 -14
  528. package/dist/dist-esm/react-components/src/components/SendBoxErrors.js +0 -18
  529. package/dist/dist-esm/react-components/src/components/SendBoxErrors.js.map +0 -1
  530. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.d.ts +0 -24
  531. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +0 -550
  532. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +0 -1
  533. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.d.ts +0 -152
  534. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js +0 -816
  535. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js.map +0 -1
  536. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.d.ts +0 -58
  537. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js +0 -144
  538. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js.map +0 -1
  539. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.d.ts +0 -26
  540. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js +0 -69
  541. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js.map +0 -1
  542. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.d.ts +0 -82
  543. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +0 -320
  544. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +0 -1
  545. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.d.ts +0 -21
  546. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js +0 -38
  547. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js.map +0 -1
  548. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.d.ts +0 -38
  549. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js +0 -92
  550. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js.map +0 -1
  551. package/dist/dist-esm/react-components/src/components/styles/Stack.style.d.ts +0 -5
  552. package/dist/dist-esm/react-components/src/components/styles/Stack.style.js +0 -32
  553. package/dist/dist-esm/react-components/src/components/styles/Stack.style.js.map +0 -1
  554. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.d.ts +0 -26
  555. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js +0 -67
  556. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js.map +0 -1
  557. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.d.ts +0 -72
  558. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js +0 -174
  559. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js.map +0 -1
  560. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.d.ts +0 -33
  561. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js +0 -116
  562. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js.map +0 -1
  563. package/dist/dist-esm/react-components/src/components/utils/merge.d.ts +0 -7
  564. package/dist/dist-esm/react-components/src/components/utils/merge.js +0 -16
  565. package/dist/dist-esm/react-components/src/components/utils/merge.js.map +0 -1
  566. package/dist/dist-esm/react-components/src/theming/icons.styles.d.ts +0 -6
  567. package/dist/dist-esm/react-components/src/theming/icons.styles.js +0 -25
  568. package/dist/dist-esm/react-components/src/theming/icons.styles.js.map +0 -1
  569. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Banner.d.ts +0 -47
  570. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Banner.js +0 -48
  571. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Banner.js.map +0 -1
  572. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.d.ts +0 -13
  573. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.js +0 -37
  574. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.js.map +0 -1
  575. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.d.ts +0 -49
  576. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js +0 -196
  577. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js.map +0 -1
  578. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useCompositeStringsForNotificationStack.d.ts +0 -7
  579. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useCompositeStringsForNotificationStack.js +0 -14
  580. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useCompositeStringsForNotificationStack.js.map +0 -1
  581. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.d.ts +0 -15
  582. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js +0 -41
  583. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js.map +0 -1
  584. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.d.ts +0 -15
  585. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.js +0 -23
  586. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.js.map +0 -1
  587. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.d.ts +0 -18
  588. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js +0 -18
  589. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js.map +0 -1
  590. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.d.ts +0 -49
  591. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.js +0 -44
  592. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.js.map +0 -1
  593. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.d.ts +0 -39
  594. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js +0 -253
  595. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js.map +0 -1
  596. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.d.ts +0 -80
  597. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js +0 -36
  598. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js.map +0 -1
  599. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.d.ts +0 -38
  600. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js +0 -67
  601. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js.map +0 -1
  602. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.d.ts +0 -5
  603. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js +0 -5
  604. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js.map +0 -1
  605. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/Timer.d.ts +0 -12
  606. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/Timer.js +0 -52
  607. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/Timer.js.map +0 -1
  608. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.d.ts +0 -10
  609. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js +0 -16
  610. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js.map +0 -1
@@ -1,9 +1,7 @@
1
1
  import { ReactElement } from 'react';
2
2
  import { Common } from "../../../acs-ui-common/src";
3
3
  import { StatefulChatClient } from "../../../chat-stateful-client/src";
4
- import { UploadChatImageResult } from "../../../acs-ui-common/src";
5
4
  import { ChatThreadClient, SendMessageOptions } from '@azure/communication-chat';
6
- import { MessageOptions } from "../../../acs-ui-common/src";
7
5
  /**
8
6
  * Object containing all the handlers required for chat components.
9
7
  *
@@ -13,15 +11,13 @@ import { MessageOptions } from "../../../acs-ui-common/src";
13
11
  * @public
14
12
  */
15
13
  export type ChatHandlers = {
16
- onSendMessage: (content: string, options?: SendMessageOptions | MessageOptions) => Promise<void>;
17
- onUploadImage: (image: Blob, imageFilename: string) => Promise<UploadChatImageResult>;
18
- onDeleteImage: (imageId: string) => Promise<void>;
14
+ onSendMessage: (content: string, options?: SendMessageOptions) => Promise<void>;
19
15
  onMessageSeen: (chatMessageId: string) => Promise<void>;
20
16
  onTyping: () => Promise<void>;
21
17
  onRemoveParticipant: (userId: string) => Promise<void>;
22
18
  updateThreadTopicName: (topicName: string) => Promise<void>;
23
19
  onLoadPreviousChatMessages: (messagesToLoad: number) => Promise<boolean>;
24
- onUpdateMessage: (messageId: string, content: string, options?: MessageOptions) => Promise<void>;
20
+ onUpdateMessage: (messageId: string, content: string) => Promise<void>;
25
21
  onDeleteMessage: (messageId: string) => Promise<void>;
26
22
  };
27
23
  /**
@@ -10,7 +10,6 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
10
10
  });
11
11
  };
12
12
  import { fromFlatCommunicationIdentifier } from "../../../acs-ui-common/src";
13
- import { getImageAttachmentsFromHTMLContent } from '../utils/getImageAttachmentsFromHTMLContent';
14
13
  import memoizeOne from 'memoize-one';
15
14
  /**
16
15
  * Create the default implementation of {@link ChatHandlers}.
@@ -34,47 +33,15 @@ export const createDefaultChatHandlers = memoizeOne((chatClient, chatThreadClien
34
33
  content,
35
34
  senderDisplayName: chatClient.getState().displayName
36
35
  };
37
- const imageAttachments = getImageAttachmentsFromHTMLContent(content);
38
- const hasAttachments = options && 'attachments' in options && options.attachments && options.attachments[0] && !options.attachments[0].attachmentType;
39
- const hasImages = options && imageAttachments && imageAttachments.length > 0;
40
- if (hasAttachments || hasImages) {
41
- const chatSDKOptions = {
42
- metadata: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.metadata), { fileSharingMetadata: JSON.stringify(options.attachments) }),
43
- attachments: imageAttachments,
44
- type: options.type
45
- };
46
- yield chatThreadClient.sendMessage(sendMessageRequest, chatSDKOptions);
47
- return;
48
- }
49
36
  yield chatThreadClient.sendMessage(sendMessageRequest, options);
50
37
  });
51
38
  },
52
- onUploadImage: function (image, imageFilename) {
53
- return __awaiter(this, void 0, void 0, function* () {
54
- const imageResult = yield chatThreadClient.uploadImage(image, imageFilename);
55
- return imageResult;
56
- });
57
- },
58
- onDeleteImage: function (imageId) {
59
- return __awaiter(this, void 0, void 0, function* () {
60
- try {
61
- yield chatThreadClient.deleteImage(imageId);
62
- }
63
- catch (e) {
64
- console.log(`Error deleting image message: ${e}`);
65
- }
66
- return;
67
- });
68
- },
69
39
  // due to a bug in babel, we can't use arrow function here
70
40
  // affecting conditional-compile-remove(attachment-upload)
71
- onUpdateMessage: function (messageId, content, options) {
41
+ onUpdateMessage: function (messageId, content) {
72
42
  return __awaiter(this, void 0, void 0, function* () {
73
- const imageAttachments = getImageAttachmentsFromHTMLContent(content);
74
43
  const updateMessageOptions = {
75
- content,
76
- metadata: Object.assign(Object.assign({}, options === null || options === void 0 ? void 0 : options.metadata), { fileSharingMetadata: JSON.stringify(options === null || options === void 0 ? void 0 : options.attachments) }),
77
- attachments: imageAttachments
44
+ content
78
45
  };
79
46
  yield chatThreadClient.updateMessage(messageId, updateMessageOptions);
80
47
  });
@@ -1 +1 @@
1
- {"version":3,"file":"createHandlers.js","sourceRoot":"","sources":["../../../../../preprocess-dist/chat-component-bindings/src/handlers/createHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAIlC,OAAO,EAAU,+BAA+B,EAAE,mCAAgC;AAIlF,OAAO,EAAE,kCAAkC,EAAE,MAAM,6CAA6C,CAAC;AAEjG,OAAO,UAAU,MAAM,aAAa,CAAC;AAwBrC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,UAAU,CAA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AAC;gBAED,gDAAgD;gBAChD,IAAI,OAAO,CAAC,IAAI,EAAE,CAAC;oBACjB,uBAAuB,GAAG,IAAI,CAAC;oBAC/B,MAAM;gBACR,CAAC;YACH,CAAC;YACD,6EAA6E;YAC7E,IAAI,WAAW,GAAG,MAAM,mBAAmB,CAAC,IAAI,EAAE,CAAC;YACnD,OAAO,CAAC,WAAW,CAAC,IAAI,IAAI,QAAQ,CAAC,MAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,KAAK,0CAAE,aAAa,CAAC,IAAI,YAAY,EAAE,CAAC;gBACxF,WAAW,GAAG,MAAM,mBAAmB,CAAC,IAAI,EAAE,CAAC;YACjD,CAAC;YACD,OAAO,uBAAuB,CAAC;QACjC,CAAC,CAAA;KACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qCAAqC,GAAG,CAAS,UAA8B,EAAE,gBAAkC,EAAE,CAAwC,EAA+B,EAAE;IACzM,OAAO,yBAAyB,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;AACjE,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { PagedAsyncIterableIterator } from '@azure/core-paging';\nimport { ReactElement } from 'react';\nimport { Common, fromFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { StatefulChatClient } from '@internal/chat-stateful-client';\nimport { ChatAttachment } from '@azure/communication-chat';\nimport { UploadChatImageResult } from '@internal/acs-ui-common';\nimport { getImageAttachmentsFromHTMLContent } from '../utils/getImageAttachmentsFromHTMLContent';\nimport { ChatMessage, ChatMessageReadReceipt, ChatThreadClient, SendMessageOptions } from '@azure/communication-chat';\nimport memoizeOne from 'memoize-one';\nimport { MessageOptions } from '@internal/acs-ui-common';\n\n/**\n * Object containing all the handlers required for chat components.\n *\n * Chat related components from this package are able to pick out relevant handlers from this object.\n * See {@link useHandlers} and {@link usePropsFor}.\n *\n * @public\n */\nexport type ChatHandlers = {\n onSendMessage: (content: string, options?: SendMessageOptions | MessageOptions) => Promise<void>;\n onUploadImage: (image: Blob, imageFilename: string) => Promise<UploadChatImageResult>;\n onDeleteImage: (imageId: string) => Promise<void>;\n onMessageSeen: (chatMessageId: string) => Promise<void>;\n onTyping: () => Promise<void>;\n onRemoveParticipant: (userId: string) => Promise<void>;\n updateThreadTopicName: (topicName: string) => Promise<void>;\n onLoadPreviousChatMessages: (messagesToLoad: number) => Promise<boolean>;\n onUpdateMessage: (messageId: string, content: string, options?: MessageOptions) => Promise<void>;\n onDeleteMessage: (messageId: string) => Promise<void>;\n};\n\n/**\n * Create the default implementation of {@link ChatHandlers}.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * Returned object is memoized to avoid rerenders when used as props for React Components.\n *\n * @public\n */\nexport const createDefaultChatHandlers = memoizeOne((chatClient: StatefulChatClient, chatThreadClient: ChatThreadClient): ChatHandlers => {\n let messageIterator: PagedAsyncIterableIterator<ChatMessage> | undefined = undefined;\n let readReceiptIterator: PagedAsyncIterableIterator<ChatMessageReadReceipt> | undefined = undefined;\n return {\n // due to a bug in babel, we can't use arrow function here\n // affecting conditional-compile-remove(attachment-upload)\n onSendMessage: async function (content: string, options?: SendMessageOptions | MessageOptions) {\n const sendMessageRequest = {\n content,\n senderDisplayName: chatClient.getState().displayName\n };\n const imageAttachments: ChatAttachment[] | undefined = getImageAttachmentsFromHTMLContent(content);\n const hasAttachments = options && 'attachments' in options && options.attachments && options.attachments[0] && !(options.attachments[0] as ChatAttachment).attachmentType;\n const hasImages = options && imageAttachments && imageAttachments.length > 0;\n if (hasAttachments || hasImages) {\n const chatSDKOptions: SendMessageOptions = {\n metadata: {\n ...options?.metadata,\n fileSharingMetadata: JSON.stringify(options.attachments)\n },\n attachments: imageAttachments,\n type: options.type\n };\n await chatThreadClient.sendMessage(sendMessageRequest, chatSDKOptions);\n return;\n }\n await chatThreadClient.sendMessage(sendMessageRequest, options as SendMessageOptions);\n },\n onUploadImage: async function (image: Blob, imageFilename: string): Promise<UploadChatImageResult> {\n const imageResult = await chatThreadClient.uploadImage(image, imageFilename);\n return imageResult;\n },\n onDeleteImage: async function (imageId: string): Promise<void> {\n try {\n await chatThreadClient.deleteImage(imageId);\n } catch (e) {\n console.log(`Error deleting image message: ${e}`);\n }\n return;\n },\n // due to a bug in babel, we can't use arrow function here\n // affecting conditional-compile-remove(attachment-upload)\n onUpdateMessage: async function (messageId: string, content: string, options?: MessageOptions) {\n const imageAttachments: ChatAttachment[] | undefined = getImageAttachmentsFromHTMLContent(content);\n const updateMessageOptions = {\n content,\n metadata: {\n ...options?.metadata,\n fileSharingMetadata: JSON.stringify(options?.attachments)\n },\n attachments: imageAttachments\n };\n await chatThreadClient.updateMessage(messageId, updateMessageOptions);\n },\n onDeleteMessage: async (messageId: string) => {\n await chatThreadClient.deleteMessage(messageId);\n },\n // This handler is designed for chatThread to consume\n onMessageSeen: async (chatMessageId: string) => {\n await chatThreadClient.sendReadReceipt({\n chatMessageId\n });\n },\n onTyping: async () => {\n await chatThreadClient.sendTypingNotification();\n },\n onRemoveParticipant: async (userId: string) => {\n await chatThreadClient.removeParticipant(fromFlatCommunicationIdentifier(userId));\n },\n updateThreadTopicName: async (topicName: string) => {\n await chatThreadClient.updateTopic(topicName);\n },\n onLoadPreviousChatMessages: async (messagesToLoad: number) => {\n if (messageIterator === undefined) {\n // Lazy definition so that errors in the method call are reported correctly.\n // Also allows recovery via retries in case of transient errors.\n messageIterator = chatThreadClient.listMessages({\n maxPageSize: 50\n });\n }\n if (readReceiptIterator === undefined) {\n readReceiptIterator = chatThreadClient.listReadReceipts();\n }\n // get the earliest message time\n let remainingMessagesToGet = messagesToLoad;\n let isAllChatMessagesLoaded = false;\n let earliestTime = Number.MAX_SAFE_INTEGER;\n while (remainingMessagesToGet >= 1) {\n const message = await messageIterator.next();\n if (message?.value?.id) {\n if (parseInt(message.value.id) < earliestTime) {\n earliestTime = parseInt(message.value.id);\n }\n }\n if (message.value?.type && message.value.type === 'text') {\n remainingMessagesToGet--;\n }\n\n // We have traversed all messages in this thread\n if (message.done) {\n isAllChatMessagesLoaded = true;\n break;\n }\n }\n // keep fetching read receipts until read receipt time < earlist message time\n let readReceipt = await readReceiptIterator.next();\n while (!readReceipt.done && parseInt(readReceipt?.value?.chatMessageId) >= earliestTime) {\n readReceipt = await readReceiptIterator.next();\n }\n return isAllChatMessagesLoaded;\n }\n };\n});\n\n/**\n * Create a set of default handlers for given component.\n *\n * Returned object is memoized (with reference to the arguments) to avoid\n * renders when used as props for React Components.\n *\n * @public\n */\nexport const createDefaultChatHandlersForComponent = <Props,>(chatClient: StatefulChatClient, chatThreadClient: ChatThreadClient, _: (props: Props) => ReactElement | null): Common<ChatHandlers, Props> => {\n return createDefaultChatHandlers(chatClient, chatThreadClient);\n};"]}
1
+ {"version":3,"file":"createHandlers.js","sourceRoot":"","sources":["../../../../../preprocess-dist/chat-component-bindings/src/handlers/createHandlers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAIlC,OAAO,EAAU,+BAA+B,EAAE,mCAAgC;AAGlF,OAAO,UAAU,MAAM,aAAa,CAAC;AAoBrC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,UAAU,CAAC,CAAC,UAA8B,EAAE,gBAAkC,EAAgB,EAAE;IACvI,IAAI,eAAe,GAAwD,SAAS,CAAC;IACrF,IAAI,mBAAmB,GAAmE,SAAS,CAAC;IACpG,OAAO;QACL,0DAA0D;QAC1D,0DAA0D;QAC1D,aAAa,EAAE,UAAgB,OAAe,EAAE,OAA4B;;gBAC1E,MAAM,kBAAkB,GAAG;oBACzB,OAAO;oBACP,iBAAiB,EAAE,UAAU,CAAC,QAAQ,EAAE,CAAC,WAAW;iBACrD,CAAC;gBACF,MAAM,gBAAgB,CAAC,WAAW,CAAC,kBAAkB,EAAE,OAA6B,CAAC,CAAC;YACxF,CAAC;SAAA;QACD,0DAA0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,OAAO,yBAAyB,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;AACjE,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { PagedAsyncIterableIterator } from '@azure/core-paging';\nimport { ReactElement } from 'react';\nimport { Common, fromFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { StatefulChatClient } from '@internal/chat-stateful-client';\nimport { ChatMessage, ChatMessageReadReceipt, ChatThreadClient, SendMessageOptions } from '@azure/communication-chat';\nimport memoizeOne from 'memoize-one';\n/**\n * Object containing all the handlers required for chat components.\n *\n * Chat related components from this package are able to pick out relevant handlers from this object.\n * See {@link useHandlers} and {@link usePropsFor}.\n *\n * @public\n */\nexport type ChatHandlers = {\n onSendMessage: (content: string, options?: SendMessageOptions) => Promise<void>;\n onMessageSeen: (chatMessageId: string) => Promise<void>;\n onTyping: () => Promise<void>;\n onRemoveParticipant: (userId: string) => Promise<void>;\n updateThreadTopicName: (topicName: string) => Promise<void>;\n onLoadPreviousChatMessages: (messagesToLoad: number) => Promise<boolean>;\n onUpdateMessage: (messageId: string, content: string) => Promise<void>;\n onDeleteMessage: (messageId: string) => Promise<void>;\n};\n\n/**\n * Create the default implementation of {@link ChatHandlers}.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * Returned object is memoized to avoid rerenders when used as props for React Components.\n *\n * @public\n */\nexport const createDefaultChatHandlers = memoizeOne((chatClient: StatefulChatClient, chatThreadClient: ChatThreadClient): ChatHandlers => {\n let messageIterator: PagedAsyncIterableIterator<ChatMessage> | undefined = undefined;\n let readReceiptIterator: PagedAsyncIterableIterator<ChatMessageReadReceipt> | undefined = undefined;\n return {\n // due to a bug in babel, we can't use arrow function here\n // affecting conditional-compile-remove(attachment-upload)\n onSendMessage: async function (content: string, options?: SendMessageOptions) {\n const sendMessageRequest = {\n content,\n senderDisplayName: chatClient.getState().displayName\n };\n await chatThreadClient.sendMessage(sendMessageRequest, options as SendMessageOptions);\n },\n // due to a bug in babel, we can't use arrow function here\n // affecting conditional-compile-remove(attachment-upload)\n onUpdateMessage: async function (messageId: string, content: string) {\n const updateMessageOptions = {\n content\n };\n await chatThreadClient.updateMessage(messageId, updateMessageOptions);\n },\n onDeleteMessage: async (messageId: string) => {\n await chatThreadClient.deleteMessage(messageId);\n },\n // This handler is designed for chatThread to consume\n onMessageSeen: async (chatMessageId: string) => {\n await chatThreadClient.sendReadReceipt({\n chatMessageId\n });\n },\n onTyping: async () => {\n await chatThreadClient.sendTypingNotification();\n },\n onRemoveParticipant: async (userId: string) => {\n await chatThreadClient.removeParticipant(fromFlatCommunicationIdentifier(userId));\n },\n updateThreadTopicName: async (topicName: string) => {\n await chatThreadClient.updateTopic(topicName);\n },\n onLoadPreviousChatMessages: async (messagesToLoad: number) => {\n if (messageIterator === undefined) {\n // Lazy definition so that errors in the method call are reported correctly.\n // Also allows recovery via retries in case of transient errors.\n messageIterator = chatThreadClient.listMessages({\n maxPageSize: 50\n });\n }\n if (readReceiptIterator === undefined) {\n readReceiptIterator = chatThreadClient.listReadReceipts();\n }\n // get the earliest message time\n let remainingMessagesToGet = messagesToLoad;\n let isAllChatMessagesLoaded = false;\n let earliestTime = Number.MAX_SAFE_INTEGER;\n while (remainingMessagesToGet >= 1) {\n const message = await messageIterator.next();\n if (message?.value?.id) {\n if (parseInt(message.value.id) < earliestTime) {\n earliestTime = parseInt(message.value.id);\n }\n }\n if (message.value?.type && message.value.type === 'text') {\n remainingMessagesToGet--;\n }\n\n // We have traversed all messages in this thread\n if (message.done) {\n isAllChatMessagesLoaded = true;\n break;\n }\n }\n // keep fetching read receipts until read receipt time < earlist message time\n let readReceipt = await readReceiptIterator.next();\n while (!readReceipt.done && parseInt(readReceipt?.value?.chatMessageId) >= earliestTime) {\n readReceipt = await readReceiptIterator.next();\n }\n return isAllChatMessagesLoaded;\n }\n };\n});\n\n/**\n * Create a set of default handlers for given component.\n *\n * Returned object is memoized (with reference to the arguments) to avoid\n * renders when used as props for React Components.\n *\n * @public\n */\nexport const createDefaultChatHandlersForComponent = <Props,>(chatClient: StatefulChatClient, chatThreadClient: ChatThreadClient, _: (props: Props) => ReactElement | null): Common<ChatHandlers, Props> => {\n return createDefaultChatHandlers(chatClient, chatThreadClient);\n};"]}
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { ErrorBar, MessageThread, ParticipantList, SendBox, TypingIndicator } from "../../../react-components/src";
3
- import { RichTextSendBox } from "../../../react-components/src";
4
3
  import { SendBoxSelector } from '../sendBoxSelector';
5
4
  import { MessageThreadSelector } from '../messageThreadSelector';
6
5
  import { TypingIndicatorSelector } from '../typingIndicatorSelector';
@@ -32,7 +31,7 @@ export declare const usePropsFor: <Component extends (props: any) => JSX.Element
32
31
  *
33
32
  * @public
34
33
  */
35
- export type GetSelector<Component extends (props: any) => JSX.Element | undefined> = AreEqual<Component, typeof SendBox> extends true ? SendBoxSelector : AreEqual<Component, typeof RichTextSendBox> extends true ? SendBoxSelector : AreEqual<Component, typeof MessageThread> extends true ? MessageThreadSelector : AreEqual<Component, typeof TypingIndicator> extends true ? TypingIndicatorSelector : AreEqual<Component, typeof ParticipantList> extends true ? ChatParticipantListSelector : AreEqual<Component, typeof ErrorBar> extends true ? ErrorBarSelector : undefined;
34
+ export type GetSelector<Component extends (props: any) => JSX.Element | undefined> = AreEqual<Component, typeof SendBox> extends true ? SendBoxSelector : AreEqual<Component, typeof MessageThread> extends true ? MessageThreadSelector : AreEqual<Component, typeof TypingIndicator> extends true ? TypingIndicatorSelector : AreEqual<Component, typeof ParticipantList> extends true ? ChatParticipantListSelector : AreEqual<Component, typeof ErrorBar> extends true ? ErrorBarSelector : undefined;
36
35
  /**
37
36
  * Get the selector for a specified component.
38
37
  *
@@ -1,7 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  import { ErrorBar, MessageThread, ParticipantList, SendBox, TypingIndicator } from "../../../react-components/src";
4
- import { RichTextSendBox } from "../../../react-components/src";
5
4
  import { useHandlers } from './useHandlers';
6
5
  import { useSelector } from './useSelector';
7
6
  import { sendBoxSelector } from '../sendBoxSelector';
@@ -67,8 +66,6 @@ const findSelector = (component) => {
67
66
  switch (component) {
68
67
  case SendBox:
69
68
  return sendBoxSelector;
70
- case RichTextSendBox:
71
- return sendBoxSelector;
72
69
  case MessageThread:
73
70
  return getMessageThreadSelector();
74
71
  case TypingIndicator:
@@ -1 +1 @@
1
- {"version":3,"file":"usePropsFor.js","sourceRoot":"","sources":["../../../../../preprocess-dist/chat-component-bindings/src/hooks/usePropsFor.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,sCAAmC;AAChH,OAAO,EAAE,eAAe,EAAE,sCAAmC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAmB,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAyB,+BAA+B,EAAE,MAAM,0BAA0B,CAAC;AAClG,OAAO,EAA2B,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAG9F,OAAO,EAA+B,2BAA2B,EAAE,MAAM,gCAAgC,CAAC;AAC1G,OAAO,EAAoB,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACzE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uCAAuC,CAAC;AAChF,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAEnC;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAiD,SAAoB,EAAwJ,EAAE;IACxP,MAAM,QAAQ,GAAG,WAAW,CAAC,SAAS,CAAC,CAAC;IACxC,MAAM,KAAK,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAC;IACp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","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { ErrorBar, MessageThread, ParticipantList, SendBox, TypingIndicator } from '@internal/react-components';\nimport { RichTextSendBox } from '@internal/react-components';\nimport { useHandlers } from './useHandlers';\nimport { useSelector } from './useSelector';\nimport { SendBoxSelector, sendBoxSelector } from '../sendBoxSelector';\nimport { MessageThreadSelector, messageThreadSelectorWithThread } from '../messageThreadSelector';\nimport { TypingIndicatorSelector, typingIndicatorSelector } from '../typingIndicatorSelector';\nimport { Common, AreEqual } from '@internal/acs-ui-common';\nimport { ChatHandlers } from '../handlers/createHandlers';\nimport { ChatParticipantListSelector, chatParticipantListSelector } from '../chatParticipantListSelector';\nimport { ErrorBarSelector, errorBarSelector } from '../errorBarSelector';\nimport { ChatThreadClientContext } from '../providers/ChatThreadClientProvider';\nimport { useContext } from 'react';\n\n/**\n * Primary hook to get all hooks necessary for a chat Component.\n *\n * Most straightforward usage of chat components looks like:\n *\n * @example\n * ```\n * import { ParticipantList, usePropsFor } from '@azure/communication-react';\n *\n * const App = (): JSX.Element => {\n * // ... code to setup Providers ...\n *\n * return <ParticipantList {...usePropsFor(ParticipantList)}/>\n * }\n * ```\n *\n * @public\n */\nexport const usePropsFor = <Component extends (props: any) => JSX.Element,>(component: Component): GetSelector<Component> extends (props: any) => any ? ReturnType<GetSelector<Component>> & Common<ChatHandlers, Parameters<Component>[0]> : undefined => {\n const selector = getSelector(component);\n const props = useSelector(selector);\n const handlers = useHandlers<Parameters<Component>[0]>(component);\n if (props !== undefined) {\n return {\n ...props,\n ...handlers\n } as any;\n }\n return undefined as any;\n};\n\n/**\n * Specific type of the selector applicable to a given Component.\n *\n * @public\n */\nexport type GetSelector<Component extends (props: any) => JSX.Element | undefined> = AreEqual<Component, typeof SendBox> extends true ? SendBoxSelector : AreEqual<Component, typeof RichTextSendBox> extends true ? SendBoxSelector : AreEqual<Component, typeof MessageThread> extends true ? MessageThreadSelector : AreEqual<Component, typeof TypingIndicator> extends true ? TypingIndicatorSelector : AreEqual<Component, typeof ParticipantList> extends true ? ChatParticipantListSelector : AreEqual<Component, typeof ErrorBar> extends true ? ErrorBarSelector : undefined;\n\n/**\n * Get the selector for a specified component.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const getSelector = <Component extends (props: any) => JSX.Element | undefined,>(component: Component): GetSelector<Component> => {\n return findSelector(component);\n};\nconst messageThreadSelectorsByThread: {\n [key: string]: MessageThreadSelector;\n} = {};\nconst findSelector = (component: (props: any) => JSX.Element | undefined): any => {\n // For the message thread selector we need to create a new one for each thread\n // If we have just one for the entire app, then we will have updates when not expecting due to\n // the arguments changing\n const getMessageThreadSelector: () => MessageThreadSelector = () => {\n const threadId = useContext(ChatThreadClientContext)?.threadId ?? 'default-id-when-not-in-provider';\n let messageThreadSelectorImpl = messageThreadSelectorsByThread[threadId];\n if (!messageThreadSelectorImpl) {\n messageThreadSelectorsByThread[threadId] = messageThreadSelectorWithThread();\n messageThreadSelectorImpl = messageThreadSelectorsByThread[threadId];\n }\n return messageThreadSelectorImpl;\n };\n switch (component) {\n case SendBox:\n return sendBoxSelector;\n case RichTextSendBox:\n return sendBoxSelector;\n case MessageThread:\n return getMessageThreadSelector();\n case TypingIndicator:\n return typingIndicatorSelector;\n case ParticipantList:\n return chatParticipantListSelector;\n case ErrorBar:\n return errorBarSelector;\n }\n return undefined;\n};"]}
1
+ {"version":3,"file":"usePropsFor.js","sourceRoot":"","sources":["../../../../../preprocess-dist/chat-component-bindings/src/hooks/usePropsFor.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,eAAe,EAAE,sCAAmC;AAChH,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAmB,eAAe,EAAE,MAAM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AAC,yBAAyB,EAAE,CAAC;YAC/B,8BAA8B,CAAC,QAAQ,CAAC,GAAG,+BAA+B,EAAE,CAAC;YAC7E,yBAAyB,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC;QACvE,CAAC;QACD,OAAO,yBAAyB,CAAC;IACnC,CAAC,CAAC;IACF,QAAQ,SAAS,EAAE,CAAC;QAClB,KAAK,OAAO;YACV,OAAO,eAAe,CAAC;QACzB,KAAK,aAAa;YAChB,OAAO,wBAAwB,EAAE,CAAC;QACpC,KAAK,eAAe;YAClB,OAAO,uBAAuB,CAAC;QACjC,KAAK,eAAe;YAClB,OAAO,2BAA2B,CAAC;QACrC,KAAK,QAAQ;YACX,OAAO,gBAAgB,CAAC;IAC5B,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { ErrorBar, MessageThread, ParticipantList, SendBox, TypingIndicator } from '@internal/react-components';\nimport { useHandlers } from './useHandlers';\nimport { useSelector } from './useSelector';\nimport { SendBoxSelector, sendBoxSelector } from '../sendBoxSelector';\nimport { MessageThreadSelector, messageThreadSelectorWithThread } from '../messageThreadSelector';\nimport { TypingIndicatorSelector, typingIndicatorSelector } from '../typingIndicatorSelector';\nimport { Common, AreEqual } from '@internal/acs-ui-common';\nimport { ChatHandlers } from '../handlers/createHandlers';\nimport { ChatParticipantListSelector, chatParticipantListSelector } from '../chatParticipantListSelector';\nimport { ErrorBarSelector, errorBarSelector } from '../errorBarSelector';\nimport { ChatThreadClientContext } from '../providers/ChatThreadClientProvider';\nimport { useContext } from 'react';\n\n/**\n * Primary hook to get all hooks necessary for a chat Component.\n *\n * Most straightforward usage of chat components looks like:\n *\n * @example\n * ```\n * import { ParticipantList, usePropsFor } from '@azure/communication-react';\n *\n * const App = (): JSX.Element => {\n * // ... code to setup Providers ...\n *\n * return <ParticipantList {...usePropsFor(ParticipantList)}/>\n * }\n * ```\n *\n * @public\n */\nexport const usePropsFor = <Component extends (props: any) => JSX.Element,>(component: Component): GetSelector<Component> extends (props: any) => any ? ReturnType<GetSelector<Component>> & Common<ChatHandlers, Parameters<Component>[0]> : undefined => {\n const selector = getSelector(component);\n const props = useSelector(selector);\n const handlers = useHandlers<Parameters<Component>[0]>(component);\n if (props !== undefined) {\n return {\n ...props,\n ...handlers\n } as any;\n }\n return undefined as any;\n};\n\n/**\n * Specific type of the selector applicable to a given Component.\n *\n * @public\n */\nexport type GetSelector<Component extends (props: any) => JSX.Element | undefined> = AreEqual<Component, typeof SendBox> extends true ? SendBoxSelector : AreEqual<Component, typeof MessageThread> extends true ? MessageThreadSelector : AreEqual<Component, typeof TypingIndicator> extends true ? TypingIndicatorSelector : AreEqual<Component, typeof ParticipantList> extends true ? ChatParticipantListSelector : AreEqual<Component, typeof ErrorBar> extends true ? ErrorBarSelector : undefined;\n\n/**\n * Get the selector for a specified component.\n *\n * Useful when implementing a custom component that utilizes the providers\n * exported from this library.\n *\n * @public\n */\nexport const getSelector = <Component extends (props: any) => JSX.Element | undefined,>(component: Component): GetSelector<Component> => {\n return findSelector(component);\n};\nconst messageThreadSelectorsByThread: {\n [key: string]: MessageThreadSelector;\n} = {};\nconst findSelector = (component: (props: any) => JSX.Element | undefined): any => {\n // For the message thread selector we need to create a new one for each thread\n // If we have just one for the entire app, then we will have updates when not expecting due to\n // the arguments changing\n const getMessageThreadSelector: () => MessageThreadSelector = () => {\n const threadId = useContext(ChatThreadClientContext)?.threadId ?? 'default-id-when-not-in-provider';\n let messageThreadSelectorImpl = messageThreadSelectorsByThread[threadId];\n if (!messageThreadSelectorImpl) {\n messageThreadSelectorsByThread[threadId] = messageThreadSelectorWithThread();\n messageThreadSelectorImpl = messageThreadSelectorsByThread[threadId];\n }\n return messageThreadSelectorImpl;\n };\n switch (component) {\n case SendBox:\n return sendBoxSelector;\n case MessageThread:\n return getMessageThreadSelector();\n case TypingIndicator:\n return typingIndicatorSelector;\n case ParticipantList:\n return chatParticipantListSelector;\n case ErrorBar:\n return errorBarSelector;\n }\n return undefined;\n};"]}
@@ -4,15 +4,10 @@ import { getChatMessages, getIsLargeGroup, getLatestReadTime, getParticipants, g
4
4
  import { toFlatCommunicationIdentifier } from "../../acs-ui-common/src";
5
5
  import { memoizeFnAll } from "../../acs-ui-common/src";
6
6
  import { createSelector } from 'reselect';
7
- import { DEFAULT_DATA_LOSS_PREVENTION_POLICY_URL } from './utils/constants';
8
7
  import { ACSKnownMessageType } from './utils/constants';
9
8
  import { updateMessagesWithAttached } from './utils/updateMessagesWithAttached';
10
9
  const memoizedAllConvertChatMessage = memoizeFnAll((_key, chatMessage, userId, isSeen, isLargeGroup) => {
11
- var _a;
12
10
  const messageType = chatMessage.type.toLowerCase();
13
- if (((_a = chatMessage.policyViolation) === null || _a === void 0 ? void 0 : _a.result) === 'contentBlocked') {
14
- return convertToUiBlockedMessage(chatMessage, userId, isSeen, isLargeGroup);
15
- }
16
11
  if (messageType === ACSKnownMessageType.text || messageType === ACSKnownMessageType.richtextHtml || messageType === ACSKnownMessageType.html) {
17
12
  return convertToUiChatMessage(chatMessage, userId, isSeen, isLargeGroup);
18
13
  }
@@ -50,21 +45,6 @@ const extractTeamsAttachmentsMetadata = (rawAttachments) => {
50
45
  attachments
51
46
  };
52
47
  };
53
- const convertToUiBlockedMessage = (message, userId, isSeen, isLargeGroup) => {
54
- const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;
55
- return {
56
- messageType: 'blocked',
57
- createdOn: message.createdOn,
58
- warningText: undefined,
59
- status: !isLargeGroup && message.status === 'delivered' && isSeen ? 'seen' : message.status,
60
- senderDisplayName: message.senderDisplayName,
61
- senderId: messageSenderId,
62
- messageId: message.id,
63
- deletedOn: message.deletedOn,
64
- mine: messageSenderId === userId,
65
- link: DEFAULT_DATA_LOSS_PREVENTION_POLICY_URL
66
- };
67
- };
68
48
  const extractAttachmentUrl = (attachment) => {
69
49
  return attachment.previewUrl ? attachment.previewUrl : attachment.url || '';
70
50
  };
@@ -271,17 +251,14 @@ const getBrokenImageViewNode = (img) => {
271
251
  return wrapper;
272
252
  };
273
253
  const isMessageValidToRender = (message) => {
274
- var _a, _b, _c, _d, _e;
254
+ var _a, _b, _c, _d;
275
255
  if (message.deletedOn) {
276
256
  return false;
277
257
  }
278
258
  if (((_a = message.metadata) === null || _a === void 0 ? void 0 : _a.fileSharingMetadata) || ((_c = (_b = message.content) === null || _b === void 0 ? void 0 : _b.attachments) === null || _c === void 0 ? void 0 : _c.length)) {
279
259
  return true;
280
260
  }
281
- if (((_d = message.policyViolation) === null || _d === void 0 ? void 0 : _d.result) === 'contentBlocked') {
282
- return true;
283
- }
284
- return !!(message.content && ((_e = message.content) === null || _e === void 0 ? void 0 : _e.message) !== '');
261
+ return !!(message.content && ((_d = message.content) === null || _d === void 0 ? void 0 : _d.message) !== '');
285
262
  };
286
263
  /**
287
264
  * Selector for {@link MessageThread} component.
@@ -1 +1 @@
1
- {"version":3,"file":"messageThreadSelector.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-component-bindings/src/messageThreadSelector.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAyB,eAAe,EAAE,eAAe,EAAE,iBAAiB,EAAE,eAAe,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC1J,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAExE,OAAO,EAAE,YAAY,EAAE,gCAAgC;AAGvD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,uCAAuC,EAAE,MAAM,mBAAmB,CAAC;AAC5E,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAE,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAKhF,MAAM,6BAA6B,GAAG,YAAY,CAAC,CAAC,IAAY,EAAE,WAAkC,EAAE,MAAc,EAAE,MAAe,EAAE,YAAqB,E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,CAAC;QAClF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,IAAI,CAAA,MAAA,OAAO,CAAC,eAAe,0CAAE,MAAM,MAAK,gBAAgB,EAAE,CAAC;QACzD,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,CAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,OAAO,MAAK,EAAE,CAAC,CAAC;AAChE,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA0B,+BAA+B,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatBaseSelectorProps, getChatMessages, getIsLargeGroup, getLatestReadTime, getParticipants, getReadReceipts, getUserId } from './baseSelectors';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ChatClientState, ChatMessageWithStatus, ResourceFetchResult } from '@internal/chat-stateful-client';\nimport { memoizeFnAll } from '@internal/acs-ui-common';\nimport { ChatMessage, Message, CommunicationParticipant, SystemMessage, MessageContentType, ReadReceiptsBySenderId } from '@internal/react-components';\nimport { BlockedMessage } from '@internal/react-components';\nimport { createSelector } from 'reselect';\nimport { DEFAULT_DATA_LOSS_PREVENTION_POLICY_URL } from './utils/constants';\nimport { ACSKnownMessageType } from './utils/constants';\nimport { updateMessagesWithAttached } from './utils/updateMessagesWithAttached';\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { ChatAttachment } from '@azure/communication-chat';\nimport type { ChatParticipant } from '@azure/communication-chat';\nimport { ChatAttachmentType } from '@internal/react-components';\nconst memoizedAllConvertChatMessage = memoizeFnAll((_key: string, chatMessage: ChatMessageWithStatus, userId: string, isSeen: boolean, isLargeGroup: boolean): Message => {\n const messageType = chatMessage.type.toLowerCase();\n if (chatMessage.policyViolation?.result === 'contentBlocked') {\n return convertToUiBlockedMessage(chatMessage, userId, isSeen, isLargeGroup);\n }\n if (messageType === ACSKnownMessageType.text || messageType === ACSKnownMessageType.richtextHtml || messageType === ACSKnownMessageType.html) {\n return convertToUiChatMessage(chatMessage, userId, isSeen, isLargeGroup);\n } else {\n return convertToUiSystemMessage(chatMessage);\n }\n});\nconst extractAttachmentMetadata = (metadata: Record<string, string>): AttachmentMetadata[] => {\n const attachmentMetadata = metadata.fileSharingMetadata;\n if (!attachmentMetadata) {\n return [];\n }\n try {\n return JSON.parse(attachmentMetadata);\n } catch (e) {\n console.error(e);\n return [];\n }\n};\nconst extractTeamsAttachmentsMetadata = (rawAttachments: ChatAttachment[]): {\n attachments: AttachmentMetadata[];\n} => {\n const attachments: AttachmentMetadata[] = [];\n rawAttachments.forEach(rawAttachment => {\n const attachmentType = rawAttachment.attachmentType as ChatAttachmentType;\n if (attachmentType === 'file') {\n attachments.push({\n id: rawAttachment.id,\n name: rawAttachment.name ?? '',\n url: extractAttachmentUrl(rawAttachment)\n });\n }\n });\n return {\n attachments\n };\n};\nconst convertToUiBlockedMessage = (message: ChatMessageWithStatus, userId: string, isSeen: boolean, isLargeGroup: boolean): BlockedMessage => {\n const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;\n return {\n messageType: 'blocked',\n createdOn: message.createdOn,\n warningText: undefined,\n status: !isLargeGroup && message.status === 'delivered' && isSeen ? 'seen' : message.status,\n senderDisplayName: message.senderDisplayName,\n senderId: messageSenderId,\n messageId: message.id,\n deletedOn: message.deletedOn,\n mine: messageSenderId === userId,\n link: DEFAULT_DATA_LOSS_PREVENTION_POLICY_URL\n };\n};\nconst extractAttachmentUrl = (attachment: ChatAttachment): string => {\n return attachment.previewUrl ? attachment.previewUrl : attachment.url || '';\n};\nconst processChatMessageContent = (message: ChatMessageWithStatus): string | undefined => {\n let content = message.content?.message;\n if (message.content?.attachments && message.content?.attachments.length > 0 && sanitizedMessageContentType(message.type).includes('html')) {\n const attachments: ChatAttachment[] = message.content?.attachments;\n // Fill in the src here\n if (content) {\n const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n document.querySelectorAll('img').forEach(img => {\n const attachmentPreviewUrl = attachments.find(attachment => attachment.id === img.id)?.previewUrl;\n if (attachmentPreviewUrl) {\n const resourceCache = message.resourceCache?.[attachmentPreviewUrl];\n const src = getResourceSourceUrl(resourceCache);\n // if in error state\n if (src === undefined) {\n const brokenImageView = getBrokenImageViewNode(img);\n img.parentElement?.replaceChild(brokenImageView, img);\n } else {\n // else in loading or success state\n img.setAttribute('src', src);\n }\n setImageWidthAndHeight(img);\n }\n });\n content = document.body.innerHTML;\n }\n const teamsImageHtmlContent = attachments.filter(attachment => attachment.attachmentType === 'image' && attachment.previewUrl !== undefined && !message.content?.message?.includes(attachment.id)).map(attachment => generateImageAttachmentImgHtml(message, attachment)).join('');\n if (teamsImageHtmlContent) {\n return (content ?? '') + teamsImageHtmlContent;\n }\n }\n return content;\n};\nconst generateImageAttachmentImgHtml = (message: ChatMessageWithStatus, attachment: ChatAttachment): string => {\n if (attachment.previewUrl !== undefined) {\n const contentType = extractAttachmentContentTypeFromName(attachment.name);\n const resourceCache = message.resourceCache?.[attachment.previewUrl];\n const src = getResourceSourceUrl(resourceCache);\n // if in error state\n if (src === undefined) {\n return `\\r\\n<p>${getBrokenImageViewNode()}</p>`;\n }\n // else in loading or success state\n return `\\r\\n<p><img alt=\"image\" src=\"${src}\" itemscope=\"${contentType}\" id=\"${attachment.id}\"></p>`;\n }\n return '';\n};\nconst getResourceSourceUrl = (result?: ResourceFetchResult): string | undefined => {\n if (result) {\n if (!result.error && result.sourceUrl) {\n // return sourceUrl for success state\n return result.sourceUrl;\n } else {\n // return undefined for error state\n return undefined;\n }\n }\n // return empty string for loading state\n return '';\n};\nconst extractAttachmentContentTypeFromName = (name?: string): string => {\n if (name === undefined) {\n return '';\n }\n const indexOfLastDot = name.lastIndexOf('.');\n if (indexOfLastDot === undefined || indexOfLastDot < 0) {\n return '';\n }\n const contentType = name.substring(indexOfLastDot + 1);\n return contentType;\n};\nconst setImageWidthAndHeight = (img?: HTMLImageElement): void => {\n if (img) {\n // define aspect ratio explicitly to prevent image not being displayed correctly\n // in safari, this includes image placeholder for loading state\n const width = img.width;\n const height = img.height;\n img.style.aspectRatio = `${width}/${height}`;\n }\n};\nconst extractAttachmentsMetadata = (message: ChatMessageWithStatus): {\n attachments?: AttachmentMetadata[];\n} => {\n let attachments: AttachmentMetadata[] = [];\n if (message.metadata) {\n attachments = attachments.concat(extractAttachmentMetadata(message.metadata));\n }\n if (message.content?.attachments) {\n const teamsAttachments = extractTeamsAttachmentsMetadata(message.content?.attachments);\n attachments = attachments.concat(teamsAttachments.attachments);\n }\n return {\n attachments: attachments.length > 0 ? attachments : undefined\n };\n};\nconst convertToUiChatMessage = (message: ChatMessageWithStatus, userId: string, isSeen: boolean, isLargeGroup: boolean): ChatMessage => {\n const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;\n const {\n attachments\n } = extractAttachmentsMetadata(message);\n return {\n messageType: 'chat',\n createdOn: message.createdOn,\n content: processChatMessageContent(message),\n contentType: sanitizedMessageContentType(message.type),\n status: !isLargeGroup && message.status === 'delivered' && isSeen ? 'seen' : message.status,\n senderDisplayName: message.senderDisplayName,\n senderId: messageSenderId,\n messageId: message.id,\n clientMessageId: message.clientMessageId,\n editedOn: message.editedOn,\n deletedOn: message.deletedOn,\n mine: messageSenderId === userId,\n metadata: message.metadata,\n attachments\n };\n};\nconst convertToUiSystemMessage = (message: ChatMessageWithStatus): SystemMessage => {\n const systemMessageType = message.type;\n if (systemMessageType === 'participantAdded' || systemMessageType === 'participantRemoved') {\n return {\n messageType: 'system',\n systemMessageType,\n createdOn: message.createdOn,\n participants: message.content?.participants\n // TODO: In our moderator logic, we use undefined name as our displayName for moderator, which should be filtered out\n // Once we have a better solution to identify the moderator, remove this line\n ?.filter((participant: ChatParticipant) => participant.displayName && participant.displayName !== '').map((participant: ChatParticipant): CommunicationParticipant => ({\n userId: toFlatCommunicationIdentifier(participant.id),\n displayName: participant.displayName\n })) ?? [],\n messageId: message.id,\n iconName: systemMessageType === 'participantAdded' ? 'PeopleAdd' : 'PeopleBlock'\n };\n } else {\n // Only topic updated type left, according to ACSKnown type\n return {\n messageType: 'system',\n systemMessageType: 'topicUpdated',\n createdOn: message.createdOn,\n topic: message.content?.topic ?? '',\n messageId: message.id,\n iconName: 'Edit'\n };\n }\n};\n\n/**\n * Selector type for {@link MessageThread} component.\n *\n * @public\n */\nexport type MessageThreadSelector = (state: ChatClientState, props: ChatBaseSelectorProps) => {\n userId: string;\n showMessageStatus: boolean;\n messages: Message[];\n};\n\n/** Returns `true` if the message has participants and at least one participant has a display name. */\nconst hasValidParticipant = (chatMessage: ChatMessageWithStatus): boolean => !!chatMessage.content?.participants && chatMessage.content.participants.some((p: ChatParticipant) => !!p.displayName);\n\n/**\n *\n * @private\n */\nexport const messageThreadSelectorWithThread: () => MessageThreadSelector = () => createSelector([getUserId, getChatMessages, getLatestReadTime, getIsLargeGroup, getReadReceipts, getParticipants], (userId, chatMessages, latestReadTime, isLargeGroup, readReceipts = [], participants) => {\n // We can't get displayName in teams meeting interop for now, disable rr feature when it is teams interop\n const isTeamsInterop = Object.values(participants).find(p => 'microsoftTeamsUserId' in p.id) !== undefined;\n\n // get number of participants\n // filter out the non valid participants (no display name)\n // Read Receipt details will be disabled when participant count is 0\n const participantCount = isTeamsInterop ? undefined : Object.values(participants).filter(p => p.displayName && p.displayName !== '').length;\n\n // creating key value pairs of senderID: last read message information\n\n const readReceiptsBySenderId: ReadReceiptsBySenderId = {};\n\n // readReceiptsBySenderId[senderID] gets updated every time a new message is read by this sender\n // in this way we can make sure that we are only saving the latest read message id and read on time for each sender\n readReceipts.filter(r => r.sender && toFlatCommunicationIdentifier(r.sender) !== userId).forEach(r => {\n readReceiptsBySenderId[toFlatCommunicationIdentifier(r.sender)] = {\n lastReadMessage: r.chatMessageId,\n displayName: participants[toFlatCommunicationIdentifier(r.sender)]?.displayName ?? ''\n };\n });\n\n // A function takes parameter above and generate return value\n const convertedMessages = memoizedAllConvertChatMessage(memoizedFn => Object.values(chatMessages).filter(message => message.type.toLowerCase() === ACSKnownMessageType.text || message.type.toLowerCase() === ACSKnownMessageType.richtextHtml || message.type.toLowerCase() === ACSKnownMessageType.html || message.type === ACSKnownMessageType.participantAdded && hasValidParticipant(message) || message.type === ACSKnownMessageType.participantRemoved && hasValidParticipant(message) ||\n // TODO: Add support for topicUpdated system messages in MessageThread component.\n // message.type === ACSKnownMessageType.topicUpdated ||\n message.clientMessageId !== undefined).filter(isMessageValidToRender).map(message => {\n return memoizedFn(message.id ?? message.clientMessageId, message, userId, message.createdOn <= latestReadTime, isLargeGroup);\n }));\n updateMessagesWithAttached(convertedMessages);\n return {\n userId,\n showMessageStatus: true,\n messages: convertedMessages,\n participantCount,\n readReceiptsBySenderId\n };\n});\nconst sanitizedMessageContentType = (type: string): MessageContentType => {\n const lowerCaseType = type.toLowerCase();\n return lowerCaseType === 'text' || lowerCaseType === 'html' || lowerCaseType === 'richtext/html' ? lowerCaseType : 'unknown';\n};\nconst getBrokenImageViewNode = (img?: HTMLDivElement): HTMLDivElement => {\n const wrapper = document.createElement('div');\n Array.from(img?.attributes ?? []).forEach(attr => {\n wrapper.setAttribute(attr.nodeName, attr.nodeValue ?? '');\n });\n wrapper.setAttribute('class', 'broken-image-wrapper');\n wrapper.setAttribute('data-ui-id', 'broken-image-icon');\n return wrapper;\n};\nconst isMessageValidToRender = (message: ChatMessageWithStatus): boolean => {\n if (message.deletedOn) {\n return false;\n }\n if (message.metadata?.fileSharingMetadata || message.content?.attachments?.length) {\n return true;\n }\n if (message.policyViolation?.result === 'contentBlocked') {\n return true;\n }\n return !!(message.content && message.content?.message !== '');\n};\n\n/**\n * Selector for {@link MessageThread} component.\n *\n * @public\n */\nexport const messageThreadSelector: MessageThreadSelector = messageThreadSelectorWithThread();"]}
1
+ {"version":3,"file":"messageThreadSelector.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-component-bindings/src/messageThreadSelector.ts"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AAC,SAAS,CAAC;AAC/H,CAAC,CAAC;AACF,MAAM,sBAAsB,GAAG,CAAC,GAAoB,EAAkB,EAAE;;IACtE,MAAM,OAAO,GAAG,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;IAC9C,KAAK,CAAC,IAAI,CAAC,MAAA,GAAG,aAAH,GAAG,uBAAH,GAAG,CAAE,UAAU,mCAAI,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;;QAC/C,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAA,IAAI,CAAC,SAAS,mCAAI,EAAE,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;IACH,OAAO,CAAC,YAAY,CAAC,OAAO,EAAE,sBAAsB,CAAC,CAAC;IACtD,OAAO,CAAC,YAAY,CAAC,YAAY,EAAE,mBAAmB,CAAC,CAAC;IACxD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AACF,MAAM,sBAAsB,GAAG,CAAC,OAA8B,EAAW,EAAE;;IACzE,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;QACtB,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,CAAA,MAAA,OAAO,CAAC,QAAQ,0CAAE,mBAAmB,MAAI,MAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,WAAW,0CAAE,MAAM,CAAA,EAAE,CAAC;QAClF,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,CAAA,MAAA,OAAO,CAAC,OAAO,0CAAE,OAAO,MAAK,EAAE,CAAC,CAAC;AAChE,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAA0B,+BAA+B,EAAE,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatBaseSelectorProps, getChatMessages, getIsLargeGroup, getLatestReadTime, getParticipants, getReadReceipts, getUserId } from './baseSelectors';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ChatClientState, ChatMessageWithStatus, ResourceFetchResult } from '@internal/chat-stateful-client';\nimport { memoizeFnAll } from '@internal/acs-ui-common';\nimport { ChatMessage, Message, CommunicationParticipant, SystemMessage, MessageContentType, ReadReceiptsBySenderId } from '@internal/react-components';\nimport { createSelector } from 'reselect';\nimport { ACSKnownMessageType } from './utils/constants';\nimport { updateMessagesWithAttached } from './utils/updateMessagesWithAttached';\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { ChatAttachment } from '@azure/communication-chat';\nimport type { ChatParticipant } from '@azure/communication-chat';\nimport { ChatAttachmentType } from '@internal/react-components';\nconst memoizedAllConvertChatMessage = memoizeFnAll((_key: string, chatMessage: ChatMessageWithStatus, userId: string, isSeen: boolean, isLargeGroup: boolean): Message => {\n const messageType = chatMessage.type.toLowerCase();\n if (messageType === ACSKnownMessageType.text || messageType === ACSKnownMessageType.richtextHtml || messageType === ACSKnownMessageType.html) {\n return convertToUiChatMessage(chatMessage, userId, isSeen, isLargeGroup);\n } else {\n return convertToUiSystemMessage(chatMessage);\n }\n});\nconst extractAttachmentMetadata = (metadata: Record<string, string>): AttachmentMetadata[] => {\n const attachmentMetadata = metadata.fileSharingMetadata;\n if (!attachmentMetadata) {\n return [];\n }\n try {\n return JSON.parse(attachmentMetadata);\n } catch (e) {\n console.error(e);\n return [];\n }\n};\nconst extractTeamsAttachmentsMetadata = (rawAttachments: ChatAttachment[]): {\n attachments: AttachmentMetadata[];\n} => {\n const attachments: AttachmentMetadata[] = [];\n rawAttachments.forEach(rawAttachment => {\n const attachmentType = rawAttachment.attachmentType as ChatAttachmentType;\n if (attachmentType === 'file') {\n attachments.push({\n id: rawAttachment.id,\n name: rawAttachment.name ?? '',\n url: extractAttachmentUrl(rawAttachment)\n });\n }\n });\n return {\n attachments\n };\n};\nconst extractAttachmentUrl = (attachment: ChatAttachment): string => {\n return attachment.previewUrl ? attachment.previewUrl : attachment.url || '';\n};\nconst processChatMessageContent = (message: ChatMessageWithStatus): string | undefined => {\n let content = message.content?.message;\n if (message.content?.attachments && message.content?.attachments.length > 0 && sanitizedMessageContentType(message.type).includes('html')) {\n const attachments: ChatAttachment[] = message.content?.attachments;\n // Fill in the src here\n if (content) {\n const document = new DOMParser().parseFromString(content ?? '', 'text/html');\n document.querySelectorAll('img').forEach(img => {\n const attachmentPreviewUrl = attachments.find(attachment => attachment.id === img.id)?.previewUrl;\n if (attachmentPreviewUrl) {\n const resourceCache = message.resourceCache?.[attachmentPreviewUrl];\n const src = getResourceSourceUrl(resourceCache);\n // if in error state\n if (src === undefined) {\n const brokenImageView = getBrokenImageViewNode(img);\n img.parentElement?.replaceChild(brokenImageView, img);\n } else {\n // else in loading or success state\n img.setAttribute('src', src);\n }\n setImageWidthAndHeight(img);\n }\n });\n content = document.body.innerHTML;\n }\n const teamsImageHtmlContent = attachments.filter(attachment => attachment.attachmentType === 'image' && attachment.previewUrl !== undefined && !message.content?.message?.includes(attachment.id)).map(attachment => generateImageAttachmentImgHtml(message, attachment)).join('');\n if (teamsImageHtmlContent) {\n return (content ?? '') + teamsImageHtmlContent;\n }\n }\n return content;\n};\nconst generateImageAttachmentImgHtml = (message: ChatMessageWithStatus, attachment: ChatAttachment): string => {\n if (attachment.previewUrl !== undefined) {\n const contentType = extractAttachmentContentTypeFromName(attachment.name);\n const resourceCache = message.resourceCache?.[attachment.previewUrl];\n const src = getResourceSourceUrl(resourceCache);\n // if in error state\n if (src === undefined) {\n return `\\r\\n<p>${getBrokenImageViewNode()}</p>`;\n }\n // else in loading or success state\n return `\\r\\n<p><img alt=\"image\" src=\"${src}\" itemscope=\"${contentType}\" id=\"${attachment.id}\"></p>`;\n }\n return '';\n};\nconst getResourceSourceUrl = (result?: ResourceFetchResult): string | undefined => {\n if (result) {\n if (!result.error && result.sourceUrl) {\n // return sourceUrl for success state\n return result.sourceUrl;\n } else {\n // return undefined for error state\n return undefined;\n }\n }\n // return empty string for loading state\n return '';\n};\nconst extractAttachmentContentTypeFromName = (name?: string): string => {\n if (name === undefined) {\n return '';\n }\n const indexOfLastDot = name.lastIndexOf('.');\n if (indexOfLastDot === undefined || indexOfLastDot < 0) {\n return '';\n }\n const contentType = name.substring(indexOfLastDot + 1);\n return contentType;\n};\nconst setImageWidthAndHeight = (img?: HTMLImageElement): void => {\n if (img) {\n // define aspect ratio explicitly to prevent image not being displayed correctly\n // in safari, this includes image placeholder for loading state\n const width = img.width;\n const height = img.height;\n img.style.aspectRatio = `${width}/${height}`;\n }\n};\nconst extractAttachmentsMetadata = (message: ChatMessageWithStatus): {\n attachments?: AttachmentMetadata[];\n} => {\n let attachments: AttachmentMetadata[] = [];\n if (message.metadata) {\n attachments = attachments.concat(extractAttachmentMetadata(message.metadata));\n }\n if (message.content?.attachments) {\n const teamsAttachments = extractTeamsAttachmentsMetadata(message.content?.attachments);\n attachments = attachments.concat(teamsAttachments.attachments);\n }\n return {\n attachments: attachments.length > 0 ? attachments : undefined\n };\n};\nconst convertToUiChatMessage = (message: ChatMessageWithStatus, userId: string, isSeen: boolean, isLargeGroup: boolean): ChatMessage => {\n const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;\n const {\n attachments\n } = extractAttachmentsMetadata(message);\n return {\n messageType: 'chat',\n createdOn: message.createdOn,\n content: processChatMessageContent(message),\n contentType: sanitizedMessageContentType(message.type),\n status: !isLargeGroup && message.status === 'delivered' && isSeen ? 'seen' : message.status,\n senderDisplayName: message.senderDisplayName,\n senderId: messageSenderId,\n messageId: message.id,\n clientMessageId: message.clientMessageId,\n editedOn: message.editedOn,\n deletedOn: message.deletedOn,\n mine: messageSenderId === userId,\n metadata: message.metadata,\n attachments\n };\n};\nconst convertToUiSystemMessage = (message: ChatMessageWithStatus): SystemMessage => {\n const systemMessageType = message.type;\n if (systemMessageType === 'participantAdded' || systemMessageType === 'participantRemoved') {\n return {\n messageType: 'system',\n systemMessageType,\n createdOn: message.createdOn,\n participants: message.content?.participants\n // TODO: In our moderator logic, we use undefined name as our displayName for moderator, which should be filtered out\n // Once we have a better solution to identify the moderator, remove this line\n ?.filter((participant: ChatParticipant) => participant.displayName && participant.displayName !== '').map((participant: ChatParticipant): CommunicationParticipant => ({\n userId: toFlatCommunicationIdentifier(participant.id),\n displayName: participant.displayName\n })) ?? [],\n messageId: message.id,\n iconName: systemMessageType === 'participantAdded' ? 'PeopleAdd' : 'PeopleBlock'\n };\n } else {\n // Only topic updated type left, according to ACSKnown type\n return {\n messageType: 'system',\n systemMessageType: 'topicUpdated',\n createdOn: message.createdOn,\n topic: message.content?.topic ?? '',\n messageId: message.id,\n iconName: 'Edit'\n };\n }\n};\n\n/**\n * Selector type for {@link MessageThread} component.\n *\n * @public\n */\nexport type MessageThreadSelector = (state: ChatClientState, props: ChatBaseSelectorProps) => {\n userId: string;\n showMessageStatus: boolean;\n messages: Message[];\n};\n\n/** Returns `true` if the message has participants and at least one participant has a display name. */\nconst hasValidParticipant = (chatMessage: ChatMessageWithStatus): boolean => !!chatMessage.content?.participants && chatMessage.content.participants.some((p: ChatParticipant) => !!p.displayName);\n\n/**\n *\n * @private\n */\nexport const messageThreadSelectorWithThread: () => MessageThreadSelector = () => createSelector([getUserId, getChatMessages, getLatestReadTime, getIsLargeGroup, getReadReceipts, getParticipants], (userId, chatMessages, latestReadTime, isLargeGroup, readReceipts = [], participants) => {\n // We can't get displayName in teams meeting interop for now, disable rr feature when it is teams interop\n const isTeamsInterop = Object.values(participants).find(p => 'microsoftTeamsUserId' in p.id) !== undefined;\n\n // get number of participants\n // filter out the non valid participants (no display name)\n // Read Receipt details will be disabled when participant count is 0\n const participantCount = isTeamsInterop ? undefined : Object.values(participants).filter(p => p.displayName && p.displayName !== '').length;\n\n // creating key value pairs of senderID: last read message information\n\n const readReceiptsBySenderId: ReadReceiptsBySenderId = {};\n\n // readReceiptsBySenderId[senderID] gets updated every time a new message is read by this sender\n // in this way we can make sure that we are only saving the latest read message id and read on time for each sender\n readReceipts.filter(r => r.sender && toFlatCommunicationIdentifier(r.sender) !== userId).forEach(r => {\n readReceiptsBySenderId[toFlatCommunicationIdentifier(r.sender)] = {\n lastReadMessage: r.chatMessageId,\n displayName: participants[toFlatCommunicationIdentifier(r.sender)]?.displayName ?? ''\n };\n });\n\n // A function takes parameter above and generate return value\n const convertedMessages = memoizedAllConvertChatMessage(memoizedFn => Object.values(chatMessages).filter(message => message.type.toLowerCase() === ACSKnownMessageType.text || message.type.toLowerCase() === ACSKnownMessageType.richtextHtml || message.type.toLowerCase() === ACSKnownMessageType.html || message.type === ACSKnownMessageType.participantAdded && hasValidParticipant(message) || message.type === ACSKnownMessageType.participantRemoved && hasValidParticipant(message) ||\n // TODO: Add support for topicUpdated system messages in MessageThread component.\n // message.type === ACSKnownMessageType.topicUpdated ||\n message.clientMessageId !== undefined).filter(isMessageValidToRender).map(message => {\n return memoizedFn(message.id ?? message.clientMessageId, message, userId, message.createdOn <= latestReadTime, isLargeGroup);\n }));\n updateMessagesWithAttached(convertedMessages);\n return {\n userId,\n showMessageStatus: true,\n messages: convertedMessages,\n participantCount,\n readReceiptsBySenderId\n };\n});\nconst sanitizedMessageContentType = (type: string): MessageContentType => {\n const lowerCaseType = type.toLowerCase();\n return lowerCaseType === 'text' || lowerCaseType === 'html' || lowerCaseType === 'richtext/html' ? lowerCaseType : 'unknown';\n};\nconst getBrokenImageViewNode = (img?: HTMLDivElement): HTMLDivElement => {\n const wrapper = document.createElement('div');\n Array.from(img?.attributes ?? []).forEach(attr => {\n wrapper.setAttribute(attr.nodeName, attr.nodeValue ?? '');\n });\n wrapper.setAttribute('class', 'broken-image-wrapper');\n wrapper.setAttribute('data-ui-id', 'broken-image-icon');\n return wrapper;\n};\nconst isMessageValidToRender = (message: ChatMessageWithStatus): boolean => {\n if (message.deletedOn) {\n return false;\n }\n if (message.metadata?.fileSharingMetadata || message.content?.attachments?.length) {\n return true;\n }\n return !!(message.content && message.content?.message !== '');\n};\n\n/**\n * Selector for {@link MessageThread} component.\n *\n * @public\n */\nexport const messageThreadSelector: MessageThreadSelector = messageThreadSelectorWithThread();"]}
@@ -7,7 +7,7 @@ export const updateMessagesWithAttached = (chatMessagesWithStatus) => {
7
7
  chatMessagesWithStatus.sort(compareMessages);
8
8
  chatMessagesWithStatus.forEach((message, index, messages) => {
9
9
  var _a, _b;
10
- if (message.messageType === 'chat' || message.messageType === 'blocked') {
10
+ if (message.messageType === 'chat') {
11
11
  /**
12
12
  * Attached === true means it is within a group of messages in the current order
13
13
  * Attached === top/bottom means it is on the top/bottom boundary
@@ -17,8 +17,8 @@ export const updateMessagesWithAttached = (chatMessagesWithStatus) => {
17
17
  let attached = false;
18
18
  const previousMessage = index > 0 ? messages[index - 1] : undefined;
19
19
  const nextMessage = index === messages.length - 1 ? undefined : messages[index + 1];
20
- const previousSenderId = (previousMessage === null || previousMessage === void 0 ? void 0 : previousMessage.messageType) === 'chat' || (previousMessage === null || previousMessage === void 0 ? void 0 : previousMessage.messageType) === 'blocked' ? previousMessage.senderId : undefined;
21
- const nextSenderId = (nextMessage === null || nextMessage === void 0 ? void 0 : nextMessage.messageType) === 'chat' || (nextMessage === null || nextMessage === void 0 ? void 0 : nextMessage.messageType) === 'blocked' ? nextMessage.senderId : undefined;
20
+ const previousSenderId = (previousMessage === null || previousMessage === void 0 ? void 0 : previousMessage.messageType) === 'chat' ? previousMessage.senderId : undefined;
21
+ const nextSenderId = (nextMessage === null || nextMessage === void 0 ? void 0 : nextMessage.messageType) === 'chat' ? nextMessage.senderId : undefined;
22
22
  const timediff = new Date((_a = message === null || message === void 0 ? void 0 : message.createdOn) !== null && _a !== void 0 ? _a : '').getTime() - new Date((_b = previousMessage === null || previousMessage === void 0 ? void 0 : previousMessage.createdOn) !== null && _b !== void 0 ? _b : '').getTime();
23
23
  const diffMins = Math.round(timediff / MINUTE_IN_MS); // minutes
24
24
  if (previousSenderId !== message.senderId) {
@@ -1 +1 @@
1
- {"version":3,"file":"updateMessagesWithAttached.js","sourceR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C,CAAC,CAAC,SAAS,CAAC;YACtI,MAAM,QAAQ,GAAG,IAAI,IAAI,CAAC,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,SAAS,mCAAI,EAAE,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,CAAC,MAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,SAAS,mCAAI,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC;YACrH,MAAM,QAAQ,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,YAAY,CAAC,CAAC,CAAC,UAAU;YAEhE,IAAI,gBAAgB,KAAK,OAAO,CAAC,QAAQ,EAAE,CAAC;gBAC1C,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;YAC/D,CAAC;iBAAM,IAAI,QAAQ,IAAI,QAAQ,IAAI,CAAC,EAAE,CAAC;gBACrC,wGAAwG;gBACxG,QAAQ,GAAG,KAAK,CAAC;YACnB,CAAC;iBAAM,CAAC;gBACN,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;YACjE,CAAC;YACD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC9B,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { Message, MessageAttachedStatus } from '@internal/react-components';\nimport { compareMessages } from './compareMessages';\nimport { MINUTE_IN_MS } from './constants';\n\n/**\n * @private\n */\nexport const updateMessagesWithAttached = (chatMessagesWithStatus: Message[]): void => {\n chatMessagesWithStatus.sort(compareMessages);\n chatMessagesWithStatus.forEach((message, index, messages) => {\n if (message.messageType === 'chat' || message.messageType === 'blocked') {\n /**\n * Attached === true means it is within a group of messages in the current order\n * Attached === top/bottom means it is on the top/bottom boundary\n * Attached === false means it is just a single message\n * A group of messages: continuous messages that belong to the same sender and not intercepted by other senders.\n */\n let attached: boolean | MessageAttachedStatus = false;\n const previousMessage = index > 0 ? messages[index - 1] : undefined;\n const nextMessage = index === messages.length - 1 ? undefined : messages[index + 1];\n const previousSenderId = previousMessage?.messageType === 'chat' || previousMessage?.messageType === 'blocked' ? previousMessage.senderId : undefined;\n const nextSenderId = nextMessage?.messageType === 'chat' || nextMessage?.messageType === 'blocked' ? nextMessage.senderId : undefined;\n const timediff = new Date(message?.createdOn ?? '').getTime() - new Date(previousMessage?.createdOn ?? '').getTime();\n const diffMins = Math.round(timediff / MINUTE_IN_MS); // minutes\n\n if (previousSenderId !== message.senderId) {\n attached = message.senderId === nextSenderId ? 'top' : false;\n } else if (diffMins && diffMins >= 5) {\n // if there are more than or equal to 5 mins time gap between messages do not attach and show time stamp\n attached = false;\n } else {\n attached = message.senderId === nextSenderId ? true : 'bottom';\n }\n message.attached = attached;\n }\n });\n};"]}
1
+ {"version":3,"file":"updateMessagesWithAttached.js","sourceRoot":"","sources":["../../../../../preprocess-dist/chat-component-bindings/src/utils/updateMessagesWithAttached.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAG,CAAC,sBAAiC,EAAQ,EAAE;IACpF,sBAAsB,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IAC7C,sBAAsB,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE;;QAC1D,IAAI,OAAO,CAAC,WAAW,KAAK,MAAM,EAAE,CAAC;YACnC;;;;;eAKG;YACH,IAAI,QAAQ,GAAoC,KAAK,CAAC;YACtD,MAAM,eAAe,GAAG,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAA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AAI,CAAC,CAAC,CAAC,QAAQ,CAAC;YACjE,CAAC;YACD,OAAO,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC9B,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\nimport { Message, MessageAttachedStatus } from '@internal/react-components';\nimport { compareMessages } from './compareMessages';\nimport { MINUTE_IN_MS } from './constants';\n\n/**\n * @private\n */\nexport const updateMessagesWithAttached = (chatMessagesWithStatus: Message[]): void => {\n chatMessagesWithStatus.sort(compareMessages);\n chatMessagesWithStatus.forEach((message, index, messages) => {\n if (message.messageType === 'chat') {\n /**\n * Attached === true means it is within a group of messages in the current order\n * Attached === top/bottom means it is on the top/bottom boundary\n * Attached === false means it is just a single message\n * A group of messages: continuous messages that belong to the same sender and not intercepted by other senders.\n */\n let attached: boolean | MessageAttachedStatus = false;\n const previousMessage = index > 0 ? messages[index - 1] : undefined;\n const nextMessage = index === messages.length - 1 ? undefined : messages[index + 1];\n const previousSenderId = previousMessage?.messageType === 'chat' ? previousMessage.senderId : undefined;\n const nextSenderId = nextMessage?.messageType === 'chat' ? nextMessage.senderId : undefined;\n const timediff = new Date(message?.createdOn ?? '').getTime() - new Date(previousMessage?.createdOn ?? '').getTime();\n const diffMins = Math.round(timediff / MINUTE_IN_MS); // minutes\n\n if (previousSenderId !== message.senderId) {\n attached = message.senderId === nextSenderId ? 'top' : false;\n } else if (diffMins && diffMins >= 5) {\n // if there are more than or equal to 5 mins time gap between messages do not attach and show time stamp\n attached = false;\n } else {\n attached = message.senderId === nextSenderId ? true : 'bottom';\n }\n message.attached = attached;\n }\n });\n};"]}
@@ -86,21 +86,7 @@ export type ChatThreadClientState = {
86
86
  */
87
87
  export type ChatThreadProperties = {
88
88
  topic?: string;
89
- createdBy?: CommunicationIdentifierKind;
90
- messagingPolicy?: MessagingPolicy;
91
89
  };
92
- /**
93
- *
94
- * Messaging policy of a chat thread.
95
- *
96
- * @beta
97
- */
98
- export interface MessagingPolicy {
99
- /**
100
- * Boolean to track whether or not messages are restricted to only text.
101
- * */
102
- textOnlyChat?: boolean;
103
- }
104
90
  /**
105
91
  * Errors teed from API calls to the Chat SDK.
106
92
  *
@@ -136,5 +122,5 @@ export declare class ChatError extends Error {
136
122
  *
137
123
  * @public
138
124
  */
139
- export type ChatErrorTarget = 'ChatClient.createChatThread' | 'ChatClient.deleteChatThread' | 'ChatClient.getChatThreadClient' | 'ChatClient.listChatThreads' | 'ChatClient.off' | 'ChatClient.on' | 'ChatClient.startRealtimeNotifications' | 'ChatClient.stopRealtimeNotifications' | 'ChatThreadClient.addParticipants' | 'ChatThreadClient.deleteMessage' | 'ChatThreadClient.getMessage' | 'ChatThreadClient.getProperties' | 'ChatThreadClient.listMessages' | 'ChatThreadClient.listParticipants' | 'ChatThreadClient.listReadReceipts' | 'ChatThreadClient.removeParticipant' | 'ChatThreadClient.sendMessage' | 'ChatThreadClient.sendReadReceipt' | 'ChatThreadClient.sendTypingNotification' | 'ChatThreadClient.updateMessage' | 'ChatThreadClient.updateProperties' | 'ChatThreadClient.updateTopic' | 'ChatThreadClient.uploadImage' | 'ChatThreadClient.deleteImage';
125
+ export type ChatErrorTarget = 'ChatClient.createChatThread' | 'ChatClient.deleteChatThread' | 'ChatClient.getChatThreadClient' | 'ChatClient.listChatThreads' | 'ChatClient.off' | 'ChatClient.on' | 'ChatClient.startRealtimeNotifications' | 'ChatClient.stopRealtimeNotifications' | 'ChatThreadClient.addParticipants' | 'ChatThreadClient.deleteMessage' | 'ChatThreadClient.getMessage' | 'ChatThreadClient.getProperties' | 'ChatThreadClient.listMessages' | 'ChatThreadClient.listParticipants' | 'ChatThreadClient.listReadReceipts' | 'ChatThreadClient.removeParticipant' | 'ChatThreadClient.sendMessage' | 'ChatThreadClient.sendReadReceipt' | 'ChatThreadClient.sendTypingNotification' | 'ChatThreadClient.updateMessage' | 'ChatThreadClient.updateTopic';
140
126
  //# sourceMappingURL=ChatClientState.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatClientState.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/ChatClientState.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAsHlC;;;;GAIG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IAalC,YAAY,MAAuB,EAAE,UAAiB,EAAE,SAAgB;QACtE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,8EAA8E;QAC9E,IAAI,CAAC,SAAS,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACnD,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,GAAG,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;IAC9D,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatMessageReadReceipt, ChatParticipant } from '@azure/communication-chat';\nimport { CommunicationIdentifierKind } from '@azure/communication-common';\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\nimport { TypingIndicatorReceivedEvent } from '@azure/communication-chat';\n\n/**\n * Centralized state for {@link @azure/communication-chat#ChatClient}.\n *\n * @public\n */\nexport type ChatClientState = {\n /**\n * Identifier of the current user.\n */\n userId: CommunicationIdentifierKind;\n /**\n * DisplayName of the current user.\n * The same value as what others see in {@link @azure/communication-chat#ChatParticipant.displayName}\n */\n displayName: string;\n /**\n * Chat threads joined by the current user.\n * Object with {@link ChatThreadClientState} fields, keyed by {@link ChatThreadClientState.threadId}.\n */\n threads: {\n [key: string]: ChatThreadClientState;\n };\n /**\n * Stores the latest error for each API method.\n *\n * See documentation of {@link ChatErrors} for details.\n */\n latestErrors: ChatErrors;\n};\n\n/**\n * Centralized state for {@link @azure/communication-chat#ChatThreadClient}.\n *\n * @public\n */\nexport type ChatThreadClientState = {\n /**\n * Messages in this thread.\n * Object with {@link ChatMessageWithStatus} entries\n * Local messages are keyed by keyed by {@link ChatMessageWithStatus.clientMessageId}.\n * Remote messages are keyed by {@link @azure/communication-chat#ChatMessage.id}.\n */\n chatMessages: {\n [key: string]: ChatMessageWithStatus;\n };\n /**\n * Participants of this chat thread.\n *\n * Object with {@link @azure/communication-chat#ChatParticipant} fields,\n * keyed by {@link @azure/communication-chat#ChatParticipant.id}.\n */\n participants: {\n [key: string]: ChatParticipant;\n };\n /**\n * Id of this chat thread. Returned from {@link @azure/communication-chat#ChatThreadClient.threadId}\n */\n threadId: string;\n /**\n * An object containing properties of this chat thread.\n */\n properties?: ChatThreadProperties;\n /**\n * An array of ReadReceipts of this chat thread. Returned from {@link @azure/communication-chat#ChatThreadClient.listReadReceipts}\n */\n readReceipts: ChatMessageReadReceipt[];\n /**\n * An array of typingIndicators of this chat thread. Captured from event listener of {@link @azure/communication-chat#ChatClient}\n * Stateful client only stores recent 8000ms real-time typing indicators data.\n */\n typingIndicators: TypingIndicatorReceivedEvent[];\n /**\n * Latest timestamp when other users read messages sent by current user.\n */\n latestReadTime: Date;\n};\n\n/**\n * Properties of a chat thread.\n *\n * We define a minimal one that helps us hide the different types used by underlying API.\n *\n * @public\n */\nexport type ChatThreadProperties = {\n topic?: string;\n createdBy?: CommunicationIdentifierKind;\n messagingPolicy?: MessagingPolicy;\n};\n/**\n *\n * Messaging policy of a chat thread.\n *\n * @beta\n */\nexport interface MessagingPolicy {\n /**\n * Boolean to track whether or not messages are restricted to only text.\n * */\n textOnlyChat?: boolean;\n}\n\n/**\n * Errors teed from API calls to the Chat SDK.\n *\n * Each property in the object stores the latest error for a particular SDK API method.\n *\n * @public\n */\nexport type ChatErrors = { [target in ChatErrorTarget]: ChatError };\n\n/**\n * Error thrown from failed {@link StatefulChatClient} methods.\n *\n * @public\n */\nexport class ChatError extends Error {\n /**\n * The API method target that failed.\n */\n public target: ChatErrorTarget;\n /**\n * Error thrown by the failed SDK method.\n */\n public innerError: Error;\n /**\n * Timestamp added to the error by the stateful layer.\n */\n public timestamp: Date;\n constructor(target: ChatErrorTarget, innerError: Error, timestamp?: Date) {\n super();\n this.target = target;\n this.innerError = innerError;\n // Testing note: It is easier to mock Date::now() than the Date() constructor.\n this.timestamp = timestamp ?? new Date(Date.now());\n this.name = 'ChatError';\n this.message = `${this.target}: ${this.innerError.message}`;\n }\n}\n\n/**\n * String literal type for all permissible keys in {@link ChatErrors}.\n *\n * @public\n */\nexport type ChatErrorTarget = 'ChatClient.createChatThread' | 'ChatClient.deleteChatThread' | 'ChatClient.getChatThreadClient' | 'ChatClient.listChatThreads' | 'ChatClient.off' | 'ChatClient.on' | 'ChatClient.startRealtimeNotifications' | 'ChatClient.stopRealtimeNotifications' | 'ChatThreadClient.addParticipants' | 'ChatThreadClient.deleteMessage' | 'ChatThreadClient.getMessage' | 'ChatThreadClient.getProperties' | 'ChatThreadClient.listMessages' | 'ChatThreadClient.listParticipants' | 'ChatThreadClient.listReadReceipts' | 'ChatThreadClient.removeParticipant' | 'ChatThreadClient.sendMessage' | 'ChatThreadClient.sendReadReceipt' | 'ChatThreadClient.sendTypingNotification' | 'ChatThreadClient.updateMessage' | 'ChatThreadClient.updateProperties' | 'ChatThreadClient.updateTopic' | 'ChatThreadClient.uploadImage' | 'ChatThreadClient.deleteImage';"]}
1
+ {"version":3,"file":"ChatClientState.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/ChatClientState.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAuGlC;;;;GAIG;AACH,MAAM,OAAO,SAAU,SAAQ,KAAK;IAalC,YAAY,MAAuB,EAAE,UAAiB,EAAE,SAAgB;QACtE,KAAK,EAAE,CAAC;QACR,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,8EAA8E;QAC9E,IAAI,CAAC,SAAS,GAAG,SAAS,aAAT,SAAS,cAAT,SAAS,GAAI,IAAI,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC;QACnD,IAAI,CAAC,IAAI,GAAG,WAAW,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,GAAG,IAAI,CAAC,MAAM,KAAK,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;IAC9D,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatMessageReadReceipt, ChatParticipant } from '@azure/communication-chat';\nimport { CommunicationIdentifierKind } from '@azure/communication-common';\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\nimport { TypingIndicatorReceivedEvent } from '@azure/communication-chat';\n\n/**\n * Centralized state for {@link @azure/communication-chat#ChatClient}.\n *\n * @public\n */\nexport type ChatClientState = {\n /**\n * Identifier of the current user.\n */\n userId: CommunicationIdentifierKind;\n /**\n * DisplayName of the current user.\n * The same value as what others see in {@link @azure/communication-chat#ChatParticipant.displayName}\n */\n displayName: string;\n /**\n * Chat threads joined by the current user.\n * Object with {@link ChatThreadClientState} fields, keyed by {@link ChatThreadClientState.threadId}.\n */\n threads: {\n [key: string]: ChatThreadClientState;\n };\n /**\n * Stores the latest error for each API method.\n *\n * See documentation of {@link ChatErrors} for details.\n */\n latestErrors: ChatErrors;\n};\n\n/**\n * Centralized state for {@link @azure/communication-chat#ChatThreadClient}.\n *\n * @public\n */\nexport type ChatThreadClientState = {\n /**\n * Messages in this thread.\n * Object with {@link ChatMessageWithStatus} entries\n * Local messages are keyed by keyed by {@link ChatMessageWithStatus.clientMessageId}.\n * Remote messages are keyed by {@link @azure/communication-chat#ChatMessage.id}.\n */\n chatMessages: {\n [key: string]: ChatMessageWithStatus;\n };\n /**\n * Participants of this chat thread.\n *\n * Object with {@link @azure/communication-chat#ChatParticipant} fields,\n * keyed by {@link @azure/communication-chat#ChatParticipant.id}.\n */\n participants: {\n [key: string]: ChatParticipant;\n };\n /**\n * Id of this chat thread. Returned from {@link @azure/communication-chat#ChatThreadClient.threadId}\n */\n threadId: string;\n /**\n * An object containing properties of this chat thread.\n */\n properties?: ChatThreadProperties;\n /**\n * An array of ReadReceipts of this chat thread. Returned from {@link @azure/communication-chat#ChatThreadClient.listReadReceipts}\n */\n readReceipts: ChatMessageReadReceipt[];\n /**\n * An array of typingIndicators of this chat thread. Captured from event listener of {@link @azure/communication-chat#ChatClient}\n * Stateful client only stores recent 8000ms real-time typing indicators data.\n */\n typingIndicators: TypingIndicatorReceivedEvent[];\n /**\n * Latest timestamp when other users read messages sent by current user.\n */\n latestReadTime: Date;\n};\n\n/**\n * Properties of a chat thread.\n *\n * We define a minimal one that helps us hide the different types used by underlying API.\n *\n * @public\n */\nexport type ChatThreadProperties = {\n topic?: string;\n};\n/**\n * Errors teed from API calls to the Chat SDK.\n *\n * Each property in the object stores the latest error for a particular SDK API method.\n *\n * @public\n */\nexport type ChatErrors = { [target in ChatErrorTarget]: ChatError };\n\n/**\n * Error thrown from failed {@link StatefulChatClient} methods.\n *\n * @public\n */\nexport class ChatError extends Error {\n /**\n * The API method target that failed.\n */\n public target: ChatErrorTarget;\n /**\n * Error thrown by the failed SDK method.\n */\n public innerError: Error;\n /**\n * Timestamp added to the error by the stateful layer.\n */\n public timestamp: Date;\n constructor(target: ChatErrorTarget, innerError: Error, timestamp?: Date) {\n super();\n this.target = target;\n this.innerError = innerError;\n // Testing note: It is easier to mock Date::now() than the Date() constructor.\n this.timestamp = timestamp ?? new Date(Date.now());\n this.name = 'ChatError';\n this.message = `${this.target}: ${this.innerError.message}`;\n }\n}\n\n/**\n * String literal type for all permissible keys in {@link ChatErrors}.\n *\n * @public\n */\nexport type ChatErrorTarget = 'ChatClient.createChatThread' | 'ChatClient.deleteChatThread' | 'ChatClient.getChatThreadClient' | 'ChatClient.listChatThreads' | 'ChatClient.off' | 'ChatClient.on' | 'ChatClient.startRealtimeNotifications' | 'ChatClient.stopRealtimeNotifications' | 'ChatThreadClient.addParticipants' | 'ChatThreadClient.deleteMessage' | 'ChatThreadClient.getMessage' | 'ChatThreadClient.getProperties' | 'ChatThreadClient.listMessages' | 'ChatThreadClient.listParticipants' | 'ChatThreadClient.listReadReceipts' | 'ChatThreadClient.removeParticipant' | 'ChatThreadClient.sendMessage' | 'ChatThreadClient.sendReadReceipt' | 'ChatThreadClient.sendTypingNotification' | 'ChatThreadClient.updateMessage' | 'ChatThreadClient.updateTopic';"]}
@@ -9,7 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  step((generator = generator.apply(thisArg, _arguments || [])).next());
10
10
  });
11
11
  };
12
- import EventEmitter from 'events';
12
+ import { EventEmitter } from 'events';
13
13
  import { enableMapSet, enablePatches, produce } from 'immer';
14
14
  import { ChatError } from './ChatClientState';
15
15
  import { createClientLogger, getLogLevel } from '@azure/logger';