@azure/communication-react 1.20.0-beta.1 → 1.20.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (634) hide show
  1. package/README.md +2 -2
  2. package/dist/communication-react.d.ts +245 -1703
  3. package/dist/dist-cjs/communication-react/index.js +36159 -165
  4. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/common.d.ts +0 -13
  6. package/dist/dist-esm/acs-ui-common/src/common.js.map +1 -1
  7. package/dist/dist-esm/acs-ui-common/src/constants.d.ts +0 -5
  8. package/dist/dist-esm/acs-ui-common/src/constants.js +0 -5
  9. package/dist/dist-esm/acs-ui-common/src/constants.js.map +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/index.d.ts +0 -4
  11. package/dist/dist-esm/acs-ui-common/src/index.js +0 -3
  12. package/dist/dist-esm/acs-ui-common/src/index.js.map +1 -1
  13. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  14. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  15. package/dist/dist-esm/acs-ui-javascript-loaders/src/callCompositeLoader.d.ts +16 -7
  16. package/dist/dist-esm/acs-ui-javascript-loaders/src/callCompositeLoader.js +10 -10
  17. package/dist/dist-esm/acs-ui-javascript-loaders/src/callCompositeLoader.js.map +1 -1
  18. package/dist/dist-esm/acs-ui-javascript-loaders/src/callWithChatCompositeLoader.d.ts +17 -7
  19. package/dist/dist-esm/acs-ui-javascript-loaders/src/callWithChatCompositeLoader.js +12 -10
  20. package/dist/dist-esm/acs-ui-javascript-loaders/src/callWithChatCompositeLoader.js.map +1 -1
  21. package/dist/dist-esm/acs-ui-javascript-loaders/src/chatCompositeLoader.d.ts +13 -7
  22. package/dist/dist-esm/acs-ui-javascript-loaders/src/chatCompositeLoader.js +10 -9
  23. package/dist/dist-esm/acs-ui-javascript-loaders/src/chatCompositeLoader.js.map +1 -1
  24. package/dist/dist-esm/acs-ui-javascript-loaders/src/outboundCallCompositeLoader.d.ts +16 -7
  25. package/dist/dist-esm/acs-ui-javascript-loaders/src/outboundCallCompositeLoader.js +10 -9
  26. package/dist/dist-esm/acs-ui-javascript-loaders/src/outboundCallCompositeLoader.js.map +1 -1
  27. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +3 -12
  28. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +0 -12
  29. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  30. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js +1 -1
  31. package/dist/dist-esm/calling-component-bindings/src/callControlSelectors.js.map +1 -1
  32. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js +0 -2
  33. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js.map +1 -1
  34. package/dist/dist-esm/calling-component-bindings/src/getRemoteParticipantsExcludingConsumers.js +2 -1
  35. package/dist/dist-esm/calling-component-bindings/src/getRemoteParticipantsExcludingConsumers.js.map +1 -1
  36. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +12 -2
  37. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +26 -6
  38. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  39. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.d.ts +6 -0
  40. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js +1 -5
  41. package/dist/dist-esm/calling-component-bindings/src/handlers/createHandlers.js.map +1 -1
  42. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.d.ts +2 -0
  43. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js +2 -19
  44. package/dist/dist-esm/calling-component-bindings/src/handlers/createTeamsCallHandlers.js.map +1 -1
  45. package/dist/dist-esm/calling-component-bindings/src/index.d.ts +2 -2
  46. package/dist/dist-esm/calling-component-bindings/src/index.js +1 -2
  47. package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
  48. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js +1 -35
  49. package/dist/dist-esm/calling-component-bindings/src/notificationStackSelector.js.map +1 -1
  50. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.d.ts +0 -1
  51. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +1 -3
  52. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
  53. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.d.ts +1 -2
  54. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js +3 -3
  55. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js.map +1 -1
  56. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js +0 -4
  57. package/dist/dist-esm/calling-stateful-client/src/CallAgentDeclarativeCommon.js.map +1 -1
  58. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +2 -79
  59. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  60. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +0 -15
  61. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +32 -107
  62. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  63. package/dist/dist-esm/calling-stateful-client/src/CallDeclarativeCommon.js.map +1 -1
  64. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.d.ts +0 -5
  65. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js +4 -27
  66. package/dist/dist-esm/calling-stateful-client/src/CallSubscriber.js.map +1 -1
  67. package/dist/dist-esm/calling-stateful-client/src/CaptionsSubscriber.js.map +1 -1
  68. package/dist/dist-esm/calling-stateful-client/src/Converter.js +0 -3
  69. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  70. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js +58 -52
  71. package/dist/dist-esm/calling-stateful-client/src/DeviceManagerDeclarative.js.map +1 -1
  72. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.d.ts +0 -1
  73. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.js +1 -7
  74. package/dist/dist-esm/calling-stateful-client/src/RecordingSubscriber.js.map +1 -1
  75. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +5 -3
  76. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
  77. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js +0 -17
  78. package/dist/dist-esm/calling-stateful-client/src/TeamsCallDeclarative.js.map +1 -1
  79. package/dist/dist-esm/calling-stateful-client/src/index-public.d.ts +0 -3
  80. package/dist/dist-esm/calling-stateful-client/src/index-public.js.map +1 -1
  81. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.d.ts +2 -6
  82. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js +2 -35
  83. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
  84. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.d.ts +1 -2
  85. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js +0 -3
  86. package/dist/dist-esm/chat-component-bindings/src/hooks/usePropsFor.js.map +1 -1
  87. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +2 -25
  88. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  89. package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js +3 -3
  90. package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js.map +1 -1
  91. package/dist/dist-esm/chat-stateful-client/src/ChatClientState.d.ts +1 -15
  92. package/dist/dist-esm/chat-stateful-client/src/ChatClientState.js.map +1 -1
  93. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js +1 -2
  94. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js.map +1 -1
  95. package/dist/dist-esm/chat-stateful-client/src/index.d.ts +0 -1
  96. package/dist/dist-esm/chat-stateful-client/src/index.js.map +1 -1
  97. package/dist/dist-esm/communication-react/src/index.d.ts +1 -27
  98. package/dist/dist-esm/communication-react/src/index.js +0 -6
  99. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  100. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCard.js +3 -2
  101. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCard.js.map +1 -1
  102. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.d.ts +0 -2
  103. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js +0 -2
  104. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js.map +1 -1
  105. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.d.ts +1 -13
  106. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js +3 -9
  107. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
  108. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +0 -11
  109. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +7 -34
  110. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  111. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.d.ts +1 -8
  112. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js +5 -9
  113. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
  114. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.d.ts +1 -2
  115. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js +4 -4
  116. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js.map +1 -1
  117. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.d.ts +1 -4
  118. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js +6 -31
  119. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBox.js.map +1 -1
  120. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.d.ts +1 -15
  121. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js +0 -9
  122. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsEditBoxPicker.js.map +1 -1
  123. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.d.ts +2 -23
  124. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js +6 -17
  125. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponent.js.map +1 -1
  126. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.d.ts +1 -8
  127. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js +6 -10
  128. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
  129. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +5 -5
  130. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
  131. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +6 -4
  132. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
  133. package/dist/dist-esm/react-components/src/components/GridLayout.js +3 -0
  134. package/dist/dist-esm/react-components/src/components/GridLayout.js.map +1 -1
  135. package/dist/dist-esm/react-components/src/components/HorizontalGallery.js +4 -5
  136. package/dist/dist-esm/react-components/src/components/HorizontalGallery.js.map +1 -1
  137. package/dist/dist-esm/react-components/src/components/ImageOverlay.js +0 -2
  138. package/dist/dist-esm/react-components/src/components/ImageOverlay.js.map +1 -1
  139. package/dist/dist-esm/react-components/src/components/InputBoxComponent.d.ts +0 -2
  140. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js +0 -15
  141. package/dist/dist-esm/react-components/src/components/InputBoxComponent.js.map +1 -1
  142. package/dist/dist-esm/react-components/src/components/LocalVideoCameraButton.js +3 -0
  143. package/dist/dist-esm/react-components/src/components/LocalVideoCameraButton.js.map +1 -1
  144. package/dist/dist-esm/react-components/src/components/LocalVideoTile.d.ts +1 -0
  145. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js +4 -4
  146. package/dist/dist-esm/react-components/src/components/LocalVideoTile.js.map +1 -1
  147. package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.js +2 -1
  148. package/dist/dist-esm/react-components/src/components/MeetingConferencePhoneInfo.js.map +1 -1
  149. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +5 -81
  150. package/dist/dist-esm/react-components/src/components/MessageThread.js +6 -16
  151. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  152. package/dist/dist-esm/react-components/src/components/MicrophoneButton.d.ts +24 -0
  153. package/dist/dist-esm/react-components/src/components/MicrophoneButton.js +25 -0
  154. package/dist/dist-esm/react-components/src/components/MicrophoneButton.js.map +1 -1
  155. package/dist/dist-esm/react-components/src/components/ModalClone/ModalClone.js +2 -1
  156. package/dist/dist-esm/react-components/src/components/ModalClone/ModalClone.js.map +1 -1
  157. package/dist/dist-esm/react-components/src/components/Notification.js +3 -1
  158. package/dist/dist-esm/react-components/src/components/Notification.js.map +1 -1
  159. package/dist/dist-esm/react-components/src/components/NotificationStack.d.ts +0 -20
  160. package/dist/dist-esm/react-components/src/components/NotificationStack.js +0 -5
  161. package/dist/dist-esm/react-components/src/components/NotificationStack.js.map +1 -1
  162. package/dist/dist-esm/react-components/src/components/ParticipantItem.js +1 -1
  163. package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
  164. package/dist/dist-esm/react-components/src/components/ParticipantList.d.ts +0 -15
  165. package/dist/dist-esm/react-components/src/components/ParticipantList.js +3 -12
  166. package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
  167. package/dist/dist-esm/react-components/src/components/ReactionButton.js +31 -41
  168. package/dist/dist-esm/react-components/src/components/ReactionButton.js.map +1 -1
  169. package/dist/dist-esm/react-components/src/components/SendBox.d.ts +1 -47
  170. package/dist/dist-esm/react-components/src/components/SendBox.js +6 -57
  171. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  172. package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.js +7 -3
  173. package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.js.map +1 -1
  174. package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js +0 -1
  175. package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js.map +1 -1
  176. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js +0 -1
  177. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js.map +1 -1
  178. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js +0 -19
  179. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js.map +1 -1
  180. package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js +0 -1
  181. package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js.map +1 -1
  182. package/dist/dist-esm/react-components/src/components/VerticalGallery.js +2 -1
  183. package/dist/dist-esm/react-components/src/components/VerticalGallery.js.map +1 -1
  184. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js +3 -3
  185. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js.map +1 -1
  186. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js +6 -2
  187. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js.map +1 -1
  188. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteContentShareReactionOverlay.js +5 -4
  189. package/dist/dist-esm/react-components/src/components/VideoGallery/RemoteContentShareReactionOverlay.js.map +1 -1
  190. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js +1 -1
  191. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js.map +1 -1
  192. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +23 -17
  193. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -1
  194. package/dist/dist-esm/react-components/src/components/VideoGallery.js +3 -3
  195. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  196. package/dist/dist-esm/react-components/src/components/VideoTile.js +3 -0
  197. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  198. package/dist/dist-esm/react-components/src/components/index.d.ts +0 -20
  199. package/dist/dist-esm/react-components/src/components/index.js +0 -7
  200. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  201. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.d.ts +1 -1
  202. package/dist/dist-esm/react-components/src/components/styles/AttachmentCardGroup.styles.d.ts +1 -1
  203. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +3 -3
  204. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +0 -8
  205. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  206. package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.d.ts +13 -6
  207. package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.js +49 -19
  208. package/dist/dist-esm/react-components/src/components/styles/ReactionButton.styles.js.map +1 -1
  209. package/dist/dist-esm/react-components/src/components/styles/ReactionOverlay.style.d.ts +0 -6
  210. package/dist/dist-esm/react-components/src/components/styles/ReactionOverlay.style.js +6 -35
  211. package/dist/dist-esm/react-components/src/components/styles/ReactionOverlay.style.js.map +1 -1
  212. package/dist/dist-esm/react-components/src/components/styles/StreamMedia.styles.js +5 -2
  213. package/dist/dist-esm/react-components/src/components/styles/StreamMedia.styles.js.map +1 -1
  214. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js +2 -1
  215. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js.map +1 -1
  216. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.d.ts +1 -37
  217. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js +3 -30
  218. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js.map +1 -1
  219. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.d.ts +2 -4
  220. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js +2 -9
  221. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
  222. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.d.ts +1 -38
  223. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +4 -131
  224. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  225. package/dist/dist-esm/react-components/src/components/utils/common.js +0 -2
  226. package/dist/dist-esm/react-components/src/components/utils/common.js.map +1 -1
  227. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.d.ts +1 -2
  228. package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.js.map +1 -1
  229. package/dist/dist-esm/react-components/src/components/utils/responsive.js +6 -0
  230. package/dist/dist-esm/react-components/src/components/utils/responsive.js.map +1 -1
  231. package/dist/dist-esm/react-components/src/components/utils.js +1 -6
  232. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  233. package/dist/dist-esm/react-components/src/gallery/dominantSpeaker.js.map +1 -1
  234. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.d.ts +0 -4
  235. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js +1 -3
  236. package/dist/dist-esm/react-components/src/identifiers/IdentifierProvider.js.map +1 -1
  237. package/dist/dist-esm/react-components/src/index.d.ts +0 -1
  238. package/dist/dist-esm/react-components/src/index.js.map +1 -1
  239. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +0 -54
  240. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
  241. package/dist/dist-esm/react-components/src/localization/locales/cy-GB/strings.json +1 -1
  242. package/dist/dist-esm/react-components/src/theming/generateTheme.js +10 -2
  243. package/dist/dist-esm/react-components/src/theming/generateTheme.js.map +1 -1
  244. package/dist/dist-esm/react-components/src/theming/icons.d.ts +0 -30
  245. package/dist/dist-esm/react-components/src/theming/icons.js +0 -91
  246. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  247. package/dist/dist-esm/react-components/src/theming/themes.d.ts +0 -6
  248. package/dist/dist-esm/react-components/src/theming/themes.js +0 -9
  249. package/dist/dist-esm/react-components/src/theming/themes.js.map +1 -1
  250. package/dist/dist-esm/react-components/src/types/Attachment.d.ts +0 -13
  251. package/dist/dist-esm/react-components/src/types/Attachment.js.map +1 -1
  252. package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +1 -20
  253. package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
  254. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +0 -72
  255. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +13 -23
  256. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  257. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +4 -34
  258. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  259. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +17 -47
  260. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +68 -137
  261. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  262. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +26 -24
  263. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js +1 -1
  264. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  265. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.d.ts +2 -2
  266. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.js +6 -7
  267. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallingSoundSubscriber.js.map +1 -1
  268. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/OnFetchProfileCallback.js +9 -4
  269. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/OnFetchProfileCallback.js.map +1 -1
  270. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.d.ts +2 -0
  271. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/createHandlers.js.map +1 -1
  272. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +0 -2
  273. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  274. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +21 -24
  275. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  276. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.d.ts +0 -3
  277. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js +50 -13
  278. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  279. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.d.ts +0 -2
  280. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js +0 -19
  281. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js.map +1 -1
  282. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js +2 -10
  283. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js.map +1 -1
  284. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.d.ts +0 -2
  285. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js +0 -19
  286. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js.map +1 -1
  287. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.d.ts +0 -1
  288. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +41 -25
  289. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
  290. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +12 -10
  291. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  292. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js +1 -1
  293. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/NetworkReconnectTile.js.map +1 -1
  294. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.d.ts +1 -0
  295. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.js +1 -1
  296. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Prompt.js.map +1 -1
  297. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.d.ts +1 -0
  298. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js +1 -1
  299. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js.map +1 -1
  300. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +7 -4
  301. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
  302. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js +5 -2
  303. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js.map +1 -1
  304. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js +7 -6
  305. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js.map +1 -1
  306. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js +4 -4
  307. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js.map +1 -1
  308. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.d.ts +0 -1
  309. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.js +7 -23
  310. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.js.map +1 -1
  311. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.d.ts +3 -0
  312. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js +6 -7
  313. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js.map +1 -1
  314. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js +5 -5
  315. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js.map +1 -1
  316. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js +1 -2
  317. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js.map +1 -1
  318. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +9 -5
  319. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  320. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +0 -3
  321. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  322. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +2 -2
  323. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  324. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.d.ts +0 -7
  325. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +16 -53
  326. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  327. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js +7 -9
  328. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js.map +1 -1
  329. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js +2 -2
  330. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js.map +1 -1
  331. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js +2 -2
  332. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js.map +1 -1
  333. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js +5 -2
  334. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js.map +1 -1
  335. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +21 -25
  336. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +16 -16
  337. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  338. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js +1 -1
  339. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/dominantRemoteParticipantSelector.js.map +1 -1
  340. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localPreviewSelector.js +2 -1
  341. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/localPreviewSelector.js.map +1 -1
  342. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js +10 -11
  343. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js.map +1 -1
  344. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +2 -14
  345. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +12 -68
  346. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  347. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +0 -65
  348. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +5 -24
  349. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  350. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.d.ts +0 -8
  351. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/Strings.js.map +1 -1
  352. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +5 -22
  353. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +14 -139
  354. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  355. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +11 -28
  356. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  357. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +2 -2
  358. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +13 -9
  359. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  360. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.d.ts +4 -10
  361. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +2 -14
  362. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
  363. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +11 -11
  364. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +2 -2
  365. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  366. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.d.ts +0 -5
  367. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js +0 -13
  368. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js.map +1 -1
  369. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.d.ts +0 -27
  370. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js +1 -2
  371. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
  372. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.d.ts +0 -2
  373. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +49 -234
  374. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  375. package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.d.ts +0 -20
  376. package/dist/dist-esm/react-composites/src/composites/ChatComposite/Strings.js.map +1 -1
  377. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +2 -6
  378. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +0 -36
  379. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  380. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts +2 -12
  381. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
  382. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js +2 -13
  383. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js.map +1 -1
  384. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useSelector.d.ts +6 -0
  385. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useSelector.js +11 -0
  386. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useSelector.js.map +1 -0
  387. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.d.ts +0 -2
  388. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
  389. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.d.ts +12 -0
  390. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js +9 -0
  391. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js.map +1 -0
  392. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +28 -15
  393. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  394. package/dist/dist-esm/react-composites/src/composites/common/HiddenFocusStartPoint.js +4 -1
  395. package/dist/dist-esm/react-composites/src/composites/common/HiddenFocusStartPoint.js.map +1 -1
  396. package/dist/dist-esm/react-composites/src/composites/common/MeetingPhoneInfoPaneContent.js +1 -1
  397. package/dist/dist-esm/react-composites/src/composites/common/MeetingPhoneInfoPaneContent.js.map +1 -1
  398. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js +5 -6
  399. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js.map +1 -1
  400. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js +1 -2
  401. package/dist/dist-esm/react-composites/src/composites/common/ParticipantContainer.js.map +1 -1
  402. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.d.ts +3 -0
  403. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +4 -7
  404. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
  405. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.d.ts +2 -41
  406. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js +0 -21
  407. package/dist/dist-esm/react-composites/src/composites/common/SendBoxPicker.js.map +1 -1
  408. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.d.ts +2 -0
  409. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +3 -4
  410. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  411. package/dist/dist-esm/react-composites/src/composites/common/adapters.d.ts +0 -23
  412. package/dist/dist-esm/react-composites/src/composites/common/adapters.js.map +1 -1
  413. package/dist/dist-esm/react-composites/src/composites/common/constants.d.ts +0 -5
  414. package/dist/dist-esm/react-composites/src/composites/common/constants.js +0 -5
  415. package/dist/dist-esm/react-composites/src/composites/common/constants.js.map +1 -1
  416. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +6 -32
  417. package/dist/dist-esm/react-composites/src/composites/common/icons.js +0 -2
  418. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  419. package/dist/dist-esm/react-composites/src/composites/common/resolveDeepNoiseSuppressionDependency.d.ts +8 -0
  420. package/dist/dist-esm/react-composites/src/composites/common/resolveDeepNoiseSuppressionDependency.js +24 -0
  421. package/dist/dist-esm/react-composites/src/composites/common/resolveDeepNoiseSuppressionDependency.js.map +1 -0
  422. package/dist/dist-esm/react-composites/src/composites/common/resolveDeepNoiseSuppressionDependencyLazy.d.ts +8 -0
  423. package/dist/dist-esm/react-composites/src/composites/common/resolveDeepNoiseSuppressionDependencyLazy.js +24 -0
  424. package/dist/dist-esm/react-composites/src/composites/common/resolveDeepNoiseSuppressionDependencyLazy.js.map +1 -0
  425. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.js.map +1 -1
  426. package/dist/dist-esm/react-composites/src/composites/common/utils.d.ts +0 -4
  427. package/dist/dist-esm/react-composites/src/composites/common/utils.js +0 -22
  428. package/dist/dist-esm/react-composites/src/composites/common/utils.js.map +1 -1
  429. package/dist/dist-esm/react-composites/src/composites/index.d.ts +2 -1
  430. package/dist/dist-esm/react-composites/src/composites/index.js +2 -0
  431. package/dist/dist-esm/react-composites/src/composites/index.js.map +1 -1
  432. package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json +2 -1
  433. package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +2 -1
  434. package/dist/dist-esm/react-composites/src/composites/localization/locales/cy-GB/strings.json +2 -1
  435. package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +2 -1
  436. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +2 -1
  437. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +2 -1
  438. package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +2 -1
  439. package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json +2 -1
  440. package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +2 -1
  441. package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/strings.json +2 -1
  442. package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +2 -1
  443. package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +2 -1
  444. package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +1 -0
  445. package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/strings.json +2 -1
  446. package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +2 -1
  447. package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/strings.json +2 -1
  448. package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +2 -1
  449. package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +2 -1
  450. package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/strings.json +2 -1
  451. package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +2 -1
  452. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +2 -1
  453. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +2 -1
  454. package/package.json +8 -9
  455. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-CK3wKmiQ.js +0 -202
  456. package/dist/dist-cjs/communication-react/ChatMessageComponentAsRichTextEditBox-CK3wKmiQ.js.map +0 -1
  457. package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-Duh89Mej.js +0 -50
  458. package/dist/dist-cjs/communication-react/RichTextSendBoxWrapper-Duh89Mej.js.map +0 -1
  459. package/dist/dist-cjs/communication-react/index-XC7Z08jO.js +0 -42425
  460. package/dist/dist-cjs/communication-react/index-XC7Z08jO.js.map +0 -1
  461. package/dist/dist-esm/acs-ui-common/src/dataConversion.d.ts +0 -6
  462. package/dist/dist-esm/acs-ui-common/src/dataConversion.js +0 -16
  463. package/dist/dist-esm/acs-ui-common/src/dataConversion.js.map +0 -1
  464. package/dist/dist-esm/acs-ui-common/src/removeImageTags.d.ts +0 -7
  465. package/dist/dist-esm/acs-ui-common/src/removeImageTags.js +0 -18
  466. package/dist/dist-esm/acs-ui-common/src/removeImageTags.js.map +0 -1
  467. package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.d.ts +0 -20
  468. package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.js +0 -118
  469. package/dist/dist-esm/calling-stateful-client/src/BreakoutRoomsSubscriber.js.map +0 -1
  470. package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.d.ts +0 -17
  471. package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.js +0 -33
  472. package/dist/dist-esm/calling-stateful-client/src/LocalRecordingSubscriber.js.map +0 -1
  473. package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.d.ts +0 -6
  474. package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.js +0 -20
  475. package/dist/dist-esm/chat-component-bindings/src/utils/getImageAttachmentsFromHTMLContent.js.map +0 -1
  476. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.d.ts +0 -10
  477. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js +0 -15
  478. package/dist/dist-esm/react-components/src/components/ChatMessage/MentionRenderer.js.map +0 -1
  479. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.d.ts +0 -24
  480. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js +0 -192
  481. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMessageComponentAsRichTextEditBox.js.map +0 -1
  482. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.d.ts +0 -69
  483. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js +0 -36
  484. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDenied.js.map +0 -1
  485. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.d.ts +0 -75
  486. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js +0 -67
  487. package/dist/dist-esm/react-components/src/components/DevicePermissions/BrowserPermissionDeniedIOS.js.map +0 -1
  488. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.d.ts +0 -105
  489. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js +0 -51
  490. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js.map +0 -1
  491. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.d.ts +0 -86
  492. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js +0 -39
  493. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js.map +0 -1
  494. package/dist/dist-esm/react-components/src/components/MentionPopover.d.ts +0 -121
  495. package/dist/dist-esm/react-components/src/components/MentionPopover.js +0 -119
  496. package/dist/dist-esm/react-components/src/components/MentionPopover.js.map +0 -1
  497. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.d.ts +0 -9
  498. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.js +0 -29
  499. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/ContextMenuPlugin.js.map +0 -1
  500. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.d.ts +0 -30
  501. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js +0 -98
  502. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/CopyPastePlugin.js.map +0 -1
  503. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.d.ts +0 -12
  504. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.js +0 -23
  505. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/KeyboardInputPlugin.js.map +0 -1
  506. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.d.ts +0 -15
  507. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js +0 -42
  508. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js.map +0 -1
  509. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.d.ts +0 -24
  510. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.js +0 -64
  511. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/RichTextToolbarPlugin.js.map +0 -1
  512. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.d.ts +0 -20
  513. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.js +0 -45
  514. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/TableEditContextMenuProvider.js.map +0 -1
  515. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.d.ts +0 -14
  516. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.js +0 -42
  517. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UndoRedoPlugin.js.map +0 -1
  518. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.d.ts +0 -29
  519. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.js +0 -87
  520. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/UpdateContentPlugin.js.map +0 -1
  521. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.d.ts +0 -58
  522. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +0 -314
  523. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +0 -1
  524. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.d.ts +0 -37
  525. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +0 -78
  526. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +0 -1
  527. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +0 -211
  528. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +0 -168
  529. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +0 -1
  530. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.d.ts +0 -16
  531. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js +0 -75
  532. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js.map +0 -1
  533. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.d.ts +0 -19
  534. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js +0 -221
  535. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/RichTextToolbar.js.map +0 -1
  536. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.d.ts +0 -7
  537. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.js +0 -51
  538. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTableCommandBarItem.js.map +0 -1
  539. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.d.ts +0 -15
  540. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js +0 -64
  541. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextInsertTablePane.js.map +0 -1
  542. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.d.ts +0 -6
  543. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.js +0 -13
  544. package/dist/dist-esm/react-components/src/components/RichTextEditor/Toolbar/Table/RichTextToolbarTableIcon.js.map +0 -1
  545. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.d.ts +0 -56
  546. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.js +0 -75
  547. package/dist/dist-esm/react-components/src/components/SendBoxErrorBar.js.map +0 -1
  548. package/dist/dist-esm/react-components/src/components/SendBoxErrors.d.ts +0 -14
  549. package/dist/dist-esm/react-components/src/components/SendBoxErrors.js +0 -18
  550. package/dist/dist-esm/react-components/src/components/SendBoxErrors.js.map +0 -1
  551. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.d.ts +0 -24
  552. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js +0 -550
  553. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/TextFieldWithMention.js.map +0 -1
  554. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.d.ts +0 -152
  555. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js +0 -816
  556. package/dist/dist-esm/react-components/src/components/TextFieldWithMention/mentionTagUtils.js.map +0 -1
  557. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.d.ts +0 -58
  558. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js +0 -144
  559. package/dist/dist-esm/react-components/src/components/styles/BrowserPermissionDenied.styles.js.map +0 -1
  560. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.d.ts +0 -26
  561. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js +0 -69
  562. package/dist/dist-esm/react-components/src/components/styles/MentionPopover.style.js.map +0 -1
  563. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.d.ts +0 -82
  564. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +0 -320
  565. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +0 -1
  566. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.d.ts +0 -21
  567. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js +0 -38
  568. package/dist/dist-esm/react-components/src/components/styles/RichTextInputBoxComponent.styles.js.map +0 -1
  569. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.d.ts +0 -38
  570. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js +0 -99
  571. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js.map +0 -1
  572. package/dist/dist-esm/react-components/src/components/styles/Stack.style.d.ts +0 -5
  573. package/dist/dist-esm/react-components/src/components/styles/Stack.style.js +0 -32
  574. package/dist/dist-esm/react-components/src/components/styles/Stack.style.js.map +0 -1
  575. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.d.ts +0 -26
  576. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js +0 -69
  577. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js.map +0 -1
  578. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.d.ts +0 -72
  579. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js +0 -174
  580. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorUtils.js.map +0 -1
  581. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.d.ts +0 -33
  582. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js +0 -116
  583. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js.map +0 -1
  584. package/dist/dist-esm/react-components/src/components/utils/merge.d.ts +0 -7
  585. package/dist/dist-esm/react-components/src/components/utils/merge.js +0 -16
  586. package/dist/dist-esm/react-components/src/components/utils/merge.js.map +0 -1
  587. package/dist/dist-esm/react-components/src/theming/icons.styles.d.ts +0 -6
  588. package/dist/dist-esm/react-components/src/theming/icons.styles.js +0 -25
  589. package/dist/dist-esm/react-components/src/theming/icons.styles.js.map +0 -1
  590. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Banner.d.ts +0 -47
  591. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Banner.js +0 -48
  592. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/Banner.js.map +0 -1
  593. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.d.ts +0 -11
  594. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.js +0 -36
  595. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/BreakoutRoomsBanner.js.map +0 -1
  596. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.d.ts +0 -49
  597. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js +0 -196
  598. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js.map +0 -1
  599. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useCompositeStringsForNotificationStack.d.ts +0 -7
  600. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useCompositeStringsForNotificationStack.js +0 -14
  601. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useCompositeStringsForNotificationStack.js.map +0 -1
  602. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.d.ts +0 -15
  603. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js +0 -41
  604. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js.map +0 -1
  605. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.d.ts +0 -8
  606. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.js +0 -25
  607. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.js.map +0 -1
  608. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.d.ts +0 -15
  609. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.js +0 -23
  610. package/dist/dist-esm/react-composites/src/composites/ChatComposite/AttachmentDownloadErrorBar.js.map +0 -1
  611. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.d.ts +0 -18
  612. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js +0 -18
  613. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreenPeoplePane.js.map +0 -1
  614. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.d.ts +0 -49
  615. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.js +0 -44
  616. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadReducer.js.map +0 -1
  617. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.d.ts +0 -39
  618. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js +0 -253
  619. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ImageUpload/ImageUploadUtils.js.map +0 -1
  620. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.d.ts +0 -80
  621. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js +0 -36
  622. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUpload.js.map +0 -1
  623. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.d.ts +0 -38
  624. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js +0 -67
  625. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js.map +0 -1
  626. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.d.ts +0 -5
  627. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js +0 -5
  628. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/index.js.map +0 -1
  629. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/Timer.d.ts +0 -12
  630. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/Timer.js +0 -52
  631. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/Timer.js.map +0 -1
  632. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.d.ts +0 -10
  633. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js +0 -16
  634. package/dist/dist-esm/react-composites/src/composites/common/RichTextSendBoxWrapper.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentCard.js","sourceRoot":"","sources":["../../../../../../preprocess-dist/react-components/src/components/Attachment/AttachmentCard.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACvL,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAErD,OAAO,EAAE,wCAAwC,EAAE,MAAM,iBAAiB,CAAC;AAG3E,OAAO,EAAE,uBAAuB,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AA6BpI;;;;;GAKG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,KAA2B,EAAe,EAAE;;IAC1E,MAAM,EACJ,UAAU,EACV,WAAW,EACX,qBAA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AAI,CAAC;oBACH,WAAW,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;gBACrC,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAI,CAAW,CAAC,OAAO,CAAC,CAAC;gBAC7C,CAAC;YACH,CAAC,GAAI,CACS,CAAC,CAAC,CAAC,oBAAC,OAAO;QACvB,oBAAC,IAAI;YACH,oBAAC,WAAW,IAAC,OAAO,EAAE,aAAa,CAAC,kBAAkB;gBACpD,oBAAC,WAAW;oBACV,oBAAC,aAAa,kBAAa,aAAa,CAAC,kBAAkB,EAAE,IAAI,EAAC,QAAQ,EAAC,IAAI,EAAE,oBAAC,IAAI,IAAC,QAAQ,EAAC,oBAAoB,GAAG,GAAI,CAC/G,CACF;YACd,oBAAC,WAAW;gBACV,oBAAC,QAAQ,QACN,WAAW,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,oBAAC,QAAQ,kBAAa,QAAQ,CAAC,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,GAAS,EAAE;wBAChI,IAAI,CAAC;4BACH,MAAM,QAAQ,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;wBACrC,CAAC;wBAAC,OAAO,CAAC,EAAE,CAAC;4BACX,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAI,CAAW,CAAC,OAAO,CAAC,CAAC;wBAC7C,CAAC;oBACH,CAAC,CAAA,IACM,QAAQ,CAAC,IAAI,CACL,CAAC,CACL,CACC,CACT,CACC,CAAC;AACf,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Icon, TooltipHost } from '@fluentui/react';\nimport { Card, CardHeader, Text, Menu, MenuTrigger, ToolbarButton, MenuPopover, MenuItem, MenuList, Toolbar, CardFooter, ProgressBar, mergeClasses } from '@fluentui/react-components';\nimport { getFileTypeIconProps } from '@fluentui/react-file-type-icons';\nimport React from 'react';\nimport { _pxToRem } from '@internal/acs-ui-common';\nimport { Announcer } from '../Announcer';\nimport { useEffect, useState, useMemo } from 'react';\nimport { _AttachmentUploadCardsStrings } from './AttachmentUploadCards';\nimport { useLocaleAttachmentCardStringsTrampoline } from '../utils/common';\nimport { AttachmentMenuAction } from '../../types/Attachment';\nimport { AttachmentMetadata, AttachmentMetadataInProgress } from '@internal/acs-ui-common';\nimport { useAttachmentCardStyles, ATTACHMENT_CARD_MIN_PROGRESS, titleTooltipContainerStyle } from '../styles/AttachmentCard.styles';\n\n/**\n * @internal\n * AttachmentCard Component Props.\n */\nexport interface _AttachmentCardProps {\n /**\n * Attachment details including name, extension, url, etc.\n */\n attachment: AttachmentMetadata | AttachmentMetadataInProgress;\n /**\n * An array of menu actions to be displayed in the attachment card.\n */\n menuActions: AttachmentMenuAction[];\n /**\n * Optional aria label strings for attachment upload cards\n */\n strings?: _AttachmentUploadCardsStrings;\n /**\n * Optional callback that runs if menu bar action onclick throws.\n */\n onActionHandlerFailed?: (errMsg: string) => void;\n /**\n * Optional flag to enable self resizing of the attachment card.\n */\n selfResizing?: boolean;\n}\n\n/**\n * @internal\n * A component for displaying an attachment card with attachment icon and progress bar.\n *\n * `_AttachmentCard` internally uses the `Card` component from `@fluentui/react-components`. You can checkout the details about these components [here](https://react.fluentui.dev/?path=/docs/components-card).\n */\nexport const _AttachmentCard = (props: _AttachmentCardProps): JSX.Element => {\n const {\n attachment,\n menuActions,\n onActionHandlerFailed,\n selfResizing\n } = props;\n const attachmentCardStyles = useAttachmentCardStyles();\n const progress = useMemo(() => {\n return 'progress' in attachment ? attachment.progress : undefined;\n }, [attachment]);\n const isUploadInProgress = useMemo(() => {\n return progress !== undefined && progress >= 0 && progress < 1;\n }, [progress]);\n const [announcerString, setAnnouncerString] = useState<string | undefined>(undefined);\n const localeStrings = useLocaleAttachmentCardStringsTrampoline();\n const uploadStartedString = props.strings?.uploading ?? localeStrings.uploading;\n const uploadCompletedString = props.strings?.uploadCompleted ?? localeStrings.uploadCompleted;\n useEffect(() => {\n if (isUploadInProgress) {\n setAnnouncerString(`${uploadStartedString} ${attachment.name}`);\n } else if (progress === 1) {\n setAnnouncerString(`${attachment.name} ${uploadCompletedString}`);\n } else {\n setAnnouncerString(undefined);\n }\n }, [progress, isUploadInProgress, attachment.name, uploadStartedString, uploadCompletedString]);\n const extension = useMemo((): string => {\n const re = /(?:\\.([^.]+))?$/;\n const match = re.exec(attachment.name);\n return match && match[1] ? match[1] : '';\n }, [attachment]);\n return <div data-is-focusable={true}>\n <Announcer announcementString={announcerString} ariaLive={'polite'} />\n <Card className={mergeClasses(attachmentCardStyles.root, selfResizing ? attachmentCardStyles.dynamicWidth : attachmentCardStyles.staticWidth)} size=\"small\" role=\"listitem\" appearance=\"filled-alternative\" aria-label={attachment.name} data-testid={'attachment-card'}>\n <CardHeader className={attachmentCardStyles.content} image={{\n className: attachmentCardStyles.fileIcon,\n children: <Icon data-ui-id={'attachmenttype-icon'} iconName={getFileTypeIconProps({\n extension: extension,\n size: 24,\n imageFileType: 'svg'\n }).iconName} />\n }} header={{\n id: 'attachment-' + attachment.id,\n children: <TooltipHost content={attachment.name} calloutProps={{\n gapSpace: 0,\n target: '#attachment-' + attachment.id\n }} hostClassName={titleTooltipContainerStyle}>\n <Text className={attachmentCardStyles.title} aria-label={attachment.name}>\n {attachment.name}\n </Text>\n </TooltipHost>\n }} action={{\n className: attachmentCardStyles.actions,\n children: MappedMenuItems(menuActions, {\n ...attachment,\n url: attachment.url ?? ''\n }, onActionHandlerFailed)\n }} />\n </Card>\n {isUploadInProgress ? <CardFooter>\n <ProgressBar thickness=\"medium\" value={Math.max(progress ?? 0, ATTACHMENT_CARD_MIN_PROGRESS)} shape=\"rounded\" />\n </CardFooter> : <> </>}\n </div>;\n};\nconst MappedMenuItems = (menuActions: AttachmentMenuAction[], attachment: AttachmentMetadata, handleOnClickError?: (errMsg: string) => void): JSX.Element => {\n const localeStrings = useLocaleAttachmentCardStringsTrampoline();\n if (menuActions.length === 0) {\n return <></>;\n }\n return menuActions.length === 1 ? <TooltipHost content={menuActions[0].name}>\n <ToolbarButton aria-label={menuActions[0].name} role=\"button\" icon={menuActions[0].icon} onClick={() => {\n try {\n menuActions[0].onClick(attachment);\n } catch (e) {\n handleOnClickError?.((e as Error).message);\n }\n }} />\n </TooltipHost> : <Toolbar>\n <Menu>\n <TooltipHost content={localeStrings.attachmentMoreMenu}>\n <MenuTrigger>\n <ToolbarButton aria-label={localeStrings.attachmentMoreMenu} role=\"button\" icon={<Icon iconName=\"AttachmentMoreMenu\" />} />\n </MenuTrigger>\n </TooltipHost>\n <MenuPopover>\n <MenuList>\n {menuActions.map((menuItem, index) => <MenuItem aria-label={menuItem.name} key={index} icon={menuItem.icon} onClick={async () => {\n try {\n await menuItem.onClick(attachment);\n } catch (e) {\n handleOnClickError?.((e as Error).message);\n }\n }}>\n {menuItem.name}\n </MenuItem>)}\n </MenuList>\n </MenuPopover>\n </Menu>\n </Toolbar>;\n};"]}
