@azure/communication-react 1.21.0-beta.1 → 1.21.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 (573) hide show
  1. package/dist/communication-react.d.ts +77 -1694
  2. package/dist/dist-cjs/communication-react/index.js +36324 -167
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/common.d.ts +0 -13
  5. package/dist/dist-esm/acs-ui-common/src/common.js.map +1 -1
  6. package/dist/dist-esm/acs-ui-common/src/constants.d.ts +0 -5
  7. package/dist/dist-esm/acs-ui-common/src/constants.js +0 -5
  8. package/dist/dist-esm/acs-ui-common/src/constants.js.map +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/index.d.ts +0 -4
  10. package/dist/dist-esm/acs-ui-common/src/index.js +0 -3
  11. package/dist/dist-esm/acs-ui-common/src/index.js.map +1 -1
  12. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  13. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  14. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +0 -8
  15. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +0 -11
  16. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  17. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js +0 -2
  18. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js.map +1 -1
  19. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +0 -2
  20. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +1 -7
  21. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  22. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +1 -5
  23. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
  24. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js +1 -19
  25. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map +1 -1
  26. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.d.ts +2 -1
  27. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js.map +1 -1
  28. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js +1 -35
  29. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js.map +1 -1
  30. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.d.ts +0 -1
  31. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +1 -3
  32. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
  33. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.d.ts +1 -1
  34. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js +3 -3
  35. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js.map +1 -1
  36. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.d.ts +1 -1
  37. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +2 -2
  38. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
  39. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js +0 -4
  40. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js.map +1 -1
  41. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +2 -79
  42. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  43. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +0 -15
  44. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +2 -95
  45. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  46. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +0 -5
  47. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +4 -27
  48. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  49. package/dist/dist-esm/calling-stateful-client/src/Converter.js +0 -3
  50. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  51. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js.map +1 -1
  52. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.d.ts +0 -1
  53. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.js +1 -7
  54. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.js.map +1 -1
  55. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
  56. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js +0 -17
  57. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js.map +1 -1
  58. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +0 -3
  59. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  60. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.d.ts +2 -6
  61. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js +2 -35
  62. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
  63. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.d.ts +1 -2
  64. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js +0 -3
  65. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js.map +1 -1
  66. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +2 -25
  67. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  68. package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js +3 -3
  69. package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js.map +1 -1
  70. package/dist/dist-esm/chat-stateful-client/src/ChatClientState.d.ts +1 -15
  71. package/dist/dist-esm/chat-stateful-client/src/ChatClientState.js.map +1 -1
  72. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js +1 -2
  73. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js.map +1 -1
  74. package/dist/dist-esm/chat-stateful-client/src/index.d.ts +0 -1
  75. package/dist/dist-esm/chat-stateful-client/src/index.js.map +1 -1
  76. package/dist/dist-esm/communication-react/src/index.d.ts +3 -29
  77. package/dist/dist-esm/communication-react/src/index.js +2 -7
  78. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  79. package/dist/dist-esm/react-components/src/components/Announcer.js +1 -1
  80. package/dist/dist-esm/react-components/src/components/Announcer.js.map +1 -1
  81. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.d.ts +0 -2
  82. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js +0 -1
  83. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js.map +1 -1
  84. package/dist/dist-esm/react-components/src/components/CameraButton.js +10 -1
  85. package/dist/dist-esm/react-components/src/components/CameraButton.js.map +1 -1
  86. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +3 -3
  87. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
  88. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +1 -13
  89. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js +3 -9
  90. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
  91. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +0 -11
  92. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +2 -32
  93. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  94. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.d.ts +1 -8
  95. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js +5 -9
  96. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
  97. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.d.ts +1 -2
  98. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js +4 -4
  99. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js.map +1 -1
  100. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.d.ts +1 -4
  101. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js +6 -31
  102. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js.map +1 -1
  103. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.d.ts +1 -15
  104. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js +0 -9
  105. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js.map +1 -1
  106. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +2 -23
  107. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js +6 -17
  108. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
  109. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.d.ts +1 -8
  110. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js +6 -10
  111. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
  112. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +5 -5
  113. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
  114. package/dist/dist-esm/react-components/src/components/DevicePermissions/DevicePermissionDropdown.d.ts +4 -0
  115. package/dist/dist-esm/react-components/src/components/DevicePermissions/DevicePermissionDropdown.js +18 -3
  116. package/dist/dist-esm/react-components/src/components/DevicePermissions/DevicePermissionDropdown.js.map +1 -1
  117. package/dist/dist-esm/react-components/src/components/ImageOverlay.js +0 -2
  118. package/dist/dist-esm/react-components/src/components/ImageOverlay.js.map +1 -1
  119. package/dist/dist-esm/react-components/src/components/InputBoxComponent.d.ts +0 -2
  120. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +0 -15
  121. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
  122. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js +2 -2
  123. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js.map +1 -1
  124. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +5 -81
  125. package/dist/dist-esm/react-components/src/components/MessageThread.js +3 -13
  126. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  127. package/dist/dist-esm/react-components/src/components/ModalClone/ModalClone.d.ts +1 -0
  128. package/dist/dist-esm/react-components/src/components/ModalClone/ModalClone.js +2 -2
  129. package/dist/dist-esm/react-components/src/components/ModalClone/ModalClone.js.map +1 -1
  130. package/dist/dist-esm/react-components/src/components/NotificationStack.d.ts +0 -20
  131. package/dist/dist-esm/react-components/src/components/NotificationStack.js +0 -5
  132. package/dist/dist-esm/react-components/src/components/NotificationStack.js.map +1 -1
  133. package/dist/dist-esm/react-components/src/components/ParticipantList.d.ts +0 -15
  134. package/dist/dist-esm/react-components/src/components/ParticipantList.js +3 -12
  135. package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
  136. package/dist/dist-esm/react-components/src/components/ReactionButton.d.ts +6 -1
  137. package/dist/dist-esm/react-components/src/components/ReactionButton.js.map +1 -1
  138. package/dist/dist-esm/react-components/src/components/SendBox.d.ts +1 -47
  139. package/dist/dist-esm/react-components/src/components/SendBox.js +6 -57
  140. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  141. package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.js +4 -7
  142. package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.js.map +1 -1
  143. package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js +0 -1
  144. package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js.map +1 -1
  145. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js +0 -1
  146. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js.map +1 -1
  147. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js +0 -19
  148. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js.map +1 -1
  149. package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js +0 -1
  150. package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js.map +1 -1
  151. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js +23 -21
  152. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js.map +1 -1
  153. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js +1 -1
  154. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoEffectsItem.js.map +1 -1
  155. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js +2 -2
  156. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js.map +1 -1
  157. package/dist/dist-esm/react-components/src/components/VideoGallery.js +1 -1
  158. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  159. package/dist/dist-esm/react-components/src/components/VideoTile.js +3 -3
  160. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  161. package/dist/dist-esm/react-components/src/components/index.d.ts +1 -21
  162. package/dist/dist-esm/react-components/src/components/index.js +0 -7
  163. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  164. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.d.ts +1 -1
  165. package/dist/dist-esm/react-components/src/components/styles/AttachmentCardGroup.styles.d.ts +1 -1
  166. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js +10 -2
  167. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js.map +1 -1
  168. package/dist/dist-esm/react-components/src/components/styles/CaptionsSettingsModal.styles.js +6 -2
  169. package/dist/dist-esm/react-components/src/components/styles/CaptionsSettingsModal.styles.js.map +1 -1
  170. package/dist/dist-esm/react-components/src/components/styles/ControlBar.styles.js +1 -2
  171. package/dist/dist-esm/react-components/src/components/styles/ControlBar.styles.js.map +1 -1
  172. package/dist/dist-esm/react-components/src/components/styles/MessageBarLink.styles.d.ts +11 -0
  173. package/dist/dist-esm/react-components/src/components/styles/MessageBarLink.styles.js +21 -0
  174. package/dist/dist-esm/react-components/src/components/styles/MessageBarLink.styles.js.map +1 -0
  175. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +3 -3
  176. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +0 -8
  177. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  178. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.d.ts +2 -0
  179. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js +6 -0
  180. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js.map +1 -1
  181. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.d.ts +1 -37
  182. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js +3 -30
  183. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js.map +1 -1
  184. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.d.ts +2 -4
  185. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js +2 -9
  186. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
  187. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +1 -38
  188. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +4 -131
  189. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  190. package/dist/dist-esm/react-components/src/components/utils/common.js +0 -2
  191. package/dist/dist-esm/react-components/src/components/utils/common.js.map +1 -1
  192. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.d.ts +1 -2
  193. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.js.map +1 -1
  194. package/dist/dist-esm/react-components/src/components/utils.js +1 -6
  195. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  196. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.d.ts +0 -4
  197. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js +1 -3
  198. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js.map +1 -1
  199. package/dist/dist-esm/react-components/src/index.d.ts +2 -1
  200. package/dist/dist-esm/react-components/src/index.js +2 -0
  201. package/dist/dist-esm/react-components/src/index.js.map +1 -1
  202. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +0 -54
  203. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
  204. package/dist/dist-esm/react-components/src/localization/locales/es-MX/ComponentLocale.d.ts +8 -0
  205. package/dist/dist-esm/react-components/src/localization/locales/es-MX/ComponentLocale.js +13 -0
  206. package/dist/dist-esm/react-components/src/localization/locales/es-MX/ComponentLocale.js.map +1 -0
  207. package/dist/dist-esm/react-components/src/localization/locales/es-MX/strings.json +692 -0
  208. package/dist/dist-esm/react-components/src/localization/locales/fr-CA/ComponentLocale.d.ts +8 -0
  209. package/dist/dist-esm/react-components/src/localization/locales/fr-CA/ComponentLocale.js +13 -0
  210. package/dist/dist-esm/react-components/src/localization/locales/fr-CA/ComponentLocale.js.map +1 -0
  211. package/dist/dist-esm/react-components/src/localization/locales/fr-CA/strings.json +692 -0
  212. package/dist/dist-esm/react-components/src/theming/icons.d.ts +0 -30
  213. package/dist/dist-esm/react-components/src/theming/icons.js +0 -90
  214. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  215. package/dist/dist-esm/react-components/src/theming/themes.d.ts +0 -6
  216. package/dist/dist-esm/react-components/src/theming/themes.js +0 -9
  217. package/dist/dist-esm/react-components/src/theming/themes.js.map +1 -1
  218. package/dist/dist-esm/react-components/src/types/Attachment.d.ts +0 -13
  219. package/dist/dist-esm/react-components/src/types/Attachment.js.map +1 -1
  220. package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +1 -20
  221. package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
  222. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +0 -72
  223. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +8 -21
  224. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  225. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +0 -34
  226. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  227. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +5 -47
  228. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +7 -105
  229. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  230. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +1 -24
  231. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js +1 -1
  232. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  233. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +0 -2
  234. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  235. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +2 -8
  236. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  237. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.d.ts +1 -2
  238. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js +0 -19
  239. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js.map +1 -1
  240. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js +7 -10
  241. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js.map +1 -1
  242. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.d.ts +1 -2
  243. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js +0 -19
  244. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js.map +1 -1
  245. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/HoldPane.js +1 -1
  246. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/HoldPane.js.map +1 -1
  247. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LobbyTile.js +1 -1
  248. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LobbyTile.js.map +1 -1
  249. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.d.ts +0 -1
  250. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +11 -10
  251. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
  252. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js +6 -5
  253. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js.map +1 -1
  254. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.d.ts +4 -0
  255. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.js.map +1 -1
  256. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js +4 -2
  257. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js.map +1 -1
  258. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.d.ts +0 -1
  259. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.js +1 -19
  260. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.js.map +1 -1
  261. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js +1 -2
  262. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js.map +1 -1
  263. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +0 -3
  264. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  265. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +0 -3
  266. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  267. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +2 -2
  268. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  269. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.d.ts +0 -7
  270. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +5 -41
  271. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  272. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js +2 -2
  273. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js.map +1 -1
  274. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js +2 -2
  275. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js.map +1 -1
  276. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/NoticePage.js +1 -1
  277. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/NoticePage.js.map +1 -1
  278. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js +2 -2
  279. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js.map +1 -1
  280. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +0 -18
  281. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +0 -16
  282. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  283. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/Buttons.styles.d.ts +0 -1
  284. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/Buttons.styles.js +0 -1
  285. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/Buttons.styles.js.map +1 -1
  286. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js +4 -2
  287. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js.map +1 -1
  288. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/NetworkReconnectTile.styles.d.ts +4 -0
  289. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/NetworkReconnectTile.styles.js +7 -0
  290. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/NetworkReconnectTile.styles.js.map +1 -1
  291. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +1 -12
  292. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +0 -59
  293. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  294. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/spotlightUtils.js +4 -0
  295. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/spotlightUtils.js.map +1 -1
  296. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +0 -65
  297. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +5 -24
  298. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  299. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.d.ts +0 -8
  300. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.js.map +1 -1
  301. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +3 -22
  302. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +2 -136
  303. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  304. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +3 -28
  305. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  306. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +0 -2
  307. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +0 -9
  308. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  309. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.d.ts +4 -10
  310. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +2 -14
  311. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
  312. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +0 -11
  313. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +1 -2
  314. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  315. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.d.ts +0 -5
  316. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js +0 -13
  317. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js.map +1 -1
  318. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts +0 -27
  319. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js +1 -2
  320. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
  321. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.d.ts +0 -2
  322. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +11 -189
  323. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  324. package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.d.ts +0 -20
  325. package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.js.map +1 -1
  326. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +2 -6
  327. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +0 -36
  328. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  329. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts +2 -12
  330. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
  331. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js +2 -13
  332. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js.map +1 -1
  333. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.d.ts +0 -2
  334. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
  335. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.d.ts +0 -4
  336. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js +0 -4
  337. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js.map +1 -1
  338. package/dist/dist-esm/react-composites/src/composites/common/AvatarPersona.js.map +1 -1
  339. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +2 -14
  340. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  341. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js +1 -2
  342. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js.map +1 -1
  343. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.d.ts +2 -41
  344. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js +0 -21
  345. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js.map +1 -1
  346. package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.js +6 -2
  347. package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.js.map +1 -1
  348. package/dist/dist-esm/react-composites/src/composites/common/adapters.d.ts +0 -23
  349. package/dist/dist-esm/react-composites/src/composites/common/adapters.js.map +1 -1
  350. package/dist/dist-esm/react-composites/src/composites/common/constants.d.ts +0 -5
  351. package/dist/dist-esm/react-composites/src/composites/common/constants.js +0 -5
  352. package/dist/dist-esm/react-composites/src/composites/common/constants.js.map +1 -1
  353. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +1 -32
  354. package/dist/dist-esm/react-composites/src/composites/common/icons.js +0 -2
  355. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  356. package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.d.ts +3 -1
  357. package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.js +9 -1
  358. package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.js.map +1 -1
  359. package/dist/dist-esm/react-composites/src/composites/common/utils.d.ts +0 -4
  360. package/dist/dist-esm/react-composites/src/composites/common/utils.js +0 -22
  361. package/dist/dist-esm/react-composites/src/composites/common/utils.js.map +1 -1
  362. package/dist/dist-esm/react-composites/src/composites/index.d.ts +2 -1
  363. package/dist/dist-esm/react-composites/src/composites/index.js +2 -0
  364. package/dist/dist-esm/react-composites/src/composites/index.js.map +1 -1
  365. package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json +2 -1
  366. package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +2 -1
  367. package/dist/dist-esm/react-composites/src/composites/localization/locales/cy-GB/strings.json +2 -1
  368. package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +2 -1
  369. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +2 -1
  370. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +2 -1
  371. package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +2 -1
  372. package/dist/dist-esm/react-composites/src/composites/localization/locales/es-MX/CompositeLocale.d.ts +8 -0
  373. package/dist/dist-esm/react-composites/src/composites/localization/locales/es-MX/CompositeLocale.js +15 -0
  374. package/dist/dist-esm/react-composites/src/composites/localization/locales/es-MX/CompositeLocale.js.map +1 -0
  375. package/dist/dist-esm/react-composites/src/composites/localization/locales/es-MX/strings.json +413 -0
  376. package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json +2 -1
  377. package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-CA/CompositeLocale.d.ts +8 -0
  378. package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-CA/CompositeLocale.js +15 -0
  379. package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-CA/CompositeLocale.js.map +1 -0
  380. package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-CA/strings.json +413 -0
  381. package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +2 -1
  382. package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/strings.json +2 -1
  383. package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +2 -1
  384. package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +2 -1
  385. package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +2 -1
  386. package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/strings.json +2 -1
  387. package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +2 -1
  388. package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/strings.json +2 -1
  389. package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +2 -1
  390. package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +2 -1
  391. package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/strings.json +2 -1
  392. package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +2 -1
  393. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +2 -1
  394. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +2 -1
  395. package/dist/tsdoc-metadata.json +1 -1
  396. package/package.json +10 -9
  397. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-Btn-7WaT.js +0 -202
  398. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-Btn-7WaT.js.map +0 -1
  399. package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-DuapxrE4.js +0 -50
  400. package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-DuapxrE4.js.map +0 -1
  401. package/dist/dist-cjs/communication-react/index-BqK17dpb.js +0 -42876
  402. package/dist/dist-cjs/communication-react/index-BqK17dpb.js.map +0 -1
  403. package/dist/dist-esm/acs-ui-common/src/dataConversion.d.ts +0 -6
  404. package/dist/dist-esm/acs-ui-common/src/dataConversion.js +0 -20
  405. package/dist/dist-esm/acs-ui-common/src/dataConversion.js.map +0 -1
  406. package/dist/dist-esm/acs-ui-common/src/removeImageTags.d.ts +0 -7
  407. package/dist/dist-esm/acs-ui-common/src/removeImageTags.js +0 -18
  408. package/dist/dist-esm/acs-ui-common/src/removeImageTags.js.map +0 -1
  409. package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.d.ts +0 -20
  410. package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.js +0 -118
  411. package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.js.map +0 -1
  412. package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.d.ts +0 -17
  413. package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.js +0 -33
  414. package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.js.map +0 -1
  415. package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.d.ts +0 -6
  416. package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.js +0 -20
  417. package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.js.map +0 -1
  418. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.d.ts +0 -10
  419. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js +0 -15
  420. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js.map +0 -1
  421. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.d.ts +0 -24
  422. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +0 -192
  423. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +0 -1
  424. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.d.ts +0 -69
  425. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js +0 -36
  426. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js.map +0 -1
  427. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.d.ts +0 -75
  428. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js +0 -67
  429. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js.map +0 -1
  430. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.d.ts +0 -105
  431. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js +0 -51
  432. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js.map +0 -1
  433. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.d.ts +0 -86
  434. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js +0 -39
  435. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js.map +0 -1
  436. package/dist/dist-esm/react-components/src/components/MentionPopover.d.ts +0 -121
  437. package/dist/dist-esm/react-components/src/components/MentionPopover.js +0 -119
  438. package/dist/dist-esm/react-components/src/components/MentionPopover.js.map +0 -1
  439. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.d.ts +0 -9
  440. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.js +0 -29
  441. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.js.map +0 -1
  442. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.d.ts +0 -30
  443. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js +0 -98
  444. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js.map +0 -1
  445. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.d.ts +0 -12
  446. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.js +0 -23
  447. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.js.map +0 -1
  448. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.d.ts +0 -15
  449. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js +0 -42
  450. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js.map +0 -1
  451. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.d.ts +0 -24
  452. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.js +0 -64
  453. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.js.map +0 -1
  454. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.d.ts +0 -20
  455. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.js +0 -45
  456. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.js.map +0 -1
  457. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.d.ts +0 -14
  458. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.js +0 -42
  459. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.js.map +0 -1
  460. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.d.ts +0 -29
  461. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.js +0 -87
  462. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.js.map +0 -1
  463. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.d.ts +0 -58
  464. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +0 -332
  465. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +0 -1
  466. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.d.ts +0 -37
  467. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +0 -75
  468. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +0 -1
  469. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +0 -215
  470. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +0 -168
  471. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +0 -1
  472. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.d.ts +0 -16
  473. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js +0 -75
  474. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js.map +0 -1
  475. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.d.ts +0 -19
  476. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js +0 -221
  477. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js.map +0 -1
  478. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.d.ts +0 -7
  479. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.js +0 -51
  480. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.js.map +0 -1
  481. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.d.ts +0 -15
  482. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js +0 -64
  483. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js.map +0 -1
  484. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.d.ts +0 -6
  485. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.js +0 -13
  486. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.js.map +0 -1
  487. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.d.ts +0 -56
  488. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.js +0 -75
  489. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.js.map +0 -1
  490. package/dist/dist-esm/react-components/src/components/SendBoxErrors.d.ts +0 -14
  491. package/dist/dist-esm/react-components/src/components/SendBoxErrors.js +0 -18
  492. package/dist/dist-esm/react-components/src/components/SendBoxErrors.js.map +0 -1
  493. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.d.ts +0 -24
  494. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +0 -550
  495. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +0 -1
  496. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.d.ts +0 -152
  497. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js +0 -819
  498. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js.map +0 -1
  499. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.d.ts +0 -58
  500. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js +0 -144
  501. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js.map +0 -1
  502. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.d.ts +0 -26
  503. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js +0 -69
  504. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js.map +0 -1
  505. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.d.ts +0 -82
  506. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +0 -320
  507. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +0 -1
  508. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.d.ts +0 -21
  509. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js +0 -38
  510. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js.map +0 -1
  511. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.d.ts +0 -38
  512. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js +0 -99
  513. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js.map +0 -1
  514. package/dist/dist-esm/react-components/src/components/styles/Stack.style.d.ts +0 -5
  515. package/dist/dist-esm/react-components/src/components/styles/Stack.style.js +0 -32
  516. package/dist/dist-esm/react-components/src/components/styles/Stack.style.js.map +0 -1
  517. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.d.ts +0 -26
  518. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js +0 -69
  519. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js.map +0 -1
  520. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.d.ts +0 -72
  521. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js +0 -177
  522. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js.map +0 -1
  523. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.d.ts +0 -33
  524. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js +0 -119
  525. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js.map +0 -1
  526. package/dist/dist-esm/react-components/src/components/utils/merge.d.ts +0 -7
  527. package/dist/dist-esm/react-components/src/components/utils/merge.js +0 -16
  528. package/dist/dist-esm/react-components/src/components/utils/merge.js.map +0 -1
  529. package/dist/dist-esm/react-components/src/theming/icons.styles.d.ts +0 -6
  530. package/dist/dist-esm/react-components/src/theming/icons.styles.js +0 -25
  531. package/dist/dist-esm/react-components/src/theming/icons.styles.js.map +0 -1
  532. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Banner.d.ts +0 -47
  533. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Banner.js +0 -48
  534. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Banner.js.map +0 -1
  535. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.d.ts +0 -11
  536. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.js +0 -36
  537. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.js.map +0 -1
  538. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.d.ts +0 -49
  539. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js +0 -196
  540. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js.map +0 -1
  541. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useCompositeStringsForNotificationStack.d.ts +0 -7
  542. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useCompositeStringsForNotificationStack.js +0 -14
  543. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useCompositeStringsForNotificationStack.js.map +0 -1
  544. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.d.ts +0 -15
  545. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js +0 -41
  546. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js.map +0 -1
  547. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.d.ts +0 -15
  548. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.js +0 -23
  549. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.js.map +0 -1
  550. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.d.ts +0 -18
  551. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js +0 -18
  552. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js.map +0 -1
  553. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.d.ts +0 -49
  554. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.js +0 -44
  555. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.js.map +0 -1
  556. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.d.ts +0 -39
  557. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js +0 -265
  558. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js.map +0 -1
  559. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.d.ts +0 -80
  560. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js +0 -36
  561. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js.map +0 -1
  562. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.d.ts +0 -38
  563. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js +0 -67
  564. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js.map +0 -1
  565. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.d.ts +0 -5
  566. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js +0 -5
  567. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js.map +0 -1
  568. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/Timer.d.ts +0 -12
  569. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/Timer.js +0 -52
  570. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/Timer.js.map +0 -1
  571. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.d.ts +0 -10
  572. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js +0 -16
  573. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js.map +0 -1
