@azure/communication-react 1.14.1-alpha-202403210013 → 1.14.1-alpha-202403270012

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 (393) hide show
  1. package/dist/communication-react.d.ts +45 -39
  2. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BgK9tOAk.js → RichTextSendBoxWrapper-Yty3fOoA.js} +6 -6
  3. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BgK9tOAk.js.map → RichTextSendBoxWrapper-Yty3fOoA.js.map} +1 -1
  4. package/dist/dist-cjs/communication-react/{index-B_kqOVlM.js → index-BEomNZbT.js} +1864 -1452
  5. package/dist/dist-cjs/communication-react/index-BEomNZbT.js.map +1 -0
  6. package/dist/dist-cjs/communication-react/index.js +3 -3
  7. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  8. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  9. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +0 -2
  10. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  11. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js +0 -1
  12. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js.map +1 -1
  13. package/dist/dist-esm/calling-component-bindings/src/getRemoteParticipantsExcludingConsumers.js +0 -2
  14. package/dist/dist-esm/calling-component-bindings/src/getRemoteParticipantsExcludingConsumers.js.map +1 -1
  15. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +17 -16
  16. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  17. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +2 -4
  18. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
  19. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js +0 -2
  20. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js.map +1 -1
  21. package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
  22. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +0 -6
  23. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
  24. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.d.ts +0 -4
  25. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js +1 -9
  26. package/dist/dist-esm/calling-component-bindings/src/utils/participantListSelectorUtils.js.map +1 -1
  27. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +12 -7
  28. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
  29. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +3 -10
  30. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
  31. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +1 -2
  32. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  33. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +1 -2
  34. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +0 -5
  35. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  36. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +2 -1
  37. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +19 -13
  38. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  39. package/dist/dist-esm/calling-stateful-client/src/Converter.js +0 -5
  40. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  41. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js +0 -1
  42. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js.map +1 -1
  43. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js +0 -5
  44. package/dist/dist-esm/calling-stateful-client/src/InternalCallContext.js.map +1 -1
  45. package/dist/dist-esm/calling-stateful-client/src/LocalVideoStreamVideoEffectsSubscriber.js +0 -2
  46. package/dist/dist-esm/calling-stateful-client/src/LocalVideoStreamVideoEffectsSubscriber.js.map +1 -1
  47. package/dist/dist-esm/calling-stateful-client/src/ParticipantSubscriber.js +0 -3
  48. package/dist/dist-esm/calling-stateful-client/src/ParticipantSubscriber.js.map +1 -1
  49. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  50. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js +4 -1
  51. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
  52. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +11 -14
  53. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  54. package/dist/dist-esm/communication-react/src/index.js +0 -1
  55. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  56. package/dist/dist-esm/react-components/src/components/AttachmentCard.d.ts +41 -0
  57. package/dist/dist-esm/react-components/src/components/AttachmentCard.js +108 -0
  58. package/dist/dist-esm/react-components/src/components/AttachmentCard.js.map +1 -0
  59. package/dist/dist-esm/react-components/src/components/AttachmentCardGroup.d.ts +16 -0
  60. package/dist/dist-esm/react-components/src/components/{FileCardGroup.js → AttachmentCardGroup.js} +5 -5
  61. package/dist/dist-esm/react-components/src/components/AttachmentCardGroup.js.map +1 -0
  62. package/dist/dist-esm/react-components/src/components/AttachmentDownloadCards.d.ts +49 -0
  63. package/dist/dist-esm/react-components/src/components/{FileDownloadCards.js → AttachmentDownloadCards.js} +28 -27
  64. package/dist/dist-esm/react-components/src/components/AttachmentDownloadCards.js.map +1 -0
  65. package/dist/dist-esm/react-components/src/components/{FileUploadCards.d.ts → AttachmentUploadCards.d.ts} +15 -15
  66. package/dist/dist-esm/react-components/src/components/AttachmentUploadCards.js +24 -0
  67. package/dist/dist-esm/react-components/src/components/AttachmentUploadCards.js.map +1 -0
  68. package/dist/dist-esm/react-components/src/components/CameraButton.js +0 -1
  69. package/dist/dist-esm/react-components/src/components/CameraButton.js.map +1 -1
  70. package/dist/dist-esm/react-components/src/components/Caption.js.map +1 -1
  71. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
  72. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.d.ts +1 -1
  73. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js +10 -10
  74. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js.map +1 -1
  75. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsRichTextEditBox.d.ts +1 -1
  76. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsRichTextEditBox.js +6 -6
  77. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsRichTextEditBox.js.map +1 -1
  78. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +1 -1
  79. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
  80. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.d.ts +1 -1
  81. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js +6 -6
  82. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
  83. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js +10 -8
  84. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js.map +1 -1
  85. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +1 -1
  86. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
  87. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.d.ts +1 -1
  88. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js +6 -6
  89. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
  90. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +10 -8
  91. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
  92. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +1 -10
  93. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
  94. package/dist/dist-esm/react-components/src/components/ErrorBar.js.map +1 -1
  95. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js +5 -3
  96. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js.map +1 -1
  97. package/dist/dist-esm/react-components/src/components/MeetingReactionOverlay.d.ts +40 -0
  98. package/dist/dist-esm/react-components/src/components/MeetingReactionOverlay.js +77 -0
  99. package/dist/dist-esm/react-components/src/components/MeetingReactionOverlay.js.map +1 -0
  100. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +4 -5
  101. package/dist/dist-esm/react-components/src/components/MessageThread.js +3 -3
  102. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  103. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +6 -4
  104. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
  105. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +1 -1
  106. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
  107. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.d.ts +3 -1
  108. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +21 -6
  109. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +1 -1
  110. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +1 -8
  111. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +55 -30
  112. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
  113. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.d.ts +2 -2
  114. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js +12 -12
  115. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js.map +1 -1
  116. package/dist/dist-esm/react-components/src/components/SendBox.d.ts +10 -10
  117. package/dist/dist-esm/react-components/src/components/SendBox.js +44 -34
  118. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  119. package/dist/dist-esm/react-components/src/components/SendBoxErrors.d.ts +2 -2
  120. package/dist/dist-esm/react-components/src/components/SendBoxErrors.js +7 -5
  121. package/dist/dist-esm/react-components/src/components/SendBoxErrors.js.map +1 -1
  122. package/dist/dist-esm/react-components/src/components/VideoGallery/ParticipantVideoTileOverlay.d.ts +15 -0
  123. package/dist/dist-esm/react-components/src/components/VideoGallery/ParticipantVideoTileOverlay.js +58 -0
  124. package/dist/dist-esm/react-components/src/components/VideoGallery/ParticipantVideoTileOverlay.js.map +1 -0
  125. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteContentShareReactionOverlay.d.ts +14 -0
  126. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteContentShareReactionOverlay.js +149 -0
  127. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteContentShareReactionOverlay.js.map +1 -0
  128. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.d.ts +4 -0
  129. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.js +14 -2
  130. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteScreenShare.js.map +1 -1
  131. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/reactionUtils.d.ts +11 -0
  132. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/reactionUtils.js +23 -0
  133. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/reactionUtils.js.map +1 -0
  134. package/dist/dist-esm/react-components/src/components/VideoGallery.js +7 -3
  135. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  136. package/dist/dist-esm/react-components/src/components/VideoTile.d.ts +5 -6
  137. package/dist/dist-esm/react-components/src/components/VideoTile.js +3 -51
  138. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  139. package/dist/dist-esm/react-components/src/components/index.d.ts +7 -5
  140. package/dist/dist-esm/react-components/src/components/index.js +3 -3
  141. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  142. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.d.ts +9 -0
  143. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.js +27 -0
  144. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.js.map +1 -0
  145. package/dist/dist-esm/react-components/src/components/styles/ReactionOverlay.style.d.ts +70 -0
  146. package/dist/dist-esm/react-components/src/components/styles/ReactionOverlay.style.js +259 -0
  147. package/dist/dist-esm/react-components/src/components/styles/ReactionOverlay.style.js.map +1 -0
  148. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.d.ts +1 -1
  149. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +2 -2
  150. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +1 -1
  151. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.d.ts +4 -0
  152. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js +5 -1
  153. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js.map +1 -1
  154. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.d.ts +2 -2
  155. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js +5 -4
  156. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js.map +1 -1
  157. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.d.ts +2 -2
  158. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js +8 -1
  159. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js.map +1 -1
  160. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.d.ts +1 -1
  161. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js +6 -5
  162. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js.map +1 -1
  163. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.d.ts +1 -1
  164. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js +16 -13
  165. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
  166. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +1 -1
  167. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +5 -3
  168. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  169. package/dist/dist-esm/react-components/src/components/utils/common.d.ts +3 -3
  170. package/dist/dist-esm/react-components/src/components/utils/common.js +5 -5
  171. package/dist/dist-esm/react-components/src/components/utils/common.js.map +1 -1
  172. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
  173. package/dist/dist-esm/react-components/src/localization/locales/ar-SA/strings.json +6 -6
  174. package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/strings.json +6 -6
  175. package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +6 -6
  176. package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +6 -6
  177. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +6 -6
  178. package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +6 -6
  179. package/dist/dist-esm/react-components/src/localization/locales/fi-FI/strings.json +6 -6
  180. package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +6 -6
  181. package/dist/dist-esm/react-components/src/localization/locales/he-IL/strings.json +6 -6
  182. package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +6 -6
  183. package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +6 -6
  184. package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +6 -6
  185. package/dist/dist-esm/react-components/src/localization/locales/nb-NO/strings.json +6 -6
  186. package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +6 -6
  187. package/dist/dist-esm/react-components/src/localization/locales/pl-PL/strings.json +6 -6
  188. package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +6 -6
  189. package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +6 -6
  190. package/dist/dist-esm/react-components/src/localization/locales/sv-SE/strings.json +6 -6
  191. package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +6 -6
  192. package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +6 -6
  193. package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +6 -6
  194. package/dist/dist-esm/react-components/src/theming/FluentV9ThemeProvider.js +1 -1
  195. package/dist/dist-esm/react-components/src/theming/FluentV9ThemeProvider.js.map +1 -1
  196. package/dist/dist-esm/react-components/src/theming/icons.js +3 -10
  197. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  198. package/dist/dist-esm/react-components/src/types/Attachment.d.ts +151 -0
  199. package/dist/dist-esm/{react-composites/src/composites/ChatComposite/file-sharing/FileUploadHandler.js → react-components/src/types/Attachment.js} +1 -1
  200. package/dist/dist-esm/react-components/src/types/Attachment.js.map +1 -0
  201. package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +1 -1
  202. package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
  203. package/dist/dist-esm/react-components/src/types/ReactionTypes.d.ts +5 -0
  204. package/dist/dist-esm/react-components/src/types/ReactionTypes.js.map +1 -1
  205. package/dist/dist-esm/react-components/src/types/index.d.ts +1 -0
  206. package/dist/dist-esm/react-components/src/types/index.js +1 -0
  207. package/dist/dist-esm/react-components/src/types/index.js.map +1 -1
  208. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +3 -3
  209. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  210. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  211. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -3
  212. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +18 -60
  213. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  214. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  215. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.js +0 -2
  216. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.js.map +1 -1
  217. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.js +3 -9
  218. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.js.map +1 -1
  219. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  220. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +14 -65
  221. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  222. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +2 -9
  223. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  224. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.d.ts +1 -1
  225. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.js +10 -10
  226. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.js.map +1 -1
  227. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +0 -9
  228. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
  229. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.d.ts +2 -0
  230. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +25 -13
  231. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  232. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.d.ts +10 -2
  233. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.js +3 -3
  234. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.js.map +1 -1
  235. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.d.ts +0 -1
  236. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js +1 -2
  237. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js.map +1 -1
  238. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +12 -7
  239. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
  240. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js +4 -18
  241. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js.map +1 -1
  242. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js +2 -9
  243. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js.map +1 -1
  244. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js +2 -22
  245. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js.map +1 -1
  246. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js +1 -6
  247. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js.map +1 -1
  248. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js +1 -6
  249. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js.map +1 -1
  250. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +6 -9
  251. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  252. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  253. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.d.ts +2 -0
  254. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +2 -2
  255. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  256. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +5 -27
  257. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  258. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/activeVideoBackgroundEffectSelector.js +0 -3
  259. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/activeVideoBackgroundEffectSelector.js.map +1 -1
  260. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +5 -0
  261. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +5 -1
  262. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  263. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.d.ts +2 -2
  264. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js +3 -12
  265. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js.map +1 -1
  266. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/getFirstSpotlightedRemoteParticipantSelector.d.ts +15 -0
  267. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/getFirstSpotlightedRemoteParticipantSelector.js +32 -0
  268. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/getFirstSpotlightedRemoteParticipantSelector.js.map +1 -0
  269. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localAndRemotePIPSelector.d.ts +10 -9
  270. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localAndRemotePIPSelector.js +28 -3
  271. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localAndRemotePIPSelector.js.map +1 -1
  272. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localVideoStreamSelector.js +0 -1
  273. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localVideoStreamSelector.js.map +1 -1
  274. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +0 -8
  275. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  276. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/spotlightUtils.d.ts +6 -0
  277. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/spotlightUtils.js +36 -0
  278. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/spotlightUtils.js.map +1 -1
  279. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/useConsoleErrors.js +0 -3
  280. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/useConsoleErrors.js.map +1 -1
  281. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +3 -3
  282. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  283. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +1 -2
  284. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +22 -35
  285. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  286. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +1 -1
  287. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  288. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +0 -8
  289. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  290. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.d.ts +1 -1
  291. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +8 -8
  292. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
  293. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +3 -12
  294. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  295. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js +4 -4
  296. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
  297. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.d.ts +1 -1
  298. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +10 -11
  299. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  300. package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.js.map +1 -1
  301. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +1 -1
  302. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +22 -22
  303. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  304. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.d.ts +2 -2
  305. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js +11 -8
  306. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js.map +1 -1
  307. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
  308. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapterProvider.js +1 -1
  309. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapterProvider.js.map +1 -1
  310. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUpload.d.ts +2 -69
  311. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUpload.js.map +1 -1
  312. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadButton.js +4 -4
  313. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadButton.js.map +1 -1
  314. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.d.ts +0 -1
  315. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js +0 -1
  316. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js.map +1 -1
  317. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js +3 -3
  318. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js.map +1 -1
  319. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
  320. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js +1 -1
  321. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js.map +1 -1
  322. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +5 -10
  323. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  324. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +7 -8
  325. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
  326. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js +11 -15
  327. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js.map +1 -1
  328. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.d.ts +4 -0
  329. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js +14 -3
  330. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js.map +1 -1
  331. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.d.ts +2 -0
  332. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +16 -17
  333. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
  334. package/dist/dist-esm/react-composites/src/composites/common/SendBox.js +8 -8
  335. package/dist/dist-esm/react-composites/src/composites/common/SendBox.js.map +1 -1
  336. package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.d.ts +0 -3
  337. package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.js +1 -6
  338. package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.js.map +1 -1
  339. package/dist/dist-esm/react-composites/src/composites/common/TabHeader.d.ts +0 -1
  340. package/dist/dist-esm/react-composites/src/composites/common/TabHeader.js +1 -4
  341. package/dist/dist-esm/react-composites/src/composites/common/TabHeader.js.map +1 -1
  342. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +2 -29
  343. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  344. package/dist/dist-esm/react-composites/src/composites/common/icons.js +2 -10
  345. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  346. package/dist/dist-esm/react-composites/src/composites/common/resolveVideoEffectDependency.js +0 -1
  347. package/dist/dist-esm/react-composites/src/composites/common/resolveVideoEffectDependency.js.map +1 -1
  348. package/dist/dist-esm/react-composites/src/composites/common/resolveVideoEffectDependencyLazy.js +0 -1
  349. package/dist/dist-esm/react-composites/src/composites/common/resolveVideoEffectDependencyLazy.js.map +1 -1
  350. package/dist/dist-esm/react-composites/src/composites/common/styles/ParticipantContainer.styles.d.ts +5 -1
  351. package/dist/dist-esm/react-composites/src/composites/common/styles/ParticipantContainer.styles.js +29 -0
  352. package/dist/dist-esm/react-composites/src/composites/common/styles/ParticipantContainer.styles.js.map +1 -1
  353. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.d.ts +5 -0
  354. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.js.map +1 -1
  355. package/dist/dist-esm/react-composites/src/composites/index.js +0 -2
  356. package/dist/dist-esm/react-composites/src/composites/index.js.map +1 -1
  357. package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json +2 -0
  358. package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +2 -0
  359. package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +2 -0
  360. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +2 -0
  361. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +2 -0
  362. package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +2 -0
  363. package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json +2 -0
  364. package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +2 -0
  365. package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/strings.json +2 -0
  366. package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +2 -0
  367. package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +2 -0
  368. package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +2 -0
  369. package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/strings.json +2 -0
  370. package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +2 -0
  371. package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/strings.json +2 -0
  372. package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +2 -0
  373. package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +2 -0
  374. package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/strings.json +2 -0
  375. package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +2 -0
  376. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +2 -0
  377. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +2 -0
  378. package/package.json +1 -1
  379. package/dist/dist-cjs/communication-react/index-B_kqOVlM.js.map +0 -1
  380. package/dist/dist-esm/react-components/src/components/FileCard.d.ts +0 -39
  381. package/dist/dist-esm/react-components/src/components/FileCard.js +0 -92
  382. package/dist/dist-esm/react-components/src/components/FileCard.js.map +0 -1
  383. package/dist/dist-esm/react-components/src/components/FileCardGroup.d.ts +0 -16
  384. package/dist/dist-esm/react-components/src/components/FileCardGroup.js.map +0 -1
  385. package/dist/dist-esm/react-components/src/components/FileDownloadCards.d.ts +0 -114
  386. package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +0 -1
  387. package/dist/dist-esm/react-components/src/components/FileUploadCards.js +0 -34
  388. package/dist/dist-esm/react-components/src/components/FileUploadCards.js.map +0 -1
  389. package/dist/dist-esm/react-components/src/components/styles/IconButton.styles.d.ts +0 -5
  390. package/dist/dist-esm/react-components/src/components/styles/IconButton.styles.js +0 -17
  391. package/dist/dist-esm/react-components/src/components/styles/IconButton.styles.js.map +0 -1
  392. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadHandler.d.ts +0 -10
  393. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadHandler.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"Strings.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/ChatComposite/Strings.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Strings used by the {@link ChatComposite} directly.\n *\n * This strings are in addition to those used by the components from the component library.\n *\n * @public\n */\nexport interface ChatCompositeStrings {\n /**\n * Chat list header text\n */\n chatListHeader: string;\n\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Upload File Button text\n */\n uploadFile: string;\n}\n"]}