1
+ {"version":3,"file":"AttachmentCard.js","sourceRoot":"","sources":["../../../../../../preprocess-dist/react-components/src/components/Attachment/AttachmentCard.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,IAAI,EAAE,WAAW,EAAE,aAAa,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AACvL,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AACvE,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MA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EAAE,CAAC;4BACX,kBAAkB,aAAlB,kBAAkB,uBAAlB,kBAAkB,CAAI,CAAW,CAAC,OAAO,CAAC,CAAC;wBAC7C,CAAC;oBACH,CAAC,CAAA,IACM,QAAQ,CAAC,IAAI,CACL,CAAC,CACL,CACC,CACT,CACC,CAAC;AACf,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Icon, TooltipHost } from '@fluentui/react';\nimport { Card, CardHeader, Text, Menu, MenuTrigger, ToolbarButton, MenuPopover, MenuItem, MenuList, Toolbar, CardFooter, ProgressBar, mergeClasses } from '@fluentui/react-components';\nimport { getFileTypeIconProps } from '@fluentui/react-file-type-icons';\nimport React from 'react';\nimport { _pxToRem } from '@internal/acs-ui-common';\nimport { Announcer } from '../Announcer';\nimport { useEffect, useState, useMemo } from 'react';\nimport { _AttachmentUploadCardsStrings } from './AttachmentUploadCards';\nimport { useLocaleAttachmentCardStringsTrampoline } from '../utils/common';\nimport { AttachmentMenuAction } from '../../types/Attachment';\nimport { AttachmentMetadata, AttachmentMetadataInProgress } from '@internal/acs-ui-common';\nimport { useAttachmentCardStyles, ATTACHMENT_CARD_MIN_PROGRESS, titleTooltipContainerStyle } from '../styles/AttachmentCard.styles';\n\n/**\n * @internal\n * AttachmentCard Component Props.\n */\nexport interface _AttachmentCardProps {\n /**\n * Attachment details including name, extension, url, etc.\n */\n attachment: AttachmentMetadata | AttachmentMetadataInProgress;\n /**\n * An array of menu actions to be displayed in the attachment card.\n */\n menuActions: AttachmentMenuAction[];\n /**\n * Optional aria label strings for attachment upload cards\n */\n strings?: _AttachmentUploadCardsStrings;\n /**\n * Optional callback that runs if menu bar action onclick throws.\n */\n onActionHandlerFailed?: (errMsg: string) => void;\n /**\n * Optional flag to enable self resizing of the attachment card.\n */\n selfResizing?: boolean;\n}\n\n/**\n * @internal\n * A component for displaying an attachment card with attachment icon and progress bar.\n *\n * `_AttachmentCard` internally uses the `Card` component from `@fluentui/react-components`. You can checkout the details about these components [here](https://react.fluentui.dev/?path=/docs/components-card).\n */\nexport const _AttachmentCard = (props: _AttachmentCardProps): JSX.Element => {\n const {\n attachment,\n menuActions,\n onActionHandlerFailed,\n selfResizing\n } = props;\n const attachmentCardStyles = useAttachmentCardStyles();\n const progress = useMemo(() => {\n return 'progress' in attachment ? attachment.progress : undefined;\n }, [attachment]);\n const isUploadInProgress = useMemo(() => {\n return progress !== undefined && progress >= 0 && progress < 1;\n }, [progress]);\n const [announcerString, setAnnouncerString] = useState<string | undefined>(undefined);\n const localeStrings = useLocaleAttachmentCardStringsTrampoline();\n const uploadStartedString = props.strings?.uploading ?? localeStrings.uploading;\n const uploadCompletedString = props.strings?.uploadCompleted ?? localeStrings.uploadCompleted;\n useEffect(() => {\n if (isUploadInProgress) {\n setAnnouncerString(`${uploadStartedString} ${attachment.name}`);\n } else if (progress === 1) {\n setAnnouncerString(`${attachment.name} ${uploadCompletedString}`);\n } else {\n setAnnouncerString(undefined);\n }\n }, [progress, isUploadInProgress, attachment.name, uploadStartedString, uploadCompletedString]);\n const extension = useMemo((): string => {\n const re = /(?:\\.([^.]+))?$/;\n const match = re.exec(attachment.name);\n return match && match[1] ? match[1] : '';\n }, [attachment]);\n return <div data-is-focusable={true}>\n <Announcer announcementString={announcerString} ariaLive={'polite'} />\n <Card className={mergeClasses(attachmentCardStyles.root, selfResizing ? attachmentCardStyles.dynamicWidth : attachmentCardStyles.staticWidth)} size=\"small\" role=\"listitem\" appearance=\"filled-alternative\" aria-label={attachment.name} data-testid={'attachment-card'}>\n <CardHeader className={attachmentCardStyles.content} image={{\n className: attachmentCardStyles.fileIcon,\n children: <Icon data-ui-id={'attachmenttype-icon'} iconName={getFileTypeIconProps({\n extension: extension,\n size: 24,\n imageFileType: 'svg'\n }).iconName} />\n }} header={{\n id: 'attachment-' + attachment.id,\n children: <TooltipHost content={attachment.name} calloutProps={{\n gapSpace: 0,\n target: '#attachment-' + attachment.id\n }} hostClassName={titleTooltipContainerStyle}>\n <Text className={attachmentCardStyles.title} aria-label={attachment.name}>\n {attachment.name}\n </Text>\n </TooltipHost>\n }} action={{\n className: attachmentCardStyles.actions,\n children: MappedMenuItems(menuActions, {\n ...attachment,\n url: attachment.url ?? ''\n }, onActionHandlerFailed)\n }} />\n </Card>\n {isUploadInProgress ? <CardFooter>\n <ProgressBar thickness=\"medium\" value={Math.max(progress ?? 0, ATTACHMENT_CARD_MIN_PROGRESS)} shape=\"rounded\" />\n </CardFooter> : <> </>}\n </div>;\n};\nconst MappedMenuItems = (menuActions: AttachmentMenuAction[], attachment: AttachmentMetadata, handleOnClickError?: (errMsg: string) => void): JSX.Element => {\n const localeStrings = useLocaleAttachmentCardStringsTrampoline();\n if (!menuActions[0]) {\n return <></>;\n }\n return menuActions.length === 1 ? <TooltipHost content={menuActions[0].name}>\n <ToolbarButton aria-label={menuActions[0].name} role=\"button\" icon={menuActions[0].icon} onClick={() => {\n try {\n menuActions[0]?.onClick(attachment);\n } catch (e) {\n handleOnClickError?.((e as Error).message);\n }\n }} />\n </TooltipHost> : <Toolbar>\n <Menu>\n <TooltipHost content={localeStrings.attachmentMoreMenu}>\n <MenuTrigger>\n <ToolbarButton aria-label={localeStrings.attachmentMoreMenu} role=\"button\" icon={<Icon iconName=\"AttachmentMoreMenu\" />} />\n </MenuTrigger>\n </TooltipHost>\n <MenuPopover>\n <MenuList>\n {menuActions.map((menuItem, index) => <MenuItem aria-label={menuItem.name} key={index} icon={menuItem.icon} onClick={async () => {\n try {\n await menuItem.onClick(attachment);\n } catch (e) {\n handleOnClickError?.((e as Error).message);\n }\n }}>\n {menuItem.name}\n </MenuItem>)}\n </MenuList>\n </MenuPopover>\n </Menu>\n </Toolbar>;\n};"]}
@@ -13,8 +13,6 @@ export type ChatAttachmentType = 'unknown' | 'image' | 'file';
13
13
  * @internal