@@ -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,CAAC,CAAC,UAA8B,EAAE,gBAAkC,EAAgB,EAAE;IACvI,IAAI,eAAe,GAAwD,SAAS,CAAC;IACrF,IAAI,mBAAmB,GAAmE,SAAS,CAA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AAC;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,0DAA0D;QAC1D,0DAA0D;QAC1D,eAAe,EAAE,UAAgB,SAAiB,EAAE,OAAe;;gBACjE,MAAM,oBAAoB,GAAG;oBAC3B,OAAO;iBACR,CAAC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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 type { 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
  *
@@ -63,9 +63,6 @@ const findSelector = (component) => {
63
63
  }
64
64
  return messageThreadSelectorImpl;
65
65
  };
66
- if (typeof component === 'function' && component.name === 'RichTextSendBox') {
67
- return sendBoxSelector;
68
- }
69
66
  switch (component) {
70
67
  case SendBox:
71
68
  return sendBoxSelector;
@@ -1 +1 @@
1
- {"version":3,"file":"usePropsFor.js","sourceRoot":"","sources":["../../../../../preprocess-dist/chat-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,GAAG,CAAC,SAAkD,EAAO,EAAE;IAC/E,8EAA8E;IAC9E,8FAA8F;IAC9F,yBAAyB;IACzB,MAAM,wBAAwB,GAAgC,GAAG,EAAE;;QACjE,MAAM,QAAQ,GAAG,MAAA,MAAA,UAAU,CAAC,uBAAuB,CAAC,0CAAE,QAAQ,mCAAI,iCAAiC,CAAC;QACpG,IAAI,yBAAyB,GAAG,8BAA8B,CAAC,QAAQ,CAAC,CAAC;QACzE,IAAI,CAAC,yBAAyB,EAAE,CAAC;YAC/B,yBAAyB,GAAG,+BAA+B,EAAE,CAAC;YAC9D,8BAA8B,CAAC,QAAQ,CAAC,GAAG,yBAAyB,CAAC;QACvE,CAAC;QACD,OAAO,yBAAyB,CAAC;IACnC,CAAC,CAAC;IACF,IAAI,OAAO,SAAS,KAAK,UAAU,IAAI,SAAS,CAAC,IAAI,KAAK,iBAAiB,EAAE,CAAC;QAC5E,OAAO,eAAe,CAAC;IACzB,CAAC;IACD,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 type { 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 messageThreadSelectorImpl = messageThreadSelectorWithThread();\n messageThreadSelectorsByThread[threadId] = messageThreadSelectorImpl;\n }\n return messageThreadSelectorImpl;\n };\n if (typeof component === 'function' && component.name === 'RichTextSendBox') {\n return sendBoxSelector;\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};"]}
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,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,UAA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K,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 messageThreadSelectorImpl = messageThreadSelectorWithThread();\n messageThreadSelectorsByThread[threadId] = messageThreadSelectorImpl;\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,EAAW,EAAE;;IACvK,MAAM,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACnD,IAAI,CAAA,MAAA,WAAW,CAAC,eAAe,0CAAE,MAAM,MAAK,gBAAgB,EAAE,CAAC;QAC7D,OAAO,yBAAyB,CAAC,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;IAC9E,CAAC;IACD,IAAI,WAAW,KAAK,mBAAmB,CAAC,IAAI,IAAI,WAAW,KAAK,mBAAmB,CAAC,YAA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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"],"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;AAEvD,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB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C,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","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,CA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,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,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YACpE,MAAM,WAAW,GAAG,KAAK,KAAK,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC;YACpF,MAAM,gBAAgB,GAAG,CAAA,eAAe,aAAf,eAAe,uBAAf,eAAe,CAAE,WAAW,MAAK,MAAM,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;YACxG,MAAM,YAAY,GAAG,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,WAAW,MAAK,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;YAC5F,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') {\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';"]}
@@ -41,8 +41,7 @@ export class EventSubscriber {
41
41
  // Note: there is a bug in chatMessageReceived event that it is missing sequenceId
42
42
  createdOn: new Date(event.createdOn),
43
43
  editedOn: 'editedOn' in event ? event.editedOn : undefined,
44
- metadata: event.metadata,
45
- policyViolation: 'policyViolation' in event ? event.policyViolation : undefined
44
+ metadata: event.metadata
46
45
  });