1
+ {"version":3,"file":"Strings.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/ChatComposite/Strings.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Strings used by the {@link ChatComposite} directly.\n *\n * This strings are in addition to those used by the components from the component library.\n *\n * @public\n */\nexport interface ChatCompositeStrings {\n /**\n * Chat list header text\n */\n chatListHeader: string;\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n /**\n * Upload File Button text\n */\n uploadFile: string;\n}\n"]}
@@ -6,7 +6,7 @@ import { ChatAdapter, ChatAdapterState, MessageDeletedListener, MessageEditedLis
6
6
  import { ResourceDetails } from './ChatAdapter';
7
7
  import { AdapterError } from '../../common/adapters';
8
8
  import { AttachmentMetadata } from "../../../../../react-components/src";
9
- import { FileUploadManager } from '../file-sharing';
9
+ import { FileUploadManager } from "../../../../../react-components/src";
10
10
  /**
11
11
  * Context of Chat, which is a centralized context for all state updates
12
12
  * @private
@@ -20,9 +20,9 @@ import { _createStatefulChatClientInner } from "../../../../../chat-stateful-cli
20
20
  import { createDefaultChatHandlers } from "../../../../../chat-component-bindings/src";
21
21
  import { toFlatCommunicationIdentifier } from "../../../../../acs-ui-common/src";
22
22
  import EventEmitter from 'events';
23
- /* @conditional-compile-remove(file-sharing) */
23
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
24
24
  import { convertFileUploadsUiStateToMessageMetadata } from './AzureCommunicationFileUploadAdapter';
25
- /* @conditional-compile-remove(file-sharing) */
25
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
26
26
  import { AzureCommunicationFileUploadAdapter } from './AzureCommunicationFileUploadAdapter';
27
27
  import { useEffect, useRef, useState } from 'react';
28
28
  import { _isValidIdentifier } from "../../../../../acs-ui-common/src";
@@ -72,7 +72,7 @@ export class ChatContext {
72
72
  thread,
73
73
  latestErrors: clientState.latestErrors
74
74
  };
75
- /* @conditional-compile-remove(file-sharing) */
75
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
76
76
  updatedState = Object.assign(Object.assign({}, updatedState), { fileUploads: this.state.fileUploads });
77
77
  this.setState(updatedState);
78
78
  }
@@ -87,7 +87,7 @@ export class AzureCommunicationChatAdapter {
87
87
  this.chatClient = chatClient;
88
88
  this.chatThreadClient = chatThreadClient;
89
89
  this.context = new ChatContext(chatClient.getState(), chatThreadClient.threadId);
90
- /* @conditional-compile-remove(file-sharing) */
90
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
91
91
  this.fileUploadAdapter = new AzureCommunicationFileUploadAdapter(this.context);
92
92
  const onStateChange = (clientState) => {
93
93
  // unsubscribe when the instance gets disposed
@@ -117,19 +117,19 @@ export class AzureCommunicationChatAdapter {
117
117
  this.loadPreviousChatMessages = this.loadPreviousChatMessages.bind(this);
118
118
  this.on = this.on.bind(this);
119
119
  this.off = this.off.bind(this);
120
- /* @conditional-compile-remove(file-sharing) */
120
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
121
121
  this.registerActiveFileUploads = this.registerActiveFileUploads.bind(this);
122
- /* @conditional-compile-remove(file-sharing) */
122
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
123
123
  this.registerCompletedFileUploads = this.registerCompletedFileUploads.bind(this);
124
- /* @conditional-compile-remove(file-sharing) */
124
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
125
125
  this.clearFileUploads = this.clearFileUploads.bind(this);
126
- /* @conditional-compile-remove(file-sharing) */
126
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
127
127
  this.cancelFileUpload = this.cancelFileUpload.bind(this);
128
- /* @conditional-compile-remove(file-sharing) */
128
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
129
129
  this.updateFileUploadProgress = this.updateFileUploadProgress.bind(this);
130
- /* @conditional-compile-remove(file-sharing) */
130
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
131
131
  this.updateFileUploadErrorMessage = this.updateFileUploadErrorMessage.bind(this);
132
- /* @conditional-compile-remove(file-sharing) */
132
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
133
133
  this.updateFileUploadMetadata = this.updateFileUploadMetadata.bind(this);
134
134
  this.downloadResourceToCache = this.downloadResourceToCache.bind(this);
135
135
  this.removeResourceFromCache = this.removeResourceFromCache.bind(this);
@@ -179,9 +179,9 @@ export class AzureCommunicationChatAdapter {
179
179
  sendMessage(content_1) {
180
180
  return __awaiter(this, arguments, void 0, function* (content, options = {}) {
181
181
  yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
182
- /* @conditional-compile-remove(file-sharing) */
182
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
183
183
  options.metadata = Object.assign(Object.assign({}, options.metadata), convertFileUploadsUiStateToMessageMetadata(this.context.getState().fileUploads));
184
- /* @conditional-compile-remove(file-sharing) */
184
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
185
185
  /**
186
186
  * All the current uploads need to be clear from the state before a message has been sent.
187
187
  * This ensures the following behavior:
@@ -232,9 +232,9 @@ export class AzureCommunicationChatAdapter {
232
232
  updateMessage(messageId, content, metadata, options) {
233
233
  return __awaiter(this, void 0, void 0, function* () {
234
234
  return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
235
- /* @conditional-compile-remove(file-sharing) */
235
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
236
236
  const updatedOptions = { attachmentMetadata: options === null || options === void 0 ? void 0 : options.attachmentMetadata, metadata: metadata };
237
- /* @conditional-compile-remove(file-sharing) */
237
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
238
238
  return yield this.handlers.onUpdateMessage(messageId, content, updatedOptions);
239
239
  return yield this.handlers.onUpdateMessage(messageId, content);
240
240
  }));
@@ -247,31 +247,31 @@ export class AzureCommunicationChatAdapter {
247
247
  }));
248
248
  });
249
249
  }
250
- /* @conditional-compile-remove(file-sharing) */
250
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
251
251
  registerActiveFileUploads(files) {
252
252
  return this.fileUploadAdapter.registerActiveFileUploads(files);
253
253
  }
254
- /* @conditional-compile-remove(file-sharing) */
254
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
255
255
  registerCompletedFileUploads(metadata) {
256
256
  return this.fileUploadAdapter.registerCompletedFileUploads(metadata);
257
257
  }
258
- /* @conditional-compile-remove(file-sharing) */
258
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
259
259
  clearFileUploads() {
260
260
  this.fileUploadAdapter.clearFileUploads();
261
261
  }
262
- /* @conditional-compile-remove(file-sharing) */
262
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
263
263
  cancelFileUpload(id) {
264
264
  this.fileUploadAdapter.cancelFileUpload(id);
265
265
  }
266
- /* @conditional-compile-remove(file-sharing) */
266
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
267
267
  updateFileUploadProgress(id, progress) {
268
268
  this.fileUploadAdapter.updateFileUploadProgress(id, progress);
269
269
  }
270
- /* @conditional-compile-remove(file-sharing) */
270
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
271
271
  updateFileUploadErrorMessage(id, errorMessage) {
272
272
  this.fileUploadAdapter.updateFileUploadErrorMessage(id, errorMessage);
273
273
  }
274
- /* @conditional-compile-remove(file-sharing) */
274
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
275
275
  updateFileUploadMetadata(id, metadata) {
276
276
  this.fileUploadAdapter.updateFileUploadMetadata(id, metadata);
277
277
  }