14
14
  */
15
15
  export interface _AttachmentDownloadCardsStrings {
16
- /** Aria label to notify user when focus is on attachment download button. */
17
- downloadAttachment: string;
18
16
  /** Aria label to notify user when focus is on attachment open button. */
19
17
  openAttachment: string;
20
18
  attachmentCardGroupMessage: string;
@@ -47,7 +47,6 @@ export const _AttachmentDownloadCards = (props) => {
47
47
  const useLocaleStringsTrampoline = () => {
48
48
  return useLocale().strings.messageThread;
49
49
  return {
50
- downloadAttachment: '',
51
50
  openAttachment: '',
52
51
  attachmentCardGroupMessage: ''
53
52
  };
@@ -67,7 +66,6 @@ const getDefaultMenuActions = (locale, chatMessage) => {
67
66
  }];
68
67
  }
69
68
  // otherwise, use the default icon ("download")
70
- actionName = locale.downloadAttachment;
71
69
  return [Object.assign(Object.assign({}, defaultAttachmentMenuAction), { name: actionName })];
72
70
  };
73
71
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentDownloadCards.js","sourceRoot":"","sources":["../../../../../../preprocess-dist/react-components/src/components/Attachment/AttachmentDownloadCards.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACzF,OAAO,EAAiB,6BAA6B,EAAE,sCAAgC;AAIvF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AA+CpF;;GAEG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,CAAC,KAAoC,EAAe,EAAE;IAC5F,MAAM,EACJ,WAAW,EACX,OAAO,EACR,GAAG,KAAK,CAAC;IACV,MAAM,aAAa,GAAG,0BAA0B,EAAE,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AAC,IAAI,CAAE,UAAiC,CAAC,GAAG,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC;QACrF,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAyB;IAC/D;;;;;;;;;;OAUG;IACH,IAAI,EAAE,UAAU;IAChB,6DAA6D;IAC7D,IAAI,EAAE,oBAAC,IAAI,IAAC,QAAQ,EAAC,oBAAoB,gBAAY,wCAAwC,GAAG;IAChG,wDAAwD;IACxD,OAAO,EAAE,qBAAqB;CAC/B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Icon } from '@fluentui/react';\nimport React, { useCallback } from 'react';\nimport { useMemo } from 'react';\nimport { useLocale } from '../../localization';\nimport { _AttachmentCard } from './AttachmentCard';\nimport { _AttachmentCardGroup, _AttachmentCardGroupLayout } from './AttachmentCardGroup';\nimport { _formatString, _isIdentityMicrosoftTeamsUser } from '@internal/acs-ui-common';\nimport { AttachmentMenuAction } from '../../types/Attachment';\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { ChatMessage } from '../../types';\nimport { mergeClasses } from '@griffel/react';\nimport { _ATTACHMENT_CARD_WIDTH_IN_REM } from '../styles/AttachmentCard.styles';\nimport { useAttachmentCardGroupStyles } from '../styles/AttachmentCardGroup.styles';\n\n/**\n * Represents the type of attachment\n * @public\n */\nexport type ChatAttachmentType = 'unknown' | 'image' | 'file';\n\n/**\n * Strings of _AttachmentDownloadCards that can be overridden.\n *\n * @internal\n */\nexport interface _AttachmentDownloadCardsStrings {\n /** Aria label to notify user when focus is on attachment download button. */\n downloadAttachment: string;\n /** Aria label to notify user when focus is on attachment open button. */\n openAttachment: string;\n attachmentCardGroupMessage: string;\n}\n\n/**\n * @internal\n */\nexport interface _AttachmentDownloadCardsProps {\n /**\n * A chat message metadata that includes attachment metadata\n */\n attachments?: AttachmentMetadata[];\n /**\n * A chat message metadata that includes attachment metadata\n */\n message?: ChatMessage;\n /**\n * Optional callback to handle attachment download\n */\n actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];\n /**\n * Optional callback that runs if downloadHandler returns an error.\n */\n onActionHandlerFailed?: (errMsg: string) => void;\n /**\n * Optional aria label strings for attachment download cards\n */\n strings?: _AttachmentDownloadCardsStrings;\n}\n\n/**\n * @internal\n */\nexport const _AttachmentDownloadCards = (props: _AttachmentDownloadCardsProps): JSX.Element => {\n const {\n attachments,\n message\n } = props;\n const localeStrings = useLocaleStringsTrampoline();\n const attachmentCardGroupStyles = useAttachmentCardGroupStyles();\n const getMenuActions = useCallback((attachment: AttachmentMetadata, localeStrings: _AttachmentDownloadCardsStrings, message?: ChatMessage, action?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[]): AttachmentMenuAction[] => {\n const defaultMenuActions = getDefaultMenuActions(localeStrings, message);\n try {\n const actions = action?.(attachment, message);\n if (actions && actions.length > 0) {\n return actions;\n } else {\n return defaultMenuActions;\n }\n } catch (error) {\n return defaultMenuActions;\n }\n }, []);\n const hasMultipleAttachments = useMemo(() => {\n return (props.attachments?.length ?? 0) > 1;\n }, [props.attachments]);\n if (!attachments || attachments.length === 0 || !attachments) {\n return <></>;\n }\n return <div className={mergeClasses(attachmentCardGroupStyles.root, hasMultipleAttachments ? attachmentCardGroupStyles.multipleAttachments : attachmentCardGroupStyles.singleAttachment)} data-ui-id=\"attachment-download-card-group\">\n <_AttachmentCardGroup attachmentGroupLayout={_AttachmentCardGroupLayout.Grid}>\n {attachments && attachments.map(attachment => <_AttachmentCard attachment={attachment} key={attachment.id} menuActions={getMenuActions(attachment, localeStrings, message, props.actionsForAttachment)} onActionHandlerFailed={props.onActionHandlerFailed} selfResizing={hasMultipleAttachments} />)}\n </_AttachmentCardGroup>\n </div>;\n};\n\n/**\n * @private\n */\nconst useLocaleStringsTrampoline = (): _AttachmentDownloadCardsStrings => {\n return useLocale().strings.messageThread;\n return {\n downloadAttachment: '',\n openAttachment: '',\n attachmentCardGroupMessage: ''\n };\n};\n\n/**\n * @private\n */\nconst getDefaultMenuActions = (locale: _AttachmentDownloadCardsStrings, chatMessage?: ChatMessage): AttachmentMenuAction[] => {\n let actionName = locale.openAttachment;\n // if message is sent by a Teams user, we need to use a different icon (\"open\")\n const isTeamsUser = _isIdentityMicrosoftTeamsUser(chatMessage?.senderId);\n if (isTeamsUser) {\n return [{\n name: actionName,\n icon: <Icon iconName=\"OpenAttachment\" />,\n onClick: defaultOnClickHandler\n }];\n }\n // otherwise, use the default icon (\"download\")\n actionName = locale.downloadAttachment;\n return [{\n ...defaultAttachmentMenuAction,\n name: actionName\n }];\n};\n\n/**\n *\n * The default action handler for downloading attachments. This handler will open the attachment's URL in a new tab.\n */\nconst defaultOnClickHandler = (attachment: AttachmentMetadata): Promise<void> => {\n return new Promise<void>(resolve => {\n window.open((attachment as AttachmentMetadata).url, '_blank', 'noopener,noreferrer');\n resolve();\n });\n};\n\n/**\n * @beta\n *\n * The default menu action for downloading attachments. This action will open the attachment's URL in a new tab.\n */\nexport const defaultAttachmentMenuAction: AttachmentMenuAction = {\n /**\n *\n * name is used for aria-label only when there's one button. For multiple buttons, it's used as a label.\n * by default it's an unlocalized string when this is used as a imported constant,\n * but you can overwrite it with your own localized string.\n *\n * i.e. defaultAttachmentMenuAction.name = localize('Download');\n *\n * when no action is provided, the UI library will overwrite this name\n * with a localized string this string when it's used in the UI.\n */\n name: 'Download',\n // this is the icon shown on the right of the attachment card\n icon: <Icon iconName=\"DownloadAttachment\" data-ui-id=\"attachment-download-card-download-icon\" />,\n // this is the action that runs when the icon is clicked\n onClick: defaultOnClickHandler\n};"]}
1
+ {"version":3,"file":"AttachmentDownloadCards.js","sourceRoot":"","sources":["../../../../../../preprocess-dist/react-components/src/components/Attachment/AttachmentDownloadCards.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO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AI,UAAU,GAAG,MAAM,CAAC,cAAc,CAAC;IACvC,+EAA+E;IAC/E,MAAM,WAAW,GAAG,6BAA6B,CAAC,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,QAAQ,CAAC,CAAC;IACzE,IAAI,WAAW,EAAE,CAAC;QAChB,OAAO,CAAC;gBACN,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,oBAAC,IAAI,IAAC,QAAQ,EAAC,gBAAgB,GAAG;gBACxC,OAAO,EAAE,qBAAqB;aAC/B,CAAC,CAAC;IACL,CAAC;IACD,+CAA+C;IAC/C,OAAO,iCACF,2BAA2B,KAC9B,IAAI,EAAE,UAAU,IAChB,CAAC;AACL,CAAC,CAAC;AAEF;;;GAGG;AACH,MAAM,qBAAqB,GAAG,CAAC,UAA8B,EAAiB,EAAE;IAC9E,OAAO,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE;QACjC,MAAM,CAAC,IAAI,CAAE,UAAiC,CAAC,GAAG,EAAE,QAAQ,EAAE,qBAAqB,CAAC,CAAC;QACrF,OAAO,EAAE,CAAC;IACZ,CAAC,CAAC,CAAC;AACL,CAAC,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAyB;IAC/D;;;;;;;;;;OAUG;IACH,IAAI,EAAE,UAAU;IAChB,6DAA6D;IAC7D,IAAI,EAAE,oBAAC,IAAI,IAAC,QAAQ,EAAC,oBAAoB,gBAAY,wCAAwC,GAAG;IAChG,wDAAwD;IACxD,OAAO,EAAE,qBAAqB;CAC/B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Icon } from '@fluentui/react';\nimport React, { useCallback } from 'react';\nimport { useMemo } from 'react';\nimport { useLocale } from '../../localization';\nimport { _AttachmentCard } from './AttachmentCard';\nimport { _AttachmentCardGroup, _AttachmentCardGroupLayout } from './AttachmentCardGroup';\nimport { _formatString, _isIdentityMicrosoftTeamsUser } from '@internal/acs-ui-common';\nimport { AttachmentMenuAction } from '../../types/Attachment';\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { ChatMessage } from '../../types';\nimport { mergeClasses } from '@griffel/react';\nimport { _ATTACHMENT_CARD_WIDTH_IN_REM } from '../styles/AttachmentCard.styles';\nimport { useAttachmentCardGroupStyles } from '../styles/AttachmentCardGroup.styles';\n\n/**\n * Represents the type of attachment\n * @public\n */\nexport type ChatAttachmentType = 'unknown' | 'image' | 'file';\n\n/**\n * Strings of _AttachmentDownloadCards that can be overridden.\n *\n * @internal\n */\nexport interface _AttachmentDownloadCardsStrings {\n /** Aria label to notify user when focus is on attachment open button. */\n openAttachment: string;\n attachmentCardGroupMessage: string;\n}\n\n/**\n * @internal\n */\nexport interface _AttachmentDownloadCardsProps {\n /**\n * A chat message metadata that includes attachment metadata\n */\n attachments?: AttachmentMetadata[];\n /**\n * A chat message metadata that includes attachment metadata\n */\n message?: ChatMessage;\n /**\n * Optional callback to handle attachment download\n */\n actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];\n /**\n * Optional callback that runs if downloadHandler returns an error.\n */\n onActionHandlerFailed?: (errMsg: string) => void;\n /**\n * Optional aria label strings for attachment download cards\n */\n strings?: _AttachmentDownloadCardsStrings;\n}\n\n/**\n * @internal\n */\nexport const _AttachmentDownloadCards = (props: _AttachmentDownloadCardsProps): JSX.Element => {\n const {\n attachments,\n message\n } = props;\n const localeStrings = useLocaleStringsTrampoline();\n const attachmentCardGroupStyles = useAttachmentCardGroupStyles();\n const getMenuActions = useCallback((attachment: AttachmentMetadata, localeStrings: _AttachmentDownloadCardsStrings, message?: ChatMessage, action?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[]): AttachmentMenuAction[] => {\n const defaultMenuActions = getDefaultMenuActions(localeStrings, message);\n try {\n const actions = action?.(attachment, message);\n if (actions && actions.length > 0) {\n return actions;\n } else {\n return defaultMenuActions;\n }\n } catch (error) {\n return defaultMenuActions;\n }\n }, []);\n const hasMultipleAttachments = useMemo(() => {\n return (props.attachments?.length ?? 0) > 1;\n }, [props.attachments]);\n if (!attachments || attachments.length === 0 || !attachments) {\n return <></>;\n }\n return <div className={mergeClasses(attachmentCardGroupStyles.root, hasMultipleAttachments ? attachmentCardGroupStyles.multipleAttachments : attachmentCardGroupStyles.singleAttachment)} data-ui-id=\"attachment-download-card-group\">\n <_AttachmentCardGroup attachmentGroupLayout={_AttachmentCardGroupLayout.Grid}>\n {attachments && attachments.map(attachment => <_AttachmentCard attachment={attachment} key={attachment.id} menuActions={getMenuActions(attachment, localeStrings, message, props.actionsForAttachment)} onActionHandlerFailed={props.onActionHandlerFailed} selfResizing={hasMultipleAttachments} />)}\n </_AttachmentCardGroup>\n </div>;\n};\n\n/**\n * @private\n */\nconst useLocaleStringsTrampoline = (): _AttachmentDownloadCardsStrings => {\n return useLocale().strings.messageThread;\n return {\n openAttachment: '',\n attachmentCardGroupMessage: ''\n };\n};\n\n/**\n * @private\n */\nconst getDefaultMenuActions = (locale: _AttachmentDownloadCardsStrings, chatMessage?: ChatMessage): AttachmentMenuAction[] => {\n let actionName = locale.openAttachment;\n // if message is sent by a Teams user, we need to use a different icon (\"open\")\n const isTeamsUser = _isIdentityMicrosoftTeamsUser(chatMessage?.senderId);\n if (isTeamsUser) {\n return [{\n name: actionName,\n icon: <Icon iconName=\"OpenAttachment\" />,\n onClick: defaultOnClickHandler\n }];\n }\n // otherwise, use the default icon (\"download\")\n return [{\n ...defaultAttachmentMenuAction,\n name: actionName\n }];\n};\n\n/**\n *\n * The default action handler for downloading attachments. This handler will open the attachment's URL in a new tab.\n */\nconst defaultOnClickHandler = (attachment: AttachmentMetadata): Promise<void> => {\n return new Promise<void>(resolve => {\n window.open((attachment as AttachmentMetadata).url, '_blank', 'noopener,noreferrer');\n resolve();\n });\n};\n\n/**\n * @beta\n *\n * The default menu action for downloading attachments. This action will open the attachment's URL in a new tab.\n */\nexport const defaultAttachmentMenuAction: AttachmentMenuAction = {\n /**\n *\n * name is used for aria-label only when there's one button. For multiple buttons, it's used as a label.\n * by default it's an unlocalized string when this is used as a imported constant,\n * but you can overwrite it with your own localized string.\n *\n * i.e. defaultAttachmentMenuAction.name = localize('Download');\n *\n * when no action is provided, the UI library will overwrite this name\n * with a localized string this string when it's used in the UI.\n */\n name: 'Download',\n // this is the icon shown on the right of the attachment card\n icon: <Icon iconName=\"DownloadAttachment\" data-ui-id=\"attachment-download-card-download-icon\" />,\n // this is the action that runs when the icon is clicked\n onClick: defaultOnClickHandler\n};"]}
@@ -2,11 +2,8 @@
2
2
  import { MessageStatus } from "../../../../acs-ui-common/src";