47
46
  };
48
47
  // convert event type to chatMessage type, only possible type is 'html' and 'text' in chat event
@@ -1 +1 @@
1
- {"version":3,"file":"EventSubscriber.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/EventSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;;;;;;;;AAIlC,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,iEAAiE;AACjE,wEAAwE;AACxE,MAAM,eAAe,GAAG,EAAE,GAAG,IAAI,CAAC;AAElC;;GAEG;AACH,MAAM,OAAO,eAAe;IAG1B,YAAY,UAAsB,EAAE,WAAwB;QAKpD,8BAAyB,GAAG,CAAC,KAAwD,EAAyB,EAAE;YACtH,OAAO,kBAAkB,CAAC;gBACxB,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,OAAO,EAAE;oBACP,OAAO,EAAE,KAAK,CAAC,OAAO;oBACtB,WAAW,EAAE,KAAK,CAAC,WAAW;iBAC/B;gBACD,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC;gBACvC,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;gBAC1C,UAAU,EAAE,EAAE;gBACd,kFAAkF;gBAClF,SAAS,EAAE,IAAI,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC;gBACpC,QAAQ,EAAE,UA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U,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;YACvE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;YACrE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACnE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACnE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;YACvE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;YACvE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,yBAAyB,EAAE,IAAI,CAAC,yBAAyB,CAAC,CAAC;YAC/E,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACnE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACnE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,6BAA6B,EAAE,IAAI,CAAC,6BAA6B,CAAC,CAAC;QACzF,CAAC,CAAC;QA5JA,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;CA0JF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatClient, ChatMessageReadReceipt, ChatMessageType } from '@azure/communication-chat';\nimport { ChatMessageDeletedEvent, ChatMessageEditedEvent, ChatMessageReceivedEvent, ChatThreadCreatedEvent, ChatThreadDeletedEvent, ChatThreadPropertiesUpdatedEvent, ParticipantsAddedEvent, ParticipantsRemovedEvent, ReadReceiptReceivedEvent, TypingIndicatorReceivedEvent } from '@azure/communication-chat';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ChatContext } from './ChatContext';\nimport { convertChatMessage } from './convertChatMessage';\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\n\n// TODO: When we can get messageId of event from SDK, remove this\n// Maximum time to look back message list when we receive a system event\nconst maxSyncTimeInMs = 10 * 1000;\n\n/**\n * @private\n */\nexport class EventSubscriber {\n private chatClient: ChatClient;\n private chatContext: ChatContext;\n constructor(chatClient: ChatClient, chatContext: ChatContext) {\n this.chatClient = chatClient;\n this.chatContext = chatContext;\n this.subscribe();\n }\n private convertEventToChatMessage = (event: ChatMessageReceivedEvent | ChatMessageEditedEvent): ChatMessageWithStatus => {\n return convertChatMessage({\n id: event.id,\n version: event.version,\n content: {\n message: event.message,\n attachments: event.attachments\n },\n type: this.convertEventType(event.type),\n sender: event.sender,\n senderDisplayName: event.senderDisplayName,\n sequenceId: '',\n // Note: there is a bug in chatMessageReceived event that it is missing sequenceId\n createdOn: new Date(event.createdOn),\n editedOn: 'editedOn' in event ? event.editedOn : undefined,\n metadata: event.metadata,\n policyViolation: 'policyViolation' in event ? event.policyViolation : undefined\n });\n };\n\n // convert event type to chatMessage type, only possible type is 'html' and 'text' in chat event\n private convertEventType = (type: string): ChatMessageType => {\n const lowerCaseType = type.toLowerCase();\n if (lowerCaseType === 'richtext/html' || lowerCaseType === 'html') {\n return 'html';\n } else {\n return 'text';\n }\n };\n private onChatMessageReceived = (event: ChatMessageReceivedEvent): void => {\n // Today we are avoiding how to render these messages. In the future we can\n // remove this condition and handle this message appropriately.\n const messageEventType = event.type.toLowerCase();\n if (messageEventType !== 'text' && messageEventType !== 'richtext/html' && messageEventType !== 'html') {\n return;\n }\n const newMessage = this.convertEventToChatMessage(event);\n\n // Because of bug in chatMessageReceived event, if we already have that particular message in context, we want to\n // make sure to not overwrite the sequenceId when calling setChatMessage.\n const existingMessage = this.chatContext.getState().threads[event.threadId]?.chatMessages[event.id];\n if (existingMessage) {\n newMessage.sequenceId = existingMessage.sequenceId;\n }\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.setChatMessage(event.threadId, newMessage);\n });\n };\n private onChatMessageDeleted = (event: ChatMessageDeletedEvent): void => {\n this.chatContext.deleteMessage(event.threadId, event.id);\n };\n private onChatMessageEdited = (event: ChatMessageEditedEvent): void => {\n const editedMessage = this.convertEventToChatMessage(event);\n this.chatContext.setChatMessage(event.threadId, convertChatMessage(editedMessage));\n };\n private onParticipantsAdded = (event: ParticipantsAddedEvent): void => {\n const participantsToAdd = event.participantsAdded.map(participant => ({\n ...participant,\n shareHistoryTime: participant.shareHistoryTime ? new Date(participant.shareHistoryTime) : undefined\n }));\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.setParticipants(event.threadId, participantsToAdd);\n });\n this.fetchLastParticipantMessage(event.threadId, 'participantAdded');\n };\n\n // This is a temporary fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK.\n // Without the temporary fix, there are missing 'participant joined' and 'participant left' system messages in the chat thread.\n private fetchLastParticipantMessage = async (threadId: string, actionType: 'participantAdded' | 'participantRemoved'): Promise<void> => {\n for await (const message of this.chatClient.getChatThreadClient(threadId).listMessages({\n startTime: new Date(Date.now() - maxSyncTimeInMs)\n })) {\n if (message.type === actionType) {\n this.chatContext.setChatMessage(threadId, {\n ...message,\n status: 'delivered'\n });\n }\n }\n };\n private onParticipantsRemoved = (event: ParticipantsRemovedEvent): void => {\n const participantIds = event.participantsRemoved.map(participant => {\n return participant.id;\n });\n this.chatContext.deleteParticipants(event.threadId, participantIds);\n\n // If the current user is removed from the thread, do not fetch the last participant message\n // as they no longer have access to the thread.\n const currentUserId = toFlatCommunicationIdentifier(this.chatContext.getState().userId);\n const wasCurrentUserRemoved = participantIds.find(id => toFlatCommunicationIdentifier(id) === currentUserId);\n if (!wasCurrentUserRemoved) {\n this.fetchLastParticipantMessage(event.threadId, 'participantRemoved');\n }\n };\n private onReadReceiptReceived = (event: ReadReceiptReceivedEvent): void => {\n const readReceipt: ChatMessageReadReceipt = {\n ...event,\n sender: event.sender,\n readOn: new Date(event.readOn)\n };\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.addReadReceipt(event.threadId, readReceipt);\n });\n };\n private onTypingIndicatorReceived = (typingIndicator: TypingIndicatorReceivedEvent): void => {\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(typingIndicator.threadId);\n this.chatContext.addTypingIndicator(typingIndicator.threadId, typingIndicator);\n });\n };\n private onChatThreadCreated = (event: ChatThreadCreatedEvent): void => {\n const properties = {\n topic: event.properties.topic\n };\n if (!this.chatContext.createThreadIfNotExist(event.threadId, properties)) {\n this.chatContext.updateThread(event.threadId, properties);\n }\n };\n private onChatThreadDeleted = (event: ChatThreadDeletedEvent): void => {\n this.chatContext.deleteThread(event.threadId);\n };\n private onChatThreadPropertiesUpdated = (event: ChatThreadPropertiesUpdatedEvent): void => {\n this.chatContext.updateThread(event.threadId, {\n topic: event.properties.topic\n });\n };\n public subscribe = (): void => {\n this.chatClient.on('chatMessageReceived', this.onChatMessageReceived);\n this.chatClient.on('chatMessageDeleted', this.onChatMessageDeleted);\n this.chatClient.on('chatMessageEdited', this.onChatMessageEdited);\n this.chatClient.on('participantsAdded', this.onParticipantsAdded);\n this.chatClient.on('participantsRemoved', this.onParticipantsRemoved);\n this.chatClient.on('readReceiptReceived', this.onReadReceiptReceived);\n this.chatClient.on('typingIndicatorReceived', this.onTypingIndicatorReceived);\n this.chatClient.on('chatThreadCreated', this.onChatThreadCreated);\n this.chatClient.on('chatThreadDeleted', this.onChatThreadDeleted);\n this.chatClient.on('chatThreadPropertiesUpdated', this.onChatThreadPropertiesUpdated);\n };\n public unsubscribe = (): void => {\n this.chatClient.off('chatMessageReceived', this.onChatMessageReceived);\n this.chatClient.off('chatMessageDeleted', this.onChatMessageDeleted);\n this.chatClient.off('chatMessageEdited', this.onChatMessageEdited);\n this.chatClient.off('participantsAdded', this.onParticipantsAdded);\n this.chatClient.off('participantsRemoved', this.onParticipantsRemoved);\n this.chatClient.off('readReceiptReceived', this.onReadReceiptReceived);\n this.chatClient.off('typingIndicatorReceived', this.onTypingIndicatorReceived);\n this.chatClient.off('chatThreadCreated', this.onChatThreadCreated);\n this.chatClient.off('chatThreadDeleted', this.onChatThreadDeleted);\n this.chatClient.off('chatThreadPropertiesUpdated', this.onChatThreadPropertiesUpdated);\n };\n}"]}
1
+ {"version":3,"file":"EventSubscriber.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/EventSubscriber.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;;;;;;;;AAIlC,OAAO,EAAE,6BAA6B,EAAE,gCAAgC;AAExE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG1D,iEAAiE;AACjE,wEAAwE;AACxE,MAAM,eAAe,GAAG,EAAE,GAAG,IAAI,CAAC;AAElC;;GAEG;AACH,MAAM,OAAO,eAAe;IAG1B,YAAY,UAAsB,EAAE,WAAwB;QAKpD,8BAAyB,GAAG,CAAC,KAAwD,EAAyB,EAAE;YACtH,OAAO,kBAAkB,CAAC;gBACxB,EAAE,EAAE,KAAK,CAAC,EAAE;gBACZ,OAAO,EAAE,KAAK,CAAC,OAAO;gBACtB,OAAO,EAAE;oBACP,OAAO,EAAE,KAAK,CAAC,OAAO;oBACtB,WAAW,EAAE,KAAK,CAAC,WAAW;iBAC/B;gBACD,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,IAAI,CAAC;gBACvC,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,iBAAiB,EAAE,KAAK,CAAC,iBAAiB;gBAC1C,UAAU,EAAE,EAAE;gBACd,kFA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AG,CAAC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;YACvE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,oBAAoB,EAAE,IAAI,CAAC,oBAAoB,CAAC,CAAC;YACrE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACnE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACnE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;YACvE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,qBAAqB,EAAE,IAAI,CAAC,qBAAqB,CAAC,CAAC;YACvE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,yBAAyB,EAAE,IAAI,CAAC,yBAAyB,CAAC,CAAC;YAC/E,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACnE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,CAAC,CAAC;YACnE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,6BAA6B,EAAE,IAAI,CAAC,6BAA6B,CAAC,CAAC;QACzF,CAAC,CAAC;QA3JA,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;QAC7B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;CAyJF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { ChatClient, ChatMessageReadReceipt, ChatMessageType } from '@azure/communication-chat';\nimport { ChatMessageDeletedEvent, ChatMessageEditedEvent, ChatMessageReceivedEvent, ChatThreadCreatedEvent, ChatThreadDeletedEvent, ChatThreadPropertiesUpdatedEvent, ParticipantsAddedEvent, ParticipantsRemovedEvent, ReadReceiptReceivedEvent, TypingIndicatorReceivedEvent } from '@azure/communication-chat';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { ChatContext } from './ChatContext';\nimport { convertChatMessage } from './convertChatMessage';\nimport { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\n\n// TODO: When we can get messageId of event from SDK, remove this\n// Maximum time to look back message list when we receive a system event\nconst maxSyncTimeInMs = 10 * 1000;\n\n/**\n * @private\n */\nexport class EventSubscriber {\n private chatClient: ChatClient;\n private chatContext: ChatContext;\n constructor(chatClient: ChatClient, chatContext: ChatContext) {\n this.chatClient = chatClient;\n this.chatContext = chatContext;\n this.subscribe();\n }\n private convertEventToChatMessage = (event: ChatMessageReceivedEvent | ChatMessageEditedEvent): ChatMessageWithStatus => {\n return convertChatMessage({\n id: event.id,\n version: event.version,\n content: {\n message: event.message,\n attachments: event.attachments\n },\n type: this.convertEventType(event.type),\n sender: event.sender,\n senderDisplayName: event.senderDisplayName,\n sequenceId: '',\n // Note: there is a bug in chatMessageReceived event that it is missing sequenceId\n createdOn: new Date(event.createdOn),\n editedOn: 'editedOn' in event ? event.editedOn : undefined,\n metadata: event.metadata\n });\n };\n\n // convert event type to chatMessage type, only possible type is 'html' and 'text' in chat event\n private convertEventType = (type: string): ChatMessageType => {\n const lowerCaseType = type.toLowerCase();\n if (lowerCaseType === 'richtext/html' || lowerCaseType === 'html') {\n return 'html';\n } else {\n return 'text';\n }\n };\n private onChatMessageReceived = (event: ChatMessageReceivedEvent): void => {\n // Today we are avoiding how to render these messages. In the future we can\n // remove this condition and handle this message appropriately.\n const messageEventType = event.type.toLowerCase();\n if (messageEventType !== 'text' && messageEventType !== 'richtext/html' && messageEventType !== 'html') {\n return;\n }\n const newMessage = this.convertEventToChatMessage(event);\n\n // Because of bug in chatMessageReceived event, if we already have that particular message in context, we want to\n // make sure to not overwrite the sequenceId when calling setChatMessage.\n const existingMessage = this.chatContext.getState().threads[event.threadId]?.chatMessages[event.id];\n if (existingMessage) {\n newMessage.sequenceId = existingMessage.sequenceId;\n }\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.setChatMessage(event.threadId, newMessage);\n });\n };\n private onChatMessageDeleted = (event: ChatMessageDeletedEvent): void => {\n this.chatContext.deleteMessage(event.threadId, event.id);\n };\n private onChatMessageEdited = (event: ChatMessageEditedEvent): void => {\n const editedMessage = this.convertEventToChatMessage(event);\n this.chatContext.setChatMessage(event.threadId, convertChatMessage(editedMessage));\n };\n private onParticipantsAdded = (event: ParticipantsAddedEvent): void => {\n const participantsToAdd = event.participantsAdded.map(participant => ({\n ...participant,\n shareHistoryTime: participant.shareHistoryTime ? new Date(participant.shareHistoryTime) : undefined\n }));\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.setParticipants(event.threadId, participantsToAdd);\n });\n this.fetchLastParticipantMessage(event.threadId, 'participantAdded');\n };\n\n // This is a temporary fix that no participant message is received for onChatMessageReceived event, which should be handled by JS SDK.\n // Without the temporary fix, there are missing 'participant joined' and 'participant left' system messages in the chat thread.\n private fetchLastParticipantMessage = async (threadId: string, actionType: 'participantAdded' | 'participantRemoved'): Promise<void> => {\n for await (const message of this.chatClient.getChatThreadClient(threadId).listMessages({\n startTime: new Date(Date.now() - maxSyncTimeInMs)\n })) {\n if (message.type === actionType) {\n this.chatContext.setChatMessage(threadId, {\n ...message,\n status: 'delivered'\n });\n }\n }\n };\n private onParticipantsRemoved = (event: ParticipantsRemovedEvent): void => {\n const participantIds = event.participantsRemoved.map(participant => {\n return participant.id;\n });\n this.chatContext.deleteParticipants(event.threadId, participantIds);\n\n // If the current user is removed from the thread, do not fetch the last participant message\n // as they no longer have access to the thread.\n const currentUserId = toFlatCommunicationIdentifier(this.chatContext.getState().userId);\n const wasCurrentUserRemoved = participantIds.find(id => toFlatCommunicationIdentifier(id) === currentUserId);\n if (!wasCurrentUserRemoved) {\n this.fetchLastParticipantMessage(event.threadId, 'participantRemoved');\n }\n };\n private onReadReceiptReceived = (event: ReadReceiptReceivedEvent): void => {\n const readReceipt: ChatMessageReadReceipt = {\n ...event,\n sender: event.sender,\n readOn: new Date(event.readOn)\n };\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(event.threadId);\n this.chatContext.addReadReceipt(event.threadId, readReceipt);\n });\n };\n private onTypingIndicatorReceived = (typingIndicator: TypingIndicatorReceivedEvent): void => {\n this.chatContext.batch(() => {\n this.chatContext.createThreadIfNotExist(typingIndicator.threadId);\n this.chatContext.addTypingIndicator(typingIndicator.threadId, typingIndicator);\n });\n };\n private onChatThreadCreated = (event: ChatThreadCreatedEvent): void => {\n const properties = {\n topic: event.properties.topic\n };\n if (!this.chatContext.createThreadIfNotExist(event.threadId, properties)) {\n this.chatContext.updateThread(event.threadId, properties);\n }\n };\n private onChatThreadDeleted = (event: ChatThreadDeletedEvent): void => {\n this.chatContext.deleteThread(event.threadId);\n };\n private onChatThreadPropertiesUpdated = (event: ChatThreadPropertiesUpdatedEvent): void => {\n this.chatContext.updateThread(event.threadId, {\n topic: event.properties.topic\n });\n };\n public subscribe = (): void => {\n this.chatClient.on('chatMessageReceived', this.onChatMessageReceived);\n this.chatClient.on('chatMessageDeleted', this.onChatMessageDeleted);\n this.chatClient.on('chatMessageEdited', this.onChatMessageEdited);\n this.chatClient.on('participantsAdded', this.onParticipantsAdded);\n this.chatClient.on('participantsRemoved', this.onParticipantsRemoved);\n this.chatClient.on('readReceiptReceived', this.onReadReceiptReceived);\n this.chatClient.on('typingIndicatorReceived', this.onTypingIndicatorReceived);\n this.chatClient.on('chatThreadCreated', this.onChatThreadCreated);\n this.chatClient.on('chatThreadDeleted', this.onChatThreadDeleted);\n this.chatClient.on('chatThreadPropertiesUpdated', this.onChatThreadPropertiesUpdated);\n };\n public unsubscribe = (): void => {\n this.chatClient.off('chatMessageReceived', this.onChatMessageReceived);\n this.chatClient.off('chatMessageDeleted', this.onChatMessageDeleted);\n this.chatClient.off('chatMessageEdited', this.onChatMessageEdited);\n this.chatClient.off('participantsAdded', this.onParticipantsAdded);\n this.chatClient.off('participantsRemoved', this.onParticipantsRemoved);\n this.chatClient.off('readReceiptReceived', this.onReadReceiptReceived);\n this.chatClient.off('typingIndicatorReceived', this.onTypingIndicatorReceived);\n this.chatClient.off('chatThreadCreated', this.onChatThreadCreated);\n this.chatClient.off('chatThreadDeleted', this.onChatThreadDeleted);\n this.chatClient.off('chatThreadPropertiesUpdated', this.onChatThreadPropertiesUpdated);\n };\n}"]}
@@ -4,5 +4,4 @@ export type { ChatMessageWithStatus } from './types/ChatMessageWithStatus';
4
4
  export type { ResourceFetchResult } from './types/ChatMessageWithStatus';