@@ -1 +1 @@
1
- {"version":3,"file":"AzureCommunicationChatAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;;;;;;;;AAElC,OAAO,EACL,8BAA8B,EAI/B,gDAAuC;AACxC,OAAO,EAAgB,yBAAyB,EAAE,mDAA0C;AAY5F,OAAO,EAAE,6BAA6B,EAAgC,yCAAgC;AACtG,OAAO,YAAY,MAAM,QAAQ,CAAC;AAclC,+CAA+C;AAC/C,OAAO,EAAqB,0CAA0C,EAAE,MAAM,uCAAuC,CAAC;AACtH,+CAA+C;AAC/C,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,yCAAgC;AAM7D;;;GAGG;AACH,MAAM,OAAO,WAAW;IAKtB,YAAY,WAA4B,EAAE,QAAgB;QAJlD,YAAO,GAAiB,IAAI,YAAY,EAAE,CAAC;QAKjD,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC7C,IAAI,CAA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W,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,CAAC,CACpG,CAAC;IAEF,4DAA4D;IAC5D,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,GAAG,EAAE;YACV,CAAC,GAAS,EAAE;gBACV,IAAI,UAAU,CAAC,OAAO,EAAE,CAAC;oBACvB,IAAI,gBAAgB,CAAC,OAAO,EAAE,CAAC;wBAC7B,MAAM,gBAAgB,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;oBACrD,CAAC;oBACD,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;oBAC7B,UAAU,CAAC,OAAO,GAAG,SAAS,CAAC;gBACjC,CAAC;YACH,CAAC,CAAA,CAAC,EAAE,CAAC;QACP,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAgB,6CAA6C,CACjE,UAA8B,EAC9B,gBAAkC;;QAElC,OAAO,IAAI,6BAA6B,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;IACzE,CAAC;CAAA;AAED,MAAM,WAAW,GAAG,CAAC,CAAQ,EAAkB,EAAE;IAC/C,OAAO,QAAQ,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,SAAS,IAAI,YAAY,IAAI,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,KAAK,SAAS,CAAC;AAC1G,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n _createStatefulChatClientInner,\n ChatClientState,\n ChatError,\n StatefulChatClient\n} from '@internal/chat-stateful-client';\nimport { ChatHandlers, createDefaultChatHandlers } from '@internal/chat-component-bindings';\nimport { ChatMessage, ChatMessageType, ChatThreadClient, SendMessageOptions } from '@azure/communication-chat';\nimport { CommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';\nimport type {\n ChatMessageDeletedEvent,\n ChatMessageEditedEvent,\n ChatMessageReceivedEvent,\n ChatThreadPropertiesUpdatedEvent,\n ParticipantsAddedEvent,\n ParticipantsRemovedEvent,\n ReadReceiptReceivedEvent\n} from '@azure/communication-chat';\nimport { toFlatCommunicationIdentifier, _TelemetryImplementationHint } from '@internal/acs-ui-common';\nimport EventEmitter from 'events';\nimport {\n ChatAdapter,\n ChatAdapterState,\n MessageDeletedListener,\n MessageEditedListener,\n MessageReadListener,\n MessageReceivedListener,\n ParticipantsAddedListener,\n ParticipantsRemovedListener,\n TopicChangedListener\n} from './ChatAdapter';\nimport { ResourceDetails } from './ChatAdapter';\nimport { AdapterError } from '../../common/adapters';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileUploadAdapter, convertFileUploadsUiStateToMessageMetadata } from './AzureCommunicationFileUploadAdapter';\n/* @conditional-compile-remove(file-sharing) */\nimport { AzureCommunicationFileUploadAdapter } from './AzureCommunicationFileUploadAdapter';\nimport { useEffect, useRef, useState } from 'react';\nimport { _isValidIdentifier } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing) */\nimport { AttachmentMetadata } from '@internal/react-components';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileUploadManager } from '../file-sharing';\n\n/**\n * Context of Chat, which is a centralized context for all state updates\n * @private\n */\nexport class ChatContext {\n private emitter: EventEmitter = new EventEmitter();\n private state: ChatAdapterState;\n private threadId: string;\n\n constructor(clientState: ChatClientState, threadId: string) {\n const thread = clientState.threads[threadId];\n this.threadId = threadId;\n if (!thread) {\n throw 'Cannot find threadId, please initialize thread before use!';\n }\n this.state = {\n userId: clientState.userId,\n displayName: clientState.displayName,\n thread,\n latestErrors: clientState.latestErrors\n };\n }\n\n public onStateChange(handler: (_uiState: ChatAdapterState) => void): void {\n this.emitter.on('stateChanged', handler);\n }\n\n public offStateChange(handler: (_uiState: ChatAdapterState) => void): void {\n this.emitter.off('stateChanged', handler);\n }\n\n public setState(state: ChatAdapterState): void {\n this.state = state;\n this.emitter.emit('stateChanged', this.state);\n }\n\n public getState(): ChatAdapterState {\n return this.state;\n }\n\n public setError(error: Error): void {\n this.setState({ ...this.state, error });\n }\n\n public updateClientState(clientState: ChatClientState): void {\n const thread = clientState.threads[this.threadId];\n if (!thread) {\n throw 'Cannot find threadId, please make sure thread state is still in Stateful ChatClient.';\n }\n\n let updatedState: ChatAdapterState = {\n userId: clientState.userId,\n displayName: clientState.displayName,\n thread,\n latestErrors: clientState.latestErrors\n };\n\n /* @conditional-compile-remove(file-sharing) */\n updatedState = { ...updatedState, fileUploads: this.state.fileUploads };\n\n this.setState(updatedState);\n }\n}\n\n/**\n * @private\n */\nexport class AzureCommunicationChatAdapter implements ChatAdapter {\n private chatClient: StatefulChatClient;\n private chatThreadClient: ChatThreadClient;\n private context: ChatContext;\n /* @conditional-compile-remove(file-sharing) */\n private fileUploadAdapter: FileUploadAdapter;\n private handlers: ChatHandlers;\n private emitter: EventEmitter = new EventEmitter();\n\n constructor(chatClient: StatefulChatClient, chatThreadClient: ChatThreadClient) {\n this.bindAllPublicMethods();\n this.chatClient = chatClient;\n this.chatThreadClient = chatThreadClient;\n this.context = new ChatContext(chatClient.getState(), chatThreadClient.threadId);\n /* @conditional-compile-remove(file-sharing) */\n this.fileUploadAdapter = new AzureCommunicationFileUploadAdapter(this.context);\n\n const onStateChange = (clientState: ChatClientState): void => {\n // unsubscribe when the instance gets disposed\n if (!this) {\n chatClient.offStateChange(onStateChange);\n return;\n }\n this.context.updateClientState(clientState);\n };\n\n this.handlers = createDefaultChatHandlers(chatClient, chatThreadClient);\n\n this.chatClient.onStateChange(onStateChange);\n this.subscribeAllEvents();\n }\n\n private bindAllPublicMethods(): void {\n this.onStateChange = this.onStateChange.bind(this);\n this.offStateChange = this.offStateChange.bind(this);\n this.getState = this.getState.bind(this);\n this.dispose = this.dispose.bind(this);\n this.fetchInitialData = this.fetchInitialData.bind(this);\n this.sendMessage = this.sendMessage.bind(this);\n this.sendReadReceipt = this.sendReadReceipt.bind(this);\n this.sendTypingIndicator = this.sendTypingIndicator.bind(this);\n this.updateMessage = this.updateMessage.bind(this);\n this.deleteMessage = this.deleteMessage.bind(this);\n this.removeParticipant = this.removeParticipant.bind(this);\n this.setTopic = this.setTopic.bind(this);\n this.loadPreviousChatMessages = this.loadPreviousChatMessages.bind(this);\n this.on = this.on.bind(this);\n this.off = this.off.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.registerActiveFileUploads = this.registerActiveFileUploads.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.registerCompletedFileUploads = this.registerCompletedFileUploads.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.clearFileUploads = this.clearFileUploads.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.cancelFileUpload = this.cancelFileUpload.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.updateFileUploadProgress = this.updateFileUploadProgress.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.updateFileUploadErrorMessage = this.updateFileUploadErrorMessage.bind(this);\n /* @conditional-compile-remove(file-sharing) */\n this.updateFileUploadMetadata = this.updateFileUploadMetadata.bind(this);\n this.downloadResourceToCache = this.downloadResourceToCache.bind(this);\n this.removeResourceFromCache = this.removeResourceFromCache.bind(this);\n }\n\n dispose(): void {\n this.unsubscribeAllEvents();\n this.chatClient.dispose();\n }\n\n async fetchInitialData(): Promise<void> {\n // If get properties fails we dont want to try to get the participants after.\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.chatThreadClient.getProperties();\n // Fetch all participants who joined before the local user.\n for await (const _page of this.chatThreadClient.listParticipants().byPage({\n // Fetch 100 participants per page by default.\n maxPageSize: 100\n // eslint-disable-next-line curly\n }));\n });\n }\n\n getState(): ChatAdapterState {\n return this.context.getState();\n }\n\n onStateChange(handler: (state: ChatAdapterState) => void): void {\n this.context.onStateChange(handler);\n }\n\n offStateChange(handler: (state: ChatAdapterState) => void): void {\n this.context.offStateChange(handler);\n }\n\n async sendMessage(content: string, options: SendMessageOptions = {}): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n /* @conditional-compile-remove(file-sharing) */\n options.metadata = {\n ...options.metadata,\n ...convertFileUploadsUiStateToMessageMetadata(this.context.getState().fileUploads)\n };\n\n /* @conditional-compile-remove(file-sharing) */\n /**\n * All the current uploads need to be clear from the state before a message has been sent.\n * This ensures the following behavior:\n * 1. File Upload cards are removed from sendbox at the same time text in sendbox is removed.\n * 2. any component rendering these file uploads doesn't continue to do so.\n * 3. Cleans the state for new file uploads with a fresh message.\n */\n this.fileUploadAdapter.clearFileUploads();\n\n await this.handlers.onSendMessage(content, options);\n });\n }\n\n async sendReadReceipt(chatMessageId: string): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onMessageSeen(chatMessageId);\n });\n }\n\n async sendTypingIndicator(): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onTyping();\n });\n }\n\n async removeParticipant(userId: string): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onRemoveParticipant(userId);\n });\n }\n\n async setTopic(topicName: string): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.updateThreadTopicName(topicName);\n });\n }\n\n async loadPreviousChatMessages(messagesToLoad: number): Promise<boolean> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return await this.handlers.onLoadPreviousChatMessages(messagesToLoad);\n });\n }\n\n async updateMessage(\n messageId: string,\n content: string,\n metadata?: Record<string, string>,\n options?: {\n /* @conditional-compile-remove(file-sharing) */\n attachmentMetadata?: AttachmentMetadata[];\n }\n ): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n /* @conditional-compile-remove(file-sharing) */\n const updatedOptions = { attachmentMetadata: options?.attachmentMetadata, metadata: metadata };\n /* @conditional-compile-remove(file-sharing) */\n return await this.handlers.onUpdateMessage(messageId, content, updatedOptions);\n return await this.handlers.onUpdateMessage(messageId, content);\n });\n }\n\n async deleteMessage(messageId: string): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return await this.handlers.onDeleteMessage(messageId);\n });\n }\n\n /* @conditional-compile-remove(file-sharing) */\n registerActiveFileUploads(files: File[]): FileUploadManager[] {\n return this.fileUploadAdapter.registerActiveFileUploads(files);\n }\n\n /* @conditional-compile-remove(file-sharing) */\n registerCompletedFileUploads(metadata: AttachmentMetadata[]): FileUploadManager[] {\n return this.fileUploadAdapter.registerCompletedFileUploads(metadata);\n }\n\n /* @conditional-compile-remove(file-sharing) */\n clearFileUploads(): void {\n this.fileUploadAdapter.clearFileUploads();\n }\n\n /* @conditional-compile-remove(file-sharing) */\n cancelFileUpload(id: string): void {\n this.fileUploadAdapter.cancelFileUpload(id);\n }\n\n /* @conditional-compile-remove(file-sharing) */\n updateFileUploadProgress(id: string, progress: number): void {\n this.fileUploadAdapter.updateFileUploadProgress(id, progress);\n }\n\n /* @conditional-compile-remove(file-sharing) */\n updateFileUploadErrorMessage(id: string, errorMessage: string): void {\n this.fileUploadAdapter.updateFileUploadErrorMessage(id, errorMessage);\n }\n\n /* @conditional-compile-remove(file-sharing) */\n updateFileUploadMetadata(id: string, metadata: AttachmentMetadata): void {\n this.fileUploadAdapter.updateFileUploadMetadata(id, metadata);\n }\n\n async downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void> {\n this.chatClient.downloadResourceToCache(\n resourceDetails.threadId,\n resourceDetails.messageId,\n resourceDetails.resourceUrl\n );\n }\n\n removeResourceFromCache(resourceDetails: ResourceDetails): void {\n this.chatClient.removeResourceFromCache(\n resourceDetails.threadId,\n resourceDetails.messageId,\n resourceDetails.resourceUrl\n );\n }\n\n private messageReceivedListener(event: ChatMessageReceivedEvent): void {\n const isCurrentChatAdapterThread = event.threadId === this.chatThreadClient.threadId;\n\n if (!isCurrentChatAdapterThread) {\n return;\n }\n\n const message = convertEventToChatMessage(event);\n this.emitter.emit('messageReceived', { message });\n\n const currentUserId = toFlatCommunicationIdentifier(this.chatClient.getState().userId);\n if (message?.sender && toFlatCommunicationIdentifier(message.sender) === currentUserId) {\n this.emitter.emit('messageSent', { message });\n }\n }\n\n private messageEditedListener(event: ChatMessageEditedEvent): void {\n const isCurrentChatAdapterThread = event.threadId === this.chatThreadClient.threadId;\n if (!isCurrentChatAdapterThread) {\n return;\n }\n\n const message = convertEventToChatMessage(event);\n this.emitter.emit('messageEdited', { message });\n }\n\n private messageDeletedListener(event: ChatMessageDeletedEvent): void {\n const isCurrentChatAdapterThread = event.threadId === this.chatThreadClient.threadId;\n if (!isCurrentChatAdapterThread) {\n return;\n }\n\n const message = convertEventToChatMessage(event);\n this.emitter.emit('messageDeleted', { message });\n }\n\n private messageReadListener({ chatMessageId, recipient }: ReadReceiptReceivedEvent): void {\n const message = this.getState().thread.chatMessages[chatMessageId];\n if (message) {\n this.emitter.emit('messageRead', { message, readBy: recipient });\n }\n }\n\n private participantsAddedListener({ addedBy, participantsAdded }: ParticipantsAddedEvent): void {\n this.emitter.emit('participantsAdded', { addedBy, participantsAdded });\n }\n\n private participantsRemovedListener({ removedBy, participantsRemoved }: ParticipantsRemovedEvent): void {\n this.emitter.emit('participantsRemoved', { removedBy, participantsRemoved });\n }\n\n private chatThreadPropertiesUpdatedListener(event: ChatThreadPropertiesUpdatedEvent): void {\n this.emitter.emit('topicChanged', { topic: event.properties.topic });\n }\n\n private subscribeAllEvents(): void {\n this.chatClient.on('chatThreadPropertiesUpdated', this.chatThreadPropertiesUpdatedListener.bind(this));\n this.chatClient.on('participantsAdded', this.participantsAddedListener.bind(this));\n this.chatClient.on('participantsRemoved', this.participantsRemovedListener.bind(this));\n this.chatClient.on('chatMessageReceived', this.messageReceivedListener.bind(this));\n this.chatClient.on('chatMessageEdited', this.messageEditedListener.bind(this));\n this.chatClient.on('chatMessageDeleted', this.messageDeletedListener.bind(this));\n this.chatClient.on('readReceiptReceived', this.messageReadListener.bind(this));\n this.chatClient.on('participantsRemoved', this.participantsRemovedListener.bind(this));\n }\n\n private unsubscribeAllEvents(): void {\n this.chatClient.off('chatThreadPropertiesUpdated', this.chatThreadPropertiesUpdatedListener.bind(this));\n this.chatClient.off('participantsAdded', this.participantsAddedListener.bind(this));\n this.chatClient.off('participantsRemoved', this.participantsRemovedListener.bind(this));\n this.chatClient.off('chatMessageReceived', this.messageReceivedListener.bind(this));\n this.chatClient.off('chatMessageEdited', this.messageEditedListener.bind(this));\n this.chatClient.off('chatMessageDeleted', this.messageDeletedListener.bind(this));\n this.chatClient.off('readReceiptReceived', this.messageReadListener.bind(this));\n this.chatClient.off('participantsRemoved', this.participantsRemovedListener.bind(this));\n }\n\n on(event: 'messageReceived', listener: MessageReceivedListener): void;\n on(event: 'messageEdited', listener: MessageEditedListener): void;\n on(event: 'messageDeleted', listener: MessageDeletedListener): void;\n on(event: 'messageSent', listener: MessageReceivedListener): void;\n on(event: 'messageRead', listener: MessageReadListener): void;\n on(event: 'participantsAdded', listener: ParticipantsAddedListener): void;\n on(event: 'participantsRemoved', listener: ParticipantsRemovedListener): void;\n on(event: 'topicChanged', listener: TopicChangedListener): void;\n on(event: 'error', listener: (e: AdapterError) => void): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n on(event: string, listener: (e: any) => void): void {\n this.emitter.on(event, listener);\n }\n\n off(event: 'messageReceived', listener: MessageReceivedListener): void;\n off(event: 'messageEdited', listener: MessageEditedListener): void;\n off(event: 'messageDeleted', listener: MessageDeletedListener): void;\n off(event: 'messageSent', listener: MessageReceivedListener): void;\n off(event: 'messageRead', listener: MessageReadListener): void;\n off(event: 'participantsAdded', listener: ParticipantsAddedListener): void;\n off(event: 'participantsRemoved', listener: ParticipantsRemovedListener): void;\n off(event: 'topicChanged', listener: TopicChangedListener): void;\n off(event: 'error', listener: (e: AdapterError) => void): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n off(event: string, listener: (e: any) => void): void {\n this.emitter.off(event, listener);\n }\n\n private async asyncTeeErrorToEventEmitter<T>(f: () => Promise<T>): Promise<T> {\n try {\n return await f();\n } catch (error) {\n if (isChatError(error as Error)) {\n this.emitter.emit('error', error as AdapterError);\n }\n throw error;\n }\n }\n}\n\nconst convertEventToChatMessage = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent | ChatMessageDeletedEvent\n): ChatMessage => {\n return {\n id: event.id,\n version: event.version,\n content: isChatMessageDeletedEvent(event) ? undefined : { message: event.message },\n type: convertEventType(event.type),\n sender: event.sender,\n senderDisplayName: event.senderDisplayName,\n sequenceId: '',\n createdOn: new Date(event.createdOn),\n editedOn: isChatMessageEditedEvent(event) ? event.editedOn : undefined,\n deletedOn: isChatMessageDeletedEvent(event) ? event.deletedOn : undefined\n };\n};\n\nconst isChatMessageEditedEvent = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent | ChatMessageDeletedEvent\n): event is ChatMessageEditedEvent => {\n return 'editedOn' in event;\n};\n\nconst isChatMessageDeletedEvent = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent | ChatMessageDeletedEvent\n): event is ChatMessageDeletedEvent => {\n return 'deletedOn' in event;\n};\n\n// only text/html message type will be received from event\nconst 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\n/**\n * Arguments for creating the Azure Communication Services implementation of {@link ChatAdapter}.\n *\n * @public\n */\nexport type AzureCommunicationChatAdapterArgs = {\n endpoint: string;\n userId: CommunicationUserIdentifier;\n displayName: string;\n credential: CommunicationTokenCredential;\n threadId: string;\n};\n\n/**\n * Create a {@link ChatAdapter} backed by Azure Communication Services.\n *\n * This is the default implementation of {@link ChatAdapter} provided by this library.\n *\n * @public\n */\nexport const createAzureCommunicationChatAdapter = async ({\n endpoint: endpointUrl,\n userId,\n displayName,\n credential,\n threadId\n}: AzureCommunicationChatAdapterArgs): Promise<ChatAdapter> => {\n return _createAzureCommunicationChatAdapterInner(endpointUrl, userId, displayName, credential, threadId);\n};\n\n/**\n * This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.\n *\n * @internal\n */\nexport const _createAzureCommunicationChatAdapterInner = async (\n endpoint: string,\n userId: CommunicationUserIdentifier,\n displayName: string,\n credential: CommunicationTokenCredential,\n threadId: string,\n telemetryImplementationHint: _TelemetryImplementationHint = 'Chat'\n): Promise<ChatAdapter> => {\n if (!_isValidIdentifier(userId)) {\n throw new Error('Provided userId is invalid. Please provide valid identifier object.');\n }\n\n const chatClient = _createStatefulChatClientInner(\n {\n userId,\n displayName,\n endpoint,\n credential\n },\n undefined,\n telemetryImplementationHint\n );\n const chatThreadClient = await chatClient.getChatThreadClient(threadId);\n await chatClient.startRealtimeNotifications();\n\n const adapter = await createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient);\n\n return adapter;\n};\n\n/**\n * A custom React hook to simplify the creation of {@link ChatAdapter}.\n *\n * Similar to {@link createAzureCommunicationChatAdapter}, but takes care of asynchronous\n * creation of the adapter internally.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n *\n * Note that you must memoize the arguments to avoid recreating adapter on each render.\n * See storybook for typical usage examples.\n *\n * @public\n */\nexport const useAzureCommunicationChatAdapter = (\n /**\n * Arguments to be passed to {@link createAzureCommunicationChatAdapter}.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n */\n args: Partial<AzureCommunicationChatAdapterArgs>,\n /**\n * Optional callback to modify the adapter once it is created.\n *\n * If set, must return the modified adapter.\n */\n afterCreate?: (adapter: ChatAdapter) => Promise<ChatAdapter>,\n /**\n * Optional callback called before the adapter is disposed.\n *\n * This is useful for clean up tasks, e.g., leaving any ongoing calls.\n */\n beforeDispose?: (adapter: ChatAdapter) => Promise<void>\n): ChatAdapter | undefined => {\n const { credential, displayName, endpoint, threadId, userId } = args;\n\n // State update needed to rerender the parent component when a new adapter is created.\n const [adapter, setAdapter] = useState<ChatAdapter | undefined>(undefined);\n // Ref needed for cleanup to access the old adapter created asynchronously.\n const adapterRef = useRef<ChatAdapter | undefined>(undefined);\n\n const afterCreateRef = useRef<((adapter: ChatAdapter) => Promise<ChatAdapter>) | undefined>(undefined);\n const beforeDisposeRef = useRef<((adapter: ChatAdapter) => Promise<void>) | undefined>(undefined);\n // These refs are updated on *each* render, so that the latest values\n // are used in the `useEffect` closures below.\n // Using a Ref ensures that new values for the callbacks do not trigger the\n // useEffect blocks, and a new adapter creation / distruction is not triggered.\n afterCreateRef.current = afterCreate;\n beforeDisposeRef.current = beforeDispose;\n\n useEffect(\n () => {\n if (!credential || !displayName || !endpoint || !threadId || !userId) {\n return;\n }\n (async () => {\n if (adapterRef.current) {\n // Dispose the old adapter when a new one is created.\n //\n // This clean up function uses `adapterRef` because `adapter` can not be added to the dependency array of\n // this `useEffect` -- we do not want to trigger a new adapter creation because of the first adapter\n // creation.\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n\n let newAdapter = await createAzureCommunicationChatAdapter({\n credential,\n displayName,\n endpoint,\n threadId,\n userId\n });\n if (afterCreateRef.current) {\n newAdapter = await afterCreateRef.current(newAdapter);\n }\n adapterRef.current = newAdapter;\n setAdapter(newAdapter);\n })();\n },\n // Explicitly list all arguments so that caller doesn't have to memoize the `args` object.\n [adapterRef, afterCreateRef, beforeDisposeRef, credential, displayName, endpoint, threadId, userId]\n );\n\n // Dispose any existing adapter when the component unmounts.\n useEffect(() => {\n return () => {\n (async () => {\n if (adapterRef.current) {\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n })();\n };\n }, []);\n\n return adapter;\n};\n\n/**\n * Create a {@link ChatAdapter} using the provided {@link StatefulChatClient}.\n *\n * Useful if you want to keep a reference to {@link StatefulChatClient}.\n * Consider using {@link createAzureCommunicationChatAdapter} for a simpler API.\n *\n * @public\n */\nexport async function createAzureCommunicationChatAdapterFromClient(\n chatClient: StatefulChatClient,\n chatThreadClient: ChatThreadClient\n): Promise<ChatAdapter> {\n return new AzureCommunicationChatAdapter(chatClient, chatThreadClient);\n}\n\nconst isChatError = (e: Error): e is ChatError => {\n return 'target' in e && e['target'] !== undefined && 'innerError' in e && e['innerError'] !== undefined;\n};\n"]}
1
+ {"version":3,"file":"AzureCommunicationChatAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;;;;;;;;AAElC,OAAO,EACL,8BAA8B,EAI/B,gDAAuC;AACxC,OAAO,EAAgB,yBAAyB,EAAE,mDAA0C;AAY5F,OAAO,EAAE,6BAA6B,EAAgC,yCAAgC;AACtG,OAAO,YAAY,MAAM,QAAQ,CAAC;AAclC,qGAAqG;AACrG,OAAO,EAAqB,0CAA0C,EAAE,MAAM,uCAAuC,CAAC;AACtH,qGAAqG;AACrG,OAAO,EAAE,mCAAmC,EAAE,MAAM,uCAAuC,CAAC;AAC5F,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,yCAAgC;AAM7D;;;GAGG;AACH,MAAM,OAAO,WAAW;IAKtB,YAAY,WAA4B,EAAE,QAAgB;QAJlD,YAAO,GAAiB,IAAI,YAAY,EAAE,CAAC;QAKjD,MAAM,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC7C,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,MAAM,EAAE,CAAC;YACZ,MAAM,4DAA4D,CAAC;QACrE,CAAC;QACD,IAAI,CAAC,KAAK,GAAG;YACX,MAAM,EAAE,WAAW,CAAC,MAAM;YAC1B,WAAW,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,gBAAgB,CAAC,OAAO,EAAE,CAAC;wBAC7B,MAAM,gBAAgB,CAAC,OAAO,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;oBACrD,CAAC;oBACD,UAAU,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;oBAC7B,UAAU,CAAC,OAAO,GAAG,SAAS,CAAC;gBACjC,CAAC;YACH,CAAC,CAAA,CAAC,EAAE,CAAC;QACP,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IAEP,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;;;;;;GAOG;AACH,MAAM,UAAgB,6CAA6C,CACjE,UAA8B,EAC9B,gBAAkC;;QAElC,OAAO,IAAI,6BAA6B,CAAC,UAAU,EAAE,gBAAgB,CAAC,CAAC;IACzE,CAAC;CAAA;AAED,MAAM,WAAW,GAAG,CAAC,CAAQ,EAAkB,EAAE;IAC/C,OAAO,QAAQ,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,SAAS,IAAI,YAAY,IAAI,CAAC,IAAI,CAAC,CAAC,YAAY,CAAC,KAAK,SAAS,CAAC;AAC1G,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport {\n _createStatefulChatClientInner,\n ChatClientState,\n ChatError,\n StatefulChatClient\n} from '@internal/chat-stateful-client';\nimport { ChatHandlers, createDefaultChatHandlers } from '@internal/chat-component-bindings';\nimport { ChatMessage, ChatMessageType, ChatThreadClient, SendMessageOptions } from '@azure/communication-chat';\nimport { CommunicationTokenCredential, CommunicationUserIdentifier } from '@azure/communication-common';\nimport type {\n ChatMessageDeletedEvent,\n ChatMessageEditedEvent,\n ChatMessageReceivedEvent,\n ChatThreadPropertiesUpdatedEvent,\n ParticipantsAddedEvent,\n ParticipantsRemovedEvent,\n ReadReceiptReceivedEvent\n} from '@azure/communication-chat';\nimport { toFlatCommunicationIdentifier, _TelemetryImplementationHint } from '@internal/acs-ui-common';\nimport EventEmitter from 'events';\nimport {\n ChatAdapter,\n ChatAdapterState,\n MessageDeletedListener,\n MessageEditedListener,\n MessageReadListener,\n MessageReceivedListener,\n ParticipantsAddedListener,\n ParticipantsRemovedListener,\n TopicChangedListener\n} from './ChatAdapter';\nimport { ResourceDetails } from './ChatAdapter';\nimport { AdapterError } from '../../common/adapters';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { FileUploadAdapter, convertFileUploadsUiStateToMessageMetadata } from './AzureCommunicationFileUploadAdapter';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { AzureCommunicationFileUploadAdapter } from './AzureCommunicationFileUploadAdapter';\nimport { useEffect, useRef, useState } from 'react';\nimport { _isValidIdentifier } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { AttachmentMetadata } from '@internal/react-components';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { FileUploadManager } from '@internal/react-components';\n\n/**\n * Context of Chat, which is a centralized context for all state updates\n * @private\n */\nexport class ChatContext {\n private emitter: EventEmitter = new EventEmitter();\n private state: ChatAdapterState;\n private threadId: string;\n\n constructor(clientState: ChatClientState, threadId: string) {\n const thread = clientState.threads[threadId];\n this.threadId = threadId;\n if (!thread) {\n throw 'Cannot find threadId, please initialize thread before use!';\n }\n this.state = {\n userId: clientState.userId,\n displayName: clientState.displayName,\n thread,\n latestErrors: clientState.latestErrors\n };\n }\n\n public onStateChange(handler: (_uiState: ChatAdapterState) => void): void {\n this.emitter.on('stateChanged', handler);\n }\n\n public offStateChange(handler: (_uiState: ChatAdapterState) => void): void {\n this.emitter.off('stateChanged', handler);\n }\n\n public setState(state: ChatAdapterState): void {\n this.state = state;\n this.emitter.emit('stateChanged', this.state);\n }\n\n public getState(): ChatAdapterState {\n return this.state;\n }\n\n public setError(error: Error): void {\n this.setState({ ...this.state, error });\n }\n\n public updateClientState(clientState: ChatClientState): void {\n const thread = clientState.threads[this.threadId];\n if (!thread) {\n throw 'Cannot find threadId, please make sure thread state is still in Stateful ChatClient.';\n }\n\n let updatedState: ChatAdapterState = {\n userId: clientState.userId,\n displayName: clientState.displayName,\n thread,\n latestErrors: clientState.latestErrors\n };\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n updatedState = { ...updatedState, fileUploads: this.state.fileUploads };\n\n this.setState(updatedState);\n }\n}\n\n/**\n * @private\n */\nexport class AzureCommunicationChatAdapter implements ChatAdapter {\n private chatClient: StatefulChatClient;\n private chatThreadClient: ChatThreadClient;\n private context: ChatContext;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n private fileUploadAdapter: FileUploadAdapter;\n private handlers: ChatHandlers;\n private emitter: EventEmitter = new EventEmitter();\n\n constructor(chatClient: StatefulChatClient, chatThreadClient: ChatThreadClient) {\n this.bindAllPublicMethods();\n this.chatClient = chatClient;\n this.chatThreadClient = chatThreadClient;\n this.context = new ChatContext(chatClient.getState(), chatThreadClient.threadId);\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n this.fileUploadAdapter = new AzureCommunicationFileUploadAdapter(this.context);\n\n const onStateChange = (clientState: ChatClientState): void => {\n // unsubscribe when the instance gets disposed\n if (!this) {\n chatClient.offStateChange(onStateChange);\n return;\n }\n this.context.updateClientState(clientState);\n };\n\n this.handlers = createDefaultChatHandlers(chatClient, chatThreadClient);\n\n this.chatClient.onStateChange(onStateChange);\n this.subscribeAllEvents();\n }\n\n private bindAllPublicMethods(): void {\n this.onStateChange = this.onStateChange.bind(this);\n this.offStateChange = this.offStateChange.bind(this);\n this.getState = this.getState.bind(this);\n this.dispose = this.dispose.bind(this);\n this.fetchInitialData = this.fetchInitialData.bind(this);\n this.sendMessage = this.sendMessage.bind(this);\n this.sendReadReceipt = this.sendReadReceipt.bind(this);\n this.sendTypingIndicator = this.sendTypingIndicator.bind(this);\n this.updateMessage = this.updateMessage.bind(this);\n this.deleteMessage = this.deleteMessage.bind(this);\n this.removeParticipant = this.removeParticipant.bind(this);\n this.setTopic = this.setTopic.bind(this);\n this.loadPreviousChatMessages = this.loadPreviousChatMessages.bind(this);\n this.on = this.on.bind(this);\n this.off = this.off.bind(this);\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n this.registerActiveFileUploads = this.registerActiveFileUploads.bind(this);\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n this.registerCompletedFileUploads = this.registerCompletedFileUploads.bind(this);\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n this.clearFileUploads = this.clearFileUploads.bind(this);\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n this.cancelFileUpload = this.cancelFileUpload.bind(this);\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n this.updateFileUploadProgress = this.updateFileUploadProgress.bind(this);\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n this.updateFileUploadErrorMessage = this.updateFileUploadErrorMessage.bind(this);\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n this.updateFileUploadMetadata = this.updateFileUploadMetadata.bind(this);\n this.downloadResourceToCache = this.downloadResourceToCache.bind(this);\n this.removeResourceFromCache = this.removeResourceFromCache.bind(this);\n }\n\n dispose(): void {\n this.unsubscribeAllEvents();\n this.chatClient.dispose();\n }\n\n async fetchInitialData(): Promise<void> {\n // If get properties fails we dont want to try to get the participants after.\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.chatThreadClient.getProperties();\n // Fetch all participants who joined before the local user.\n for await (const _page of this.chatThreadClient.listParticipants().byPage({\n // Fetch 100 participants per page by default.\n maxPageSize: 100\n // eslint-disable-next-line curly\n }));\n });\n }\n\n getState(): ChatAdapterState {\n return this.context.getState();\n }\n\n onStateChange(handler: (state: ChatAdapterState) => void): void {\n this.context.onStateChange(handler);\n }\n\n offStateChange(handler: (state: ChatAdapterState) => void): void {\n this.context.offStateChange(handler);\n }\n\n async sendMessage(content: string, options: SendMessageOptions = {}): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n options.metadata = {\n ...options.metadata,\n ...convertFileUploadsUiStateToMessageMetadata(this.context.getState().fileUploads)\n };\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n /**\n * All the current uploads need to be clear from the state before a message has been sent.\n * This ensures the following behavior:\n * 1. File Upload cards are removed from sendbox at the same time text in sendbox is removed.\n * 2. any component rendering these file uploads doesn't continue to do so.\n * 3. Cleans the state for new file uploads with a fresh message.\n */\n this.fileUploadAdapter.clearFileUploads();\n\n await this.handlers.onSendMessage(content, options);\n });\n }\n\n async sendReadReceipt(chatMessageId: string): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onMessageSeen(chatMessageId);\n });\n }\n\n async sendTypingIndicator(): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onTyping();\n });\n }\n\n async removeParticipant(userId: string): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.onRemoveParticipant(userId);\n });\n }\n\n async setTopic(topicName: string): Promise<void> {\n await this.asyncTeeErrorToEventEmitter(async () => {\n await this.handlers.updateThreadTopicName(topicName);\n });\n }\n\n async loadPreviousChatMessages(messagesToLoad: number): Promise<boolean> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return await this.handlers.onLoadPreviousChatMessages(messagesToLoad);\n });\n }\n\n async updateMessage(\n messageId: string,\n content: string,\n metadata?: Record<string, string>,\n options?: {\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n attachmentMetadata?: AttachmentMetadata[];\n }\n ): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const updatedOptions = { attachmentMetadata: options?.attachmentMetadata, metadata: metadata };\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n return await this.handlers.onUpdateMessage(messageId, content, updatedOptions);\n return await this.handlers.onUpdateMessage(messageId, content);\n });\n }\n\n async deleteMessage(messageId: string): Promise<void> {\n return await this.asyncTeeErrorToEventEmitter(async () => {\n return await this.handlers.onDeleteMessage(messageId);\n });\n }\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n registerActiveFileUploads(files: File[]): FileUploadManager[] {\n return this.fileUploadAdapter.registerActiveFileUploads(files);\n }\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n registerCompletedFileUploads(metadata: AttachmentMetadata[]): FileUploadManager[] {\n return this.fileUploadAdapter.registerCompletedFileUploads(metadata);\n }\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n clearFileUploads(): void {\n this.fileUploadAdapter.clearFileUploads();\n }\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n cancelFileUpload(id: string): void {\n this.fileUploadAdapter.cancelFileUpload(id);\n }\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n updateFileUploadProgress(id: string, progress: number): void {\n this.fileUploadAdapter.updateFileUploadProgress(id, progress);\n }\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n updateFileUploadErrorMessage(id: string, errorMessage: string): void {\n this.fileUploadAdapter.updateFileUploadErrorMessage(id, errorMessage);\n }\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n updateFileUploadMetadata(id: string, metadata: AttachmentMetadata): void {\n this.fileUploadAdapter.updateFileUploadMetadata(id, metadata);\n }\n\n async downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void> {\n this.chatClient.downloadResourceToCache(\n resourceDetails.threadId,\n resourceDetails.messageId,\n resourceDetails.resourceUrl\n );\n }\n\n removeResourceFromCache(resourceDetails: ResourceDetails): void {\n this.chatClient.removeResourceFromCache(\n resourceDetails.threadId,\n resourceDetails.messageId,\n resourceDetails.resourceUrl\n );\n }\n\n private messageReceivedListener(event: ChatMessageReceivedEvent): void {\n const isCurrentChatAdapterThread = event.threadId === this.chatThreadClient.threadId;\n\n if (!isCurrentChatAdapterThread) {\n return;\n }\n\n const message = convertEventToChatMessage(event);\n this.emitter.emit('messageReceived', { message });\n\n const currentUserId = toFlatCommunicationIdentifier(this.chatClient.getState().userId);\n if (message?.sender && toFlatCommunicationIdentifier(message.sender) === currentUserId) {\n this.emitter.emit('messageSent', { message });\n }\n }\n\n private messageEditedListener(event: ChatMessageEditedEvent): void {\n const isCurrentChatAdapterThread = event.threadId === this.chatThreadClient.threadId;\n if (!isCurrentChatAdapterThread) {\n return;\n }\n\n const message = convertEventToChatMessage(event);\n this.emitter.emit('messageEdited', { message });\n }\n\n private messageDeletedListener(event: ChatMessageDeletedEvent): void {\n const isCurrentChatAdapterThread = event.threadId === this.chatThreadClient.threadId;\n if (!isCurrentChatAdapterThread) {\n return;\n }\n\n const message = convertEventToChatMessage(event);\n this.emitter.emit('messageDeleted', { message });\n }\n\n private messageReadListener({ chatMessageId, recipient }: ReadReceiptReceivedEvent): void {\n const message = this.getState().thread.chatMessages[chatMessageId];\n if (message) {\n this.emitter.emit('messageRead', { message, readBy: recipient });\n }\n }\n\n private participantsAddedListener({ addedBy, participantsAdded }: ParticipantsAddedEvent): void {\n this.emitter.emit('participantsAdded', { addedBy, participantsAdded });\n }\n\n private participantsRemovedListener({ removedBy, participantsRemoved }: ParticipantsRemovedEvent): void {\n this.emitter.emit('participantsRemoved', { removedBy, participantsRemoved });\n }\n\n private chatThreadPropertiesUpdatedListener(event: ChatThreadPropertiesUpdatedEvent): void {\n this.emitter.emit('topicChanged', { topic: event.properties.topic });\n }\n\n private subscribeAllEvents(): void {\n this.chatClient.on('chatThreadPropertiesUpdated', this.chatThreadPropertiesUpdatedListener.bind(this));\n this.chatClient.on('participantsAdded', this.participantsAddedListener.bind(this));\n this.chatClient.on('participantsRemoved', this.participantsRemovedListener.bind(this));\n this.chatClient.on('chatMessageReceived', this.messageReceivedListener.bind(this));\n this.chatClient.on('chatMessageEdited', this.messageEditedListener.bind(this));\n this.chatClient.on('chatMessageDeleted', this.messageDeletedListener.bind(this));\n this.chatClient.on('readReceiptReceived', this.messageReadListener.bind(this));\n this.chatClient.on('participantsRemoved', this.participantsRemovedListener.bind(this));\n }\n\n private unsubscribeAllEvents(): void {\n this.chatClient.off('chatThreadPropertiesUpdated', this.chatThreadPropertiesUpdatedListener.bind(this));\n this.chatClient.off('participantsAdded', this.participantsAddedListener.bind(this));\n this.chatClient.off('participantsRemoved', this.participantsRemovedListener.bind(this));\n this.chatClient.off('chatMessageReceived', this.messageReceivedListener.bind(this));\n this.chatClient.off('chatMessageEdited', this.messageEditedListener.bind(this));\n this.chatClient.off('chatMessageDeleted', this.messageDeletedListener.bind(this));\n this.chatClient.off('readReceiptReceived', this.messageReadListener.bind(this));\n this.chatClient.off('participantsRemoved', this.participantsRemovedListener.bind(this));\n }\n\n on(event: 'messageReceived', listener: MessageReceivedListener): void;\n on(event: 'messageEdited', listener: MessageEditedListener): void;\n on(event: 'messageDeleted', listener: MessageDeletedListener): void;\n on(event: 'messageSent', listener: MessageReceivedListener): void;\n on(event: 'messageRead', listener: MessageReadListener): void;\n on(event: 'participantsAdded', listener: ParticipantsAddedListener): void;\n on(event: 'participantsRemoved', listener: ParticipantsRemovedListener): void;\n on(event: 'topicChanged', listener: TopicChangedListener): void;\n on(event: 'error', listener: (e: AdapterError) => void): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n on(event: string, listener: (e: any) => void): void {\n this.emitter.on(event, listener);\n }\n\n off(event: 'messageReceived', listener: MessageReceivedListener): void;\n off(event: 'messageEdited', listener: MessageEditedListener): void;\n off(event: 'messageDeleted', listener: MessageDeletedListener): void;\n off(event: 'messageSent', listener: MessageReceivedListener): void;\n off(event: 'messageRead', listener: MessageReadListener): void;\n off(event: 'participantsAdded', listener: ParticipantsAddedListener): void;\n off(event: 'participantsRemoved', listener: ParticipantsRemovedListener): void;\n off(event: 'topicChanged', listener: TopicChangedListener): void;\n off(event: 'error', listener: (e: AdapterError) => void): void;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n off(event: string, listener: (e: any) => void): void {\n this.emitter.off(event, listener);\n }\n\n private async asyncTeeErrorToEventEmitter<T>(f: () => Promise<T>): Promise<T> {\n try {\n return await f();\n } catch (error) {\n if (isChatError(error as Error)) {\n this.emitter.emit('error', error as AdapterError);\n }\n throw error;\n }\n }\n}\n\nconst convertEventToChatMessage = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent | ChatMessageDeletedEvent\n): ChatMessage => {\n return {\n id: event.id,\n version: event.version,\n content: isChatMessageDeletedEvent(event) ? undefined : { message: event.message },\n type: convertEventType(event.type),\n sender: event.sender,\n senderDisplayName: event.senderDisplayName,\n sequenceId: '',\n createdOn: new Date(event.createdOn),\n editedOn: isChatMessageEditedEvent(event) ? event.editedOn : undefined,\n deletedOn: isChatMessageDeletedEvent(event) ? event.deletedOn : undefined\n };\n};\n\nconst isChatMessageEditedEvent = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent | ChatMessageDeletedEvent\n): event is ChatMessageEditedEvent => {\n return 'editedOn' in event;\n};\n\nconst isChatMessageDeletedEvent = (\n event: ChatMessageReceivedEvent | ChatMessageEditedEvent | ChatMessageDeletedEvent\n): event is ChatMessageDeletedEvent => {\n return 'deletedOn' in event;\n};\n\n// only text/html message type will be received from event\nconst 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\n/**\n * Arguments for creating the Azure Communication Services implementation of {@link ChatAdapter}.\n *\n * @public\n */\nexport type AzureCommunicationChatAdapterArgs = {\n endpoint: string;\n userId: CommunicationUserIdentifier;\n displayName: string;\n credential: CommunicationTokenCredential;\n threadId: string;\n};\n\n/**\n * Create a {@link ChatAdapter} backed by Azure Communication Services.\n *\n * This is the default implementation of {@link ChatAdapter} provided by this library.\n *\n * @public\n */\nexport const createAzureCommunicationChatAdapter = async ({\n endpoint: endpointUrl,\n userId,\n displayName,\n credential,\n threadId\n}: AzureCommunicationChatAdapterArgs): Promise<ChatAdapter> => {\n return _createAzureCommunicationChatAdapterInner(endpointUrl, userId, displayName, credential, threadId);\n};\n\n/**\n * This inner function is used to allow injection of TelemetryImplementationHint without changing the public API.\n *\n * @internal\n */\nexport const _createAzureCommunicationChatAdapterInner = async (\n endpoint: string,\n userId: CommunicationUserIdentifier,\n displayName: string,\n credential: CommunicationTokenCredential,\n threadId: string,\n telemetryImplementationHint: _TelemetryImplementationHint = 'Chat'\n): Promise<ChatAdapter> => {\n if (!_isValidIdentifier(userId)) {\n throw new Error('Provided userId is invalid. Please provide valid identifier object.');\n }\n\n const chatClient = _createStatefulChatClientInner(\n {\n userId,\n displayName,\n endpoint,\n credential\n },\n undefined,\n telemetryImplementationHint\n );\n const chatThreadClient = await chatClient.getChatThreadClient(threadId);\n await chatClient.startRealtimeNotifications();\n\n const adapter = await createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient);\n\n return adapter;\n};\n\n/**\n * A custom React hook to simplify the creation of {@link ChatAdapter}.\n *\n * Similar to {@link createAzureCommunicationChatAdapter}, but takes care of asynchronous\n * creation of the adapter internally.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n *\n * Note that you must memoize the arguments to avoid recreating adapter on each render.\n * See storybook for typical usage examples.\n *\n * @public\n */\nexport const useAzureCommunicationChatAdapter = (\n /**\n * Arguments to be passed to {@link createAzureCommunicationChatAdapter}.\n *\n * Allows arguments to be undefined so that you can respect the rule-of-hooks and pass in arguments\n * as they are created. The adapter is only created when all arguments are defined.\n */\n args: Partial<AzureCommunicationChatAdapterArgs>,\n /**\n * Optional callback to modify the adapter once it is created.\n *\n * If set, must return the modified adapter.\n */\n afterCreate?: (adapter: ChatAdapter) => Promise<ChatAdapter>,\n /**\n * Optional callback called before the adapter is disposed.\n *\n * This is useful for clean up tasks, e.g., leaving any ongoing calls.\n */\n beforeDispose?: (adapter: ChatAdapter) => Promise<void>\n): ChatAdapter | undefined => {\n const { credential, displayName, endpoint, threadId, userId } = args;\n\n // State update needed to rerender the parent component when a new adapter is created.\n const [adapter, setAdapter] = useState<ChatAdapter | undefined>(undefined);\n // Ref needed for cleanup to access the old adapter created asynchronously.\n const adapterRef = useRef<ChatAdapter | undefined>(undefined);\n\n const afterCreateRef = useRef<((adapter: ChatAdapter) => Promise<ChatAdapter>) | undefined>(undefined);\n const beforeDisposeRef = useRef<((adapter: ChatAdapter) => Promise<void>) | undefined>(undefined);\n // These refs are updated on *each* render, so that the latest values\n // are used in the `useEffect` closures below.\n // Using a Ref ensures that new values for the callbacks do not trigger the\n // useEffect blocks, and a new adapter creation / distruction is not triggered.\n afterCreateRef.current = afterCreate;\n beforeDisposeRef.current = beforeDispose;\n\n useEffect(\n () => {\n if (!credential || !displayName || !endpoint || !threadId || !userId) {\n return;\n }\n (async () => {\n if (adapterRef.current) {\n // Dispose the old adapter when a new one is created.\n //\n // This clean up function uses `adapterRef` because `adapter` can not be added to the dependency array of\n // this `useEffect` -- we do not want to trigger a new adapter creation because of the first adapter\n // creation.\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n\n let newAdapter = await createAzureCommunicationChatAdapter({\n credential,\n displayName,\n endpoint,\n threadId,\n userId\n });\n if (afterCreateRef.current) {\n newAdapter = await afterCreateRef.current(newAdapter);\n }\n adapterRef.current = newAdapter;\n setAdapter(newAdapter);\n })();\n },\n // Explicitly list all arguments so that caller doesn't have to memoize the `args` object.\n [adapterRef, afterCreateRef, beforeDisposeRef, credential, displayName, endpoint, threadId, userId]\n );\n\n // Dispose any existing adapter when the component unmounts.\n useEffect(() => {\n return () => {\n (async () => {\n if (adapterRef.current) {\n if (beforeDisposeRef.current) {\n await beforeDisposeRef.current(adapterRef.current);\n }\n adapterRef.current.dispose();\n adapterRef.current = undefined;\n }\n })();\n };\n }, []);\n\n return adapter;\n};\n\n/**\n * Create a {@link ChatAdapter} using the provided {@link StatefulChatClient}.\n *\n * Useful if you want to keep a reference to {@link StatefulChatClient}.\n * Consider using {@link createAzureCommunicationChatAdapter} for a simpler API.\n *\n * @public\n */\nexport async function createAzureCommunicationChatAdapterFromClient(\n chatClient: StatefulChatClient,\n chatThreadClient: ChatThreadClient\n): Promise<ChatAdapter> {\n return new AzureCommunicationChatAdapter(chatClient, chatThreadClient);\n}\n\nconst isChatError = (e: Error): e is ChatError => {\n return 'target' in e && e['target'] !== undefined && 'innerError' in e && e['innerError'] !== undefined;\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import { AttachmentMetadata } from "../../../../../react-components/src";
2
- import { FileUploadManager, FileUploadState } from '../file-sharing';
2
+ import { FileUploadManager, FileUploadState } from "../../../../../react-components/src";
3
3
  import { FileSharingMetadata } from '../file-sharing';
4
4
  import { ChatContext } from './AzureCommunicationChatAdapter';
5
5
  /**
@@ -44,5 +44,5 @@ export declare class AzureCommunicationFileUploadAdapter implements FileUploadAd
44
44
  * @param fileUploadUiState {@link FileUploadsUiState}
45
45
  * @private
46
46
  */
47
- export declare const convertFileUploadsUiStateToMessageMetadata: (fileUploads?: FileUploadsUiState) => FileSharingMetadata;
47
+ export declare const convertFileUploadsUiStateToMessageMetadata: (fileUploads?: FileUploadsUiState) => FileSharingMetadata | undefined;
48
48
  //# sourceMappingURL=AzureCommunicationFileUploadAdapter.d.ts.map
@@ -1,10 +1,10 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- /* @conditional-compile-remove(file-sharing) */
3
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
4
4
  import { produce } from 'immer';
5
- /* @conditional-compile-remove(file-sharing) */
5
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
6
6
  import { FileUpload } from '../file-sharing';
7
- /* @conditional-compile-remove(file-sharing) */
7
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
8
8
  /**
9
9
  * @internal
10
10
  */
@@ -44,7 +44,7 @@ class FileUploadContext {
44
44
  }));