3
3
  import { MessageProps, MessageRenderer, MessageThreadStyles, _ChatMessageProps } from '../MessageThread';
4
4
  import { ChatMessage, OnRenderAvatarCallback } from '../../types';
5
- import { BlockedMessage } from '../../types';
6
5
  import { AttachmentMenuAction } from '../../types/Attachment';
7
6
  import { AttachmentMetadata } from "../../../../acs-ui-common/src";
8
- import { AttachmentMetadataInProgress } from "../../../../acs-ui-common/src";
9
- import { MentionOptions } from '../MentionPopover';
10
7
  import { MessageStatusIndicatorProps } from '../MessageStatusIndicator';
11
8
  import { InlineImageOptions } from './ChatMessageContent';
12
9
  /**
@@ -22,7 +19,7 @@ export type ChatMessageComponentWrapperProps = _ChatMessageProps & {
22
19
  styles: MessageThreadStyles | undefined;
23
20
  shouldOverlapAvatarAndMessage: boolean;
24
21
  onRenderMessageStatus: ((messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null) | undefined;
25
- defaultStatusRenderer: (message: ChatMessage | BlockedMessage, participantCount: number, readCount: number, status?: MessageStatus) => JSX.Element;
22
+ defaultStatusRenderer: (message: ChatMessage, participantCount: number, readCount: number, status?: MessageStatus) => JSX.Element;
26
23
  onRenderMessage?: (messageProps: MessageProps, messageRenderer?: MessageRenderer) => JSX.Element;
27
24
  onRenderAvatar?: OnRenderAvatarCallback;
28
25
  showMessageStatus?: boolean;
@@ -32,21 +29,12 @@ export type ChatMessageComponentWrapperProps = _ChatMessageProps & {
32
29
  id: string;
33
30
  displayName: string;
34
31
  }[]) => void) => void;
35
- onDisplayDateTimeString?: (messageDate: Date) => string;
36
32
  inlineImageOptions?: InlineImageOptions;
37
- mentionOptions?: MentionOptions;
38
33
  onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;
39
34
  /**
40
35
  * Optional callback to define custom actions for attachments.
41
36
  */