5
5
  export { ChatError } from './ChatClientState';
6
6
  export type { ChatClientState, ChatErrors, ChatThreadClientState, ChatThreadProperties, ChatErrorTarget } from './ChatClientState';
7
- export type { MessagingPolicy } from './ChatClientState';
8
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,iCAAiC,EAAE,MAAM,sBAAsB,CAAC;AAInI,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { createStatefulChatClient, _createStatefulChatClientInner, _createStatefulChatClientWithDeps } from './StatefulChatClient';\nexport type { StatefulChatClient, StatefulChatClientArgs, StatefulChatClientOptions } from './StatefulChatClient';\nexport type { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\nexport type { ResourceFetchResult } from './types/ChatMessageWithStatus';\nexport { ChatError } from './ChatClientState';\nexport type { ChatClientState, ChatErrors, ChatThreadClientState, ChatThreadProperties, ChatErrorTarget } from './ChatClientState';\nexport type { MessagingPolicy } from './ChatClientState';"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../preprocess-dist/chat-stateful-client/src/index.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,wBAAwB,EAAE,8BAA8B,EAAE,iCAAiC,EAAE,MAAM,sBAAsB,CAAC;AAInI,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nexport { createStatefulChatClient, _createStatefulChatClientInner, _createStatefulChatClientWithDeps } from './StatefulChatClient';\nexport type { StatefulChatClient, StatefulChatClientArgs, StatefulChatClientOptions } from './StatefulChatClient';\nexport type { ChatMessageWithStatus } from './types/ChatMessageWithStatus';\nexport type { ResourceFetchResult } from './types/ChatMessageWithStatus';\nexport { ChatError } from './ChatClientState';\nexport type { ChatClientState, ChatErrors, ChatThreadClientState, ChatThreadProperties, ChatErrorTarget } from './ChatClientState';"]}