45
45
  }
46
46
  }
47
- /* @conditional-compile-remove(file-sharing) */
47
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
48
48
  /**
49
49
  * @internal
50
50
  */
@@ -122,24 +122,27 @@ export class AzureCommunicationFileUploadAdapter {
122
122
  fileUpload === null || fileUpload === void 0 ? void 0 : fileUpload.off('uploadFail', this.updateFileUploadErrorMessage.bind(this));
123
123
  }
124
124
  }
125
- /* @conditional-compile-remove(file-sharing) */
125
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
126
126
  /**
127
127
  * @param fileUploadUiState {@link FileUploadsUiState}
128
128
  * @private
129
129
  */
130
130
  export const convertFileUploadsUiStateToMessageMetadata = (fileUploads) => {
131
- const fileMetadata = [];
132
131
  if (fileUploads) {
132
+ const fileMetadata = [];
133
133
  Object.keys(fileUploads).forEach((key) => {
134
134
  const file = fileUploads[key];
135
135
  if (!file.error && file.metadata) {
136
136
  fileMetadata.push(file.metadata);
137
137
  }
138
138
  });
139
+ if (fileMetadata.length > 0) {
140
+ return { fileSharingMetadata: JSON.stringify(fileMetadata) };
141
+ }
139
142
  }
140
- return { fileSharingMetadata: JSON.stringify(fileMetadata) };
143
+ return undefined;
141
144
  };