42
37
  actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];
43
- isRichTextEditorEnabled?: boolean;
44
- onPaste?: (event: {
45
- content: DocumentFragment;
46
- }) => void;
47
- onRemoveInlineImage?: (imageAttributes: Record<string, string>, messageId: string) => void;
48
- onInsertInlineImage?: (imageAttributes: Record<string, string>, messageId: string) => void;
49
- inlineImagesWithProgress?: AttachmentMetadataInProgress[];
50
38
  };
51
39
  /**
52
40
  * The wrapper component to display different types of chat message.
@@ -10,7 +10,7 @@ import { FluentChatMessageComponent } from './MessageComponents/FluentChatMessag
10
10
  * @private
11
11
  */
12
12
  export const ChatMessageComponentWrapper = (props) => {
13
- var _a, _b;
13
+ var _a;
14
14
  const { message, styles, onRenderMessage, key: messageKey } = props;
15
15
  const systemMessageStyle = useMemo(() => {
16
16
  return {
@@ -22,17 +22,11 @@ export const ChatMessageComponentWrapper = (props) => {
22
22
  paddingTop: '1rem',
23
23
  paddingBottom: '0.25rem'
24
24
  };
25
- }, []); // Similar logic as switch statement case 'chat', if statement for conditional compile (merge logic to switch case when stabilize)
26
- if (message.messageType === 'blocked') {
27
- const myChatMessageStyle = message.status === 'failed' ? (_a = styles === null || styles === void 0 ? void 0 : styles.failedMyChatMessageContainer) !== null && _a !== void 0 ? _a : styles === null || styles === void 0 ? void 0 : styles.myChatMessageContainer : styles === null || styles === void 0 ? void 0 : styles.myChatMessageContainer;
28
- const blockedMessageStyle = styles === null || styles === void 0 ? void 0 : styles.blockedMessageContainer;
29
- const messageContainerStyle = message.mine ? myChatMessageStyle : blockedMessageStyle;
30
- return fluentChatComponent(Object.assign(Object.assign({}, props), { message: message, messageContainerStyle: messageContainerStyle }));
31
- }
25
+ }, []);
32
26
  switch (message.messageType) {
33
27
  case 'chat':
34
28
  {
35
- const myChatMessageStyle = message.status === 'failed' ? (_b = styles === null || styles === void 0 ? void 0 : styles.failedMyChatMessageContainer) !== null && _b !== void 0 ? _b : styles === null || styles === void 0 ? void 0 : styles.myChatMessageContainer : styles === null || styles === void 0 ? void 0 : styles.myChatMessageContainer;
29
+ const myChatMessageStyle = message.status === 'failed' ? (_a = styles === null || styles === void 0 ? void 0 : styles.failedMyChatMessageContainer) !== null && _a !== void 0 ? _a : styles === null || styles === void 0 ? void 0 : styles.myChatMessageContainer : styles === null || styles === void 0 ? void 0 : styles.myChatMessageContainer;
36
30
  const chatMessageStyle = styles === null || styles === void 0 ? void 0 : styles.chatMessageContainer;
37
31
  const messageContainerStyle = message.mine ? myChatMessageStyle : chatMessageStyle;
38
32
  return fluentChatComponent(Object.assign(Object.assign({}, props), { message: message, messageContainerStyle: messageContainerStyle }));
@@ -1 +1 @@
1
- {"version":3,"file":"ChatMessageComponentWrapper.js","sourceRoot":"","sources":["../../../../../../preprocess-dist/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAUvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAC;AAClG,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AA0C5F;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,KAAuC,EAAe,EAAE;;IAClG,MAAM,EACJ,OAAO,EACP,MAAM,EACN,eAAe,EACf,GAAG,EAAE,UAAU,EAChB,GAAG,KAAK,CAAC;IACV,MAA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I,CAAC;IACnD,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { MessageStatus } from '@internal/acs-ui-common';\nimport React, { useMemo } from 'react';\nimport { MessageProps, MessageRenderer, MessageThreadStyles, _ChatMessageProps } from '../MessageThread';\nimport { ChatMessage, OnRenderAvatarCallback } from '../../types';\nimport { BlockedMessage } from '../../types';\nimport { AttachmentMenuAction } from '../../types/Attachment';\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { AttachmentMetadataInProgress } from '@internal/acs-ui-common';\nimport { MentionOptions } from '../MentionPopover';\nimport { MessageStatusIndicatorProps } from '../MessageStatusIndicator';\nimport { FluentChatMessageComponentWrapperProps } from './MessageComponents/FluentChatMessageComponent';\nimport { DefaultSystemMessage } from './DefaultSystemMessage';\nimport { InlineImageOptions } from './ChatMessageContent';\nimport { FluentChatMyMessageComponent } from './MyMessageComponents/FluentChatMyMessageComponent';\nimport { FluentChatMessageComponent } from './MessageComponents/FluentChatMessageComponent';\n\n/**\n * Props for {@link ChatMessageComponentWrapper}\n *\n * @private\n */\nexport type ChatMessageComponentWrapperProps = _ChatMessageProps & {\n /**\n * UserId of the current user.\n */\n userId: string;\n styles: MessageThreadStyles | undefined;\n shouldOverlapAvatarAndMessage: boolean;\n onRenderMessageStatus: ((messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null) | undefined;\n defaultStatusRenderer: (message: ChatMessage | BlockedMessage, participantCount: number, readCount: number, status?: MessageStatus) => JSX.Element;\n onRenderMessage?: (messageProps: MessageProps, messageRenderer?: MessageRenderer) => JSX.Element;\n onRenderAvatar?: OnRenderAvatarCallback;\n showMessageStatus?: boolean;\n participantCount?: number;\n readCount?: number;\n onActionButtonClick: (message: ChatMessage, setMessageReadBy: (readBy: {\n id: string;\n displayName: string;\n }[]) => void) => void;\n onDisplayDateTimeString?: (messageDate: Date) => string;\n inlineImageOptions?: InlineImageOptions;\n mentionOptions?: MentionOptions;\n onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;\n /**\n * Optional callback to define custom actions for attachments.\n */\n actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];\n isRichTextEditorEnabled?: boolean;\n onPaste?: (event: {\n content: DocumentFragment;\n }) => void;\n onRemoveInlineImage?: (imageAttributes: Record<string, string>, messageId: string) => void;\n onInsertInlineImage?: (imageAttributes: Record<string, string>, messageId: string) => void;\n inlineImagesWithProgress?: AttachmentMetadataInProgress[];\n};\n\n/**\n * The wrapper component to display different types of chat message.\n *\n * @private\n */\nexport const ChatMessageComponentWrapper = (props: ChatMessageComponentWrapperProps): JSX.Element => {\n const {\n message,\n styles,\n onRenderMessage,\n key: messageKey\n } = props;\n const systemMessageStyle = useMemo(() => {\n return {\n paddingTop: '0.5rem'\n };\n }, []);\n const customMessageStyle = useMemo(() => {\n return {\n paddingTop: '1rem',\n paddingBottom: '0.25rem'\n };\n }, []); // Similar logic as switch statement case 'chat', if statement for conditional compile (merge logic to switch case when stabilize)\n if (message.messageType === 'blocked') {\n const myChatMessageStyle = message.status === 'failed' ? styles?.failedMyChatMessageContainer ?? styles?.myChatMessageContainer : styles?.myChatMessageContainer;\n const blockedMessageStyle = styles?.blockedMessageContainer;\n const messageContainerStyle = message.mine ? myChatMessageStyle : blockedMessageStyle;\n return fluentChatComponent({\n ...props,\n message: message,\n messageContainerStyle: messageContainerStyle\n });\n }\n switch (message.messageType) {\n case 'chat':\n {\n const myChatMessageStyle = message.status === 'failed' ? styles?.failedMyChatMessageContainer ?? styles?.myChatMessageContainer : styles?.myChatMessageContainer;\n const chatMessageStyle = styles?.chatMessageContainer;\n const messageContainerStyle = message.mine ? myChatMessageStyle : chatMessageStyle;\n return fluentChatComponent({\n ...props,\n message: message,\n messageContainerStyle: messageContainerStyle\n });\n }\n case 'system':\n {\n const messageContainerStyle = styles?.systemMessageContainer;\n const systemMessageComponent = onRenderMessage === undefined ? <DefaultSystemMessage {...props} /> : onRenderMessage({\n ...props,\n messageContainerStyle\n }, props => <DefaultSystemMessage {...props} />);\n return <div key={messageKey} style={systemMessageStyle}>\n {systemMessageComponent}\n </div>;\n }\n default:\n {\n // We do not handle custom type message by default, users can handle custom type by using onRenderMessage function.\n const customMessageComponent = onRenderMessage === undefined ? <></> : onRenderMessage({\n ...props\n });\n return <div key={messageKey} style={customMessageStyle}>\n {customMessageComponent}\n </div>;\n }\n }\n};\nconst fluentChatComponent = (props: FluentChatMessageComponentWrapperProps): JSX.Element => {\n if (props.message.mine === true) {\n return <FluentChatMyMessageComponent {...props} />;\n } else {\n return <FluentChatMessageComponent {...props} />;\n }\n};"]}
1
+ {"version":3,"file":"ChatMessageComponentWrapper.js","sourceRoot":"","sources":["../../../../../../preprocess-dist/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAOvC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAE9D,OAAO,EAAE,4BAA4B,EAAE,MAAM,oDAAoD,CAAC;AAClG,OAAO,EAAE,0BAA0B,EAAE,MAAM,gDAAgD,CAAC;AAiC5F;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAG,CAAC,KAAuC,EAAe,EAAE;;IAClG,MAAM,EACJ,OAAO,EACP,MAAM,EACN,eAAe,EACf,GAAG,EAAE,UAAU,EAChB,GAAG,KAAK,CAAC;IACV,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,EAAE;QACtC,OAAO;YACL,UAAU,EAAE,QAAQ;SACrB,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,EAAE;QACtC,OAAO;YACL,UAAU,EAAE,MAAM;YAClB,aAAa,EAAE,SAAS;SACzB,CAAC;IACJ,CAAC,E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,OAAO,6BAAK,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,kBAAkB,IACnD,sBAAsB,CACnB,CAAC;YACT,CAAC;IACL,CAAC;AACH,CAAC,CAAC;AACF,MAAM,mBAAmB,GAAG,CAAC,KAA6C,EAAe,EAAE;IACzF,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,IAAI,EAAE,CAAC;QAChC,OAAO,oBAAC,4BAA4B,oBAAK,KAAK,EAAI,CAAC;IACrD,CAAC;SAAM,CAAC;QACN,OAAO,oBAAC,0BAA0B,oBAAK,KAAK,EAAI,CAAC;IACnD,CAAC;AACH,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { MessageStatus } from '@internal/acs-ui-common';\nimport React, { useMemo } from 'react';\nimport { MessageProps, MessageRenderer, MessageThreadStyles, _ChatMessageProps } from '../MessageThread';\nimport { ChatMessage, OnRenderAvatarCallback } from '../../types';\nimport { AttachmentMenuAction } from '../../types/Attachment';\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { MessageStatusIndicatorProps } from '../MessageStatusIndicator';\nimport { FluentChatMessageComponentWrapperProps } from './MessageComponents/FluentChatMessageComponent';\nimport { DefaultSystemMessage } from './DefaultSystemMessage';\nimport { InlineImageOptions } from './ChatMessageContent';\nimport { FluentChatMyMessageComponent } from './MyMessageComponents/FluentChatMyMessageComponent';\nimport { FluentChatMessageComponent } from './MessageComponents/FluentChatMessageComponent';\n\n/**\n * Props for {@link ChatMessageComponentWrapper}\n *\n * @private\n */\nexport type ChatMessageComponentWrapperProps = _ChatMessageProps & {\n /**\n * UserId of the current user.\n */\n userId: string;\n styles: MessageThreadStyles | undefined;\n shouldOverlapAvatarAndMessage: boolean;\n onRenderMessageStatus: ((messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null) | undefined;\n defaultStatusRenderer: (message: ChatMessage, participantCount: number, readCount: number, status?: MessageStatus) => JSX.Element;\n onRenderMessage?: (messageProps: MessageProps, messageRenderer?: MessageRenderer) => JSX.Element;\n onRenderAvatar?: OnRenderAvatarCallback;\n showMessageStatus?: boolean;\n participantCount?: number;\n readCount?: number;\n onActionButtonClick: (message: ChatMessage, setMessageReadBy: (readBy: {\n id: string;\n displayName: string;\n }[]) => void) => void;\n inlineImageOptions?: InlineImageOptions;\n onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;\n /**\n * Optional callback to define custom actions for attachments.\n */\n actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];\n};\n\n/**\n * The wrapper component to display different types of chat message.\n *\n * @private\n */\nexport const ChatMessageComponentWrapper = (props: ChatMessageComponentWrapperProps): JSX.Element => {\n const {\n message,\n styles,\n onRenderMessage,\n key: messageKey\n } = props;\n const systemMessageStyle = useMemo(() => {\n return {\n paddingTop: '0.5rem'\n };\n }, []);\n const customMessageStyle = useMemo(() => {\n return {\n paddingTop: '1rem',\n paddingBottom: '0.25rem'\n };\n }, []);\n switch (message.messageType) {\n case 'chat':\n {\n const myChatMessageStyle = message.status === 'failed' ? styles?.failedMyChatMessageContainer ?? styles?.myChatMessageContainer : styles?.myChatMessageContainer;\n const chatMessageStyle = styles?.chatMessageContainer;\n const messageContainerStyle = message.mine ? myChatMessageStyle : chatMessageStyle;\n return fluentChatComponent({\n ...props,\n message: message,\n messageContainerStyle: messageContainerStyle\n });\n }\n case 'system':\n {\n const messageContainerStyle = styles?.systemMessageContainer;\n const systemMessageComponent = onRenderMessage === undefined ? <DefaultSystemMessage {...props} /> : onRenderMessage({\n ...props,\n messageContainerStyle\n }, props => <DefaultSystemMessage {...props} />);\n return <div key={messageKey} style={systemMessageStyle}>\n {systemMessageComponent}\n </div>;\n }\n default:\n {\n // We do not handle custom type message by default, users can handle custom type by using onRenderMessage function.\n const customMessageComponent = onRenderMessage === undefined ? <></> : onRenderMessage({\n ...props\n });\n return <div key={messageKey} style={customMessageStyle}>\n {customMessageComponent}\n </div>;\n }\n }\n};\nconst fluentChatComponent = (props: FluentChatMessageComponentWrapperProps): JSX.Element => {\n if (props.message.mine === true) {\n return <FluentChatMyMessageComponent {...props} />;\n } else {\n return <FluentChatMessageComponent {...props} />;\n }\n};"]}
@@ -1,19 +1,12 @@
1
1
  import React from 'react';
2
2
  import { ChatMessage } from '../../types/ChatMessage';
3
- import { BlockedMessage } from '../../types/ChatMessage';
4
- import { MentionDisplayOptions } from '../MentionPopover';
5
3
  import { MessageThreadStrings } from '../MessageThread';
6
4
  import { AttachmentMetadata } from "../../../../acs-ui-common/src";
7
5
  type ChatMessageContentProps = {
8
6
  message: ChatMessage;
9
7
  strings: MessageThreadStrings;
10
- mentionDisplayOptions?: MentionDisplayOptions;
11
8
  inlineImageOptions?: InlineImageOptions;
12
9
  };
13
- type BlockedMessageContentProps = {
14
- message: BlockedMessage;
15
- strings: MessageThreadStrings;
16
- };
17
10
  /**
18
11
  * InlineImage's state, as reflected in the UI.
19
12
  *
@@ -38,10 +31,6 @@ export interface InlineImageOptions {
38
31
  }
39
32
  /** @private */
40
33
  export declare const ChatMessageContent: (props: ChatMessageContentProps) => JSX.Element;
41
- /**
42
- * @private
43
- */
44
- export declare const BlockedMessageContent: (props: BlockedMessageContentProps) => JSX.Element;
45
34
  /**
46
35
  * @private
47
36
  */
@@ -6,11 +6,8 @@ import parse, { Element as DOMElement } from 'html-react-parser';
6
6
  import { attributesToProps } from 'html-react-parser';
7
7
  import Linkify from 'react-linkify';
8
8
  import { Link } from '@fluentui/react';
9
- import { FontIcon, Stack } from '@fluentui/react';
10
9
  import LiveMessage from '../Announcer/LiveMessage';
11
- import { defaultOnMentionRender } from './MentionRenderer';
12
10
  import DOMPurify from 'dompurify';
13
- import { dataLossIconStyle } from '../styles/MessageThread.styles';
14
11
  import { messageTextContentStyles } from '../styles/MessageThread.styles';
15
12
  /** @private */
16
13
  export const ChatMessageContent = (props) => {
@@ -39,22 +36,6 @@ const MessageContentAsText = (props) => {
39
36
  return React.createElement(Link, { target: "_blank", href: decoratedHref, key: key }, decoratedText);
40
37
  } }, props.message.content) });