142
- /* @conditional-compile-remove(file-sharing) */
145
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
143
146
  /**
144
147
  * @private
145
148
  */
@@ -1 +1 @@
1
- {"version":3,"file":"AzureCommunicationFileUploadAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,+CAA+C;AAC/C,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,+CAA+C;AAC/C,OAAO,EAAuB,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAyBlE,+CAA+C;AAC/C;;GAEG;AACH,MAAM,iBAAiB;IAGrB,YAAY,WAAwB;QAClC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAEM,cAAc;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC;IACjD,CAAC;IAEM,cAAc,CAAC,WAAyB;QAC7C,MAAM,cAAc,GAAG,+CAA+C,CAAC,WAAW,CAAC,CAAC;QACpF,IAAI,CAAC,WAAW,CAAC,QAAQ,CACvB,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC,KAAK,EAAE,EAAE;YAC7C,KAAK,CAAC,WAAW,GAAG,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC;YAC5C,KAAK,CAAC,WAAW,mCAAQ,KAAK,CAAC,WAAW,GAAK,cAAc,CAAE,CAAC;QAClE,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IAEM,gBAAgB;QACrB,IAAI,CAAC,WAAW,CAAC,QAAQ,CACvB,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,CAAC,KAAuB,EAAE,EAAE;YAC/D,KAAK,CAAC,WAAW,GAAG,EAAE,CAAC;QACzB,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IAEM,gBAAgB,CAAC,EAAU,EAAE,IAAuE;QACzG,IAAI,CAAC,WAAW,CAAC,QAAQ,CACvB,OAAO,CAAC,IAAI,CAAC,WA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C;AAC/D,CAAC,CAAC;AAEF,+CAA+C;AAC/C;;GAEG;AACH,MAAM,+CAA+C,GAAG,CAAC,WAAyB,EAAsB,EAAE;IACxG,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,GAAuB,EAAE,UAAU,EAAE,EAAE;QAChE,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG;YACnB,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE,UAAU,CAAC,QAAQ;SAC9B,CAAC;QACF,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AttachmentMetadata } from '@internal/react-components';\nimport { FileUploadManager, FileUploadState } from '../file-sharing';\n/* @conditional-compile-remove(file-sharing) */\nimport { produce } from 'immer';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileSharingMetadata, FileUpload } from '../file-sharing';\n/* @conditional-compile-remove(file-sharing) */\nimport { ChatContext } from './AzureCommunicationChatAdapter';\n/* @conditional-compile-remove(file-sharing) */\nimport { ChatAdapterState } from './ChatAdapter';\n\n/**\n * A record containing {@link FileUploadState} mapped to unique ids.\n * @beta\n */\nexport type FileUploadsUiState = Record<string, FileUploadState>;\n\n/**\n * @beta\n */\nexport interface FileUploadAdapter {\n registerActiveFileUploads: (files: File[]) => FileUploadManager[];\n registerCompletedFileUploads: (metadata: AttachmentMetadata[]) => FileUploadManager[];\n clearFileUploads: () => void;\n cancelFileUpload: (id: string) => void;\n updateFileUploadProgress: (id: string, progress: number) => void;\n updateFileUploadErrorMessage: (id: string, errorMessage: string) => void;\n updateFileUploadMetadata: (id: string, metadata: AttachmentMetadata) => void;\n}\n\n/* @conditional-compile-remove(file-sharing) */\n/**\n * @internal\n */\nclass FileUploadContext {\n private chatContext: ChatContext;\n\n constructor(chatContext: ChatContext) {\n this.chatContext = chatContext;\n }\n\n public getFileUploads(): FileUploadsUiState | undefined {\n return this.chatContext.getState().fileUploads;\n }\n\n public addFileUploads(fileUploads: FileUpload[]): void {\n const fileUploadsMap = convertObservableFileUploadToFileUploadsUiState(fileUploads);\n this.chatContext.setState(\n produce(this.chatContext.getState(), (draft) => {\n draft.fileUploads = draft.fileUploads || {};\n draft.fileUploads = { ...draft.fileUploads, ...fileUploadsMap };\n })\n );\n }\n\n public clearFileUploads(): void {\n this.chatContext.setState(\n produce(this.chatContext.getState(), (draft: ChatAdapterState) => {\n draft.fileUploads = {};\n })\n );\n }\n\n public updateFileUpload(id: string, data: Partial<Pick<FileUploadState, 'progress' | 'metadata' | 'error'>>): void {\n this.chatContext.setState(\n produce(this.chatContext.getState(), (draft: ChatAdapterState) => {\n if (draft.fileUploads?.[id]) {\n draft.fileUploads[id] = {\n ...draft.fileUploads?.[id],\n ...data\n };\n }\n })\n );\n }\n\n public deleteFileUploads(ids: string[]): void {\n this.chatContext.setState(\n produce(this.chatContext.getState(), (draft: ChatAdapterState) => {\n ids.forEach((id) => {\n delete draft?.fileUploads?.[id];\n });\n })\n );\n }\n}\n\n/* @conditional-compile-remove(file-sharing) */\n/**\n * @internal\n */\nexport class AzureCommunicationFileUploadAdapter implements FileUploadAdapter {\n private context: FileUploadContext;\n private fileUploads: FileUpload[] = [];\n\n constructor(chatContext: ChatContext) {\n this.context = new FileUploadContext(chatContext);\n }\n\n private findFileUpload(id: string): FileUpload | undefined {\n return this.fileUploads.find((fileUpload) => fileUpload.id === id);\n }\n\n private deleteFileUploads(ids: string[]): void {\n this.fileUploads = this.fileUploads.filter((fileUpload) => !ids.includes(fileUpload.id));\n this.context.deleteFileUploads(ids);\n }\n\n private deleteErroneousFileUploads(): void {\n const fileUploads = this.context.getFileUploads() || {};\n const ids = Object.values(fileUploads)\n .filter((item: FileUploadState) => item.error)\n .map((item: FileUploadState) => item.id);\n\n ids.forEach((id) => {\n const fileUpload = this.findFileUpload(id);\n this.unsubscribeAllEvents(fileUpload);\n });\n\n this.deleteFileUploads(ids);\n }\n\n private registerFileUploads(files: File[] | AttachmentMetadata[]): FileUploadManager[] {\n this.deleteErroneousFileUploads();\n const fileUploads: FileUpload[] = [];\n files.forEach((file) => fileUploads.push(new FileUpload(file)));\n fileUploads.forEach((fileUpload) => this.subscribeAllEvents(fileUpload));\n this.fileUploads = this.fileUploads.concat(fileUploads);\n this.context.addFileUploads(fileUploads);\n return fileUploads;\n }\n\n registerActiveFileUploads(files: File[]): FileUploadManager[] {\n return this.registerFileUploads(files);\n }\n\n registerCompletedFileUploads(metadata: AttachmentMetadata[]): FileUploadManager[] {\n return this.registerFileUploads(metadata);\n }\n\n clearFileUploads(): void {\n this.context.clearFileUploads();\n this.fileUploads.forEach((fileUpload) => this.unsubscribeAllEvents(fileUpload));\n this.fileUploads = [];\n }\n\n cancelFileUpload(id: string): void {\n this.deleteErroneousFileUploads();\n const fileUpload = this.findFileUpload(id);\n this.unsubscribeAllEvents(fileUpload);\n this.deleteFileUploads([id]);\n }\n\n updateFileUploadProgress(id: string, progress: number): void {\n this.context.updateFileUpload(id, { progress });\n }\n\n updateFileUploadErrorMessage(id: string, errorMessage: string): void {\n this.context.updateFileUpload(id, {\n error: {\n message: errorMessage,\n timestamp: Date.now()\n }\n });\n }\n\n updateFileUploadMetadata(id: string, metadata: AttachmentMetadata): void {\n this.context.updateFileUpload(id, { progress: 1, metadata });\n }\n\n private subscribeAllEvents(fileUpload: FileUpload): void {\n fileUpload.on('uploadProgressChange', this.updateFileUploadProgress.bind(this));\n fileUpload.on('uploadComplete', this.updateFileUploadMetadata.bind(this));\n fileUpload.on('uploadFail', this.updateFileUploadErrorMessage.bind(this));\n }\n\n private unsubscribeAllEvents(fileUpload?: FileUpload): void {\n fileUpload?.off('uploadProgressChange', this.updateFileUploadProgress.bind(this));\n fileUpload?.off('uploadComplete', this.updateFileUploadMetadata.bind(this));\n fileUpload?.off('uploadFail', this.updateFileUploadErrorMessage.bind(this));\n }\n}\n\n/* @conditional-compile-remove(file-sharing) */\n/**\n * @param fileUploadUiState {@link FileUploadsUiState}\n * @private\n */\nexport const convertFileUploadsUiStateToMessageMetadata = (fileUploads?: FileUploadsUiState): FileSharingMetadata => {\n const fileMetadata: AttachmentMetadata[] = [];\n if (fileUploads) {\n Object.keys(fileUploads).forEach((key) => {\n const file = fileUploads[key];\n if (!file.error && file.metadata) {\n fileMetadata.push(file.metadata);\n }\n });\n }\n\n return { fileSharingMetadata: JSON.stringify(fileMetadata) };\n};\n\n/* @conditional-compile-remove(file-sharing) */\n/**\n * @private\n */\nconst convertObservableFileUploadToFileUploadsUiState = (fileUploads: FileUpload[]): FileUploadsUiState => {\n return fileUploads.reduce((map: FileUploadsUiState, fileUpload) => {\n map[fileUpload.id] = {\n id: fileUpload.id,\n filename: fileUpload.fileName,\n progress: 0,\n metadata: fileUpload.metadata\n };\n return map;\n }, {});\n};\n"]}
1
+ {"version":3,"file":"AzureCommunicationFileUploadAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,qGAAqG;AACrG,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,qGAAqG;AACrG,OAAO,EAAuB,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAyBlE,qGAAqG;AACrG;;GAEG;AACH,MAAM,iBAAiB;IAGrB,YAAY,WAAwB;QAClC,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;IACjC,CAAC;IAEM,cAAc;QACnB,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,WAAW,CAAC;IACjD,CAAC;IAEM,cAAc,CAAC,WAAyB;QAC7C,MAAM,cAAc,GAAG,+CAA+C,CAAC,WAAW,CAAC,CAAC;QACpF,IAAI,CAAC,WAAW,CAAC,QAAQ,CACvB,OAAO,CA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C,CAAC;IAC9E,CAAC;CACF;AAED,qGAAqG;AACrG;;;GAGG;AACH,MAAM,CAAC,MAAM,0CAA0C,GAAG,CACxD,WAAgC,EACC,EAAE;IACnC,IAAI,WAAW,EAAE,CAAC;QAChB,MAAM,YAAY,GAAyB,EAAE,CAAC;QAC9C,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;YACvC,MAAM,IAAI,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC;YAC9B,IAAI,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBACjC,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;YACnC,CAAC;QACH,CAAC,CAAC,CAAC;QACH,IAAI,YAAY,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YAC5B,OAAO,EAAE,mBAAmB,EAAE,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,EAAE,CAAC;QAC/D,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,qGAAqG;AACrG;;GAEG;AACH,MAAM,+CAA+C,GAAG,CAAC,WAAyB,EAAsB,EAAE;IACxG,OAAO,WAAW,CAAC,MAAM,CAAC,CAAC,GAAuB,EAAE,UAAU,EAAE,EAAE;QAChE,GAAG,CAAC,UAAU,CAAC,EAAE,CAAC,GAAG;YACnB,EAAE,EAAE,UAAU,CAAC,EAAE;YACjB,QAAQ,EAAE,UAAU,CAAC,QAAQ;YAC7B,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE,UAAU,CAAC,QAAQ;SAC9B,CAAC;QACF,OAAO,GAAG,CAAC;IACb,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { AttachmentMetadata } from '@internal/react-components';\nimport { FileUploadManager, FileUploadState } from '@internal/react-components';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { produce } from 'immer';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { FileSharingMetadata, FileUpload } from '../file-sharing';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { ChatContext } from './AzureCommunicationChatAdapter';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { ChatAdapterState } from './ChatAdapter';\n\n/**\n * A record containing {@link FileUploadState} mapped to unique ids.\n * @beta\n */\nexport type FileUploadsUiState = Record<string, FileUploadState>;\n\n/**\n * @beta\n */\nexport interface FileUploadAdapter {\n registerActiveFileUploads: (files: File[]) => FileUploadManager[];\n registerCompletedFileUploads: (metadata: AttachmentMetadata[]) => FileUploadManager[];\n clearFileUploads: () => void;\n cancelFileUpload: (id: string) => void;\n updateFileUploadProgress: (id: string, progress: number) => void;\n updateFileUploadErrorMessage: (id: string, errorMessage: string) => void;\n updateFileUploadMetadata: (id: string, metadata: AttachmentMetadata) => void;\n}\n\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n/**\n * @internal\n */\nclass FileUploadContext {\n private chatContext: ChatContext;\n\n constructor(chatContext: ChatContext) {\n this.chatContext = chatContext;\n }\n\n public getFileUploads(): FileUploadsUiState | undefined {\n return this.chatContext.getState().fileUploads;\n }\n\n public addFileUploads(fileUploads: FileUpload[]): void {\n const fileUploadsMap = convertObservableFileUploadToFileUploadsUiState(fileUploads);\n this.chatContext.setState(\n produce(this.chatContext.getState(), (draft) => {\n draft.fileUploads = draft.fileUploads || {};\n draft.fileUploads = { ...draft.fileUploads, ...fileUploadsMap };\n })\n );\n }\n\n public clearFileUploads(): void {\n this.chatContext.setState(\n produce(this.chatContext.getState(), (draft: ChatAdapterState) => {\n draft.fileUploads = {};\n })\n );\n }\n\n public updateFileUpload(id: string, data: Partial<Pick<FileUploadState, 'progress' | 'metadata' | 'error'>>): void {\n this.chatContext.setState(\n produce(this.chatContext.getState(), (draft: ChatAdapterState) => {\n if (draft.fileUploads?.[id]) {\n draft.fileUploads[id] = {\n ...draft.fileUploads?.[id],\n ...data\n };\n }\n })\n );\n }\n\n public deleteFileUploads(ids: string[]): void {\n this.chatContext.setState(\n produce(this.chatContext.getState(), (draft: ChatAdapterState) => {\n ids.forEach((id) => {\n delete draft?.fileUploads?.[id];\n });\n })\n );\n }\n}\n\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n/**\n * @internal\n */\nexport class AzureCommunicationFileUploadAdapter implements FileUploadAdapter {\n private context: FileUploadContext;\n private fileUploads: FileUpload[] = [];\n\n constructor(chatContext: ChatContext) {\n this.context = new FileUploadContext(chatContext);\n }\n\n private findFileUpload(id: string): FileUpload | undefined {\n return this.fileUploads.find((fileUpload) => fileUpload.id === id);\n }\n\n private deleteFileUploads(ids: string[]): void {\n this.fileUploads = this.fileUploads.filter((fileUpload) => !ids.includes(fileUpload.id));\n this.context.deleteFileUploads(ids);\n }\n\n private deleteErroneousFileUploads(): void {\n const fileUploads = this.context.getFileUploads() || {};\n const ids = Object.values(fileUploads)\n .filter((item: FileUploadState) => item.error)\n .map((item: FileUploadState) => item.id);\n\n ids.forEach((id) => {\n const fileUpload = this.findFileUpload(id);\n this.unsubscribeAllEvents(fileUpload);\n });\n\n this.deleteFileUploads(ids);\n }\n\n private registerFileUploads(files: File[] | AttachmentMetadata[]): FileUploadManager[] {\n this.deleteErroneousFileUploads();\n const fileUploads: FileUpload[] = [];\n files.forEach((file) => fileUploads.push(new FileUpload(file)));\n fileUploads.forEach((fileUpload) => this.subscribeAllEvents(fileUpload));\n this.fileUploads = this.fileUploads.concat(fileUploads);\n this.context.addFileUploads(fileUploads);\n return fileUploads;\n }\n\n registerActiveFileUploads(files: File[]): FileUploadManager[] {\n return this.registerFileUploads(files);\n }\n\n registerCompletedFileUploads(metadata: AttachmentMetadata[]): FileUploadManager[] {\n return this.registerFileUploads(metadata);\n }\n\n clearFileUploads(): void {\n this.context.clearFileUploads();\n this.fileUploads.forEach((fileUpload) => this.unsubscribeAllEvents(fileUpload));\n this.fileUploads = [];\n }\n\n cancelFileUpload(id: string): void {\n this.deleteErroneousFileUploads();\n const fileUpload = this.findFileUpload(id);\n this.unsubscribeAllEvents(fileUpload);\n this.deleteFileUploads([id]);\n }\n\n updateFileUploadProgress(id: string, progress: number): void {\n this.context.updateFileUpload(id, { progress });\n }\n\n updateFileUploadErrorMessage(id: string, errorMessage: string): void {\n this.context.updateFileUpload(id, {\n error: {\n message: errorMessage,\n timestamp: Date.now()\n }\n });\n }\n\n updateFileUploadMetadata(id: string, metadata: AttachmentMetadata): void {\n this.context.updateFileUpload(id, { progress: 1, metadata });\n }\n\n private subscribeAllEvents(fileUpload: FileUpload): void {\n fileUpload.on('uploadProgressChange', this.updateFileUploadProgress.bind(this));\n fileUpload.on('uploadComplete', this.updateFileUploadMetadata.bind(this));\n fileUpload.on('uploadFail', this.updateFileUploadErrorMessage.bind(this));\n }\n\n private unsubscribeAllEvents(fileUpload?: FileUpload): void {\n fileUpload?.off('uploadProgressChange', this.updateFileUploadProgress.bind(this));\n fileUpload?.off('uploadComplete', this.updateFileUploadMetadata.bind(this));\n fileUpload?.off('uploadFail', this.updateFileUploadErrorMessage.bind(this));\n }\n}\n\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n/**\n * @param fileUploadUiState {@link FileUploadsUiState}\n * @private\n */\nexport const convertFileUploadsUiStateToMessageMetadata = (\n fileUploads?: FileUploadsUiState\n): FileSharingMetadata | undefined => {\n if (fileUploads) {\n const fileMetadata: AttachmentMetadata[] = [];\n Object.keys(fileUploads).forEach((key) => {\n const file = fileUploads[key];\n if (!file.error && file.metadata) {\n fileMetadata.push(file.metadata);\n }\n });\n if (fileMetadata.length > 0) {\n return { fileSharingMetadata: JSON.stringify(fileMetadata) };\n }\n }\n return undefined;\n};\n\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n/**\n * @private\n */\nconst convertObservableFileUploadToFileUploadsUiState = (fileUploads: FileUpload[]): FileUploadsUiState => {\n return fileUploads.reduce((map: FileUploadsUiState, fileUpload) => {\n map[fileUpload.id] = {\n id: fileUpload.id,\n filename: fileUpload.fileName,\n progress: 0,\n metadata: fileUpload.metadata\n };\n return map;\n }, {});\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"ChatAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/ChatComposite/adapter/ChatAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ChatMessage, ChatParticipant, SendMessageOptions } from '@azure/communication-chat';\nimport type { CommunicationIdentifierKind, CommunicationUserKind } from '@azure/communication-common';\nimport { ChatThreadClientState } from '@internal/chat-stateful-client';\nimport type { AdapterError, AdapterErrors, AdapterState, Disposable } from '../../common/adapters';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileUploadAdapter, FileUploadsUiState } from './AzureCommunicationFileUploadAdapter';\n/* @conditional-compile-remove(file-sharing) */\nimport { AttachmentMetadata } from '@internal/react-components';\n\n/**\n * {@link ChatAdapter} state for pure UI purposes.\n *\n * @public\n */\nexport type ChatAdapterUiState = {\n // FIXME(Delete?)\n // Self-contained state for composite\n error?: Error;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Files being uploaded by a user in the current thread.\n * Should be set to null once the upload is complete.\n * Array of type {@link FileUploadsUiState}\n * @beta\n */\n fileUploads?: FileUploadsUiState;\n};\n\n/**\n * {@link ChatAdapter} state inferred from Azure Communication Services backend.\n *\n * @public\n */\nexport type ChatCompositeClientState = {\n userId: CommunicationIdentifierKind;\n displayName: string;\n thread: ChatThreadClientState;\n /**\n * Latest error encountered for each operation performed via the adapter.\n */\n latestErrors: AdapterErrors;\n};\n\n/**\n * {@link ChatAdapter} state.\n *\n * @public\n */\nexport type ChatAdapterState = ChatAdapterUiState & ChatCompositeClientState;\n\n/**\n * Functionality for managing the current chat thread.\n *\n * @public\n */\nexport interface ChatAdapterThreadManagement {\n /**\n * Fetch initial state for the Chat adapter.\n *\n * Performs the minimal fetch necessary for ChatComposite and API methods.\n */\n fetchInitialData(): Promise<void>;\n /**\n * Send a message in the thread.\n */\n sendMessage(content: string, options?: SendMessageOptions): Promise<void>;\n /**\n * Send a read receipt for a message.\n */\n sendReadReceipt(chatMessageId: string): Promise<void>;\n /**\n * Send typing indicator in the thread.\n */\n sendTypingIndicator(): Promise<void>;\n /**\n * Remove a participant in the thread.\n */\n removeParticipant(userId: string): Promise<void>;\n /**\n * Set the topic for the thread.\n */\n setTopic(topicName: string): Promise<void>;\n /**\n * Update a message content.\n */\n updateMessage(\n messageId: string,\n content: string,\n metadata?: Record<string, string>,\n /* @conditional-compile-remove(file-sharing) */\n options?: {\n attachmentMetadata?: AttachmentMetadata[];\n }\n ): Promise<void>;\n /**\n * Delete a message in the thread.\n */\n deleteMessage(messageId: string): Promise<void>;\n /**\n * Load more previous messages in the chat thread history.\n *\n * @remarks\n * This method is usually used to control incremental fetch/infinite scroll\n *\n */\n loadPreviousChatMessages(messagesToLoad: number): Promise<boolean>;\n /**\n * Downloads a resource into the cache for the given message.\n */\n downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void>;\n /**\n * Removes a resource from the cache for the given message.\n */\n removeResourceFromCache(resourceDetails: ResourceDetails): void;\n}\n/**\n * Details required for download a resource to cache.\n *\n * @public\n */\nexport type ResourceDetails = {\n threadId: string;\n messageId: string;\n resourceUrl: string;\n};\n\n/**\n * Chat composite events that can be subscribed to.\n *\n * @public\n */\nexport interface ChatAdapterSubscribers {\n /**\n * Subscribe function for 'messageReceived' event.\n */\n on(event: 'messageReceived', listener: MessageReceivedListener): void;\n /**\n * Subscribe function for 'messageEdited' event.\n */\n on(event: 'messageEdited', listener: MessageEditedListener): void;\n /**\n * Subscribe function for 'messageDeleted' event.\n */\n on(event: 'messageDeleted', listener: MessageDeletedListener): void;\n /**\n * Subscribe function for 'messageSent' event.\n */\n on(event: 'messageSent', listener: MessageSentListener): void;\n /**\n * Subscribe function for 'messageRead' event.\n */\n on(event: 'messageRead', listener: MessageReadListener): void;\n /**\n * Subscribe function for 'participantsAdded' event.\n */\n on(event: 'participantsAdded', listener: ParticipantsAddedListener): void;\n /**\n * Subscribe function for 'participantsRemoved' event.\n */\n on(event: 'participantsRemoved', listener: ParticipantsRemovedListener): void;\n /**\n * Subscribe function for 'topicChanged' event.\n */\n on(event: 'topicChanged', listener: TopicChangedListener): void;\n /**\n * Subscribe function for 'error' event.\n */\n on(event: 'error', listener: (e: AdapterError) => void): void;\n\n /**\n * Unsubscribe function for 'messageReceived' event.\n */\n off(event: 'messageReceived', listener: MessageReceivedListener): void;\n /**\n * Unsubscribe function for 'messageEdited' event.\n */\n off(event: 'messageEdited', listener: MessageEditedListener): void;\n /**\n * Unsubscribe function for 'messageDeleted' event.\n */\n off(event: 'messageDeleted', listener: MessageDeletedListener): void;\n /**\n * Unsubscribe function for 'messageSent' event.\n */\n off(event: 'messageSent', listener: MessageSentListener): void;\n /**\n * Unsubscribe function for 'messageRead' event.\n */\n off(event: 'messageRead', listener: MessageReadListener): void;\n /**\n * Unsubscribe function for 'participantsAdded' event.\n */\n off(event: 'participantsAdded', listener: ParticipantsAddedListener): void;\n /**\n * Unsubscribe function for 'participantsRemoved' event.\n */\n off(event: 'participantsRemoved', listener: ParticipantsRemovedListener): void;\n /**\n * Unsubscribe function for 'topicChanged' event.\n */\n off(event: 'topicChanged', listener: TopicChangedListener): void;\n /**\n * Unsubscribe function for 'error' event.\n */\n off(event: 'error', listener: (e: AdapterError) => void): void;\n}\n\n/**\n * {@link ChatComposite} Adapter interface.\n *\n * @public\n */\nexport type ChatAdapter = ChatAdapterThreadManagement &\n AdapterState<ChatAdapterState> &\n Disposable &\n ChatAdapterSubscribers &\n /* @conditional-compile-remove(file-sharing) */\n FileUploadAdapter;\n\n/**\n * Callback for {@link ChatAdapterSubscribers} 'messageReceived' event.\n *\n * @public\n */\nexport type MessageReceivedListener = (event: { message: ChatMessage }) => void;\n\n/**\n * Callback for {@link ChatAdapterSubscribers} 'messageSent' event.\n *\n * @public\n */\nexport type MessageSentListener = MessageReceivedListener;\n\n/**\n * Callback for {@link ChatAdapterSubscribers} 'messageEdited' event.\n *\n * @public\n */\nexport type MessageEditedListener = MessageReceivedListener;\n\n/**\n * Callback for {@link ChatAdapterSubscribers} 'messageDeleted' event.\n *\n * @public\n */\nexport type MessageDeletedListener = MessageReceivedListener;\n\n/**\n * Callback for {@link ChatAdapterSubscribers} 'messageRead' event.\n *\n * @public\n */\nexport type MessageReadListener = (event: { message: ChatMessage; readBy: CommunicationUserKind }) => void;\n\n/**\n * Callback for {@link ChatAdapterSubscribers} 'participantsAdded' event.\n *\n * @public\n */\nexport type ParticipantsAddedListener = (event: {\n participantsAdded: ChatParticipant[];\n addedBy: ChatParticipant;\n}) => void;\n\n/**\n * Callback for {@link ChatAdapterSubscribers} 'participantsRemoved' event.\n *\n * @public\n */\nexport type ParticipantsRemovedListener = (event: {\n participantsRemoved: ChatParticipant[];\n removedBy: ChatParticipant;\n}) => void;\n\n/**\n * Callback for {@link ChatAdapterSubscribers} 'topicChanged' event.\n *\n * @public\n */\nexport type TopicChangedListener = (event: { topic: string }) => void;\n"]}
1
+ {"version":3,"file":"ChatAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/ChatComposite/adapter/ChatAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type { ChatMessage, ChatParticipant, SendMessageOptions } from '@azure/communication-chat';\nimport type { CommunicationIdentifierKind, CommunicationUserKind } from '@azure/communication-common';\nimport { ChatThreadClientState } from '@internal/chat-stateful-client';\nimport type { AdapterError, AdapterErrors, AdapterState, Disposable } from '../../common/adapters';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { FileUploadAdapter, FileUploadsUiState } from './AzureCommunicationFileUploadAdapter';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { AttachmentMetadata } from '@internal/react-components';\n\n/**\n * {@link ChatAdapter} state for pure UI purposes.\n *\n * @public\n */\nexport type ChatAdapterUiState = {\n // FIXME(Delete?)\n // Self-contained state for composite\n error?: Error;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n /**\n * Files being uploaded by a user in the current thread.\n * Should be set to null once the upload is complete.\n * Array of type {@link FileUploadsUiState}\n * @beta\n */\n fileUploads?: FileUploadsUiState;\n};\n\n/**\n * {@link ChatAdapter} state inferred from Azure Communication Services backend.\n *\n * @public\n */\nexport type ChatCompositeClientState = {\n userId: CommunicationIdentifierKind;\n displayName: string;\n thread: ChatThreadClientState;\n /**\n * Latest error encountered for each operation performed via the adapter.\n */\n latestErrors: AdapterErrors;\n};\n\n/**\n * {@link ChatAdapter} state.\n *\n * @public\n */\nexport type ChatAdapterState = ChatAdapterUiState & ChatCompositeClientState;\n\n/**\n * Functionality for managing the current chat thread.\n *\n * @public\n */\nexport interface ChatAdapterThreadManagement {\n /**\n * Fetch initial state for the Chat adapter.\n *\n * Performs the minimal fetch necessary for ChatComposite and API methods.\n */\n fetchInitialData(): Promise<void>;\n /**\n * Send a message in the thread.\n */\n sendMessage(content: string, options?: SendMessageOptions): Promise<void>;\n /**\n * Send a read receipt for a message.\n */\n sendReadReceipt(chatMessageId: string): Promise<void>;\n /**\n * Send typing indicator in the thread.\n */\n sendTypingIndicator(): Promise<void>;\n /**\n * Remove a participant in the thread.\n */\n removeParticipant(userId: string): Promise<void>;\n /**\n * Set the topic for the thread.\n */\n setTopic(topicName: string): Promise<void>;\n /**\n * Update a message content.\n */\n updateMessage(\n messageId: string,\n content: string,\n metadata?: Record<string, string>,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n options?: {\n attachmentMetadata?: AttachmentMetadata[];\n }\n ): Promise<void>;\n /**\n * Delete a message in the thread.\n */\n deleteMessage(messageId: string): Promise<void>;\n /**\n * Load more previous messages in the chat thread history.\n *\n * @remarks\n * This method is usually used to control incremental fetch/infinite scroll\n *\n */\n loadPreviousChatMessages(messagesToLoad: number): Promise<boolean>;\n /**\n * Downloads a resource into the cache for the given message.\n */\n downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void>;\n /**\n * Removes a resource from the cache for the given message.\n */\n removeResourceFromCache(resourceDetails: ResourceDetails): void;\n}\n/**\n * Details required for download a resource to cache.\n *\n * @public\n */\nexport type ResourceDetails = {\n threadId: string;\n messageId: string;\n resourceUrl: string;\n};\n\n/**\n * Chat composite events that can be subscribed to.\n *\n * @public\n */\nexport interface ChatAdapterSubscribers {\n /**\n * Subscribe function for 'messageReceived' event.\n */\n on(event: 'messageReceived', listener: MessageReceivedListener): void;\n /**\n * Subscribe function for 'messageEdited' event.\n */\n on(event: 'messageEdited', listener: MessageEditedListener): void;\n /**\n * Subscribe function for 'messageDeleted' event.\n */\n on(event: 'messageDeleted', listener: MessageDeletedListener): void;\n /**\n * Subscribe function for 'messageSent' event.\n */\n on(event: 'messageSent', listener: MessageSentListener): void;\n /**\n * Subscribe function for 'messageRead' event.\n */\n on(event: 'messageRead', listener: MessageReadListener): void;\n /**\n * Subscribe function for 'participantsAdded' event.\n */\n on(event: 'participantsAdded', listener: ParticipantsAddedListener): void;\n /**\n * Subscribe function for 'participantsRemoved' event.\n */\n on(event: 'participantsRemoved', listener: ParticipantsRemovedListener): void;\n /**\n * Subscribe function for 'topicChanged' event.\n */\n on(event: 'topicChanged', listener: TopicChangedListener): void;\n /**\n * Subscribe function for 'error' event.\n */\n on(event: 'error', listener: (e: AdapterError) => void): void;\n\n /**\n * Unsubscribe function for 'messageReceived' event.\n */\n off(event: 'messageReceived', listener: MessageReceivedListener): void;\n /**\n * Unsubscribe function for 'messageEdited' event.\n */\n off(event: 'messageEdited', listener: MessageEditedListener): void;\n /**\n * Unsubscribe function for 'messageDeleted' event.\n */\n off(event: 'messageDeleted', listener: MessageDeletedListener): void;\n /**\n * Unsubscribe function for 'messageSent' event.\n */\n off(event: 'messageSent', listener: MessageSentListener): void;\n /**\n * Unsubscribe function for 'messageRead' event.\n */\n off(event: 'messageRead', listener: MessageReadListener): void;\n /**\n * Unsubscribe function for 'participantsAdded' event.\n */\n off(event: 'participantsAdded', listener: ParticipantsAddedListener): void;\n /**\n * Unsubscribe function for 'participantsRemoved' event.\n */\n off(event: 'participantsRemoved', listener: ParticipantsRemovedListener): void;\n /**\n * Unsubscribe function for 'topicChanged' event.\n */\n off(event: 'topicChanged', listener: TopicChangedListener): void;\n /**\n * Unsubscribe function for 'error' event.\n */\n off(event: 'error', listener: (e: AdapterError) => void): void;\n}\n\n/**\n * {@link ChatComposite} Adapter interface.\n *\n * @public\n */\nexport type ChatAdapter = ChatAdapterThreadManagement &\n AdapterState<ChatAdapterState> &\n Disposable &\n ChatAdapterSubscribers &\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n FileUploadAdapter;\n\n/**\n * Callback for {@link ChatAdapterSubscribers} 'messageReceived' event.\n *\n * @public\n */\nexport type MessageReceivedListener = (event: { message: ChatMessage }) => void;\n\n/**\n * Callback for {@link ChatAdapterSubscribers} 'messageSent' event.\n *\n * @public\n */\nexport type MessageSentListener = MessageReceivedListener;\n\n/**\n * Callback for {@link ChatAdapterSubscribers} 'messageEdited' event.\n *\n * @public\n */\nexport type MessageEditedListener = MessageReceivedListener;\n\n/**\n * Callback for {@link ChatAdapterSubscribers} 'messageDeleted' event.\n *\n * @public\n */\nexport type MessageDeletedListener = MessageReceivedListener;\n\n/**\n * Callback for {@link ChatAdapterSubscribers} 'messageRead' event.\n *\n * @public\n */\nexport type MessageReadListener = (event: { message: ChatMessage; readBy: CommunicationUserKind }) => void;\n\n/**\n * Callback for {@link ChatAdapterSubscribers} 'participantsAdded' event.\n *\n * @public\n */\nexport type ParticipantsAddedListener = (event: {\n participantsAdded: ChatParticipant[];\n addedBy: ChatParticipant;\n}) => void;\n\n/**\n * Callback for {@link ChatAdapterSubscribers} 'participantsRemoved' event.\n *\n * @public\n */\nexport type ParticipantsRemovedListener = (event: {\n participantsRemoved: ChatParticipant[];\n removedBy: ChatParticipant;\n}) => void;\n\n/**\n * Callback for {@link ChatAdapterSubscribers} 'topicChanged' event.\n *\n * @public\n */\nexport type TopicChangedListener = (event: { topic: string }) => void;\n"]}
@@ -23,7 +23,7 @@ export const useAdapter = () => {
23
23
  * @private
24
24
  */
25
25
  export const useFileUploadAdapter = () => {
26
- /* @conditional-compile-remove(file-sharing) */
26
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
27
27
  return useAdapter();
28
28
  // A stub that short-circuits all logic because none of the fields are available.
29
29
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"ChatAdapterProvider.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/ChatComposite/adapter/ChatAdapterProvider.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAazD,MAAM,kBAAkB,GAAG,aAAa,CAA0B,SAAS,CAAC,CAAC;AAE7E;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAwB,EAAe,EAAE;IAC3E,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC1B,OAAO,oBAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,IAAG,KAAK,CAAC,QAAQ,CAA+B,CAAC;AACrG,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,GAAgB,EAAE;IAC1C,MAAM,OAAO,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,qDAAqD,CAAC;IAC9D,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAsB,EAAE;IAC1D,+CAA+C;IAC/C,OAAO,UAAU,EAAE,CAAC;IACpB,iFAAiF;IACjF,OAAO;QACL,yBAAyB;YACvB,OAAO,EAAyB,CAAC;QACnC,CAAC;QACD,4BAA4B;YAC1B,OAAO,EAAyB,CAAC;QACnC,CAAC;QACD,gBAAgB;YACd,OAAO;QACT,CAAC;QACD,gBAAgB;YACd,OAAO;QACT,CAAC;QACD,4BAA4B;YAC1B,OAAO;QACT,CAAC;QACD,wBAAwB;YACtB,OAAO;QACT,CAAC;QACD,wBAAwB;YACtB,OAAO;QACT,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { createContext, useContext } from 'react';\nimport { FileUploadManager } from '../file-sharing';\nimport { FileUploadAdapter } from './AzureCommunicationFileUploadAdapter';\nimport { ChatAdapter } from './ChatAdapter';\n\n/**\n * @private\n */\ntype ChatProviderProps = {\n children: React.ReactNode;\n adapter: ChatAdapter;\n};\n\nconst ChatAdapterContext = createContext<ChatAdapter | undefined>(undefined);\n\n/**\n * @private\n */\nexport const ChatAdapterProvider = (props: ChatProviderProps): JSX.Element => {\n const { adapter } = props;\n return <ChatAdapterContext.Provider value={adapter}>{props.children}</ChatAdapterContext.Provider>;\n};\n\n/**\n * @private\n */\nexport const useAdapter = (): ChatAdapter => {\n const adapter = useContext(ChatAdapterContext);\n if (!adapter) {\n throw 'Cannot find adapter please initialize before usage.';\n }\n return adapter;\n};\n\n/**\n * @private\n */\nexport const useFileUploadAdapter = (): FileUploadAdapter => {\n /* @conditional-compile-remove(file-sharing) */\n return useAdapter();\n // A stub that short-circuits all logic because none of the fields are available.\n return {\n registerActiveFileUploads() {\n return [] as FileUploadManager[];\n },\n registerCompletedFileUploads() {\n return [] as FileUploadManager[];\n },\n cancelFileUpload() {\n // noop\n },\n clearFileUploads() {\n // noop\n },\n updateFileUploadErrorMessage() {\n // noop\n },\n updateFileUploadProgress() {\n // noop\n },\n updateFileUploadMetadata() {\n // noop\n }\n };\n};\n"]}
1
+ {"version":3,"file":"ChatAdapterProvider.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/ChatComposite/adapter/ChatAdapterProvider.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAazD,MAAM,kBAAkB,GAAG,aAAa,CAA0B,SAAS,CAAC,CAAC;AAE7E;;GAEG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,KAAwB,EAAe,EAAE;IAC3E,MAAM,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IAC1B,OAAO,oBAAC,kBAAkB,CAAC,QAAQ,IAAC,KAAK,EAAE,OAAO,IAAG,KAAK,CAAC,QAAQ,CAA+B,CAAC;AACrG,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,GAAgB,EAAE;IAC1C,MAAM,OAAO,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAC/C,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,qDAAqD,CAAC;IAC9D,CAAC;IACD,OAAO,OAAO,CAAC;AACjB,CAAC,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,GAAsB,EAAE;IAC1D,qGAAqG;IACrG,OAAO,UAAU,EAAE,CAAC;IACpB,iFAAiF;IACjF,OAAO;QACL,yBAAyB;YACvB,OAAO,EAAyB,CAAC;QACnC,CAAC;QACD,4BAA4B;YAC1B,OAAO,EAAyB,CAAC;QACnC,CAAC;QACD,gBAAgB;YACd,OAAO;QACT,CAAC;QACD,gBAAgB;YACd,OAAO;QACT,CAAC;QACD,4BAA4B;YAC1B,OAAO;QACT,CAAC;QACD,wBAAwB;YACtB,OAAO;QACT,CAAC;QACD,wBAAwB;YACtB,OAAO;QACT,CAAC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React, { createContext, useContext } from 'react';\nimport { FileUploadManager } from '@internal/react-components';\nimport { FileUploadAdapter } from './AzureCommunicationFileUploadAdapter';\nimport { ChatAdapter } from './ChatAdapter';\n\n/**\n * @private\n */\ntype ChatProviderProps = {\n children: React.ReactNode;\n adapter: ChatAdapter;\n};\n\nconst ChatAdapterContext = createContext<ChatAdapter | undefined>(undefined);\n\n/**\n * @private\n */\nexport const ChatAdapterProvider = (props: ChatProviderProps): JSX.Element => {\n const { adapter } = props;\n return <ChatAdapterContext.Provider value={adapter}>{props.children}</ChatAdapterContext.Provider>;\n};\n\n/**\n * @private\n */\nexport const useAdapter = (): ChatAdapter => {\n const adapter = useContext(ChatAdapterContext);\n if (!adapter) {\n throw 'Cannot find adapter please initialize before usage.';\n }\n return adapter;\n};\n\n/**\n * @private\n */\nexport const useFileUploadAdapter = (): FileUploadAdapter => {\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n return useAdapter();\n // A stub that short-circuits all logic because none of the fields are available.\n return {\n registerActiveFileUploads() {\n return [] as FileUploadManager[];\n },\n registerCompletedFileUploads() {\n return [] as FileUploadManager[];\n },\n cancelFileUpload() {\n // noop\n },\n clearFileUploads() {\n // noop\n },\n updateFileUploadErrorMessage() {\n // noop\n },\n updateFileUploadProgress() {\n // noop\n },\n updateFileUploadMetadata() {\n // noop\n }\n };\n};\n"]}