41
38
  };
42
- /**
43
- * @private
44
- */
45
- export const BlockedMessageContent = (props) => {
46
- var _a;
47
- const Icon = React.createElement(FontIcon, { className: dataLossIconStyle, iconName: 'DataLossPreventionProhibited' });
48
- const blockedMessage = props.message.warningText === undefined ? props.strings.blockedWarningText : props.message.warningText;
49
- const blockedMessageLink = props.message.link;
50
- const blockedMessageLinkText = blockedMessageLink ? (_a = props.message.linkText) !== null && _a !== void 0 ? _a : props.strings.blockedWarningLinkText : '';
51
- const liveAuthor = props.message.mine || props.message.senderDisplayName === undefined ? '' : props.message.senderDisplayName;
52
- const liveBlockedWarningText = `${liveAuthor} ${blockedMessage} ${blockedMessageLinkText}`;
53
- return React.createElement(MessageContentWithLiveAria, { message: props.message, liveMessage: liveBlockedWarningText, ariaLabel: liveBlockedWarningText, content: React.createElement(Stack, { horizontal: true, wrap: true },
54
- Icon,
55
- blockedMessage && React.createElement("p", null, blockedMessage),
56
- blockedMessageLink && React.createElement(Link, { target: '_blank', href: blockedMessageLink }, blockedMessageLinkText)) });
57
- };
58
39
  const extractContentForAllyMessage = (props) => {
59
40
  var _a;
60
41
  let attachments = undefined;
@@ -132,29 +113,20 @@ const processHtmlToReact = (props) => {
132
113
  var _a;
133
114
  const options = {
134
115
  transform(reactNode, domNode) {
135
- var _a, _b, _c;
116
+ var _a;
136
117
  if (domNode instanceof DOMElement && domNode.attribs) {
137
118
  // Transform custom rendering of mentions
138
- if (domNode.name === 'msft-mention') {
139
- const { id } = domNode.attribs;
140
- const mention = {
141
- id: id,
142
- displayText: (_a = domNode.children[0].nodeValue) !== null && _a !== void 0 ? _a : ''
143
- };
144
- if ((_b = props.mentionDisplayOptions) === null || _b === void 0 ? void 0 : _b.onRenderMention) {
145
- return props.mentionDisplayOptions.onRenderMention(mention, defaultOnMentionRender);
146
- }
147
- return defaultOnMentionRender(mention);
148
- }
149
119
  // Transform inline images
150
120
  if (domNode.name && domNode.name === 'img' && domNode.attribs && domNode.attribs.id) {
151
- domNode.attribs['aria-label'] = domNode.attribs.name;
121
+ if (domNode.attribs.name) {
122
+ domNode.attribs['aria-label'] = domNode.attribs.name;
123
+ }
152
124
  const imgProps = attributesToProps(domNode.attribs);
153
125
  const inlineImageProps = {
154
126
  messageId: props.message.messageId,
155
127
  imageAttributes: imgProps
156
128
  };
157
- return ((_c = props.inlineImageOptions) === null || _c === void 0 ? void 0 : _c.onRenderInlineImage) ? props.inlineImageOptions.onRenderInlineImage(inlineImageProps, defaultOnRenderInlineImage) : defaultOnRenderInlineImage(inlineImageProps);
129
+ return ((_a = props.inlineImageOptions) === null || _a === void 0 ? void 0 : _a.onRenderInlineImage) ? props.inlineImageOptions.onRenderInlineImage(inlineImageProps, defaultOnRenderInlineImage) : defaultOnRenderInlineImage(inlineImageProps);
158
130
  }
159
131
  // Transform links to open in new tab
160
132
  if (domNode.name === 'a' && React.isValidElement(reactNode)) {
@@ -185,7 +157,8 @@ const decodeEntities = (encodedString) => {
185
157
  // Find all matches of HTML entities defined in translate_re and
186
158
  // replace them with the corresponding character from the translate object.
187
159
  .replace(translate_re, function (match, entity) {
188
- return translate[entity];
160
+ var _a;
161
+ return (_a = translate[entity]) !== null && _a !== void 0 ? _a : match;
189
162
  })
190
163
  // Find numeric entities (e.g., &#65;)
191
164
  // and replace them with the equivalent character using the String.fromCharCode method,
@@ -1 +1 @@
1
- {"version":3,"file":"ChatMessageContent.js","sourceRoot":"","sources":["../../../../../../preprocess-dist/react-components/src/components/ChatMessage/ChatMessageContent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,sCAAgC;AACxD,OAAO,KAAK,EAAE,EAA0B,OAAO,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,OAAO,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;QACvF,iDAAiD;SAChD,OAAO,CAAC,YAAY,EAAE,UAAU,KAAK,EAAE,MAAM;QAC5C,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACjC,OAAO,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport parse, { HTMLReactParserOptions, Element as DOMElement } from 'html-react-parser';\nimport { attributesToProps } from 'html-react-parser';\nimport Linkify from 'react-linkify';\nimport { ChatMessage } from '../../types/ChatMessage';\nimport { BlockedMessage } from '../../types/ChatMessage';\nimport { Link } from '@fluentui/react';\nimport { MentionDisplayOptions, Mention } from '../MentionPopover';\nimport { FontIcon, Stack } from '@fluentui/react';\nimport { MessageThreadStrings } from '../MessageThread';\nimport LiveMessage from '../Announcer/LiveMessage';\nimport { defaultOnMentionRender } from './MentionRenderer';\nimport DOMPurify from 'dompurify';\nimport { _AttachmentDownloadCardsStrings } from '../Attachment/AttachmentDownloadCards';\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { dataLossIconStyle } from '../styles/MessageThread.styles';\nimport { messageTextContentStyles } from '../styles/MessageThread.styles';\ntype ChatMessageContentProps = {\n message: ChatMessage;\n strings: MessageThreadStrings;\n mentionDisplayOptions?: MentionDisplayOptions;\n inlineImageOptions?: InlineImageOptions;\n};\ntype BlockedMessageContentProps = {\n message: BlockedMessage;\n strings: MessageThreadStrings;\n};\ntype MessageContentWithLiveAriaProps = {\n message: ChatMessage | BlockedMessage;\n liveMessage: string;\n ariaLabel?: string;\n content: JSX.Element;\n className?: string;\n};\n\n/**\n * InlineImage's state, as reflected in the UI.\n *\n * @public\n */\nexport interface InlineImage {\n /** ID of the message that the inline image is belonged to */\n messageId: string;\n /** Attributes of the inline image */\n imageAttributes: React.ImgHTMLAttributes<HTMLImageElement>;\n}\n\n/**\n * Options to display inline image in the inline image scenario.\n *\n * @public\n */\nexport interface InlineImageOptions {\n /**\n * Optional callback to render an inline image of in a message.\n */\n onRenderInlineImage?: (inlineImage: InlineImage, defaultOnRender: (inlineImage: InlineImage) => JSX.Element) => JSX.Element;\n}\n\n/** @private */\nexport const ChatMessageContent = (props: ChatMessageContentProps): JSX.Element => {\n switch (props.message.contentType) {\n case 'text':\n return MessageContentAsText(props);\n case 'html':\n return MessageContentAsRichTextHTML(props);\n case 'richtext/html':\n return MessageContentAsRichTextHTML(props);\n default:\n console.warn('unknown message content type');\n return <></>;\n }\n};\nconst MessageContentWithLiveAria = (props: MessageContentWithLiveAriaProps): JSX.Element => {\n return <div data-ui-status={props.message.status} role=\"text\" aria-label={props.ariaLabel} className={props.className}>\n <LiveMessage message={props.liveMessage} ariaLive=\"polite\" />\n {props.content}\n </div>;\n};\nconst MessageContentAsRichTextHTML = (props: ChatMessageContentProps): JSX.Element => {\n return <MessageContentWithLiveAria message={props.message} liveMessage={generateLiveMessage(props)} ariaLabel={messageContentAriaText(props)} content={processHtmlToReact(props)} />;\n};\nconst MessageContentAsText = (props: ChatMessageContentProps): JSX.Element => {\n return <MessageContentWithLiveAria message={props.message} liveMessage={generateLiveMessage(props)} ariaLabel={messageContentAriaText(props)} className={messageTextContentStyles} content={<Linkify componentDecorator={(decoratedHref: string, decoratedText: string, key: number) => {\n return <Link target=\"_blank\" href={decoratedHref} key={key}>\n {decoratedText}\n </Link>;\n }}>\n {props.message.content}\n </Linkify>} />;\n};\n/**\n * @private\n */\nexport const BlockedMessageContent = (props: BlockedMessageContentProps): JSX.Element => {\n const Icon: JSX.Element = <FontIcon className={dataLossIconStyle} iconName={'DataLossPreventionProhibited'} />;\n const blockedMessage = props.message.warningText === undefined ? props.strings.blockedWarningText : props.message.warningText;\n const blockedMessageLink = props.message.link;\n const blockedMessageLinkText = blockedMessageLink ? props.message.linkText ?? props.strings.blockedWarningLinkText : '';\n const liveAuthor = props.message.mine || props.message.senderDisplayName === undefined ? '' : props.message.senderDisplayName;\n const liveBlockedWarningText = `${liveAuthor} ${blockedMessage} ${blockedMessageLinkText}`;\n return <MessageContentWithLiveAria message={props.message} liveMessage={liveBlockedWarningText} ariaLabel={liveBlockedWarningText} content={<Stack horizontal wrap>\n {Icon}\n {blockedMessage && <p>{blockedMessage}</p>}\n {blockedMessageLink && <Link target={'_blank'} href={blockedMessageLink}>\n {blockedMessageLinkText}\n </Link>}\n </Stack>} />;\n};\nconst extractContentForAllyMessage = (props: ChatMessageContentProps): string => {\n let attachments = undefined;\n attachments = props.message.attachments;\n if (props.message.content || attachments) {\n // Replace all <img> tags with 'image' for aria.\n const parsedContent = DOMPurify.sanitize(props.message.content ?? '', {\n ALLOWED_TAGS: ['img'],\n RETURN_DOM_FRAGMENT: true\n });\n parsedContent.childNodes.forEach(child => {\n if (child.nodeName.toLowerCase() !== 'img') {\n return;\n }\n const imageTextNode = document.createElement('div');\n imageTextNode.innerHTML = 'image ';\n parsedContent.replaceChild(imageTextNode, child);\n });\n\n // Inject message attachment count for aria.\n // this is only applying to file attachments not for inline images.\n if (attachments && attachments.length > 0) {\n const attachmentCardDescription = attachmentCardGroupDescription(props);\n const attachmentTextNode = document.createElement('div');\n attachmentTextNode.innerHTML = `${attachmentCardDescription}`;\n parsedContent.appendChild(attachmentTextNode);\n }\n\n // Strip all html tags from the content for aria.\n let message = DOMPurify.sanitize(parsedContent, {\n ALLOWED_TAGS: []\n });\n // decode HTML entities so that screen reader can read the content properly.\n message = decodeEntities(message);\n return message;\n }\n return '';\n};\nconst generateLiveMessage = (props: ChatMessageContentProps): string => {\n const liveAuthor = _formatString(props.strings.liveAuthorIntro, {\n author: `${props.message.senderDisplayName}`\n });\n return `${props.message.editedOn ? props.strings.editedTag : ''} ${props.message.mine ? '' : liveAuthor} ${extractContentForAllyMessage(props)} `;\n};\nconst messageContentAriaText = (props: ChatMessageContentProps): string | undefined => {\n const message = extractContentForAllyMessage(props);\n return props.message.mine ? _formatString(props.strings.messageContentMineAriaText, {\n status: props.message.status ?? '',\n message: message\n }) : _formatString(props.strings.messageContentAriaText, {\n status: props.message.status ?? '',\n author: `${props.message.senderDisplayName}`,\n message: message\n });\n};\nconst attachmentCardGroupDescription = (props: ChatMessageContentProps): string => {\n const attachments = props.message.attachments;\n return getAttachmentCountLiveMessage(attachments ?? [], props.strings.attachmentCardGroupMessage);\n};\n/**\n * @private\n */\nexport const getAttachmentCountLiveMessage = (attachments: AttachmentMetadata[], attachmentCardGroupMessage: string): string => {\n if (attachments.length === 0) {\n return '';\n }\n return _formatString(attachmentCardGroupMessage, {\n attachmentCount: `${attachments.length}`\n });\n return '';\n};\nconst defaultOnRenderInlineImage = (inlineImage: InlineImage): JSX.Element => {\n return <img key={inlineImage.imageAttributes.id} tabIndex={0} data-ui-id={inlineImage.imageAttributes.id} {...inlineImage.imageAttributes} />;\n};\nconst processHtmlToReact = (props: ChatMessageContentProps): JSX.Element => {\n const options: HTMLReactParserOptions = {\n transform(reactNode, domNode) {\n if (domNode instanceof DOMElement && domNode.attribs) {\n // Transform custom rendering of mentions\n if (domNode.name === 'msft-mention') {\n const {\n id\n } = domNode.attribs;\n const mention: Mention = {\n id: id,\n displayText: (domNode.children[0] as unknown as Text).nodeValue ?? ''\n };\n if (props.mentionDisplayOptions?.onRenderMention) {\n return props.mentionDisplayOptions.onRenderMention(mention, defaultOnMentionRender);\n }\n return defaultOnMentionRender(mention);\n }\n\n // Transform inline images\n if (domNode.name && domNode.name === 'img' && domNode.attribs && domNode.attribs.id) {\n domNode.attribs['aria-label'] = domNode.attribs.name;\n const imgProps = attributesToProps(domNode.attribs);\n const inlineImageProps: InlineImage = {\n messageId: props.message.messageId,\n imageAttributes: imgProps\n };\n return props.inlineImageOptions?.onRenderInlineImage ? props.inlineImageOptions.onRenderInlineImage(inlineImageProps, defaultOnRenderInlineImage) : defaultOnRenderInlineImage(inlineImageProps);\n }\n\n // Transform links to open in new tab\n if (domNode.name === 'a' && React.isValidElement<React.AnchorHTMLAttributes<HTMLAnchorElement>>(reactNode)) {\n return React.cloneElement(reactNode, {\n target: '_blank',\n rel: 'noreferrer noopener'\n });\n }\n }\n // Pass through the original node\n return reactNode as unknown as JSX.Element;\n }\n };\n return <>{parse(props.message.content ?? '', options)}</>;\n};\nconst decodeEntities = (encodedString: string): string => {\n // This regular expression matches HTML entities.\n const translate_re = /&(nbsp|amp|quot|lt|gt);/g;\n // This object maps HTML entities to their respective characters.\n const translate: Record<string, string> = {\n nbsp: ' ',\n amp: '&',\n quot: '\"',\n lt: '<',\n gt: '>'\n };\n return encodedString\n // Find all matches of HTML entities defined in translate_re and\n // replace them with the corresponding character from the translate object.\n .replace(translate_re, function (match, entity) {\n return translate[entity];\n })\n // Find numeric entities (e.g., &#65;)\n // and replace them with the equivalent character using the String.fromCharCode method,\n // which converts Unicode values into characters.\n .replace(/&#(\\d+);/gi, function (match, numStr) {\n const num = parseInt(numStr, 10);\n return String.fromCharCode(num);\n });\n};"]}
1
+ {"version":3,"file":"ChatMessageContent.js","sourceRoot":"","sources":["../../../../../../preprocess-dist/react-components/src/components/ChatMessage/ChatMessageContent.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,sCAAgC;AACxD,OAAO,KAAK,EAAE,EAA0B,OAAO,IAAI,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACzF,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,OAAO,MAAM,eAAe,CAAC;AAEpC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,OAAO,WAAW,MAAM,0BAA0B,CAAC;AACnD,OAAO,SAAS,MAAM,WAAW,CAAC;AAGlC,OAAO,EAAE,wBAAwB,EAAE,MAAM,gCAAgC,CAAC;AAsC1E,eAAe;AACf,MAAM,CAAC,MAAM,kB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,aAAqB,EAAU,EAAE;IACvD,iDAAiD;IACjD,MAAM,YAAY,GAAG,0BAA0B,CAAC;IAChD,iEAAiE;IACjE,MAAM,SAAS,GAA2B;QACxC,IAAI,EAAE,GAAG;QACT,GAAG,EAAE,GAAG;QACR,IAAI,EAAE,GAAG;QACT,EAAE,EAAE,GAAG;QACP,EAAE,EAAE,GAAG;KACR,CAAC;IACF,OAAO,aAAa;QACpB,gEAAgE;QAChE,2EAA2E;SAC1E,OAAO,CAAC,YAAY,EAAE,UAAU,KAAK,EAAE,MAAM;;QAC5C,OAAO,MAAA,SAAS,CAAC,MAAM,CAAC,mCAAI,KAAK,CAAC;IACpC,CAAC,CAAC;QACF,sCAAsC;QACtC,uFAAuF;QACvF,iDAAiD;SAChD,OAAO,CAAC,YAAY,EAAE,UAAU,KAAK,EAAE,MAAM;QAC5C,MAAM,GAAG,GAAG,QAAQ,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QACjC,OAAO,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAClC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport React from 'react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport parse, { HTMLReactParserOptions, Element as DOMElement } from 'html-react-parser';\nimport { attributesToProps } from 'html-react-parser';\nimport Linkify from 'react-linkify';\nimport { ChatMessage } from '../../types/ChatMessage';\nimport { Link } from '@fluentui/react';\nimport { MessageThreadStrings } from '../MessageThread';\nimport LiveMessage from '../Announcer/LiveMessage';\nimport DOMPurify from 'dompurify';\nimport { _AttachmentDownloadCardsStrings } from '../Attachment/AttachmentDownloadCards';\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { messageTextContentStyles } from '../styles/MessageThread.styles';\ntype ChatMessageContentProps = {\n message: ChatMessage;\n strings: MessageThreadStrings;\n inlineImageOptions?: InlineImageOptions;\n};\ntype MessageContentWithLiveAriaProps = {\n message: ChatMessage;\n liveMessage: string;\n ariaLabel?: string;\n content: JSX.Element;\n className?: string;\n};\n\n/**\n * InlineImage's state, as reflected in the UI.\n *\n * @public\n */\nexport interface InlineImage {\n /** ID of the message that the inline image is belonged to */\n messageId: string;\n /** Attributes of the inline image */\n imageAttributes: React.ImgHTMLAttributes<HTMLImageElement>;\n}\n\n/**\n * Options to display inline image in the inline image scenario.\n *\n * @public\n */\nexport interface InlineImageOptions {\n /**\n * Optional callback to render an inline image of in a message.\n */\n onRenderInlineImage?: (inlineImage: InlineImage, defaultOnRender: (inlineImage: InlineImage) => JSX.Element) => JSX.Element;\n}\n\n/** @private */\nexport const ChatMessageContent = (props: ChatMessageContentProps): JSX.Element => {\n switch (props.message.contentType) {\n case 'text':\n return MessageContentAsText(props);\n case 'html':\n return MessageContentAsRichTextHTML(props);\n case 'richtext/html':\n return MessageContentAsRichTextHTML(props);\n default:\n console.warn('unknown message content type');\n return <></>;\n }\n};\nconst MessageContentWithLiveAria = (props: MessageContentWithLiveAriaProps): JSX.Element => {\n return <div data-ui-status={props.message.status} role=\"text\" aria-label={props.ariaLabel} className={props.className}>\n <LiveMessage message={props.liveMessage} ariaLive=\"polite\" />\n {props.content}\n </div>;\n};\nconst MessageContentAsRichTextHTML = (props: ChatMessageContentProps): JSX.Element => {\n return <MessageContentWithLiveAria message={props.message} liveMessage={generateLiveMessage(props)} ariaLabel={messageContentAriaText(props)} content={processHtmlToReact(props)} />;\n};\nconst MessageContentAsText = (props: ChatMessageContentProps): JSX.Element => {\n return <MessageContentWithLiveAria message={props.message} liveMessage={generateLiveMessage(props)} ariaLabel={messageContentAriaText(props)} className={messageTextContentStyles} content={<Linkify componentDecorator={(decoratedHref: string, decoratedText: string, key: number) => {\n return <Link target=\"_blank\" href={decoratedHref} key={key}>\n {decoratedText}\n </Link>;\n }}>\n {props.message.content}\n </Linkify>} />;\n};\nconst extractContentForAllyMessage = (props: ChatMessageContentProps): string => {\n let attachments = undefined;\n attachments = props.message.attachments;\n if (props.message.content || attachments) {\n // Replace all <img> tags with 'image' for aria.\n const parsedContent = DOMPurify.sanitize(props.message.content ?? '', {\n ALLOWED_TAGS: ['img'],\n RETURN_DOM_FRAGMENT: true\n });\n parsedContent.childNodes.forEach(child => {\n if (child.nodeName.toLowerCase() !== 'img') {\n return;\n }\n const imageTextNode = document.createElement('div');\n imageTextNode.innerHTML = 'image ';\n parsedContent.replaceChild(imageTextNode, child);\n });\n\n // Inject message attachment count for aria.\n // this is only applying to file attachments not for inline images.\n if (attachments && attachments.length > 0) {\n const attachmentCardDescription = attachmentCardGroupDescription(props);\n const attachmentTextNode = document.createElement('div');\n attachmentTextNode.innerHTML = `${attachmentCardDescription}`;\n parsedContent.appendChild(attachmentTextNode);\n }\n\n // Strip all html tags from the content for aria.\n let message = DOMPurify.sanitize(parsedContent, {\n ALLOWED_TAGS: []\n });\n // decode HTML entities so that screen reader can read the content properly.\n message = decodeEntities(message);\n return message;\n }\n return '';\n};\nconst generateLiveMessage = (props: ChatMessageContentProps): string => {\n const liveAuthor = _formatString(props.strings.liveAuthorIntro, {\n author: `${props.message.senderDisplayName}`\n });\n return `${props.message.editedOn ? props.strings.editedTag : ''} ${props.message.mine ? '' : liveAuthor} ${extractContentForAllyMessage(props)} `;\n};\nconst messageContentAriaText = (props: ChatMessageContentProps): string | undefined => {\n const message = extractContentForAllyMessage(props);\n return props.message.mine ? _formatString(props.strings.messageContentMineAriaText, {\n status: props.message.status ?? '',\n message: message\n }) : _formatString(props.strings.messageContentAriaText, {\n status: props.message.status ?? '',\n author: `${props.message.senderDisplayName}`,\n message: message\n });\n};\nconst attachmentCardGroupDescription = (props: ChatMessageContentProps): string => {\n const attachments = props.message.attachments;\n return getAttachmentCountLiveMessage(attachments ?? [], props.strings.attachmentCardGroupMessage);\n};\n/**\n * @private\n */\nexport const getAttachmentCountLiveMessage = (attachments: AttachmentMetadata[], attachmentCardGroupMessage: string): string => {\n if (attachments.length === 0) {\n return '';\n }\n return _formatString(attachmentCardGroupMessage, {\n attachmentCount: `${attachments.length}`\n });\n return '';\n};\nconst defaultOnRenderInlineImage = (inlineImage: InlineImage): JSX.Element => {\n return <img key={inlineImage.imageAttributes.id} tabIndex={0} data-ui-id={inlineImage.imageAttributes.id} {...inlineImage.imageAttributes} />;\n};\nconst processHtmlToReact = (props: ChatMessageContentProps): JSX.Element => {\n const options: HTMLReactParserOptions = {\n transform(reactNode, domNode) {\n if (domNode instanceof DOMElement && domNode.attribs) {\n // Transform custom rendering of mentions\n // Transform inline images\n if (domNode.name && domNode.name === 'img' && domNode.attribs && domNode.attribs.id) {\n if (domNode.attribs.name) {\n domNode.attribs['aria-label'] = domNode.attribs.name;\n }\n const imgProps = attributesToProps(domNode.attribs);\n const inlineImageProps: InlineImage = {\n messageId: props.message.messageId,\n imageAttributes: imgProps\n };\n return props.inlineImageOptions?.onRenderInlineImage ? props.inlineImageOptions.onRenderInlineImage(inlineImageProps, defaultOnRenderInlineImage) : defaultOnRenderInlineImage(inlineImageProps);\n }\n\n // Transform links to open in new tab\n if (domNode.name === 'a' && React.isValidElement<React.AnchorHTMLAttributes<HTMLAnchorElement>>(reactNode)) {\n return React.cloneElement(reactNode, {\n target: '_blank',\n rel: 'noreferrer noopener'\n });\n }\n }\n // Pass through the original node\n return reactNode as unknown as JSX.Element;\n }\n };\n return <>{parse(props.message.content ?? '', options)}</>;\n};\nconst decodeEntities = (encodedString: string): string => {\n // This regular expression matches HTML entities.\n const translate_re = /&(nbsp|amp|quot|lt|gt);/g;\n // This object maps HTML entities to their respective characters.\n const translate: Record<string, string> = {\n nbsp: ' ',\n amp: '&',\n quot: '\"',\n lt: '<',\n gt: '>'\n };\n return encodedString\n // Find all matches of HTML entities defined in translate_re and\n // replace them with the corresponding character from the translate object.\n .replace(translate_re, function (match, entity) {\n return translate[entity] ?? match;\n })\n // Find numeric entities (e.g., &#65;)\n // and replace them with the equivalent character using the String.fromCharCode method,\n // which converts Unicode values into characters.\n .replace(/&#(\\d+);/gi, function (match, numStr) {\n const num = parseInt(numStr, 10);\n return String.fromCharCode(num);\n });\n};"]}
@@ -1,14 +1,12 @@
1
1
  import React from 'react';
2
2
  import { InlineImageOptions } from '../ChatMessageContent';
3
3
  import { ChatMessage } from '../../../types/ChatMessage';
4
- import { BlockedMessage } from '../../../types/ChatMessage';
5
4
  import { MessageThreadStrings } from '../../MessageThread';
6
5
  import { ComponentSlotStyle } from '../../../types';
7
6
  import { AttachmentMenuAction } from '../../../types';
8
7
  import { AttachmentMetadata } from "../../../../../acs-ui-common/src";
9
- import { MentionDisplayOptions } from '../../MentionPopover';
10
8
  type ChatMessageComponentAsMessageBubbleProps = {
11
- message: ChatMessage | BlockedMessage;
9
+ message: ChatMessage;
12
10
  messageContainerStyle?: ComponentSlotStyle;
13
11
  showDate?: boolean;
14
12
  strings: MessageThreadStrings;
@@ -30,11 +28,6 @@ type ChatMessageComponentAsMessageBubbleProps = {
30
28
  * @beta
31
29
  */
32
30
  onDisplayDateTimeString?: (messageDate: Date) => string;
33
- /**
34
- * Optional props needed to display suggestions in the mention scenario.
35
- * @internal
36
- */
37
- mentionDisplayOptions?: MentionDisplayOptions;
38
31
  /**
39
32
  * Optional callback called when an inline image is clicked.
40
33
  * @beta
@@ -11,13 +11,12 @@ import { createStyleFromV8Style } from '../../styles/v8StyleShim';
11
11
  import { mergeClasses } from '@fluentui/react-components';
12
12
  import { useChatMessageStyles, useChatMessageCommonStyles } from '../../styles/MessageThread.styles';
13
13
  import { generateCustomizedTimestamp, generateDefaultTimestamp, getMessageBubbleContent, getMessageEditedDetails } from '../../utils/ChatMessageComponentUtils';
14
- import { doesMessageContainMultipleAttachments } from '../../utils/ChatMessageComponentAsEditBoxUtils';
15
14
  /** @private */
16
15
  const MessageBubble = (props) => {
17
16
  const ids = useIdentifiers();
18
17
  const theme = useTheme();
19
18
  const locale = useLocale();
20
- const { userId, message, showDate, messageContainerStyle, strings, onRenderAttachmentDownloads, inlineImageOptions, shouldOverlapAvatarAndMessage, actionsForAttachment, mentionDisplayOptions, onDisplayDateTimeString } = props;
19
+ const { userId, message, showDate, messageContainerStyle, strings, onRenderAttachmentDownloads, inlineImageOptions, shouldOverlapAvatarAndMessage, actionsForAttachment, onDisplayDateTimeString } = props;
21
20
  const formattedTimestamp = useMemo(() => {
22
21
  const defaultTimeStamp = message.createdOn ? generateDefaultTimestamp(message.createdOn, showDate, strings) : undefined;
23
22
  const customTimestamp = message.createdOn ? generateCustomizedTimestamp(message.createdOn, locale, onDisplayDateTimeString) : '';
@@ -27,17 +26,14 @@ const MessageBubble = (props) => {
27
26
  return getMessageEditedDetails(message, theme, strings.editedTag);
28
27
  }, [strings.editedTag, theme, message]);
29
28
  const getContent = useCallback(() => {
30
- return getMessageBubbleContent(message, strings, userId, inlineImageOptions, mentionDisplayOptions, onRenderAttachmentDownloads, actionsForAttachment);
31
- }, [actionsForAttachment, inlineImageOptions, mentionDisplayOptions, message, onRenderAttachmentDownloads, strings, userId]);
32
- const isBlockedMessage = false || message.messageType === 'blocked';
29
+ return getMessageBubbleContent(message, strings, userId, inlineImageOptions, onRenderAttachmentDownloads, actionsForAttachment);
30
+ }, [actionsForAttachment, inlineImageOptions, message, onRenderAttachmentDownloads, strings, userId]);
31
+ const isBlockedMessage = false;
33
32
  const chatMessageCommonStyles = useChatMessageCommonStyles();
34
- const hasMultipleAttachments = useMemo(() => {
35
- return doesMessageContainMultipleAttachments(message);
36
- }, [message]);
37
33
  const chatMessageStyles = useChatMessageStyles();
38
34
  const chatItemMessageContainerClassName = mergeClasses(chatMessageCommonStyles.body, chatMessageStyles.body,
39
35
  // disable placeholder functionality for GA releases as it might confuse users
40
- chatMessageCommonStyles.bodyWithPlaceholderImage, isBlockedMessage ? chatMessageCommonStyles.blocked : props.message.status === 'failed' ? chatMessageCommonStyles.failed : undefined, shouldOverlapAvatarAndMessage ? chatMessageStyles.avatarOverlap : chatMessageStyles.avatarNoOverlap, hasMultipleAttachments ? chatMessageStyles.multipleAttachments : undefined, message.attached === 'top' || message.attached === false ? chatMessageStyles.bodyWithAvatar : chatMessageStyles.bodyWithoutAvatar,
36
+ chatMessageCommonStyles.bodyWithPlaceholderImage, isBlockedMessage ? chatMessageCommonStyles.blocked : props.message.status === 'failed' ? chatMessageCommonStyles.failed : undefined, shouldOverlapAvatarAndMessage ? chatMessageStyles.avatarOverlap : chatMessageStyles.avatarNoOverlap, message.attached === 'top' || message.attached === false ? chatMessageStyles.bodyWithAvatar : chatMessageStyles.bodyWithoutAvatar,
41
37
  // messageContainerStyle used in className and style prop as style prop can't handle CSS selectors
42
38
  mergeStyles(messageContainerStyle));
43
39
  const attached = message.attached === true ? 'center' : message.attached === 'bottom' ? 'bottom' : 'top';
@@ -1 +1 @@
1
- {"version":3,"file":"ChatMessageComponentAsMessageBubble.js","sourceRoot":"","sources":["../../../../../../../preprocess-dist/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEhF,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACpI,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAAC;AACzE,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAS5C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAC;AAC1D,OAAO,EAAE,oBAAoB,EAAE,0BAA0B,EAAE,MAAM,mCAAmC,CAAC;AACrG,OAAO,EAAE,2BAA2B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ui/react';\nimport { ChatMessage as FluentChatMessage } from '@fluentui-contrib/react-chat';\nimport { _formatString } from '@internal/acs-ui-common';\nimport React, { useCallback, useMemo } from 'react';\nimport { chatMessageDateStyle, chatMessageAuthorStyle, chatMessageDateFailedStyle } from '../../styles/ChatMessageComponent.styles';\nimport { useIdentifiers } from '../../../identifiers/IdentifierProvider';\nimport { useTheme } from '../../../theming';\nimport { InlineImageOptions } from '../ChatMessageContent';\nimport { ChatMessage } from '../../../types/ChatMessage';\nimport { BlockedMessage } from '../../../types/ChatMessage';\nimport { MessageThreadStrings } from '../../MessageThread';\nimport { ComponentSlotStyle } from '../../../types';\nimport { AttachmentMenuAction } from '../../../types';\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { _AttachmentDownloadCards } from '../../Attachment/AttachmentDownloadCards';\nimport { useLocale } from '../../../localization';\nimport { MentionDisplayOptions } from '../../MentionPopover';\nimport { createStyleFromV8Style } from '../../styles/v8StyleShim';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { useChatMessageStyles, useChatMessageCommonStyles } from '../../styles/MessageThread.styles';\nimport { generateCustomizedTimestamp, generateDefaultTimestamp, getMessageBubbleContent, getMessageEditedDetails } from '../../utils/ChatMessageComponentUtils';\nimport { doesMessageContainMultipleAttachments } from '../../utils/ChatMessageComponentAsEditBoxUtils';\ntype ChatMessageComponentAsMessageBubbleProps = {\n message: ChatMessage | BlockedMessage;\n messageContainerStyle?: ComponentSlotStyle;\n showDate?: boolean;\n strings: MessageThreadStrings;\n userId: string;\n /**\n * Whether to overlap avatar and message when the view is width constrained.\n */\n shouldOverlapAvatarAndMessage: boolean;\n /**\n * Optional callback to render message attachments in the message component.\n */\n onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;\n /**\n * Optional callback to define custom actions for attachments.\n */\n actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];\n /**\n * Optional function to provide customized date format.\n * @beta\n */\n onDisplayDateTimeString?: (messageDate: Date) => string;\n /**\n * Optional props needed to display suggestions in the mention scenario.\n * @internal\n */\n mentionDisplayOptions?: MentionDisplayOptions;\n /**\n * Optional callback called when an inline image is clicked.\n * @beta\n */\n inlineImageOptions?: InlineImageOptions;\n};\n\n/** @private */\nconst MessageBubble = (props: ChatMessageComponentAsMessageBubbleProps): JSX.Element => {\n const ids = useIdentifiers();\n const theme = useTheme();\n const locale = useLocale();\n const {\n userId,\n message,\n showDate,\n messageContainerStyle,\n strings,\n onRenderAttachmentDownloads,\n inlineImageOptions,\n shouldOverlapAvatarAndMessage,\n actionsForAttachment,\n mentionDisplayOptions,\n onDisplayDateTimeString\n } = props;\n const formattedTimestamp = useMemo(() => {\n const defaultTimeStamp = message.createdOn ? generateDefaultTimestamp(message.createdOn, showDate, strings) : undefined;\n const customTimestamp = message.createdOn ? generateCustomizedTimestamp(message.createdOn, locale, onDisplayDateTimeString) : '';\n return customTimestamp || defaultTimeStamp;\n }, [locale, message.createdOn, onDisplayDateTimeString, showDate, strings]);\n const getMessageDetails = useCallback(() => {\n return getMessageEditedDetails(message, theme, strings.editedTag);\n }, [strings.editedTag, theme, message]);\n const getContent = useCallback(() => {\n return getMessageBubbleContent(message, strings, userId, inlineImageOptions, mentionDisplayOptions, onRenderAttachmentDownloads, actionsForAttachment);\n }, [actionsForAttachment, inlineImageOptions, mentionDisplayOptions, message, onRenderAttachmentDownloads, strings, userId]);\n const isBlockedMessage = false || message.messageType === 'blocked';\n const chatMessageCommonStyles = useChatMessageCommonStyles();\n const hasMultipleAttachments = useMemo(() => {\n return doesMessageContainMultipleAttachments(message as ChatMessage);\n }, [message]);\n const chatMessageStyles = useChatMessageStyles();\n const chatItemMessageContainerClassName = mergeClasses(chatMessageCommonStyles.body, chatMessageStyles.body,\n // disable placeholder functionality for GA releases as it might confuse users\n chatMessageCommonStyles.bodyWithPlaceholderImage, isBlockedMessage ? chatMessageCommonStyles.blocked : props.message.status === 'failed' ? chatMessageCommonStyles.failed : undefined, shouldOverlapAvatarAndMessage ? chatMessageStyles.avatarOverlap : chatMessageStyles.avatarNoOverlap, hasMultipleAttachments ? chatMessageStyles.multipleAttachments : undefined, message.attached === 'top' || message.attached === false ? chatMessageStyles.bodyWithAvatar : chatMessageStyles.bodyWithoutAvatar,\n // messageContainerStyle used in className and style prop as style prop can't handle CSS selectors\n mergeStyles(messageContainerStyle));\n const attached = message.attached === true ? 'center' : message.attached === 'bottom' ? 'bottom' : 'top';\n const chatMessage = <>\n <div key={props.message.messageId}>\n <FluentChatMessage attached={attached} key={props.message.messageId} root={{\n className: chatMessageStyles.root\n }} author={<Text className={chatMessageAuthorStyle}>{message.senderDisplayName}</Text>} body={{\n className: chatItemMessageContainerClassName,\n style: {\n ...createStyleFromV8Style(messageContainerStyle)\n }\n }} data-testid=\"chat-composite-message\" timestamp={<Text className={props.message.status === 'failed' ? chatMessageDateFailedStyle(theme) : chatMessageDateStyle(theme)} data-ui-id={ids.messageTimestamp}>\n {formattedTimestamp}\n </Text>} details={getMessageDetails()}>\n {getContent()}\n </FluentChatMessage>\n </div>\n </>;\n return chatMessage;\n};\n\n/** @private */\nexport const ChatMessageComponentAsMessageBubble = React.memo(MessageBubble);"]}
1
+ {"version":3,"file":"ChatMessageComponentAsMessageBubble.js","sourceRoot":"","sources":["../../../../../../../preprocess-dist/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEhF,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,0BAA0B,EAAE,MAAM,0CAA0C,CAAC;AACpI,OAAO,EAAE,cAAc,EAAE,MAAM,yCAAyC,CAA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,qBAAqB,CAAC,CAAC,CAAC;IACpC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,KAAK,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC;IACzG,MAAM,WAAW,GAAG;QAChB,6BAAK,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS;YAC/B,oBAAC,iBAAiB,IAAC,QAAQ,EAAE,QAAQ,EAAE,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,IAAI,EAAE;oBAC3E,SAAS,EAAE,iBAAiB,CAAC,IAAI;iBAClC,EAAE,MAAM,EAAE,oBAAC,IAAI,IAAC,SAAS,EAAE,sBAAsB,IAAG,OAAO,CAAC,iBAAiB,CAAQ,EAAE,IAAI,EAAE;oBAC5F,SAAS,EAAE,iCAAiC;oBAC5C,KAAK,oBACA,sBAAsB,CAAC,qBAAqB,CAAC,CACjD;iBACF,iBAAc,wBAAwB,EAAC,SAAS,EAAE,oBAAC,IAAI,IAAC,SAAS,EAAE,KAAK,CAAC,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,0BAA0B,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,KAAK,CAAC,gBAAc,GAAG,CAAC,gBAAgB,IAChM,kBAAkB,CACd,EAAE,OAAO,EAAE,iBAAiB,EAAE,IACtC,UAAU,EAAE,CACK,CAChB,CACL,CAAC;IACN,OAAO,WAAW,CAAC;AACrB,CAAC,CAAC;AAEF,eAAe;AACf,MAAM,CAAC,MAAM,mCAAmC,GAAG,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { Text, mergeStyles } from '@fluentui/react';\nimport { ChatMessage as FluentChatMessage } from '@fluentui-contrib/react-chat';\nimport { _formatString } from '@internal/acs-ui-common';\nimport React, { useCallback, useMemo } from 'react';\nimport { chatMessageDateStyle, chatMessageAuthorStyle, chatMessageDateFailedStyle } from '../../styles/ChatMessageComponent.styles';\nimport { useIdentifiers } from '../../../identifiers/IdentifierProvider';\nimport { useTheme } from '../../../theming';\nimport { InlineImageOptions } from '../ChatMessageContent';\nimport { ChatMessage } from '../../../types/ChatMessage';\nimport { MessageThreadStrings } from '../../MessageThread';\nimport { ComponentSlotStyle } from '../../../types';\nimport { AttachmentMenuAction } from '../../../types';\nimport { AttachmentMetadata } from '@internal/acs-ui-common';\nimport { _AttachmentDownloadCards } from '../../Attachment/AttachmentDownloadCards';\nimport { useLocale } from '../../../localization';\nimport { createStyleFromV8Style } from '../../styles/v8StyleShim';\nimport { mergeClasses } from '@fluentui/react-components';\nimport { useChatMessageStyles, useChatMessageCommonStyles } from '../../styles/MessageThread.styles';\nimport { generateCustomizedTimestamp, generateDefaultTimestamp, getMessageBubbleContent, getMessageEditedDetails } from '../../utils/ChatMessageComponentUtils';\ntype ChatMessageComponentAsMessageBubbleProps = {\n message: ChatMessage;\n messageContainerStyle?: ComponentSlotStyle;\n showDate?: boolean;\n strings: MessageThreadStrings;\n userId: string;\n /**\n * Whether to overlap avatar and message when the view is width constrained.\n */\n shouldOverlapAvatarAndMessage: boolean;\n /**\n * Optional callback to render message attachments in the message component.\n */\n onRenderAttachmentDownloads?: (message: ChatMessage) => JSX.Element;\n /**\n * Optional callback to define custom actions for attachments.\n */\n actionsForAttachment?: (attachment: AttachmentMetadata, message?: ChatMessage) => AttachmentMenuAction[];\n /**\n * Optional function to provide customized date format.\n * @beta\n */\n onDisplayDateTimeString?: (messageDate: Date) => string;\n /**\n * Optional callback called when an inline image is clicked.\n * @beta\n */\n inlineImageOptions?: InlineImageOptions;\n};\n\n/** @private */\nconst MessageBubble = (props: ChatMessageComponentAsMessageBubbleProps): JSX.Element => {\n const ids = useIdentifiers();\n const theme = useTheme();\n const locale = useLocale();\n const {\n userId,\n message,\n showDate,\n messageContainerStyle,\n strings,\n onRenderAttachmentDownloads,\n inlineImageOptions,\n shouldOverlapAvatarAndMessage,\n actionsForAttachment,\n onDisplayDateTimeString\n } = props;\n const formattedTimestamp = useMemo(() => {\n const defaultTimeStamp = message.createdOn ? generateDefaultTimestamp(message.createdOn, showDate, strings) : undefined;\n const customTimestamp = message.createdOn ? generateCustomizedTimestamp(message.createdOn, locale, onDisplayDateTimeString) : '';\n return customTimestamp || defaultTimeStamp;\n }, [locale, message.createdOn, onDisplayDateTimeString, showDate, strings]);\n const getMessageDetails = useCallback(() => {\n return getMessageEditedDetails(message, theme, strings.editedTag);\n }, [strings.editedTag, theme, message]);\n const getContent = useCallback(() => {\n return getMessageBubbleContent(message, strings, userId, inlineImageOptions, onRenderAttachmentDownloads, actionsForAttachment);\n }, [actionsForAttachment, inlineImageOptions, message, onRenderAttachmentDownloads, strings, userId]);\n const isBlockedMessage = false;\n const chatMessageCommonStyles = useChatMessageCommonStyles();\n const chatMessageStyles = useChatMessageStyles();\n const chatItemMessageContainerClassName = mergeClasses(chatMessageCommonStyles.body, chatMessageStyles.body,\n // disable placeholder functionality for GA releases as it might confuse users\n chatMessageCommonStyles.bodyWithPlaceholderImage, isBlockedMessage ? chatMessageCommonStyles.blocked : props.message.status === 'failed' ? chatMessageCommonStyles.failed : undefined, shouldOverlapAvatarAndMessage ? chatMessageStyles.avatarOverlap : chatMessageStyles.avatarNoOverlap, message.attached === 'top' || message.attached === false ? chatMessageStyles.bodyWithAvatar : chatMessageStyles.bodyWithoutAvatar,\n // messageContainerStyle used in className and style prop as style prop can't handle CSS selectors\n mergeStyles(messageContainerStyle));\n const attached = message.attached === true ? 'center' : message.attached === 'bottom' ? 'bottom' : 'top';\n const chatMessage = <>\n <div key={props.message.messageId}>\n <FluentChatMessage attached={attached} key={props.message.messageId} root={{\n className: chatMessageStyles.root\n }} author={<Text className={chatMessageAuthorStyle}>{message.senderDisplayName}</Text>} body={{\n className: chatItemMessageContainerClassName,\n style: {\n ...createStyleFromV8Style(messageContainerStyle)\n }\n }} data-testid=\"chat-composite-message\" timestamp={<Text className={props.message.status === 'failed' ? chatMessageDateFailedStyle(theme) : chatMessageDateStyle(theme)} data-ui-id={ids.messageTimestamp}>\n {formattedTimestamp}\n </Text>} details={getMessageDetails()}>\n {getContent()}\n </FluentChatMessage>\n </div>\n </>;\n return chatMessage;\n};\n\n/** @private */\nexport const ChatMessageComponentAsMessageBubble = React.memo(MessageBubble);"]}
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  import { ChatMessageComponentWrapperProps } from '../ChatMessageComponentWrapper';
3
- import { BlockedMessage } from '../../../types/ChatMessage';
4
3
  import { ChatMessage } from '../../../types/ChatMessage';
5
4
  /**
6
5
  * Props for {@link FluentChatMessageComponentWrapper}
@@ -8,7 +7,7 @@ import { ChatMessage } from '../../../types/ChatMessage';
8
7
  * @private
9
8
  */
10
9
  export type FluentChatMessageComponentWrapperProps = ChatMessageComponentWrapperProps & {
11
- message: ChatMessage | BlockedMessage;
10
+ message: ChatMessage;
12
11
  };
13
12
  /**
14
13
  * The component for rendering a chat message using Fluent UI components