@azure/communication-react 1.5.1-alpha-202211250013.0 → 1.5.2-alpha-202301190014.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 (303) hide show
  1. package/CHANGELOG.beta.md +47 -1
  2. package/CHANGELOG.json +1554 -0
  3. package/CHANGELOG.stable.md +88 -2
  4. package/dist/communication-react.d.ts +468 -296
  5. package/dist/dist-cjs/communication-react/index.js +2904 -1694
  6. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  7. package/dist/dist-esm/acs-ui-common/src/identifier.js +3 -47
  8. package/dist/dist-esm/acs-ui-common/src/identifier.js.map +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  10. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  11. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.d.ts +5 -0
  12. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js +8 -0
  13. package/dist/dist-esm/calling-component-bindings/src/baseSelectors.js.map +1 -1
  14. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js +21 -10
  15. package/dist/dist-esm/calling-component-bindings/src/errorBarSelector.js.map +1 -1
  16. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.d.ts +1 -2
  17. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js +0 -7
  18. package/dist/dist-esm/calling-component-bindings/src/hooks/usePropsFor.js.map +1 -1
  19. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js +13 -4
  20. package/dist/dist-esm/calling-component-bindings/src/participantListSelector.js.map +1 -1
  21. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.d.ts +7 -0
  22. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js +9 -0
  23. package/dist/dist-esm/calling-component-bindings/src/utils/callUtils.js.map +1 -1
  24. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.d.ts +12 -0
  25. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js +31 -6
  26. package/dist/dist-esm/calling-component-bindings/src/utils/videoGalleryUtils.js.map +1 -1
  27. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js +2 -13
  28. package/dist/dist-esm/calling-component-bindings/src/videoGallerySelector.js.map +1 -1
  29. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +2 -1
  30. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  31. package/dist/dist-esm/calling-stateful-client/src/CallContext.d.ts +2 -1
  32. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +14 -0
  33. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  34. package/dist/dist-esm/calling-stateful-client/src/Converter.js +1 -1
  35. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  36. package/dist/dist-esm/calling-stateful-client/src/Logger.d.ts +1 -0
  37. package/dist/dist-esm/calling-stateful-client/src/Logger.js +1 -0
  38. package/dist/dist-esm/calling-stateful-client/src/Logger.js.map +1 -1
  39. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.d.ts +2 -1
  40. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js +11 -4
  41. package/dist/dist-esm/calling-stateful-client/src/StatefulCallClient.js.map +1 -1
  42. package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js +39 -12
  43. package/dist/dist-esm/calling-stateful-client/src/StreamUtils.js.map +1 -1
  44. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js +2 -2
  45. package/dist/dist-esm/calling-stateful-client/src/TypeGuards.js.map +1 -1
  46. package/dist/dist-esm/calling-stateful-client/src/VideoStreamRendererViewDeclarative.d.ts +19 -0
  47. package/dist/dist-esm/calling-stateful-client/src/VideoStreamRendererViewDeclarative.js +43 -0
  48. package/dist/dist-esm/calling-stateful-client/src/VideoStreamRendererViewDeclarative.js.map +1 -0
  49. package/dist/dist-esm/communication-react/src/index.d.ts +7 -5
  50. package/dist/dist-esm/communication-react/src/index.js +5 -3
  51. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  52. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.d.ts +105 -0
  53. package/dist/dist-esm/react-components/src/components/DevicePermissions/{DomainPermissions.js → SitePermissions.js} +28 -22
  54. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissions.js.map +1 -0
  55. package/dist/dist-esm/react-components/src/components/DevicePermissions/{DomainPermissionsScaffolding.d.ts → SitePermissionsScaffolding.d.ts} +12 -12
  56. package/dist/dist-esm/react-components/src/components/DevicePermissions/{DomainPermissionsScaffolding.js → SitePermissionsScaffolding.js} +4 -4
  57. package/dist/dist-esm/react-components/src/components/DevicePermissions/SitePermissionsScaffolding.js.map +1 -0
  58. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +20 -9
  59. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
  60. package/dist/dist-esm/react-components/src/components/Drawer/DrawerContentContainer.d.ts +1 -0
  61. package/dist/dist-esm/react-components/src/components/Drawer/DrawerContentContainer.js +18 -2
  62. package/dist/dist-esm/react-components/src/components/Drawer/DrawerContentContainer.js.map +1 -1
  63. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenu.d.ts +4 -0
  64. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenu.js +1 -1
  65. package/dist/dist-esm/react-components/src/components/Drawer/DrawerMenu.js.map +1 -1
  66. package/dist/dist-esm/react-components/src/components/Drawer/DrawerSurface.d.ts +4 -0
  67. package/dist/dist-esm/react-components/src/components/Drawer/DrawerSurface.js +1 -1
  68. package/dist/dist-esm/react-components/src/components/Drawer/DrawerSurface.js.map +1 -1
  69. package/dist/dist-esm/react-components/src/components/ErrorBar.d.ts +8 -0
  70. package/dist/dist-esm/react-components/src/components/ErrorBar.js.map +1 -1
  71. package/dist/dist-esm/react-components/src/components/MessageThread.js +6 -4
  72. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  73. package/dist/dist-esm/react-components/src/components/ParticipantItem.d.ts +0 -2
  74. package/dist/dist-esm/react-components/src/components/ParticipantItem.js +10 -12
  75. package/dist/dist-esm/react-components/src/components/ParticipantItem.js.map +1 -1
  76. package/dist/dist-esm/react-components/src/components/ParticipantsButton.d.ts +4 -0
  77. package/dist/dist-esm/react-components/src/components/ParticipantsButton.js +25 -4
  78. package/dist/dist-esm/react-components/src/components/ParticipantsButton.js.map +1 -1
  79. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.d.ts +10 -4
  80. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js +79 -7
  81. package/dist/dist-esm/react-components/src/components/RemoteVideoTile.js.map +1 -1
  82. package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.d.ts +6 -6
  83. package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js +13 -21
  84. package/dist/dist-esm/react-components/src/components/UnsupportedBrowser.js.map +1 -1
  85. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.d.ts +37 -0
  86. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js +27 -0
  87. package/dist/dist-esm/react-components/src/components/UnsupportedBrowserVersion.js.map +1 -0
  88. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.d.ts +41 -0
  89. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js +32 -0
  90. package/dist/dist-esm/react-components/src/components/UnsupportedEnvironment.js.map +1 -0
  91. package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.d.ts +32 -0
  92. package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js +25 -0
  93. package/dist/dist-esm/react-components/src/components/UnsupportedOperatingSystem.js.map +1 -0
  94. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.d.ts +16 -0
  95. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +60 -0
  96. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -0
  97. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.d.ts +12 -0
  98. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js +41 -0
  99. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js.map +1 -0
  100. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.d.ts +25 -0
  101. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +76 -0
  102. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -0
  103. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.d.ts +38 -0
  104. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.js +4 -0
  105. package/dist/dist-esm/react-components/src/components/VideoGallery/Layout.js.map +1 -0
  106. package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.d.ts +9 -0
  107. package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.js +18 -0
  108. package/dist/dist-esm/react-components/src/components/VideoGallery/ScrollableHorizontalGallery.js.map +1 -0
  109. package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.d.ts +14 -0
  110. package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.js +19 -0
  111. package/dist/dist-esm/react-components/src/components/VideoGallery/VideoGalleryResponsiveHorizontalGallery.js.map +1 -0
  112. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/DefaultLayout.styles.d.ts +6 -0
  113. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/DefaultLayout.styles.js +9 -0
  114. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/DefaultLayout.styles.js.map +1 -0
  115. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.d.ts +62 -0
  116. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js +118 -0
  117. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideo.styles.js.map +1 -0
  118. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideoLayout.styles.d.ts +14 -0
  119. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideoLayout.styles.js +28 -0
  120. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/FloatingLocalVideoLayout.styles.js.map +1 -0
  121. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/Layout.styles.d.ts +6 -0
  122. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/Layout.styles.js +9 -0
  123. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/Layout.styles.js.map +1 -0
  124. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/RemoteVideoTile.styles.d.ts +9 -0
  125. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/RemoteVideoTile.styles.js +22 -0
  126. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/RemoteVideoTile.styles.js.map +1 -0
  127. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.d.ts +10 -0
  128. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.js +29 -0
  129. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/ScrollableHorizontalGallery.style.js.map +1 -0
  130. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.d.ts +45 -0
  131. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.js +57 -0
  132. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveHorizontalGallery.styles.js.map +1 -0
  133. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.d.ts +2 -2
  134. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.js +7 -2
  135. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoStreamLifecycleMaintainer.js.map +1 -1
  136. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.d.ts +23 -0
  137. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +96 -0
  138. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js.map +1 -0
  139. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.d.ts +27 -0
  140. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js +121 -0
  141. package/dist/dist-esm/react-components/src/components/VideoGallery/utils/videoGalleryLayoutUtils.js.map +1 -0
  142. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +66 -0
  143. package/dist/dist-esm/react-components/src/components/VideoGallery.js +131 -124
  144. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  145. package/dist/dist-esm/react-components/src/components/VideoTile.d.ts +12 -17
  146. package/dist/dist-esm/react-components/src/components/VideoTile.js +71 -38
  147. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  148. package/dist/dist-esm/react-components/src/components/index.d.ts +8 -3
  149. package/dist/dist-esm/react-components/src/components/index.js +3 -2
  150. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  151. package/dist/dist-esm/react-components/src/components/styles/{DomainPermissions.styles.d.ts → SitePermissions.styles.d.ts} +1 -1
  152. package/dist/dist-esm/react-components/src/components/styles/{DomainPermissions.styles.js → SitePermissions.styles.js} +1 -1
  153. package/dist/dist-esm/react-components/src/components/styles/SitePermissions.styles.js.map +1 -0
  154. package/dist/dist-esm/react-components/src/components/styles/TroubleshootingGuideErrorBar.styles.js +2 -1
  155. package/dist/dist-esm/react-components/src/components/styles/TroubleshootingGuideErrorBar.styles.js.map +1 -1
  156. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.d.ts +26 -0
  157. package/dist/dist-esm/react-components/src/components/styles/{UnsupportedBrowser.styles.js → UnsupportedEnvironment.styles.js} +25 -10
  158. package/dist/dist-esm/react-components/src/components/styles/UnsupportedEnvironment.styles.js.map +1 -0
  159. package/dist/dist-esm/react-components/src/components/styles/VideoGallery.styles.d.ts +1 -95
  160. package/dist/dist-esm/react-components/src/components/styles/VideoGallery.styles.js +3 -138
  161. package/dist/dist-esm/react-components/src/components/styles/VideoGallery.styles.js.map +1 -1
  162. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.d.ts +1 -1
  163. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js +11 -26
  164. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js.map +1 -1
  165. package/dist/dist-esm/react-components/src/components/utils/useLongPress.d.ts +13 -10
  166. package/dist/dist-esm/react-components/src/components/utils/useLongPress.js +66 -37
  167. package/dist/dist-esm/react-components/src/components/utils/useLongPress.js.map +1 -1
  168. package/dist/dist-esm/react-components/src/components/utils.d.ts +1 -6
  169. package/dist/dist-esm/react-components/src/components/utils.js +4 -16
  170. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  171. package/dist/dist-esm/react-components/src/index.d.ts +0 -1
  172. package/dist/dist-esm/react-components/src/index.js.map +1 -1
  173. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.d.ts +31 -19
  174. package/dist/dist-esm/react-components/src/localization/LocalizationProvider.js.map +1 -1
  175. package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +1 -1
  176. package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +1 -1
  177. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +49 -14
  178. package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +1 -1
  179. package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +1 -1
  180. package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +1 -1
  181. package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +1 -1
  182. package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +1 -1
  183. package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +1 -1
  184. package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +1 -1
  185. package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +1 -1
  186. package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +1 -1
  187. package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +1 -1
  188. package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +1 -1
  189. package/dist/dist-esm/react-components/src/theming/icons.d.ts +11 -6
  190. package/dist/dist-esm/react-components/src/theming/icons.js +30 -20
  191. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  192. package/dist/dist-esm/react-components/src/theming/icons.styles.d.ts +1 -1
  193. package/dist/dist-esm/react-components/src/theming/icons.styles.js +1 -1
  194. package/dist/dist-esm/react-components/src/theming/icons.styles.js.map +1 -1
  195. package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.d.ts +2 -0
  196. package/dist/dist-esm/react-components/src/types/VideoGalleryParticipant.js.map +1 -1
  197. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +24 -11
  198. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +9 -9
  199. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  200. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +56 -0
  201. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  202. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +16 -10
  203. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +89 -40
  204. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  205. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +11 -17
  206. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  207. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.d.ts +2 -2
  208. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js +1 -1
  209. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/index.js.map +1 -1
  210. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.d.ts +1 -0
  211. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +19 -18
  212. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  213. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.d.ts +5 -4
  214. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js +68 -28
  215. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallReadinessModal.js.map +1 -1
  216. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.d.ts +16 -0
  217. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/{ConfigurationpageCameraDropdown.js → ConfigurationPageCameraDropdown.js} +4 -6
  218. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageCameraDropdown.js.map +1 -0
  219. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/{ConfigurationpageErrorBar.d.ts → ConfigurationPageErrorBar.d.ts} +3 -4
  220. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/{ConfigurationpageErrorBar.js → ConfigurationPageErrorBar.js} +4 -6
  221. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageErrorBar.js.map +1 -0
  222. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.d.ts +16 -0
  223. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/{ConfigurationpageMicDropdown.js → ConfigurationPageMicDropdown.js} +4 -8
  224. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationPageMicDropdown.js.map +1 -0
  225. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.js +1 -0
  226. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalAndRemotePIP.js.map +1 -1
  227. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.d.ts +0 -1
  228. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js +16 -14
  229. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalDeviceSettings.js.map +1 -1
  230. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.js +8 -3
  231. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.js.map +1 -1
  232. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.d.ts +3 -0
  233. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js +26 -4
  234. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/MediaGallery.js.map +1 -1
  235. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js +1 -1
  236. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js.map +1 -1
  237. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js +11 -3
  238. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useAdaptedSelector.js.map +1 -1
  239. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +4 -4
  240. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js +1 -1
  241. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  242. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +6 -2
  243. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  244. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.d.ts +3 -3
  245. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +46 -27
  246. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  247. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.d.ts +2 -0
  248. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js +28 -7
  249. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/UnsupportedBrowser.js.map +1 -1
  250. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/mediaGallerySelector.d.ts +7 -0
  251. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/mediaGallerySelector.js +9 -1
  252. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/mediaGallerySelector.js.map +1 -1
  253. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.d.ts +4 -0
  254. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js +10 -0
  255. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallPage.styles.js.map +1 -1
  256. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.d.ts +29 -0
  257. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js +119 -0
  258. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/MediaGalleryUtils.js.map +1 -0
  259. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +20 -4
  260. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +74 -21
  261. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  262. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +16 -7
  263. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +22 -10
  264. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  265. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js +2 -0
  266. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js.map +1 -1
  267. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +1 -0
  268. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +6 -0
  269. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  270. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +4 -0
  271. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  272. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +1 -0
  273. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +7 -1
  274. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  275. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +8 -0
  276. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  277. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +4 -0
  278. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  279. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js +26 -3
  280. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js.map +1 -1
  281. package/dist/dist-esm/react-composites/src/composites/common/HiddenFocusStartPoint.d.ts +8 -0
  282. package/dist/dist-esm/react-composites/src/composites/common/HiddenFocusStartPoint.js +40 -0
  283. package/dist/dist-esm/react-composites/src/composites/common/HiddenFocusStartPoint.js.map +1 -0
  284. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js +1 -1
  285. package/dist/dist-esm/react-composites/src/composites/common/ModalLocalAndRemotePIP.js.map +1 -1
  286. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +11 -6
  287. package/dist/dist-esm/react-composites/src/composites/common/styles/ModalLocalAndRemotePIP.styles.js +1 -0
  288. package/dist/dist-esm/react-composites/src/composites/common/styles/ModalLocalAndRemotePIP.styles.js.map +1 -1
  289. package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.js +2 -1
  290. package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.js.map +1 -1
  291. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +15 -1
  292. package/package.json +12 -11
  293. package/dist/dist-esm/react-components/src/components/DevicePermissions/DomainPermissions.d.ts +0 -101
  294. package/dist/dist-esm/react-components/src/components/DevicePermissions/DomainPermissions.js.map +0 -1
  295. package/dist/dist-esm/react-components/src/components/DevicePermissions/DomainPermissionsScaffolding.js.map +0 -1
  296. package/dist/dist-esm/react-components/src/components/styles/DomainPermissions.styles.js.map +0 -1
  297. package/dist/dist-esm/react-components/src/components/styles/UnsupportedBrowser.styles.d.ts +0 -22
  298. package/dist/dist-esm/react-components/src/components/styles/UnsupportedBrowser.styles.js.map +0 -1
  299. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.d.ts +0 -17
  300. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageCameraDropdown.js.map +0 -1
  301. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageErrorBar.js.map +0 -1
  302. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.d.ts +0 -17
  303. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/ConfigurationpageMicDropdown.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
- import { AnimationStyles, mergeStyles, Stack, useTheme } from '@fluentui/react';
3
+ import { AnimationStyles, mergeStyles, Stack, Text, useTheme } from '@fluentui/react';
4
4
  import React from 'react';
5
5
  /**
6
6
  * Container that holds the content of the drawer
@@ -13,7 +13,23 @@ export const DrawerContentContainer = (props) => {
13
13
  const backgroundColor = theme.palette.white;
14
14
  const borderRadius = theme.effects.roundedCorner4;
15
15
  const rootStyles = mergeStyles(containerStyles(backgroundColor, borderRadius), (_a = props.styles) === null || _a === void 0 ? void 0 : _a.root);
16
- return React.createElement(Stack, { className: rootStyles }, props.children);
16
+ return (React.createElement(Stack, { className: rootStyles },
17
+ props.heading && (React.createElement(Stack, { className: mergeStyles(headingContainerStyles) },
18
+ React.createElement(Text, { className: mergeStyles(headingStyles(theme)) }, props.heading))),
19
+ props.children));
17
20
  };
18
21
  const containerStyles = (backgroundColor, borderRadius) => (Object.assign({ background: backgroundColor, borderTopRightRadius: borderRadius, borderTopLeftRadius: borderRadius }, AnimationStyles.slideUpIn10));
22
+ const headingContainerStyles = {
23
+ textAlign: 'center',
24
+ width: '100%',
25
+ padding: '0.5rem'
26
+ };
27
+ const headingStyles = (theme) => ({
28
+ color: theme.palette.neutralSecondary,
29
+ fontSize: theme.fonts.smallPlus.fontSize,
30
+ lineHeight: '1rem',
31
+ whiteSpace: 'nowrap',
32
+ overflow: 'hidden',
33
+ textOverflow: 'ellipsis'
34
+ });
19
35
  //# sourceMappingURL=DrawerContentContainer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"DrawerContentContainer.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/Drawer/DrawerContentContainer.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,eAAe,EAAU,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACxF,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B;;;;GAIG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,CAAC,KAGtC,EAAe,EAAE;;IAChB,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,eAAe,GAAG,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC;IAC5C,MAAM,YAAY,GAAG,KAAK,CAAC,OAAO,CAAC,cAAc,CAAC;IAClD,MAAM,UAAU,GAAG,WAAW,CAAC,eAAe,CAAC,eAAe,EAAE,YAAY,CAAC,EAAE,MAAA,KAAK,CAAC,MAAM,0CAAE,IAAI,CAAC,CAAC;IAEnG,OAAO,oBAAC,KAAK,IAAC,SAAS,EAAE,UAAU,IAAG,KAAK,CAAC,QAAQ,CAAS,CAAC;AAChE,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,eAAuB,EAAE,YAAoB,EAAU,EAAE,CAAC,iBACjF,UAAU,EAAE,eAAe,EAE3B,oBAAoB,EAAE,YAAY,EAClC,mBAAmB,EAAE,YAAY,IAE9B,eAAe,CAAC,WAAW,EAC9B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AnimationStyles, IStyle, mergeStyles, Stack, useTheme } from '@fluentui/react';\nimport React from 'react';\nimport { BaseCustomStyles } from '../../types';\n\n/**\n * Container that holds the content of the drawer\n *\n * @private\n */\nexport const DrawerContentContainer = (props: {\n children: React.ReactNode;\n styles?: BaseCustomStyles;\n}): JSX.Element => {\n const theme = useTheme();\n const backgroundColor = theme.palette.white;\n const borderRadius = theme.effects.roundedCorner4;\n const rootStyles = mergeStyles(containerStyles(backgroundColor, borderRadius), props.styles?.root);\n\n return <Stack className={rootStyles}>{props.children}</Stack>;\n};\n\nconst containerStyles = (backgroundColor: string, borderRadius: string): IStyle => ({\n background: backgroundColor,\n\n borderTopRightRadius: borderRadius,\n borderTopLeftRadius: borderRadius,\n\n ...AnimationStyles.slideUpIn10\n});\n"]}
1
+ {"version":3,"file":"DrawerContentContainer.js","sourceRoot":"","sources":["../../../../../../../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G,CAAC,KAAY,EAAU,EAAE,CAAC,CAAC;IAC/C,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,gBAAgB;IACrC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,QAAQ;IACxC,UAAU,EAAE,MAAM;IAClB,UAAU,EAAE,QAAQ;IACpB,QAAQ,EAAE,QAAQ;IAClB,YAAY,EAAE,UAAU;CACzB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AnimationStyles, IStyle, mergeStyles, Stack, Text, Theme, useTheme } from '@fluentui/react';\nimport React from 'react';\nimport { BaseCustomStyles } from '../../types';\n\n/**\n * Container that holds the content of the drawer\n *\n * @private\n */\nexport const DrawerContentContainer = (props: {\n children: React.ReactNode;\n heading?: string;\n styles?: BaseCustomStyles;\n}): JSX.Element => {\n const theme = useTheme();\n const backgroundColor = theme.palette.white;\n const borderRadius = theme.effects.roundedCorner4;\n const rootStyles = mergeStyles(containerStyles(backgroundColor, borderRadius), props.styles?.root);\n\n return (\n <Stack className={rootStyles}>\n {props.heading && (\n <Stack className={mergeStyles(headingContainerStyles)}>\n <Text className={mergeStyles(headingStyles(theme))}>{props.heading}</Text>\n </Stack>\n )}\n {props.children}\n </Stack>\n );\n};\n\nconst containerStyles = (backgroundColor: string, borderRadius: string): IStyle => ({\n background: backgroundColor,\n\n borderTopRightRadius: borderRadius,\n borderTopLeftRadius: borderRadius,\n\n ...AnimationStyles.slideUpIn10\n});\n\nconst headingContainerStyles: IStyle = {\n textAlign: 'center',\n width: '100%',\n padding: '0.5rem'\n};\n\nconst headingStyles = (theme: Theme): IStyle => ({\n color: theme.palette.neutralSecondary,\n fontSize: theme.fonts.smallPlus.fontSize,\n lineHeight: '1rem',\n whiteSpace: 'nowrap',\n overflow: 'hidden',\n textOverflow: 'ellipsis'\n});\n"]}
@@ -22,6 +22,10 @@ export interface _DrawerMenuProps {
22
22
  * Callback when the drawer's light-dismissal is triggered.
23
23
  */
24
24
  onLightDismiss: () => void;
25
+ /**
26
+ * String to show in heading of drawer menu
27
+ */
28
+ heading?: string;
25
29
  styles?: _DrawerMenuStyles;
26
30
  }
27
31
  /**
@@ -43,7 +43,7 @@ export const _DrawerMenu = (props) => {
43
43
  borderTopLeftRadius: borderRadius
44
44
  }
45
45
  }), [firstItemStyle, borderRadius]);
46
- return (React.createElement(_DrawerSurface, { styles: (_b = props.styles) === null || _b === void 0 ? void 0 : _b.drawerSurfaceStyles, onLightDismiss: props.onLightDismiss },
46
+ return (React.createElement(_DrawerSurface, { styles: (_b = props.styles) === null || _b === void 0 ? void 0 : _b.drawerSurfaceStyles, onLightDismiss: props.onLightDismiss, heading: props.heading },
47
47
  React.createElement(Stack, { styles: props.styles, role: "menu", "data-ui-id": "drawer-menu" }, menuItemsToRender === null || menuItemsToRender === void 0 ? void 0 :
48
48
  menuItemsToRender.slice(0, 1).map((item) => (React.createElement(DrawerMenuItem, Object.assign({}, item, { key: '0', styles: modifiedFirstItemStyle, onItemClick: (ev, itemKey) => {
49
49
  onItemClick(item, ev, itemKey);
@@ -1 +1 @@
1
- {"version":3,"file":"DrawerMenu.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/Drawer/DrawerMenu.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAwB,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAwB,MAAM,iBAAiB,CAAC;AA4BvE;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAe,EAAE;;IAClE,gGAAgG;IAChG,iGAAiG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C,mBAAmB,EAAE,YAAY;SAClC;KACF,CAAC,EACJ,CAAC,cAAc,EAAE,YAAY,CAAC,CAC/B,CAAC;IAEF,OAAO,CACL,oBAAC,cAAc,IAAC,MAAM,EAAE,MAAA,KAAK,CAAC,MAAM,0CAAE,mBAAmB,EAAE,cAAc,EAAE,KAAK,CAAC,cAAc;QAC7F,oBAAC,KAAK,IAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAC,MAAM,gBAAY,aAAa,IAC9D,iBAAiB,aAAjB,iBAAiB;YAAjB,iBAAiB,CAAE,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC5C,oBAAC,cAAc,oBACT,IAAI,IACR,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,sBAAsB,EAC9B,WAAW,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE;oBAC3B,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;gBACjC,CAAC,IACD,CACH,CAAC,EACD,iBAAiB,aAAjB,iBAAiB;YAAjB,iBAAiB,CAAE,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAC5C,oBAAC,cAAc,oBACT,IAAI,IACR,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,EACf,WAAW,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE;oBAC3B,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;gBACjC,CAAC,IACD,CACH,CAAC,CACI,CACO,CAClB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { merge, Stack } from '@fluentui/react';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { _DrawerSurfaceProps } from '.';\nimport { useTheme } from '../../theming/FluentThemeProvider';\nimport { BaseCustomStyles } from '../../types';\nimport { DrawerMenuItem, _DrawerMenuItemProps } from './DrawerMenuItem';\nimport { _DrawerSurface, _DrawerSurfaceStyles } from './DrawerSurface';\n\n/**\n * Styles for the {@link _DrawerMenu}.\n *\n * @internal\n */\nexport interface _DrawerMenuStyles extends BaseCustomStyles {\n /** Styles for the {@link DrawerSurface} container. */\n drawerSurfaceStyles?: _DrawerSurfaceStyles;\n}\n\n/**\n * Props for the {@link _DrawerMenu}\n *\n * @internal\n */\nexport interface _DrawerMenuProps {\n items: _DrawerMenuItemProps[];\n\n /**\n * Callback when the drawer's light-dismissal is triggered.\n */\n onLightDismiss: () => void;\n\n styles?: _DrawerMenuStyles;\n}\n\n/**\n * Takes a set of menu items and returns a created menu inside a {@link _DrawerSurface}.\n *\n * @internal\n */\nexport const _DrawerMenu = (props: _DrawerMenuProps): JSX.Element => {\n // This component breaks from a pure component pattern in order to internally support sub menus.\n // When a sub menu item is clicked the menu items displayed is updated to be that of the submenu.\n // To track this state we store a list of the keys clicked up until this point.\n const [selectedKeyPath, setSelectedKeyPath] = useState<string[]>([]);\n\n // Get the menu items that should be rendered\n const menuItemsToRender = useMemo(() => {\n let items: _DrawerMenuItemProps[] | undefined = props.items;\n for (const subMenuKey of selectedKeyPath) {\n items = items?.find((item) => item.itemKey === subMenuKey)?.subMenuProps;\n }\n return items;\n }, [props.items, selectedKeyPath]);\n\n // When an item is clicked and it contains a submenu, push the key for the submenu. This will ensure\n // a new render is triggered, menuItemsToRender will be re-calculated and the submenu will render.\n const onItemClick = useCallback(\n (\n item: _DrawerMenuItemProps,\n ev?: React.MouseEvent<HTMLElement, MouseEvent> | React.KeyboardEvent<HTMLElement> | undefined,\n itemKey?: string | undefined\n ): void => {\n if (item.subMenuProps) {\n setSelectedKeyPath([...selectedKeyPath, item.itemKey]);\n }\n\n item.onItemClick?.(ev, itemKey);\n },\n [selectedKeyPath]\n );\n\n // Ensure the first item has a border radius that matches the DrawerSurface\n const borderRadius = useTheme().effects.roundedCorner4;\n const firstItemStyle = menuItemsToRender && menuItemsToRender[0]?.styles;\n const modifiedFirstItemStyle = useMemo(\n () =>\n merge(firstItemStyle ?? {}, {\n root: {\n borderTopRightRadius: borderRadius,\n borderTopLeftRadius: borderRadius\n }\n }),\n [firstItemStyle, borderRadius]\n );\n\n return (\n <_DrawerSurface styles={props.styles?.drawerSurfaceStyles} onLightDismiss={props.onLightDismiss}>\n <Stack styles={props.styles} role=\"menu\" data-ui-id=\"drawer-menu\">\n {menuItemsToRender?.slice(0, 1).map((item) => (\n <DrawerMenuItem\n {...item}\n key={'0'}\n styles={modifiedFirstItemStyle}\n onItemClick={(ev, itemKey) => {\n onItemClick(item, ev, itemKey);\n }}\n />\n ))}\n {menuItemsToRender?.slice(1).map((item, i) => (\n <DrawerMenuItem\n {...item}\n key={`${i + 1}`}\n onItemClick={(ev, itemKey) => {\n onItemClick(item, ev, itemKey);\n }}\n />\n ))}\n </Stack>\n </_DrawerSurface>\n );\n};\n"]}
1
+ {"version":3,"file":"DrawerMenu.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/Drawer/DrawerMenu.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9D,OAAO,EAAE,QAAQ,EAAE,MAAM,mCAAmC,CAAC;AAE7D,OAAO,EAAE,cAAc,EAAwB,MAAM,kBAAkB,CAAC;AACxE,OAAO,EAAE,cAAc,EAAwB,MAAM,iBAAiB,CAAC;AAiCvE;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,KAAuB,EAAe,EAAE;;IAClE,gGAAgG;IAChG,iGAAiG;IACjG,+EAA+E;IAC/E,MAAM,CAAC,eAAe,EAAE,kBAAkB,CAAC,GAAG,QAAQ,CAAW,E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,CAAC;IAEF,OAAO,CACL,oBAAC,cAAc,IACb,MAAM,EAAE,MAAA,KAAK,CAAC,MAAM,0CAAE,mBAAmB,EACzC,cAAc,EAAE,KAAK,CAAC,cAAc,EACpC,OAAO,EAAE,KAAK,CAAC,OAAO;QAEtB,oBAAC,KAAK,IAAC,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,IAAI,EAAC,MAAM,gBAAY,aAAa,IAC9D,iBAAiB,aAAjB,iBAAiB;YAAjB,iBAAiB,CAAE,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAC5C,oBAAC,cAAc,oBACT,IAAI,IACR,GAAG,EAAE,GAAG,EACR,MAAM,EAAE,sBAAsB,EAC9B,WAAW,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE;oBAC3B,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;gBACjC,CAAC,IACD,CACH,CAAC,EACD,iBAAiB,aAAjB,iBAAiB;YAAjB,iBAAiB,CAAE,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAC5C,oBAAC,cAAc,oBACT,IAAI,IACR,GAAG,EAAE,GAAG,CAAC,GAAG,CAAC,EAAE,EACf,WAAW,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE;oBAC3B,WAAW,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;gBACjC,CAAC,IACD,CACH,CAAC,CACI,CACO,CAClB,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { merge, Stack } from '@fluentui/react';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { _DrawerSurfaceProps } from '.';\nimport { useTheme } from '../../theming/FluentThemeProvider';\nimport { BaseCustomStyles } from '../../types';\nimport { DrawerMenuItem, _DrawerMenuItemProps } from './DrawerMenuItem';\nimport { _DrawerSurface, _DrawerSurfaceStyles } from './DrawerSurface';\n\n/**\n * Styles for the {@link _DrawerMenu}.\n *\n * @internal\n */\nexport interface _DrawerMenuStyles extends BaseCustomStyles {\n /** Styles for the {@link DrawerSurface} container. */\n drawerSurfaceStyles?: _DrawerSurfaceStyles;\n}\n\n/**\n * Props for the {@link _DrawerMenu}\n *\n * @internal\n */\nexport interface _DrawerMenuProps {\n items: _DrawerMenuItemProps[];\n\n /**\n * Callback when the drawer's light-dismissal is triggered.\n */\n onLightDismiss: () => void;\n\n /**\n * String to show in heading of drawer menu\n */\n heading?: string;\n\n styles?: _DrawerMenuStyles;\n}\n\n/**\n * Takes a set of menu items and returns a created menu inside a {@link _DrawerSurface}.\n *\n * @internal\n */\nexport const _DrawerMenu = (props: _DrawerMenuProps): JSX.Element => {\n // This component breaks from a pure component pattern in order to internally support sub menus.\n // When a sub menu item is clicked the menu items displayed is updated to be that of the submenu.\n // To track this state we store a list of the keys clicked up until this point.\n const [selectedKeyPath, setSelectedKeyPath] = useState<string[]>([]);\n\n // Get the menu items that should be rendered\n const menuItemsToRender = useMemo(() => {\n let items: _DrawerMenuItemProps[] | undefined = props.items;\n for (const subMenuKey of selectedKeyPath) {\n items = items?.find((item) => item.itemKey === subMenuKey)?.subMenuProps;\n }\n return items;\n }, [props.items, selectedKeyPath]);\n\n // When an item is clicked and it contains a submenu, push the key for the submenu. This will ensure\n // a new render is triggered, menuItemsToRender will be re-calculated and the submenu will render.\n const onItemClick = useCallback(\n (\n item: _DrawerMenuItemProps,\n ev?: React.MouseEvent<HTMLElement, MouseEvent> | React.KeyboardEvent<HTMLElement> | undefined,\n itemKey?: string | undefined\n ): void => {\n if (item.subMenuProps) {\n setSelectedKeyPath([...selectedKeyPath, item.itemKey]);\n }\n\n item.onItemClick?.(ev, itemKey);\n },\n [selectedKeyPath]\n );\n\n // Ensure the first item has a border radius that matches the DrawerSurface\n const borderRadius = useTheme().effects.roundedCorner4;\n const firstItemStyle = menuItemsToRender && menuItemsToRender[0]?.styles;\n const modifiedFirstItemStyle = useMemo(\n () =>\n merge(firstItemStyle ?? {}, {\n root: {\n borderTopRightRadius: borderRadius,\n borderTopLeftRadius: borderRadius\n }\n }),\n [firstItemStyle, borderRadius]\n );\n\n return (\n <_DrawerSurface\n styles={props.styles?.drawerSurfaceStyles}\n onLightDismiss={props.onLightDismiss}\n heading={props.heading}\n >\n <Stack styles={props.styles} role=\"menu\" data-ui-id=\"drawer-menu\">\n {menuItemsToRender?.slice(0, 1).map((item) => (\n <DrawerMenuItem\n {...item}\n key={'0'}\n styles={modifiedFirstItemStyle}\n onItemClick={(ev, itemKey) => {\n onItemClick(item, ev, itemKey);\n }}\n />\n ))}\n {menuItemsToRender?.slice(1).map((item, i) => (\n <DrawerMenuItem\n {...item}\n key={`${i + 1}`}\n onItemClick={(ev, itemKey) => {\n onItemClick(item, ev, itemKey);\n }}\n />\n ))}\n </Stack>\n </_DrawerSurface>\n );\n};\n"]}
@@ -25,6 +25,10 @@ export interface _DrawerSurfaceProps {
25
25
  * Callback when the drawer's light-dismissal is triggered.
26
26
  */
27
27
  onLightDismiss: () => void;
28
+ /**
29
+ * String to show in heading of drawer surface
30
+ */
31
+ heading?: string;
28
32
  /** Styles for the {@link DrawerSurface} */
29
33
  styles?: _DrawerSurfaceStyles;
30
34
  }
@@ -23,7 +23,7 @@ export const _DrawerSurface = (props) => {
23
23
  // Ensure when the focus trap has focus, the light dismiss area can still be clicked with mouse to dismiss.
24
24
  // Note: this still correctly captures keyboard focus, this just allows mouse click outside of the focus trap.
25
25
  isClickableOutsideFocusTrap: true },
26
- React.createElement(DrawerContentContainer, { styles: (_c = props.styles) === null || _c === void 0 ? void 0 : _c.drawerContentContainer }, props.children))));
26
+ React.createElement(DrawerContentContainer, { styles: (_c = props.styles) === null || _c === void 0 ? void 0 : _c.drawerContentContainer, heading: props.heading }, props.children))));
27
27
  };
28
28
  const drawerSurfaceStyles = {
29
29
  width: '100%',
@@ -1 +1 @@
1
- {"version":3,"file":"DrawerSurface.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/Drawer/DrawerSurface.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAU,WAAW,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAkC1D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAA0B,EAAe,EAAE;;IACxE,MAAM,UAAU,GAAG,WAAW,CAAC,mBAAmB,EAAE,MAAA,KAAK,CAAC,MAAM,0CAAE,IAAI,CAAC,CAAC;IAExE,OAAO,CACL,oBAAC,KAAK,IAAC,SAAS,EAAE,UAAU;QAC1B,oBAAC,kBAAkB,IAAC,MAAM,EAAE,MAAA,KAAK,CAAC,MAAM,0CAAE,gBAAgB,EAAE,SAAS,EAAE,KAAK,CAAC,cAAc,GAAI;QAC/F,oBAAC,aAAa,IACZ,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;gBACf,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,CAAC,CAAC,GAAG,KAAK,KAAK,EAAE;oBACzC,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,cAAc,EAAE,CAAC;iBAChD;YACH,CAAC;YACD,2GAA2G;YAC3G,8GAA8G;YAC9G,2BAA2B,EAAE,IAAI;YAEjC,oBAAC,sBAAsB,IAAC,MAAM,EAAE,MAAA,KAAK,CAAC,MAAM,0CAAE,sBAAsB,IAAG,KAAK,CAAC,QAAQ,CAA0B,CACjG,CACV,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAW;IAClC,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,iBAAiB;CAC9B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { FocusTrapZone, IStyle, mergeStyles, Stack } from '@fluentui/react';\nimport React from 'react';\nimport { BaseCustomStyles } from '../../types';\nimport { DrawerContentContainer } from './DrawerContentContainer';\nimport { DrawerLightDismiss } from './DrawerLightDismiss';\n\n/**\n * Styles for the {@link _DrawerSurface}.\n *\n * @internal\n */\nexport interface _DrawerSurfaceStyles extends BaseCustomStyles {\n /** Styles for the root of the container of the {@link DrawerSurface} content. */\n drawerContentRoot?: BaseCustomStyles;\n /** Styles for the container of the {@link DrawerSurface} content. */\n drawerContentContainer?: BaseCustomStyles;\n /** Styles for the light dismiss element of the {@link DrawerSurface}. */\n lightDismissRoot?: BaseCustomStyles;\n}\n\n/**\n * Props for {@link DrawerSurface} component.\n *\n * @internal\n */\nexport interface _DrawerSurfaceProps {\n /** Content of the Drawer */\n children: React.ReactNode;\n\n /**\n * Callback when the drawer's light-dismissal is triggered.\n */\n onLightDismiss: () => void;\n\n /** Styles for the {@link DrawerSurface} */\n styles?: _DrawerSurfaceStyles;\n}\n\n/**\n * A `Drawer` can be used to reveal lightweight views inside your application.\n * They appear from the bottom of the screen upwards and are light-dismissed.\n *\n * @internal\n */\nexport const _DrawerSurface = (props: _DrawerSurfaceProps): JSX.Element => {\n const rootStyles = mergeStyles(drawerSurfaceStyles, props.styles?.root);\n\n return (\n <Stack className={rootStyles}>\n <DrawerLightDismiss styles={props.styles?.lightDismissRoot} onDismiss={props.onLightDismiss} />\n <FocusTrapZone\n onKeyDown={(e) => {\n if (e.key === 'Escape' || e.key === 'Esc') {\n props.onLightDismiss && props.onLightDismiss();\n }\n }}\n // Ensure when the focus trap has focus, the light dismiss area can still be clicked with mouse to dismiss.\n // Note: this still correctly captures keyboard focus, this just allows mouse click outside of the focus trap.\n isClickableOutsideFocusTrap={true}\n >\n <DrawerContentContainer styles={props.styles?.drawerContentContainer}>{props.children}</DrawerContentContainer>\n </FocusTrapZone>\n </Stack>\n );\n};\n\nconst drawerSurfaceStyles: IStyle = {\n width: '100%',\n height: '100%',\n background: 'rgba(0,0,0,0.4)'\n};\n"]}
1
+ {"version":3,"file":"DrawerSurface.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/Drawer/DrawerSurface.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,aAAa,EAAU,WAAW,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAuC1D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAA0B,EAAe,EAAE;;IACxE,MAAM,UAAU,GAAG,WAAW,CAAC,mBAAmB,EAAE,MAAA,KAAK,CAAC,MAAM,0CAAE,IAAI,CAAC,CAAC;IAExE,OAAO,CACL,oBAAC,KAAK,IAAC,SAAS,EAAE,UAAU;QAC1B,oBAAC,kBAAkB,IAAC,MAAM,EAAE,MAAA,KAAK,CAAC,MAAM,0CAAE,gBAAgB,EAAE,SAAS,EAAE,KAAK,CAAC,cAAc,GAAI;QAC/F,oBAAC,aAAa,IACZ,SAAS,EAAE,CAAC,CAAC,EAAE,EAAE;gBACf,IAAI,CAAC,CAAC,GAAG,KAAK,QAAQ,IAAI,CAAC,CAAC,GAAG,KAAK,KAAK,EAAE;oBACzC,KAAK,CAAC,cAAc,IAAI,KAAK,CAAC,cAAc,EAAE,CAAC;iBAChD;YACH,CAAC;YACD,2GAA2G;YAC3G,8GAA8G;YAC9G,2BAA2B,EAAE,IAAI;YAEjC,oBAAC,sBAAsB,IAAC,MAAM,EAAE,MAAA,KAAK,CAAC,MAAM,0CAAE,sBAAsB,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,IACzF,KAAK,CAAC,QAAQ,CACQ,CACX,CACV,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAW;IAClC,KAAK,EAAE,MAAM;IACb,MAAM,EAAE,MAAM;IACd,UAAU,EAAE,iBAAiB;CAC9B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { FocusTrapZone, IStyle, mergeStyles, Stack } from '@fluentui/react';\nimport React from 'react';\nimport { BaseCustomStyles } from '../../types';\nimport { DrawerContentContainer } from './DrawerContentContainer';\nimport { DrawerLightDismiss } from './DrawerLightDismiss';\n\n/**\n * Styles for the {@link _DrawerSurface}.\n *\n * @internal\n */\nexport interface _DrawerSurfaceStyles extends BaseCustomStyles {\n /** Styles for the root of the container of the {@link DrawerSurface} content. */\n drawerContentRoot?: BaseCustomStyles;\n /** Styles for the container of the {@link DrawerSurface} content. */\n drawerContentContainer?: BaseCustomStyles;\n /** Styles for the light dismiss element of the {@link DrawerSurface}. */\n lightDismissRoot?: BaseCustomStyles;\n}\n\n/**\n * Props for {@link DrawerSurface} component.\n *\n * @internal\n */\nexport interface _DrawerSurfaceProps {\n /** Content of the Drawer */\n children: React.ReactNode;\n\n /**\n * Callback when the drawer's light-dismissal is triggered.\n */\n onLightDismiss: () => void;\n\n /**\n * String to show in heading of drawer surface\n */\n heading?: string;\n\n /** Styles for the {@link DrawerSurface} */\n styles?: _DrawerSurfaceStyles;\n}\n\n/**\n * A `Drawer` can be used to reveal lightweight views inside your application.\n * They appear from the bottom of the screen upwards and are light-dismissed.\n *\n * @internal\n */\nexport const _DrawerSurface = (props: _DrawerSurfaceProps): JSX.Element => {\n const rootStyles = mergeStyles(drawerSurfaceStyles, props.styles?.root);\n\n return (\n <Stack className={rootStyles}>\n <DrawerLightDismiss styles={props.styles?.lightDismissRoot} onDismiss={props.onLightDismiss} />\n <FocusTrapZone\n onKeyDown={(e) => {\n if (e.key === 'Escape' || e.key === 'Esc') {\n props.onLightDismiss && props.onLightDismiss();\n }\n }}\n // Ensure when the focus trap has focus, the light dismiss area can still be clicked with mouse to dismiss.\n // Note: this still correctly captures keyboard focus, this just allows mouse click outside of the focus trap.\n isClickableOutsideFocusTrap={true}\n >\n <DrawerContentContainer styles={props.styles?.drawerContentContainer} heading={props.heading}>\n {props.children}\n </DrawerContentContainer>\n </FocusTrapZone>\n </Stack>\n );\n};\n\nconst drawerSurfaceStyles: IStyle = {\n width: '100%',\n height: '100%',\n background: 'rgba(0,0,0,0.4)'\n};\n"]}
@@ -102,6 +102,10 @@ export interface ErrorBarStrings {
102
102
  * Message shown when microphone can be enumerated but access is blocked by the system.
103
103
  */
104
104
  callMicrophoneAccessDenied: string;
105
+ /**
106
+ * Message shown when microphone can be enumerated but access is blocked by the system, for safari browsers
107
+ */
108
+ callMicrophoneAccessDeniedSafari: string;
105
109
  /**
106
110
  * Message shown when microphone is muted by the system (not by local or remote participants)
107
111
  */
@@ -124,6 +128,10 @@ export interface ErrorBarStrings {
124
128
  * Message shown when camera can be enumerated but access is blocked by the system.
125
129
  */
126
130
  callCameraAccessDenied: string;
131
+ /**
132
+ * Message shown when camera can be enumerated but access is blocked by the system, for safari browsers
133
+ */
134
+ callCameraAccessDeniedSafari: string;
127
135
  /**
128
136
  * Message shown when local video fails to start because camera is already in use by
129
137
  * another applciation.
@@ -1 +1 @@
1
- {"version":3,"file":"ErrorBar.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/ErrorBar.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAoB,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAEL,YAAY,EACZ,+BAA+B,EAC/B,YAAY,EACZ,mBAAmB,EACnB,cAAc,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AS;aACtB;YACD,SAAS,EAAE;gBACT,MAAM,EAAE,CAAC;gBACT,UAAU,EAAE,QAAQ;aACrB;SACF,EACD,GAAG,EAAE,KAAK,CAAC,IAAI,EACf,cAAc,EAAE,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,EAC1C,mBAAmB,EAAE,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,EACpD,SAAS,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,YAAY,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC,EACzE,sBAAsB,EAAE,OAAO,CAAC,sBAAsB,EACtD,gBAAgB,EAAE,EAAE,QAAQ,EAAE,eAAe,EAAE,KAE9C,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CACT,CACd,CAAC,CACI,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useEffect, useRef, useState } from 'react';\nimport { IMessageBarProps, MessageBar, Stack } from '@fluentui/react';\nimport { useLocale } from '../localization';\nimport {\n DismissedError,\n dismissError,\n dropDismissalsForInactiveErrors,\n errorsToShow,\n messageBarIconProps,\n messageBarType\n} from './utils';\n\n/**\n * Props for {@link ErrorBar}.\n *\n * In addition to the following, {@link ErrorBar} forwards all\n * {@link @fluentui/react#IMessageBarProps} to the underlying {@link @fluentui/react#MessageBar}.\n *\n * @public\n */\nexport interface ErrorBarProps extends IMessageBarProps {\n /**\n * Strings shown on the UI on errors.\n */\n strings?: ErrorBarStrings;\n\n /**\n * Currently active errors.\n */\n activeErrorMessages: ActiveErrorMessage[];\n\n /**\n * If set, errors with {@link ActiveErrorMessage.timestamp} older than the time this component is mounted\n * are not shown.\n *\n * This is useful when using the {@link ErrorBar} with a stateful client that handles more than one call\n * or chat thread. Set this prop to ignore errors from previous call or chat.\n *\n * @defaultValue false\n */\n ignorePremountErrors?: boolean;\n}\n\n/**\n * All strings that may be shown on the UI in the {@link ErrorBar}.\n *\n * @public\n */\nexport interface ErrorBarStrings {\n /**\n * Unable to reach Chat service.\n *\n * This can mean:\n * - Incorrect Azure Communication Services endpoint was provided.\n * - User's network connection is down.\n */\n unableToReachChatService: string;\n\n /**\n * User does not have access to the Chat service.\n * This usually means that either the Azure Communication Services endpiont or the token provided are incorrect.\n */\n accessDenied: string;\n\n /**\n * User is no longer on the thread.\n *\n * See also: {@link ErrorBarStrings.sendMessageNotInChatThread} for a more specific error.\n */\n userNotInChatThread: string;\n\n /**\n * Sending message failed because user is no longer on the thread.\n */\n sendMessageNotInChatThread: string;\n\n /**\n * A generic message when sending message fails.\n * Prefer more specific error strings when possible.\n */\n sendMessageGeneric: string;\n\n /**\n * A generic message when starting video fails.\n */\n startVideoGeneric: string;\n\n /**\n * A generic message when starting video fails.\n */\n stopVideoGeneric: string;\n\n /**\n * A generic message when muting microphone fails.\n */\n muteGeneric: string;\n\n /**\n * A generic message when unmuting microphone fails.\n */\n unmuteGeneric: string;\n\n /**\n * A generic message when starting screenshare fails.\n */\n startScreenShareGeneric: string;\n\n /**\n * A generic message when stopping screenshare fails.\n */\n stopScreenShareGeneric: string;\n\n /**\n * Message shown when poor network quality is detected during a call.\n */\n callNetworkQualityLow: string;\n\n /**\n * Message shown on failure to detect audio output devices.\n */\n callNoSpeakerFound: string;\n\n /**\n * Message shown on failure to detect audio input devices.\n */\n callNoMicrophoneFound: string;\n\n /**\n * Message shown when microphone can be enumerated but access is blocked by the system.\n */\n callMicrophoneAccessDenied: string;\n\n /**\n * Message shown when microphone is muted by the system (not by local or remote participants)\n */\n callMicrophoneMutedBySystem: string;\n\n /**\n * Message shown when microphone is unmuted by the system (not by local or remote participants).\n * This typically occurs if the system recovers from an unexpected mute.\n */\n callMicrophoneUnmutedBySystem: string;\n\n /**\n * Mac OS specific message shown when microphone can be enumerated but access is\n * blocked by the system.\n */\n callMacOsMicrophoneAccessDenied: string;\n\n /**\n * Message shown when poor network causes local video stream to be frozen.\n */\n callLocalVideoFreeze: string;\n\n /**\n * Message shown when camera can be enumerated but access is blocked by the system.\n */\n callCameraAccessDenied: string;\n\n /**\n * Message shown when local video fails to start because camera is already in use by\n * another applciation.\n */\n callCameraAlreadyInUse: string;\n\n /**\n * Message shown when local video is stopped by the system (not by local or remote participants)\n */\n callVideoStoppedBySystem: string;\n\n /**\n * Message shown when local video was recovered by the system (not by the local participant)\n */\n callVideoRecoveredBySystem: string;\n\n /**\n * Mac OS specific message shown when system denies access to camera.\n */\n callMacOsCameraAccessDenied: string;\n\n /**\n * Mac OS specific message shown when system denies sharing local screen on a call.\n */\n callMacOsScreenShareAccessDenied: string;\n /**\n * Dimiss errorbar button aria label read by screen reader accessibility tools\n */\n dismissButtonAriaLabel?: string;\n\n /**\n * An error message when joining a call fails.\n */\n failedToJoinCallGeneric?: string;\n\n /**\n * An error message when joining a call fails specifically due to an invalid meeting link.\n */\n failedToJoinCallInvalidMeetingLink?: string;\n}\n\n/**\n * All errors that can be shown in the {@link ErrorBar}.\n *\n * @public\n */\nexport type ErrorType = keyof ErrorBarStrings;\n\n/**\n * Active error messages to be shown via {@link ErrorBar}.\n *\n * @public\n */\nexport interface ActiveErrorMessage {\n /**\n * Type of error that is active.\n */\n type: ErrorType;\n /**\n * The latest timestamp when this error was observed.\n *\n * When available, this is used to track errors that have already been seen and dismissed\n * by the user.\n */\n timestamp?: Date;\n}\n\n/**\n * A component to show error messages on the UI.\n * All strings that can be shown are accepted as the {@link ErrorBarProps.strings} so that they can be localized.\n * Active errors are selected by {@link ErrorBarProps.activeErrorMessages}.\n *\n * This component internally tracks dismissed by the user.\n * * Errors that have an associated timestamp: The error is shown on the UI again if it occurs after being dismissed.\n * * Errors that do not have a timestamp: The error is dismissed until it disappears from the props.\n * If the error recurs, it is shown in the UI.\n *\n * Uses {@link @fluentui/react#MessageBar} UI element.\n *\n * @public\n */\nexport const ErrorBar = (props: ErrorBarProps): JSX.Element => {\n const localeStrings = useLocale().strings.errorBar;\n const strings = props.strings ?? localeStrings;\n\n // Timestamp for when this comopnent is first mounted.\n // Never updated through the lifecycle of this component.\n const mountTimestamp = useRef(new Date(Date.now()));\n\n const [dismissedErrors, setDismissedErrors] = useState<DismissedError[]>([]);\n\n // dropDismissalsForInactiveErrors only returns a new object if `dismissedErrors` actually changes.\n // Without this behaviour, this `useEffect` block would cause a render loop.\n useEffect(\n () => setDismissedErrors(dropDismissalsForInactiveErrors(props.activeErrorMessages, dismissedErrors)),\n [props.activeErrorMessages, dismissedErrors]\n );\n\n const toShow = errorsToShow(\n props.activeErrorMessages,\n dismissedErrors,\n props.ignorePremountErrors ? mountTimestamp.current : undefined\n );\n\n return (\n <Stack data-ui-id=\"error-bar-stack\">\n {toShow.map((error) => (\n <MessageBar\n {...props}\n styles={{\n innerText: {\n paddingTop: messageBarType(error.type) === 5 ? '0.15rem' : '0.1rem', // to move the inner text of the message bar down to be centered\n lineHeight: 'none'\n },\n icon: {\n height: 0\n },\n content: {\n lineHeight: 'inherit'\n },\n dismissal: {\n height: 0,\n paddingTop: '0.8rem'\n }\n }}\n key={error.type}\n messageBarType={messageBarType(error.type)}\n messageBarIconProps={messageBarIconProps(error.type)}\n onDismiss={() => setDismissedErrors(dismissError(dismissedErrors, error))}\n dismissButtonAriaLabel={strings.dismissButtonAriaLabel}\n dismissIconProps={{ iconName: 'ErrorBarClear' }}\n >\n {strings[error.type]}\n </MessageBar>\n ))}\n </Stack>\n );\n};\n"]}
1
+ {"version":3,"file":"ErrorBar.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/ErrorBar.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAoB,UAAU,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAEL,YAAY,EACZ,+BAA+B,EAC/B,YAAY,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EAAE;gBACP,UAAU,EAAE,SAAS;aACtB;YACD,SAAS,EAAE;gBACT,MAAM,EAAE,CAAC;gBACT,UAAU,EAAE,QAAQ;aACrB;SACF,EACD,GAAG,EAAE,KAAK,CAAC,IAAI,EACf,cAAc,EAAE,cAAc,CAAC,KAAK,CAAC,IAAI,CAAC,EAC1C,mBAAmB,EAAE,mBAAmB,CAAC,KAAK,CAAC,IAAI,CAAC,EACpD,SAAS,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,YAAY,CAAC,eAAe,EAAE,KAAK,CAAC,CAAC,EACzE,sBAAsB,EAAE,OAAO,CAAC,sBAAsB,EACtD,gBAAgB,EAAE,EAAE,QAAQ,EAAE,eAAe,EAAE,KAE9C,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CACT,CACd,CAAC,CACI,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useEffect, useRef, useState } from 'react';\nimport { IMessageBarProps, MessageBar, Stack } from '@fluentui/react';\nimport { useLocale } from '../localization';\nimport {\n DismissedError,\n dismissError,\n dropDismissalsForInactiveErrors,\n errorsToShow,\n messageBarIconProps,\n messageBarType\n} from './utils';\n\n/**\n * Props for {@link ErrorBar}.\n *\n * In addition to the following, {@link ErrorBar} forwards all\n * {@link @fluentui/react#IMessageBarProps} to the underlying {@link @fluentui/react#MessageBar}.\n *\n * @public\n */\nexport interface ErrorBarProps extends IMessageBarProps {\n /**\n * Strings shown on the UI on errors.\n */\n strings?: ErrorBarStrings;\n\n /**\n * Currently active errors.\n */\n activeErrorMessages: ActiveErrorMessage[];\n\n /**\n * If set, errors with {@link ActiveErrorMessage.timestamp} older than the time this component is mounted\n * are not shown.\n *\n * This is useful when using the {@link ErrorBar} with a stateful client that handles more than one call\n * or chat thread. Set this prop to ignore errors from previous call or chat.\n *\n * @defaultValue false\n */\n ignorePremountErrors?: boolean;\n}\n\n/**\n * All strings that may be shown on the UI in the {@link ErrorBar}.\n *\n * @public\n */\nexport interface ErrorBarStrings {\n /**\n * Unable to reach Chat service.\n *\n * This can mean:\n * - Incorrect Azure Communication Services endpoint was provided.\n * - User's network connection is down.\n */\n unableToReachChatService: string;\n\n /**\n * User does not have access to the Chat service.\n * This usually means that either the Azure Communication Services endpiont or the token provided are incorrect.\n */\n accessDenied: string;\n\n /**\n * User is no longer on the thread.\n *\n * See also: {@link ErrorBarStrings.sendMessageNotInChatThread} for a more specific error.\n */\n userNotInChatThread: string;\n\n /**\n * Sending message failed because user is no longer on the thread.\n */\n sendMessageNotInChatThread: string;\n\n /**\n * A generic message when sending message fails.\n * Prefer more specific error strings when possible.\n */\n sendMessageGeneric: string;\n\n /**\n * A generic message when starting video fails.\n */\n startVideoGeneric: string;\n\n /**\n * A generic message when starting video fails.\n */\n stopVideoGeneric: string;\n\n /**\n * A generic message when muting microphone fails.\n */\n muteGeneric: string;\n\n /**\n * A generic message when unmuting microphone fails.\n */\n unmuteGeneric: string;\n\n /**\n * A generic message when starting screenshare fails.\n */\n startScreenShareGeneric: string;\n\n /**\n * A generic message when stopping screenshare fails.\n */\n stopScreenShareGeneric: string;\n\n /**\n * Message shown when poor network quality is detected during a call.\n */\n callNetworkQualityLow: string;\n\n /**\n * Message shown on failure to detect audio output devices.\n */\n callNoSpeakerFound: string;\n\n /**\n * Message shown on failure to detect audio input devices.\n */\n callNoMicrophoneFound: string;\n\n /**\n * Message shown when microphone can be enumerated but access is blocked by the system.\n */\n callMicrophoneAccessDenied: string;\n\n /**\n * Message shown when microphone can be enumerated but access is blocked by the system, for safari browsers\n */\n callMicrophoneAccessDeniedSafari: string;\n\n /**\n * Message shown when microphone is muted by the system (not by local or remote participants)\n */\n callMicrophoneMutedBySystem: string;\n\n /**\n * Message shown when microphone is unmuted by the system (not by local or remote participants).\n * This typically occurs if the system recovers from an unexpected mute.\n */\n callMicrophoneUnmutedBySystem: string;\n\n /**\n * Mac OS specific message shown when microphone can be enumerated but access is\n * blocked by the system.\n */\n callMacOsMicrophoneAccessDenied: string;\n\n /**\n * Message shown when poor network causes local video stream to be frozen.\n */\n callLocalVideoFreeze: string;\n\n /**\n * Message shown when camera can be enumerated but access is blocked by the system.\n */\n callCameraAccessDenied: string;\n\n /**\n * Message shown when camera can be enumerated but access is blocked by the system, for safari browsers\n */\n callCameraAccessDeniedSafari: string;\n\n /**\n * Message shown when local video fails to start because camera is already in use by\n * another applciation.\n */\n callCameraAlreadyInUse: string;\n\n /**\n * Message shown when local video is stopped by the system (not by local or remote participants)\n */\n callVideoStoppedBySystem: string;\n\n /**\n * Message shown when local video was recovered by the system (not by the local participant)\n */\n callVideoRecoveredBySystem: string;\n\n /**\n * Mac OS specific message shown when system denies access to camera.\n */\n callMacOsCameraAccessDenied: string;\n\n /**\n * Mac OS specific message shown when system denies sharing local screen on a call.\n */\n callMacOsScreenShareAccessDenied: string;\n /**\n * Dimiss errorbar button aria label read by screen reader accessibility tools\n */\n dismissButtonAriaLabel?: string;\n\n /**\n * An error message when joining a call fails.\n */\n failedToJoinCallGeneric?: string;\n\n /**\n * An error message when joining a call fails specifically due to an invalid meeting link.\n */\n failedToJoinCallInvalidMeetingLink?: string;\n}\n\n/**\n * All errors that can be shown in the {@link ErrorBar}.\n *\n * @public\n */\nexport type ErrorType = keyof ErrorBarStrings;\n\n/**\n * Active error messages to be shown via {@link ErrorBar}.\n *\n * @public\n */\nexport interface ActiveErrorMessage {\n /**\n * Type of error that is active.\n */\n type: ErrorType;\n /**\n * The latest timestamp when this error was observed.\n *\n * When available, this is used to track errors that have already been seen and dismissed\n * by the user.\n */\n timestamp?: Date;\n}\n\n/**\n * A component to show error messages on the UI.\n * All strings that can be shown are accepted as the {@link ErrorBarProps.strings} so that they can be localized.\n * Active errors are selected by {@link ErrorBarProps.activeErrorMessages}.\n *\n * This component internally tracks dismissed by the user.\n * * Errors that have an associated timestamp: The error is shown on the UI again if it occurs after being dismissed.\n * * Errors that do not have a timestamp: The error is dismissed until it disappears from the props.\n * If the error recurs, it is shown in the UI.\n *\n * Uses {@link @fluentui/react#MessageBar} UI element.\n *\n * @public\n */\nexport const ErrorBar = (props: ErrorBarProps): JSX.Element => {\n const localeStrings = useLocale().strings.errorBar;\n const strings = props.strings ?? localeStrings;\n\n // Timestamp for when this comopnent is first mounted.\n // Never updated through the lifecycle of this component.\n const mountTimestamp = useRef(new Date(Date.now()));\n\n const [dismissedErrors, setDismissedErrors] = useState<DismissedError[]>([]);\n\n // dropDismissalsForInactiveErrors only returns a new object if `dismissedErrors` actually changes.\n // Without this behaviour, this `useEffect` block would cause a render loop.\n useEffect(\n () => setDismissedErrors(dropDismissalsForInactiveErrors(props.activeErrorMessages, dismissedErrors)),\n [props.activeErrorMessages, dismissedErrors]\n );\n\n const toShow = errorsToShow(\n props.activeErrorMessages,\n dismissedErrors,\n props.ignorePremountErrors ? mountTimestamp.current : undefined\n );\n\n return (\n <Stack data-ui-id=\"error-bar-stack\">\n {toShow.map((error) => (\n <MessageBar\n {...props}\n styles={{\n innerText: {\n paddingTop: messageBarType(error.type) === 5 ? '0.15rem' : '0.1rem', // to move the inner text of the message bar down to be centered\n lineHeight: 'none'\n },\n icon: {\n height: 0\n },\n content: {\n lineHeight: 'inherit'\n },\n dismissal: {\n height: 0,\n paddingTop: '0.8rem'\n }\n }}\n key={error.type}\n messageBarType={messageBarType(error.type)}\n messageBarIconProps={messageBarIconProps(error.type)}\n onDismiss={() => setDismissedErrors(dismissError(dismissedErrors, error))}\n dismissButtonAriaLabel={strings.dismissButtonAriaLabel}\n dismissIconProps={{ iconName: 'ErrorBarClear' }}\n >\n {strings[error.type]}\n </MessageBar>\n ))}\n </Stack>\n );\n};\n"]}
@@ -109,7 +109,7 @@ const DefaultSystemMessage = (props) => {
109
109
  }
110
110
  return React.createElement(React.Fragment, null);
111
111
  };
112
- const memoizeAllMessages = memoizeFnAll((_messageKey, message, showMessageDate, showMessageStatus, onRenderAvatar, shouldOverlapAvatarAndMessage, styles, onRenderMessageStatus, defaultStatusRenderer, defaultChatMessageRenderer, strings, _attached, statusToRender, participantCount, readCount, onRenderMessage, onUpdateMessage, onDeleteMessage, onSendMessage) => {
112
+ const memoizeAllMessages = memoizeFnAll((_messageKey, message, showMessageDate, showMessageStatus, onRenderAvatar, shouldOverlapAvatarAndMessage, styles, onRenderMessageStatus, defaultStatusRenderer, defaultChatMessageRenderer, strings, _attached, statusToRender, participantCount, readCount, onRenderMessage, onUpdateMessage, onDeleteMessage, onSendMessage, disableEditing) => {
113
113
  var _a, _b, _c, _d, _e, _f, _g;
114
114
  const messageProps = {
115
115
  message,
@@ -117,7 +117,8 @@ const memoizeAllMessages = memoizeFnAll((_messageKey, message, showMessageDate,
117
117
  showDate: showMessageDate,
118
118
  onUpdateMessage,
119
119
  onDeleteMessage,
120
- onSendMessage
120
+ onSendMessage,
121
+ disableEditing
121
122
  };
122
123
  switch (message.messageType) {
123
124
  case 'chat': {
@@ -470,7 +471,7 @@ export const MessageThread = (props) => {
470
471
  return memoizedMessageFn(key !== null && key !== void 0 ? key : 'id_' + index, message, showMessageDate, showMessageStatus, onRenderAvatar, isNarrow, styles, onRenderMessageStatus, defaultStatusRenderer, defaultChatMessageRenderer, strings,
471
472
  // Temporary solution to make sure we re-render if attach attribute is changed.
472
473
  // The proper fix should be in selector.
473
- message.messageType === 'chat' ? message.attached : undefined, statusToRender, participantCount, readCountForHoveredIndicator, onRenderMessage, onUpdateMessage, onDeleteMessage, onSendMessage);
474
+ message.messageType === 'chat' ? message.attached : undefined, statusToRender, participantCount, readCountForHoveredIndicator, onRenderMessage, onUpdateMessage, onDeleteMessage, onSendMessage, props.disableEditing);
474
475
  });
475
476
  }), [
476
477
  messages,
@@ -491,7 +492,8 @@ export const MessageThread = (props) => {
491
492
  onSendMessage,
492
493
  lastSeenChatMessage,
493
494
  lastSendingChatMessage,
494
- lastDeliveredChatMessage
495
+ lastDeliveredChatMessage,
496
+ props.disableEditing
495
497
  ]);
496
498
  const theme = useTheme();
497
499
  const chatBody = useMemo(() => {
@@ -1 +1 @@
1
- {"version":3,"file":"MessageThread.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/MessageThread.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,EACL,IAAI,EAEJ,IAAI,EACJ,GAAG,EAEH,WAAW,IAAI,oBAAoB,EACpC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,aAAa,EACb,8BAA8B,EAC9B,2BAA2B,EAC3B,SAAS,EACT,oBAAoB,EACpB,qBAAqB,EACrB,2BAA2B,EAC3B,oBAAoB,EACpB,+BAA+B,EAC/B,6BAA6B,EAC7B,2BAA2B,EAC3B,gBAAgB,EAChB,sBAAsB,EACtB,4BAA4B,EAC7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,IAAI,EAEJ,WAAW,EACX,OAAO,EACP,WAAW,EACX,aAAa,EACb,KAAK,EAGN,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAatC,OAAO,EAAE,sBAAsB,EAA+B,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EAAE,YAAY,EAAiB,mCAAgC;AACtE,OAAO,EAAE,aAAa,IAAI,sBAAsB,EAA0B,MAAM,iBAAiB,CAAC;AAClG,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAE,iCAAiC,EAAE,MAAM,2CAA2C,CAAC;AAG9F,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC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IAAI,CAAC,6BAA6B,IAAI,CACzD,6BAAK,SAAS,EAAE,WAAW,CAAC,8BAA8B,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,yBAAyB,CAAC,IAC3F,8BAA8B,CAAC,CAAC,CAAC,CAChC,8BAA8B,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,oBAAoB,EAAE,OAAO,EAAE,cAAc,EAAE,CAAC,CAChG,CAAC,CAAC,CAAC,CACF,oBAAC,6BAA6B,IAAC,IAAI,EAAE,OAAO,CAAC,oBAAoB,EAAE,OAAO,EAAE,cAAc,GAAI,CAC/F,CACG,CACP;YAED,oBAAC,GAAG,IAAC,QAAQ,EAAE,gBAAgB,IAAG,QAAQ,CAAO,CAC3C,CACJ,CACP,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,+BAA+B,GAAG,CACtC,KAAyB,EAC4C,EAAE;IACvE,+CAA+C;IAC/C,OAAO,KAAK,CAAC,qBAAqB,CAAC;IACnC,OAAO,SAAS,CAAC;AACnB,CAAC,CAAC;AAEF,MAAM,UAAU,GAAG,CAAC,KAAY,EAAsB,EAAE;IACtD,OAAO;QACL,UAAU,EAAE;YACV,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY;SAClC;QACD,aAAa,EAAE;YACb,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,WAAW;SACjC;QACD,WAAW,EAAE;YACX,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,WAAW;SACjC;QACD,cAAc,EAAE;YACd,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,WAAW;SACjC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport {\n Chat,\n ChatItemProps,\n Flex,\n Ref,\n ShorthandValue,\n mergeStyles as mergeNorthstarThemes\n} from '@fluentui/react-northstar';\nimport {\n DownIconStyle,\n newMessageButtonContainerStyle,\n messageThreadContainerStyle,\n chatStyle,\n buttonWithIconStyles,\n newMessageButtonStyle,\n messageStatusContainerStyle,\n noMessageStatusStyle,\n defaultChatItemMessageContainer,\n defaultMyChatMessageContainer,\n defaultChatMessageContainer,\n gutterWithAvatar,\n gutterWithHiddenAvatar,\n FailedMyChatMessageContainer\n} from './styles/MessageThread.styles';\nimport {\n Icon,\n IStyle,\n mergeStyles,\n Persona,\n PersonaSize,\n PrimaryButton,\n Stack,\n IPersona,\n Theme\n} from '@fluentui/react';\nimport { ComponentSlotStyle } from '@fluentui/react-northstar';\nimport { LiveAnnouncer } from 'react-aria-live';\nimport { delay } from './utils/delay';\nimport {\n BaseCustomStyles,\n ChatMessage,\n CustomMessage,\n SystemMessage,\n CommunicationParticipant,\n OnRenderAvatarCallback,\n ParticipantAddedSystemMessage,\n ParticipantRemovedSystemMessage,\n Message,\n ReadReceiptsBySenderId\n} from '../types';\nimport { MessageStatusIndicator, MessageStatusIndicatorProps } from './MessageStatusIndicator';\nimport { memoizeFnAll, MessageStatus } from '@internal/acs-ui-common';\nimport { SystemMessage as SystemMessageComponent, SystemMessageIconTypes } from './SystemMessage';\nimport { ChatMessageComponent } from './ChatMessage/ChatMessageComponent';\nimport { useLocale } from '../localization/LocalizationProvider';\nimport { isNarrowWidth, _useContainerWidth } from './utils/responsive';\nimport { getParticipantsWhoHaveReadMessage } from './utils/getParticipantsWhoHaveReadMessage';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileDownloadHandler, FileMetadata } from './FileDownloadCards';\nimport { useTheme } from '../theming';\n\nconst isMessageSame = (first: ChatMessage, second: ChatMessage): boolean => {\n return (\n first.messageId === second.messageId &&\n first.content === second.content &&\n first.contentType === second.contentType &&\n JSON.stringify(first.createdOn) === JSON.stringify(second.createdOn) &&\n first.senderId === second.senderId &&\n first.senderDisplayName === second.senderDisplayName &&\n first.status === second.status\n );\n};\n\n/**\n * Get the latest message from the message array.\n *\n * @param messages\n */\nconst getLatestChatMessage = (messages: (ChatMessage | SystemMessage | CustomMessage)[]): ChatMessage | undefined => {\n for (let i = messages.length - 1; i >= 0; i--) {\n const message = messages[i];\n if (message.messageType === 'chat' && !!message.createdOn) {\n return message;\n }\n }\n return undefined;\n};\n\n/**\n * Compare latestMessageFromPreviousMessages & latestMessageFromNewMessages to see if the new message is not from\n * current user.\n */\nconst isThereNewMessageNotFromCurrentUser = (\n userId: string,\n latestMessageFromPreviousMessages?: ChatMessage,\n latestMessageFromNewMessages?: ChatMessage\n): boolean => {\n if (latestMessageFromNewMessages === undefined) {\n return false;\n }\n if (latestMessageFromPreviousMessages === undefined) {\n return latestMessageFromNewMessages.senderId !== userId;\n }\n return (\n !isMessageSame(latestMessageFromNewMessages, latestMessageFromPreviousMessages) &&\n latestMessageFromNewMessages.senderId !== userId\n );\n};\n\n/**\n * Returns true if the current user sent the latest message and false otherwise. It will ignore messages that have no\n * sender, messages that have failed to send, and messages from the current user that is marked as SEEN. This is meant\n * as an indirect way to detect if user is at bottom of the chat when the component updates with new messages. If we\n * updated this component due to current user sending a message we want to then call scrollToBottom.\n */\nconst didUserSendTheLatestMessage = (\n userId: string,\n latestMessageFromPreviousMessages?: ChatMessage,\n latestMessageFromNewMessages?: ChatMessage\n): boolean => {\n if (latestMessageFromNewMessages === undefined) {\n return false;\n }\n if (latestMessageFromPreviousMessages === undefined) {\n return latestMessageFromNewMessages.senderId === userId;\n }\n return (\n !isMessageSame(latestMessageFromNewMessages, latestMessageFromPreviousMessages) &&\n latestMessageFromNewMessages.senderId === userId\n );\n};\n\n/**\n * Fluent styles for {@link MessageThread}.\n *\n * @public\n */\nexport interface MessageThreadStyles extends BaseCustomStyles {\n /** Styles for load previous messages container. */\n loadPreviousMessagesButtonContainer?: IStyle;\n /** Styles for new message container. */\n newMessageButtonContainer?: IStyle;\n /** Styles for chat container. */\n chatContainer?: ComponentSlotStyle;\n /** styles for my chat items. */\n myChatItemMessageContainer?: ComponentSlotStyle;\n /** styles for chat items. */\n chatItemMessageContainer?: ComponentSlotStyle;\n /** Styles for my chat message container. */\n myChatMessageContainer?: ComponentSlotStyle;\n /** Styles for my chat message container in case of failure. */\n failedMyChatMessageContainer?: ComponentSlotStyle;\n /** Styles for chat message container. */\n chatMessageContainer?: ComponentSlotStyle;\n /** Styles for system message container. */\n systemMessageContainer?: ComponentSlotStyle;\n /** Styles for message status indicator container. */\n messageStatusContainer?: (mine: boolean) => IStyle;\n}\n\n/**\n * Strings of {@link MessageThread} that can be overridden.\n *\n * @public\n */\nexport interface MessageThreadStrings {\n /** String for Sunday */\n sunday: string;\n /** String for Monday */\n monday: string;\n /** String for Tuesday */\n tuesday: string;\n /** String for Wednesday */\n wednesday: string;\n /** String for Thursday */\n thursday: string;\n /** String for Friday */\n friday: string;\n /** String for Saturday */\n saturday: string;\n /** String for Yesterday */\n yesterday: string;\n /** String for participants joined */\n participantJoined: string;\n /** String for participants left */\n participantLeft: string;\n /** Tag shown on a message that has been edited */\n editedTag: string;\n /** String for editing message in floating menu */\n editMessage: string;\n /** String for removing message in floating menu */\n removeMessage: string;\n /** String for resending failed message in floating menu */\n resendMessage?: string;\n /** String for indicating failed to send messages */\n failToSendTag?: string;\n /** String for LiveMessage introduction for the Chat Message */\n liveAuthorIntro: string;\n /** String for aria text of remote user's message content */\n messageContentAriaText: string;\n /** String for aria text of local user's message content */\n messageContentMineAriaText: string;\n /** String for warning on text limit exceeded in EditBox*/\n editBoxTextLimit: string;\n /** String for placeholder text in EditBox when there is no user input*/\n editBoxPlaceholderText: string;\n /** String for new messages indicator*/\n newMessagesIndicator: string;\n /** String for showing message read status in floating menu */\n messageReadCount?: string;\n /** String for replacing display name when there is none*/\n noDisplayNameSub: string;\n /** String for Cancel button in EditBox*/\n editBoxCancelButton: string;\n /** String for Submit in EditBox when there is no user input*/\n editBoxSubmitButton: string;\n /** String for action menu indicating there are more options */\n actionMenuMoreOptions?: string;\n /* @conditional-compile-remove(file-sharing) */\n /** String for download file button in file card */\n downloadFile: string;\n}\n\n/**\n * Arguments for {@link MessageThreadProps.onRenderJumpToNewMessageButton}.\n *\n * @public\n */\nexport interface JumpToNewMessageButtonProps {\n /** String for button text */\n text: string;\n /** Callback for when button is clicked */\n onClick: () => void;\n}\n\nconst DefaultJumpToNewMessageButton = (props: JumpToNewMessageButtonProps): JSX.Element => {\n const { text, onClick } = props;\n return (\n <PrimaryButton\n className={newMessageButtonStyle}\n styles={buttonWithIconStyles}\n text={text}\n onClick={onClick}\n onRenderIcon={() => <Icon iconName=\"Down\" className={DownIconStyle} />}\n />\n );\n};\n\nconst generateParticipantsStr = (participants: CommunicationParticipant[], defaultName: string): string =>\n participants\n .map(\n (participant) =>\n `${!participant.displayName || participant.displayName === '' ? defaultName : participant.displayName}`\n )\n .join(', ');\n\n/**\n * A component to render a single message.\n *\n * @public\n */\nexport type MessageRenderer = (props: MessageProps) => JSX.Element;\n\nconst ParticipantSystemMessageComponent = ({\n message,\n style,\n defaultName\n}: {\n message: ParticipantAddedSystemMessage | ParticipantRemovedSystemMessage;\n style?: ComponentSlotStyle;\n defaultName: string;\n}): JSX.Element => {\n const { strings } = useLocale();\n const participantsStr = generateParticipantsStr(message.participants, defaultName);\n const messageSuffix =\n message.systemMessageType === 'participantAdded'\n ? strings.messageThread.participantJoined\n : strings.messageThread.participantLeft;\n\n if (participantsStr !== '') {\n return (\n <SystemMessageComponent\n iconName={(message.iconName ? message.iconName : '') as SystemMessageIconTypes}\n content={`${participantsStr} ${messageSuffix}`}\n containerStyle={style}\n />\n );\n }\n return <></>;\n};\n\nconst DefaultSystemMessage: MessageRenderer = (props: MessageProps) => {\n const message = props.message;\n switch (message.messageType) {\n case 'system':\n switch (message.systemMessageType) {\n case 'content':\n return (\n <SystemMessageComponent\n iconName={(message.iconName ? message.iconName : '') as SystemMessageIconTypes}\n content={message.content ?? ''}\n containerStyle={props?.messageContainerStyle}\n />\n );\n case 'participantAdded':\n case 'participantRemoved':\n return (\n <ParticipantSystemMessageComponent\n message={message}\n style={props.messageContainerStyle}\n defaultName={props.strings.noDisplayNameSub}\n />\n );\n }\n }\n return <></>;\n};\n\nconst memoizeAllMessages = memoizeFnAll(\n (\n _messageKey: string,\n message: Message,\n showMessageDate: boolean,\n showMessageStatus: boolean,\n onRenderAvatar: OnRenderAvatarCallback | undefined,\n shouldOverlapAvatarAndMessage: boolean,\n styles: MessageThreadStyles | undefined,\n onRenderMessageStatus:\n | ((messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null)\n | undefined,\n defaultStatusRenderer: (\n message: ChatMessage,\n status: MessageStatus,\n participantCount: number,\n readCount: number\n ) => JSX.Element,\n defaultChatMessageRenderer: (message: MessageProps) => JSX.Element,\n strings: MessageThreadStrings,\n _attached?: boolean | string,\n statusToRender?: MessageStatus,\n participantCount?: number,\n readCount?: number,\n onRenderMessage?: (message: MessageProps, defaultOnRender?: MessageRenderer) => JSX.Element,\n onUpdateMessage?: UpdateMessageCallback,\n onDeleteMessage?: (messageId: string) => Promise<void>,\n onSendMessage?: (content: string) => Promise<void>\n ): ShorthandValue<ChatItemProps> => {\n const messageProps: MessageProps = {\n message,\n strings,\n showDate: showMessageDate,\n onUpdateMessage,\n onDeleteMessage,\n onSendMessage\n };\n\n switch (message.messageType) {\n case 'chat': {\n const myChatMessageStyle =\n message.status === 'failed'\n ? styles?.failedMyChatMessageContainer ?? styles?.myChatMessageContainer ?? FailedMyChatMessageContainer\n : styles?.myChatMessageContainer ?? defaultMyChatMessageContainer;\n const chatMessageStyle = styles?.chatMessageContainer ?? defaultChatMessageContainer;\n messageProps.messageContainerStyle = message.mine ? myChatMessageStyle : chatMessageStyle;\n\n const chatMessageComponent =\n onRenderMessage === undefined\n ? defaultChatMessageRenderer(messageProps)\n : onRenderMessage(messageProps, defaultChatMessageRenderer);\n\n const personaOptions: IPersona = {\n hidePersonaDetails: true,\n size: PersonaSize.size32,\n text: message.senderDisplayName,\n showOverflowTooltip: false\n };\n\n const chatItemMessageStyle =\n (message.mine ? styles?.myChatItemMessageContainer : styles?.chatItemMessageContainer) ||\n defaultChatItemMessageContainer(shouldOverlapAvatarAndMessage);\n\n const chatGutterStyles =\n message.attached === 'top' || message.attached === false ? gutterWithAvatar : gutterWithHiddenAvatar;\n\n return {\n gutter: {\n styles: chatGutterStyles,\n content: message.mine ? (\n ''\n ) : onRenderAvatar ? (\n onRenderAvatar(message.senderId ?? '', personaOptions)\n ) : (\n <Persona {...personaOptions} />\n )\n },\n contentPosition: message.mine ? 'end' : 'start',\n message: {\n styles: chatItemMessageStyle,\n content: (\n <Flex hAlign={message.mine ? 'end' : undefined} vAlign=\"end\">\n {chatMessageComponent}\n <div\n className={mergeStyles(\n messageStatusContainerStyle(message.mine ?? false),\n styles?.messageStatusContainer ? styles.messageStatusContainer(message.mine ?? false) : ''\n )}\n >\n {showMessageStatus && statusToRender ? (\n onRenderMessageStatus ? (\n onRenderMessageStatus({ status: statusToRender })\n ) : (\n defaultStatusRenderer(message, statusToRender, participantCount ?? 0, readCount ?? 0)\n )\n ) : (\n <div className={mergeStyles(noMessageStatusStyle)} />\n )}\n </div>\n </Flex>\n )\n },\n attached: message.attached,\n key: _messageKey\n };\n }\n\n case 'system': {\n messageProps.messageContainerStyle = styles?.systemMessageContainer;\n const systemMessageComponent =\n onRenderMessage === undefined ? (\n <DefaultSystemMessage {...messageProps} />\n ) : (\n onRenderMessage(messageProps, (props) => <DefaultSystemMessage {...props} />)\n );\n return {\n children: systemMessageComponent,\n key: _messageKey\n };\n }\n\n default: {\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(messageProps);\n return {\n children: customMessageComponent,\n key: _messageKey\n };\n }\n }\n }\n);\n\nconst getLastChatMessageIdWithStatus = (messages: Message[], status: MessageStatus): string | undefined => {\n for (let i = messages.length - 1; i >= 0; i--) {\n const message = messages[i];\n if (message.messageType === 'chat' && message.status === status && message.mine) {\n return message.messageId;\n }\n }\n return undefined;\n};\n\n/**\n * @public\n * Callback function run when a message is updated.\n */\nexport type UpdateMessageCallback = (\n messageId: string,\n content: string,\n /* @conditional-compile-remove(file-sharing) */\n metadata?: Record<string, string>,\n /* @conditional-compile-remove(file-sharing) */\n options?: {\n attachedFilesMetadata?: FileMetadata[];\n }\n) => Promise<void>;\n\n/**\n * Props for {@link MessageThread}.\n *\n * @public\n */\nexport type MessageThreadProps = {\n /**\n * UserId of the current user.\n */\n userId: string;\n /**\n * Messages to render in message thread. A message can be of type `ChatMessage`, `SystemMessage` or `CustomMessage`.\n */\n messages: (ChatMessage | SystemMessage | CustomMessage)[];\n /**\n * number of participants in the thread\n */\n participantCount?: number;\n /**\n * read receipts for each sender in the chat\n */\n readReceiptsBySenderId?: ReadReceiptsBySenderId;\n /**\n * Allows users to pass an object containing custom CSS styles.\n * @Example\n * ```\n * <MessageThread styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: MessageThreadStyles;\n /**\n * Whether the new message button is disabled or not.\n *\n * @defaultValue `false`\n */\n disableJumpToNewMessageButton?: boolean;\n /**\n * Whether the date of each message is displayed or not.\n * It is ignored when onDisplayDateTimeString is supplied.\n *\n * @defaultValue `false`\n */\n showMessageDate?: boolean;\n /**\n * Whether the status indicator for each message is displayed or not.\n *\n * @defaultValue `false`\n */\n showMessageStatus?: boolean;\n /**\n * Number of chat messages to reload each time onLoadPreviousChatMessages is called.\n *\n * @defaultValue 0\n */\n numberOfChatMessagesToReload?: number;\n /**\n * Optional callback to override actions on message being seen.\n *\n * @param messageId - message Id\n */\n onMessageSeen?: (messageId: string) => Promise<void>;\n /**\n * Optional callback to override render of the message status indicator.\n *\n * @param messageStatusIndicatorProps - props of type MessageStatusIndicatorProps\n */\n onRenderMessageStatus?: (messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null;\n /**\n * Optional callback to override render of the avatar.\n *\n * @param userId - user Id\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n /**\n * Optional callback to override render of the button for jumping to the new message.\n *\n * @param newMessageButtonProps - button props of type JumpToNewMessageButtonProps\n */\n onRenderJumpToNewMessageButton?: (newMessageButtonProps: JumpToNewMessageButtonProps) => JSX.Element;\n /**\n * Optional callback to override loading of previous messages.\n * It accepts the number of history chat messages that we want to load and return a boolean Promise indicating if we have got all the history messages.\n * If the promise resolves to `true`, we have load all chat messages into the message thread and `loadPreviousMessagesButton` will not be rendered anymore.\n */\n onLoadPreviousChatMessages?: (messagesToLoad: number) => Promise<boolean>;\n /**\n * Optional callback to override render of a message.\n *\n * @param messageProps - props of type {@link communication-react#MessageProps}\n * @param defaultOnRender - default render of type {@link communication-react#MessageRenderer}\n *\n * @remarks\n * `messageRenderer` is not provided for `CustomMessage` and thus only available for `ChatMessage` and `SystemMessage`.\n */\n onRenderMessage?: (messageProps: MessageProps, messageRenderer?: MessageRenderer) => JSX.Element;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optional callback to render uploaded files in the message component.\n * @beta\n */\n onRenderFileDownloads?: (userId: string, message: ChatMessage) => JSX.Element;\n /**\n * Optional callback to edit a message.\n *\n * @param messageId - message id from chatClient\n * @param content - new content of the message\n *\n */\n onUpdateMessage?: UpdateMessageCallback;\n\n /**\n * Optional callback to delete a message.\n *\n * @param messageId - message id from chatClient\n *\n */\n onDeleteMessage?: (messageId: string) => Promise<void>;\n\n /**\n * Optional callback to send a message.\n *\n * @param messageId - message id from chatClient\n *\n */\n onSendMessage?: (messageId: string) => Promise<void>;\n\n /**\n /**\n * Disable editing messages.\n *\n * @remarks This removes the action menu on messages.\n *\n * @defaultValue `false`\n */\n disableEditing?: boolean;\n\n /**\n * Optional strings to override in component\n */\n strings?: Partial<MessageThreadStrings>;\n\n /* @conditional-compile-remove(file-sharing) */\n /**\n * @beta\n * Optional function called when someone clicks on the file download icon.\n * If file attachments are defined in the `message.metadata` property using the `fileSharingMetadata` key,\n * this function will be called with the data inside `fileSharingMetadata` key.\n */\n fileDownloadHandler?: FileDownloadHandler;\n\n /* @conditional-compile-remove(date-time-customization) */\n /**\n * Optional function to provide customized date format.\n * @beta\n */\n onDisplayDateTimeString?: (messageDate: Date) => string;\n};\n\n/**\n * Props to render a single message.\n *\n * See {@link MessageRenderer}.\n *\n * @public\n */\nexport type MessageProps = {\n /**\n * Message to render. It can type `ChatMessage` or `SystemMessage` or `CustomMessage`.\n */\n message: Message;\n /**\n * Strings from parent MessageThread component\n */\n strings: MessageThreadStrings;\n /**\n * Custom CSS styles for chat message container.\n */\n messageContainerStyle?: ComponentSlotStyle;\n /**\n * Whether the date of a message is displayed or not.\n *\n * @defaultValue `false`\n */\n showDate?: boolean;\n /**\n * Disable editing messages.\n *\n * @remarks This removes the action menu on messages.\n *\n * @defaultValue `false`\n */\n disableEditing?: boolean;\n /**\n * Optional callback to edit a message.\n *\n * @param messageId - message id from chatClient\n * @param content - new content of the message\n */\n onUpdateMessage?: UpdateMessageCallback;\n\n /**\n * Optional callback to delete a message.\n *\n * @param messageId - message id from chatClient\n *\n */\n onDeleteMessage?: (messageId: string) => Promise<void>;\n\n /**\n * Optional callback to send a message.\n *\n * @param messageId - message id from chatClient\n *\n */\n onSendMessage?: (messageId: string) => Promise<void>;\n};\n\n/**\n * `MessageThread` allows you to easily create a component for rendering chat messages, handling scrolling behavior of new/old messages and customizing icons & controls inside the chat thread.\n * @param props - of type MessageThreadProps\n *\n * Users will need to provide at least chat messages and userId to render the `MessageThread` component.\n * Users can also customize `MessageThread` by passing in their own Avatar, `MessageStatusIndicator` icon, `JumpToNewMessageButton`, `LoadPreviousMessagesButton` and the behavior of these controls.\n *\n * `MessageThread` internally uses the `Chat` & `Chat.Message` component from `@fluentui/react-northstar`. You can checkout the details about these [two components](https://fluentsite.z22.web.core.windows.net/0.53.0/components/chat/props).\n *\n * @public\n */\nexport const MessageThread = (props: MessageThreadProps): JSX.Element => {\n const {\n messages: newMessages,\n userId,\n participantCount,\n readReceiptsBySenderId,\n styles,\n disableJumpToNewMessageButton = false,\n showMessageDate = false,\n showMessageStatus = false,\n numberOfChatMessagesToReload = 5,\n onMessageSeen,\n onRenderMessageStatus,\n onRenderAvatar,\n onLoadPreviousChatMessages,\n onRenderJumpToNewMessageButton,\n onRenderMessage,\n onUpdateMessage,\n onDeleteMessage,\n onSendMessage,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString\n } = props;\n\n const onRenderFileDownloads = onRenderFileDownloadsTrampoline(props);\n\n const [messages, setMessages] = useState<(ChatMessage | SystemMessage | CustomMessage)[]>([]);\n // We need this state to wait for one tick and scroll to bottom after messages have been initialized.\n // Otherwise chatScrollDivRef.current.clientHeight is wrong if we scroll to bottom before messages are initialized.\n const [chatMessagesInitialized, setChatMessagesInitialized] = useState<boolean>(false);\n const [isAtBottomOfScroll, setIsAtBottomOfScroll] = useState<boolean>(true);\n const [forceUpdate, setForceUpdate] = useState<number>(0);\n\n // Used to decide if should auto scroll to bottom or show \"new message\" button\n const [latestPreviousChatMessage, setLatestPreviousChatMessage] = useState<ChatMessage | undefined>(undefined);\n const [latestCurrentChatMessage, setLatestCurrentChatMessage] = useState<ChatMessage | undefined>(undefined);\n const [existsNewChatMessage, setExistsNewChatMessage] = useState<boolean>(false);\n\n const [lastSeenChatMessage, setLastSeenChatMessage] = useState<string | undefined>(undefined);\n const [lastDeliveredChatMessage, setLastDeliveredChatMessage] = useState<string | undefined>(undefined);\n const [lastSendingChatMessage, setLastSendingChatMessage] = useState<string | undefined>(undefined);\n\n // readCount and participantCount will only need to be updated on-fly when user hover on an indicator\n const [readCountForHoveredIndicator, setReadCountForHoveredIndicator] = useState<number | undefined>(undefined);\n\n const isAllChatMessagesLoadedRef = useRef(false);\n\n const previousTopRef = useRef<number>(-1);\n const previousHeightRef = useRef<number>(-1);\n\n const messageIdSeenByMeRef = useRef<string>('');\n\n const chatScrollDivRef = useRef<HTMLElement>(null);\n const chatThreadRef = useRef<HTMLElement>(null);\n const isLoadingChatMessagesRef = useRef(false);\n\n // When the chat thread is narrow, we perform space optimizations such as overlapping\n // the avatar on top of the chat message and moving the chat accept/reject edit buttons\n // to a new line\n const chatThreadWidth = _useContainerWidth(chatThreadRef);\n const isNarrow = chatThreadWidth ? isNarrowWidth(chatThreadWidth) : false;\n\n const messagesRef = useRef(messages);\n const setMessagesRef = (messagesWithAttachedValue: (ChatMessage | SystemMessage | CustomMessage)[]): void => {\n messagesRef.current = messagesWithAttachedValue;\n setMessages(messagesWithAttachedValue);\n };\n\n const isAtBottomOfScrollRef = useRef(isAtBottomOfScroll);\n const setIsAtBottomOfScrollRef = (isAtBottomOfScrollValue: boolean): void => {\n isAtBottomOfScrollRef.current = isAtBottomOfScrollValue;\n setIsAtBottomOfScroll(isAtBottomOfScrollValue);\n };\n\n const chatMessagesInitializedRef = useRef(chatMessagesInitialized);\n const setChatMessagesInitializedRef = (chatMessagesInitialized: boolean): void => {\n chatMessagesInitializedRef.current = chatMessagesInitialized;\n setChatMessagesInitialized(chatMessagesInitialized);\n };\n\n // we try to only send those message status if user is scrolled to the bottom.\n const sendMessageStatusIfAtBottom = useCallback(async (): Promise<void> => {\n if (\n !isAtBottomOfScrollRef.current ||\n !document.hasFocus() ||\n !messagesRef.current ||\n messagesRef.current.length === 0 ||\n !showMessageStatus\n ) {\n return;\n }\n const messagesWithId = messagesRef.current.filter((message) => {\n return message.messageType === 'chat' && !message.mine && !!message.messageId;\n });\n if (messagesWithId.length === 0) {\n return;\n }\n const lastMessage: ChatMessage = messagesWithId[messagesWithId.length - 1] as ChatMessage;\n try {\n if (\n onMessageSeen &&\n lastMessage &&\n lastMessage.messageId &&\n lastMessage.messageId !== messageIdSeenByMeRef.current\n ) {\n await onMessageSeen(lastMessage.messageId);\n messageIdSeenByMeRef.current = lastMessage.messageId;\n }\n } catch (e) {\n console.log('onMessageSeen Error', lastMessage, e);\n }\n }, [showMessageStatus, onMessageSeen]);\n\n const scrollToBottom = useCallback((): void => {\n if (chatScrollDivRef.current) {\n chatScrollDivRef.current.scrollTop = chatScrollDivRef.current.scrollHeight;\n }\n setExistsNewChatMessage(false);\n setIsAtBottomOfScrollRef(true);\n sendMessageStatusIfAtBottom();\n }, [sendMessageStatusIfAtBottom]);\n\n const handleScrollToTheBottom = useCallback((): void => {\n if (!chatScrollDivRef.current) {\n return;\n }\n\n const atBottom =\n Math.ceil(chatScrollDivRef.current.scrollTop) >=\n chatScrollDivRef.current.scrollHeight - chatScrollDivRef.current.clientHeight;\n if (atBottom) {\n sendMessageStatusIfAtBottom();\n if (!isAtBottomOfScrollRef.current) {\n scrollToBottom();\n }\n }\n setIsAtBottomOfScrollRef(atBottom);\n }, [scrollToBottom, sendMessageStatusIfAtBottom]);\n\n // Infinite scrolling + threadInitialize function\n const fetchNewMessageWhenAtTop = useCallback(async () => {\n if (!isLoadingChatMessagesRef.current) {\n if (onLoadPreviousChatMessages) {\n isLoadingChatMessagesRef.current = true;\n // Fetch message until scrollTop reach the threshold for fetching new message\n while (\n !isAllChatMessagesLoadedRef.current &&\n chatScrollDivRef.current &&\n chatScrollDivRef.current.scrollTop <= 500\n ) {\n isAllChatMessagesLoadedRef.current = await onLoadPreviousChatMessages(numberOfChatMessagesToReload);\n await delay(200);\n }\n isLoadingChatMessagesRef.current = false;\n }\n }\n }, [numberOfChatMessagesToReload, onLoadPreviousChatMessages]);\n\n // The below 2 of useEffects are design for fixing infinite scrolling problem\n // Scrolling element will behave differently when scrollTop = 0(it sticks at the top)\n // we need to get previousTop before it prepend contents\n // Execute order [newMessage useEffect] => get previousTop => dom update => [messages useEffect]\n useEffect(() => {\n if (!chatScrollDivRef.current) {\n return;\n }\n previousTopRef.current = chatScrollDivRef.current.scrollTop;\n previousHeightRef.current = chatScrollDivRef.current.scrollHeight;\n }, [newMessages]);\n\n useEffect(() => {\n if (!chatScrollDivRef.current) {\n return;\n }\n chatScrollDivRef.current.scrollTop =\n chatScrollDivRef.current.scrollHeight - (previousHeightRef.current - previousTopRef.current);\n }, [messages]);\n\n // Fetch more messages to make the scroll bar appear, infinity scroll is then handled in the handleScroll function.\n useEffect(() => {\n fetchNewMessageWhenAtTop();\n }, [fetchNewMessageWhenAtTop]);\n\n /**\n * One time run useEffects. Sets up listeners when component is mounted and tears down listeners when component\n * unmounts unless these function changed\n */\n useEffect(() => {\n window && window.addEventListener('click', sendMessageStatusIfAtBottom);\n window && window.addEventListener('focus', sendMessageStatusIfAtBottom);\n return () => {\n window && window.removeEventListener('click', sendMessageStatusIfAtBottom);\n window && window.removeEventListener('focus', sendMessageStatusIfAtBottom);\n };\n }, [sendMessageStatusIfAtBottom]);\n\n useEffect(() => {\n const chatScrollDiv = chatScrollDivRef.current;\n chatScrollDiv?.addEventListener('scroll', handleScrollToTheBottom);\n chatScrollDiv?.addEventListener('scroll', fetchNewMessageWhenAtTop);\n\n return () => {\n chatScrollDiv?.removeEventListener('scroll', handleScrollToTheBottom);\n chatScrollDiv?.removeEventListener('scroll', fetchNewMessageWhenAtTop);\n };\n }, [fetchNewMessageWhenAtTop, handleScrollToTheBottom]);\n\n /**\n * ClientHeight controls the number of messages to render. However ClientHeight will not be initialized after the\n * first render (not sure but I guess Fluent is updating it in hook which is after render maybe?) so we need to\n * trigger a re-render until ClientHeight is initialized. This force re-render should only happen once.\n */\n const clientHeight = chatThreadRef.current?.clientHeight;\n useEffect(() => {\n if (clientHeight === undefined) {\n setForceUpdate(forceUpdate + 1);\n return;\n }\n // Only scroll to bottom if isAtBottomOfScrollRef is true\n isAtBottomOfScrollRef.current && scrollToBottom();\n }, [clientHeight, forceUpdate, scrollToBottom, chatMessagesInitialized]);\n\n /**\n * This needs to run to update latestPreviousChatMessage & latestCurrentChatMessage.\n * These two states are used to manipulate scrollbar\n */\n useEffect(() => {\n setLatestPreviousChatMessage(getLatestChatMessage(messagesRef.current));\n setLatestCurrentChatMessage(getLatestChatMessage(newMessages));\n setMessagesRef(newMessages);\n !chatMessagesInitializedRef.current && setChatMessagesInitializedRef(true);\n setLastDeliveredChatMessage(getLastChatMessageIdWithStatus(newMessages, 'delivered'));\n setLastSeenChatMessage(getLastChatMessageIdWithStatus(newMessages, 'seen'));\n setLastSendingChatMessage(getLastChatMessageIdWithStatus(newMessages, 'sending'));\n }, [newMessages]);\n\n /**\n * This needs to run after messages are rendererd so we can manipulate the scroll bar.\n */\n useEffect(() => {\n // If user just sent the latest message then we assume we can move user to bottom of scroll.\n if (\n isThereNewMessageNotFromCurrentUser(userId, latestPreviousChatMessage, latestCurrentChatMessage) &&\n !isAtBottomOfScrollRef.current\n ) {\n setExistsNewChatMessage(true);\n } else if (\n didUserSendTheLatestMessage(userId, latestPreviousChatMessage, latestCurrentChatMessage) ||\n isAtBottomOfScrollRef.current\n ) {\n scrollToBottom();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [messages]);\n\n const participantCountRef = useRef(participantCount);\n const readReceiptsBySenderIdRef = useRef(readReceiptsBySenderId);\n\n participantCountRef.current = participantCount;\n readReceiptsBySenderIdRef.current = readReceiptsBySenderId;\n\n const onActionButtonClickMemo = useCallback(\n (message: ChatMessage, setMessageReadBy: (readBy: { id: string; displayName: string }[]) => void) => {\n if (participantCountRef.current && participantCountRef.current - 1 > 1 && readReceiptsBySenderIdRef.current) {\n setMessageReadBy(getParticipantsWhoHaveReadMessage(message, readReceiptsBySenderIdRef.current));\n }\n },\n []\n );\n\n const localeStrings = useLocale().strings.messageThread;\n const strings = useMemo(() => ({ ...localeStrings, ...props.strings }), [localeStrings, props.strings]);\n // To rerender the defaultChatMessageRenderer if app running across days(every new day chat time stamp need to be regenerated)\n const defaultChatMessageRenderer = useCallback(\n (messageProps: MessageProps) => {\n if (messageProps.message.messageType === 'chat') {\n return (\n <ChatMessageComponent\n {...messageProps}\n onRenderFileDownloads={onRenderFileDownloads}\n /* @conditional-compile-remove(file-sharing) */\n strings={strings}\n message={messageProps.message}\n userId={props.userId}\n remoteParticipantsCount={participantCount ? participantCount - 1 : 0}\n inlineAcceptRejectEditButtons={!isNarrow}\n onRenderAvatar={onRenderAvatar}\n showMessageStatus={showMessageStatus}\n messageStatus={messageProps.message.status}\n onActionButtonClick={onActionButtonClickMemo}\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString={onDisplayDateTimeString}\n />\n );\n }\n return <></>;\n },\n [\n onRenderFileDownloads,\n /* @conditional-compile-remove(file-sharing) */\n strings,\n props.userId,\n participantCount,\n isNarrow,\n onRenderAvatar,\n showMessageStatus,\n onActionButtonClickMemo,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString\n ]\n );\n\n const defaultStatusRenderer = useCallback(\n (message: ChatMessage, status: MessageStatus, participantCount: number, readCount: number) => {\n const onToggleToolTip = (isToggled: boolean): void => {\n if (isToggled && readReceiptsBySenderIdRef.current) {\n setReadCountForHoveredIndicator(\n getParticipantsWhoHaveReadMessage(message, readReceiptsBySenderIdRef.current).length\n );\n } else {\n setReadCountForHoveredIndicator(undefined);\n }\n };\n return (\n <MessageStatusIndicator\n status={status}\n readCount={readCount}\n onToggleToolTip={onToggleToolTip}\n // -1 because participant count does not include myself\n remoteParticipantsCount={participantCount ? participantCount - 1 : 0}\n />\n );\n },\n []\n );\n\n const messagesToDisplay = useMemo(\n () =>\n memoizeAllMessages((memoizedMessageFn) => {\n return messages.map((message: Message, index: number): ShorthandValue<ChatItemProps> => {\n let key: string | undefined = message.messageId;\n let statusToRender: MessageStatus | undefined = undefined;\n\n if (message.messageType === 'chat') {\n if (!message.messageId || message.messageId === '') {\n key = message.clientMessageId;\n }\n if (showMessageStatus && message.mine) {\n switch (message.messageId) {\n case lastSeenChatMessage: {\n statusToRender = 'seen';\n break;\n }\n case lastSendingChatMessage: {\n statusToRender = 'sending';\n break;\n }\n case lastDeliveredChatMessage: {\n statusToRender = 'delivered';\n break;\n }\n }\n }\n if (message.mine && message.status === 'failed') {\n statusToRender = 'failed';\n }\n }\n\n return memoizedMessageFn(\n key ?? 'id_' + index,\n message,\n showMessageDate,\n showMessageStatus,\n onRenderAvatar,\n isNarrow,\n styles,\n onRenderMessageStatus,\n defaultStatusRenderer,\n defaultChatMessageRenderer,\n strings,\n // Temporary solution to make sure we re-render if attach attribute is changed.\n // The proper fix should be in selector.\n message.messageType === 'chat' ? message.attached : undefined,\n statusToRender,\n participantCount,\n readCountForHoveredIndicator,\n onRenderMessage,\n onUpdateMessage,\n onDeleteMessage,\n onSendMessage\n );\n });\n }),\n [\n messages,\n showMessageDate,\n showMessageStatus,\n onRenderAvatar,\n isNarrow,\n styles,\n onRenderMessageStatus,\n defaultStatusRenderer,\n defaultChatMessageRenderer,\n strings,\n participantCount,\n readCountForHoveredIndicator,\n onRenderMessage,\n onUpdateMessage,\n onDeleteMessage,\n onSendMessage,\n lastSeenChatMessage,\n lastSendingChatMessage,\n lastDeliveredChatMessage\n ]\n );\n\n const theme = useTheme();\n\n const chatBody = useMemo(() => {\n return (\n <LiveAnnouncer>\n <Chat\n styles={mergeNorthstarThemes(chatStyle, linkStyles(theme), styles?.chatContainer ?? {})}\n items={messagesToDisplay}\n />\n </LiveAnnouncer>\n );\n }, [theme, styles?.chatContainer, messagesToDisplay]);\n\n return (\n <Ref innerRef={chatThreadRef}>\n <Stack className={mergeStyles(messageThreadContainerStyle, styles?.root)} grow>\n {/* Always ensure New Messages button is above the chat body element in the DOM tree. This is to ensure correct\n tab ordering. Because the New Messages button floats on top of the chat body it is in a higher z-index and\n thus Users should be able to tab navigate to the new messages button _before_ tab focus is taken to the chat body.*/}\n {existsNewChatMessage && !disableJumpToNewMessageButton && (\n <div className={mergeStyles(newMessageButtonContainerStyle, styles?.newMessageButtonContainer)}>\n {onRenderJumpToNewMessageButton ? (\n onRenderJumpToNewMessageButton({ text: strings.newMessagesIndicator, onClick: scrollToBottom })\n ) : (\n <DefaultJumpToNewMessageButton text={strings.newMessagesIndicator} onClick={scrollToBottom} />\n )}\n </div>\n )}\n\n <Ref innerRef={chatScrollDivRef}>{chatBody}</Ref>\n </Stack>\n </Ref>\n );\n};\n\nconst onRenderFileDownloadsTrampoline = (\n props: MessageThreadProps\n): ((userId: string, message: ChatMessage) => JSX.Element) | undefined => {\n /* @conditional-compile-remove(file-sharing) */\n return props.onRenderFileDownloads;\n return undefined;\n};\n\nconst linkStyles = (theme: Theme): ComponentSlotStyle => {\n return {\n '& a:link': {\n color: theme.palette.themePrimary\n },\n '& a:visited': {\n color: theme.palette.themeDarker\n },\n '& a:hover': {\n color: theme.palette.themeDarker\n },\n '& a:selected': {\n color: theme.palette.themeDarker\n }\n };\n};\n\"../../../acs-ui-common/src\""]}
1
+ {"version":3,"file":"MessageThread.js","sourceRoot":"","sources":["../../../../../../react-components/src/components/MessageThread.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,EACL,IAAI,EAEJ,IAAI,EACJ,GAAG,EAEH,WAAW,IAAI,oBAAoB,EACpC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACL,aAAa,EACb,8BAA8B,EAC9B,2BAA2B,EAC3B,SAAS,EACT,oBAAoB,EACpB,qBAAqB,EACrB,2BAA2B,EAC3B,oBAAoB,EACpB,+BAA+B,EAC/B,6BAA6B,EAC7B,2BAA2B,EAC3B,gBAAgB,EAChB,sBAAsB,EACtB,4BAA4B,EAC7B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,IAAI,EAEJ,WAAW,EACX,OAAO,EACP,WAAW,EACX,aAAa,EACb,KAAK,EAGN,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAC;AAatC,OAAO,EAAE,sBAAsB,EAA+B,MAAM,0BAA0B,CAAC;AAC/F,OAAO,EAAE,YAAY,EAAiB,mCAAgC;AACtE,OAAO,EAAE,aAAa,IAAI,sBAAsB,EAA0B,MAAM,iBAAiB,CAAC;AAClG,OAAO,EAAE,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAC1E,OAA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,CAAC,OAAO,CAAC,WAAW;SACjC;KACF,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';\nimport {\n Chat,\n ChatItemProps,\n Flex,\n Ref,\n ShorthandValue,\n mergeStyles as mergeNorthstarThemes\n} from '@fluentui/react-northstar';\nimport {\n DownIconStyle,\n newMessageButtonContainerStyle,\n messageThreadContainerStyle,\n chatStyle,\n buttonWithIconStyles,\n newMessageButtonStyle,\n messageStatusContainerStyle,\n noMessageStatusStyle,\n defaultChatItemMessageContainer,\n defaultMyChatMessageContainer,\n defaultChatMessageContainer,\n gutterWithAvatar,\n gutterWithHiddenAvatar,\n FailedMyChatMessageContainer\n} from './styles/MessageThread.styles';\nimport {\n Icon,\n IStyle,\n mergeStyles,\n Persona,\n PersonaSize,\n PrimaryButton,\n Stack,\n IPersona,\n Theme\n} from '@fluentui/react';\nimport { ComponentSlotStyle } from '@fluentui/react-northstar';\nimport { LiveAnnouncer } from 'react-aria-live';\nimport { delay } from './utils/delay';\nimport {\n BaseCustomStyles,\n ChatMessage,\n CustomMessage,\n SystemMessage,\n CommunicationParticipant,\n OnRenderAvatarCallback,\n ParticipantAddedSystemMessage,\n ParticipantRemovedSystemMessage,\n Message,\n ReadReceiptsBySenderId\n} from '../types';\nimport { MessageStatusIndicator, MessageStatusIndicatorProps } from './MessageStatusIndicator';\nimport { memoizeFnAll, MessageStatus } from '@internal/acs-ui-common';\nimport { SystemMessage as SystemMessageComponent, SystemMessageIconTypes } from './SystemMessage';\nimport { ChatMessageComponent } from './ChatMessage/ChatMessageComponent';\nimport { useLocale } from '../localization/LocalizationProvider';\nimport { isNarrowWidth, _useContainerWidth } from './utils/responsive';\nimport { getParticipantsWhoHaveReadMessage } from './utils/getParticipantsWhoHaveReadMessage';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileDownloadHandler, FileMetadata } from './FileDownloadCards';\nimport { useTheme } from '../theming';\n\nconst isMessageSame = (first: ChatMessage, second: ChatMessage): boolean => {\n return (\n first.messageId === second.messageId &&\n first.content === second.content &&\n first.contentType === second.contentType &&\n JSON.stringify(first.createdOn) === JSON.stringify(second.createdOn) &&\n first.senderId === second.senderId &&\n first.senderDisplayName === second.senderDisplayName &&\n first.status === second.status\n );\n};\n\n/**\n * Get the latest message from the message array.\n *\n * @param messages\n */\nconst getLatestChatMessage = (messages: (ChatMessage | SystemMessage | CustomMessage)[]): ChatMessage | undefined => {\n for (let i = messages.length - 1; i >= 0; i--) {\n const message = messages[i];\n if (message.messageType === 'chat' && !!message.createdOn) {\n return message;\n }\n }\n return undefined;\n};\n\n/**\n * Compare latestMessageFromPreviousMessages & latestMessageFromNewMessages to see if the new message is not from\n * current user.\n */\nconst isThereNewMessageNotFromCurrentUser = (\n userId: string,\n latestMessageFromPreviousMessages?: ChatMessage,\n latestMessageFromNewMessages?: ChatMessage\n): boolean => {\n if (latestMessageFromNewMessages === undefined) {\n return false;\n }\n if (latestMessageFromPreviousMessages === undefined) {\n return latestMessageFromNewMessages.senderId !== userId;\n }\n return (\n !isMessageSame(latestMessageFromNewMessages, latestMessageFromPreviousMessages) &&\n latestMessageFromNewMessages.senderId !== userId\n );\n};\n\n/**\n * Returns true if the current user sent the latest message and false otherwise. It will ignore messages that have no\n * sender, messages that have failed to send, and messages from the current user that is marked as SEEN. This is meant\n * as an indirect way to detect if user is at bottom of the chat when the component updates with new messages. If we\n * updated this component due to current user sending a message we want to then call scrollToBottom.\n */\nconst didUserSendTheLatestMessage = (\n userId: string,\n latestMessageFromPreviousMessages?: ChatMessage,\n latestMessageFromNewMessages?: ChatMessage\n): boolean => {\n if (latestMessageFromNewMessages === undefined) {\n return false;\n }\n if (latestMessageFromPreviousMessages === undefined) {\n return latestMessageFromNewMessages.senderId === userId;\n }\n return (\n !isMessageSame(latestMessageFromNewMessages, latestMessageFromPreviousMessages) &&\n latestMessageFromNewMessages.senderId === userId\n );\n};\n\n/**\n * Fluent styles for {@link MessageThread}.\n *\n * @public\n */\nexport interface MessageThreadStyles extends BaseCustomStyles {\n /** Styles for load previous messages container. */\n loadPreviousMessagesButtonContainer?: IStyle;\n /** Styles for new message container. */\n newMessageButtonContainer?: IStyle;\n /** Styles for chat container. */\n chatContainer?: ComponentSlotStyle;\n /** styles for my chat items. */\n myChatItemMessageContainer?: ComponentSlotStyle;\n /** styles for chat items. */\n chatItemMessageContainer?: ComponentSlotStyle;\n /** Styles for my chat message container. */\n myChatMessageContainer?: ComponentSlotStyle;\n /** Styles for my chat message container in case of failure. */\n failedMyChatMessageContainer?: ComponentSlotStyle;\n /** Styles for chat message container. */\n chatMessageContainer?: ComponentSlotStyle;\n /** Styles for system message container. */\n systemMessageContainer?: ComponentSlotStyle;\n /** Styles for message status indicator container. */\n messageStatusContainer?: (mine: boolean) => IStyle;\n}\n\n/**\n * Strings of {@link MessageThread} that can be overridden.\n *\n * @public\n */\nexport interface MessageThreadStrings {\n /** String for Sunday */\n sunday: string;\n /** String for Monday */\n monday: string;\n /** String for Tuesday */\n tuesday: string;\n /** String for Wednesday */\n wednesday: string;\n /** String for Thursday */\n thursday: string;\n /** String for Friday */\n friday: string;\n /** String for Saturday */\n saturday: string;\n /** String for Yesterday */\n yesterday: string;\n /** String for participants joined */\n participantJoined: string;\n /** String for participants left */\n participantLeft: string;\n /** Tag shown on a message that has been edited */\n editedTag: string;\n /** String for editing message in floating menu */\n editMessage: string;\n /** String for removing message in floating menu */\n removeMessage: string;\n /** String for resending failed message in floating menu */\n resendMessage?: string;\n /** String for indicating failed to send messages */\n failToSendTag?: string;\n /** String for LiveMessage introduction for the Chat Message */\n liveAuthorIntro: string;\n /** String for aria text of remote user's message content */\n messageContentAriaText: string;\n /** String for aria text of local user's message content */\n messageContentMineAriaText: string;\n /** String for warning on text limit exceeded in EditBox*/\n editBoxTextLimit: string;\n /** String for placeholder text in EditBox when there is no user input*/\n editBoxPlaceholderText: string;\n /** String for new messages indicator*/\n newMessagesIndicator: string;\n /** String for showing message read status in floating menu */\n messageReadCount?: string;\n /** String for replacing display name when there is none*/\n noDisplayNameSub: string;\n /** String for Cancel button in EditBox*/\n editBoxCancelButton: string;\n /** String for Submit in EditBox when there is no user input*/\n editBoxSubmitButton: string;\n /** String for action menu indicating there are more options */\n actionMenuMoreOptions?: string;\n /* @conditional-compile-remove(file-sharing) */\n /** String for download file button in file card */\n downloadFile: string;\n}\n\n/**\n * Arguments for {@link MessageThreadProps.onRenderJumpToNewMessageButton}.\n *\n * @public\n */\nexport interface JumpToNewMessageButtonProps {\n /** String for button text */\n text: string;\n /** Callback for when button is clicked */\n onClick: () => void;\n}\n\nconst DefaultJumpToNewMessageButton = (props: JumpToNewMessageButtonProps): JSX.Element => {\n const { text, onClick } = props;\n return (\n <PrimaryButton\n className={newMessageButtonStyle}\n styles={buttonWithIconStyles}\n text={text}\n onClick={onClick}\n onRenderIcon={() => <Icon iconName=\"Down\" className={DownIconStyle} />}\n />\n );\n};\n\nconst generateParticipantsStr = (participants: CommunicationParticipant[], defaultName: string): string =>\n participants\n .map(\n (participant) =>\n `${!participant.displayName || participant.displayName === '' ? defaultName : participant.displayName}`\n )\n .join(', ');\n\n/**\n * A component to render a single message.\n *\n * @public\n */\nexport type MessageRenderer = (props: MessageProps) => JSX.Element;\n\nconst ParticipantSystemMessageComponent = ({\n message,\n style,\n defaultName\n}: {\n message: ParticipantAddedSystemMessage | ParticipantRemovedSystemMessage;\n style?: ComponentSlotStyle;\n defaultName: string;\n}): JSX.Element => {\n const { strings } = useLocale();\n const participantsStr = generateParticipantsStr(message.participants, defaultName);\n const messageSuffix =\n message.systemMessageType === 'participantAdded'\n ? strings.messageThread.participantJoined\n : strings.messageThread.participantLeft;\n\n if (participantsStr !== '') {\n return (\n <SystemMessageComponent\n iconName={(message.iconName ? message.iconName : '') as SystemMessageIconTypes}\n content={`${participantsStr} ${messageSuffix}`}\n containerStyle={style}\n />\n );\n }\n return <></>;\n};\n\nconst DefaultSystemMessage: MessageRenderer = (props: MessageProps) => {\n const message = props.message;\n switch (message.messageType) {\n case 'system':\n switch (message.systemMessageType) {\n case 'content':\n return (\n <SystemMessageComponent\n iconName={(message.iconName ? message.iconName : '') as SystemMessageIconTypes}\n content={message.content ?? ''}\n containerStyle={props?.messageContainerStyle}\n />\n );\n case 'participantAdded':\n case 'participantRemoved':\n return (\n <ParticipantSystemMessageComponent\n message={message}\n style={props.messageContainerStyle}\n defaultName={props.strings.noDisplayNameSub}\n />\n );\n }\n }\n return <></>;\n};\n\nconst memoizeAllMessages = memoizeFnAll(\n (\n _messageKey: string,\n message: Message,\n showMessageDate: boolean,\n showMessageStatus: boolean,\n onRenderAvatar: OnRenderAvatarCallback | undefined,\n shouldOverlapAvatarAndMessage: boolean,\n styles: MessageThreadStyles | undefined,\n onRenderMessageStatus:\n | ((messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null)\n | undefined,\n defaultStatusRenderer: (\n message: ChatMessage,\n status: MessageStatus,\n participantCount: number,\n readCount: number\n ) => JSX.Element,\n defaultChatMessageRenderer: (message: MessageProps) => JSX.Element,\n strings: MessageThreadStrings,\n _attached?: boolean | string,\n statusToRender?: MessageStatus,\n participantCount?: number,\n readCount?: number,\n onRenderMessage?: (message: MessageProps, defaultOnRender?: MessageRenderer) => JSX.Element,\n onUpdateMessage?: UpdateMessageCallback,\n onDeleteMessage?: (messageId: string) => Promise<void>,\n onSendMessage?: (content: string) => Promise<void>,\n disableEditing?: boolean\n ): ShorthandValue<ChatItemProps> => {\n const messageProps: MessageProps = {\n message,\n strings,\n showDate: showMessageDate,\n onUpdateMessage,\n onDeleteMessage,\n onSendMessage,\n disableEditing\n };\n\n switch (message.messageType) {\n case 'chat': {\n const myChatMessageStyle =\n message.status === 'failed'\n ? styles?.failedMyChatMessageContainer ?? styles?.myChatMessageContainer ?? FailedMyChatMessageContainer\n : styles?.myChatMessageContainer ?? defaultMyChatMessageContainer;\n const chatMessageStyle = styles?.chatMessageContainer ?? defaultChatMessageContainer;\n messageProps.messageContainerStyle = message.mine ? myChatMessageStyle : chatMessageStyle;\n\n const chatMessageComponent =\n onRenderMessage === undefined\n ? defaultChatMessageRenderer(messageProps)\n : onRenderMessage(messageProps, defaultChatMessageRenderer);\n\n const personaOptions: IPersona = {\n hidePersonaDetails: true,\n size: PersonaSize.size32,\n text: message.senderDisplayName,\n showOverflowTooltip: false\n };\n\n const chatItemMessageStyle =\n (message.mine ? styles?.myChatItemMessageContainer : styles?.chatItemMessageContainer) ||\n defaultChatItemMessageContainer(shouldOverlapAvatarAndMessage);\n\n const chatGutterStyles =\n message.attached === 'top' || message.attached === false ? gutterWithAvatar : gutterWithHiddenAvatar;\n\n return {\n gutter: {\n styles: chatGutterStyles,\n content: message.mine ? (\n ''\n ) : onRenderAvatar ? (\n onRenderAvatar(message.senderId ?? '', personaOptions)\n ) : (\n <Persona {...personaOptions} />\n )\n },\n contentPosition: message.mine ? 'end' : 'start',\n message: {\n styles: chatItemMessageStyle,\n content: (\n <Flex hAlign={message.mine ? 'end' : undefined} vAlign=\"end\">\n {chatMessageComponent}\n <div\n className={mergeStyles(\n messageStatusContainerStyle(message.mine ?? false),\n styles?.messageStatusContainer ? styles.messageStatusContainer(message.mine ?? false) : ''\n )}\n >\n {showMessageStatus && statusToRender ? (\n onRenderMessageStatus ? (\n onRenderMessageStatus({ status: statusToRender })\n ) : (\n defaultStatusRenderer(message, statusToRender, participantCount ?? 0, readCount ?? 0)\n )\n ) : (\n <div className={mergeStyles(noMessageStatusStyle)} />\n )}\n </div>\n </Flex>\n )\n },\n attached: message.attached,\n key: _messageKey\n };\n }\n\n case 'system': {\n messageProps.messageContainerStyle = styles?.systemMessageContainer;\n const systemMessageComponent =\n onRenderMessage === undefined ? (\n <DefaultSystemMessage {...messageProps} />\n ) : (\n onRenderMessage(messageProps, (props) => <DefaultSystemMessage {...props} />)\n );\n return {\n children: systemMessageComponent,\n key: _messageKey\n };\n }\n\n default: {\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(messageProps);\n return {\n children: customMessageComponent,\n key: _messageKey\n };\n }\n }\n }\n);\n\nconst getLastChatMessageIdWithStatus = (messages: Message[], status: MessageStatus): string | undefined => {\n for (let i = messages.length - 1; i >= 0; i--) {\n const message = messages[i];\n if (message.messageType === 'chat' && message.status === status && message.mine) {\n return message.messageId;\n }\n }\n return undefined;\n};\n\n/**\n * @public\n * Callback function run when a message is updated.\n */\nexport type UpdateMessageCallback = (\n messageId: string,\n content: string,\n /* @conditional-compile-remove(file-sharing) */\n metadata?: Record<string, string>,\n /* @conditional-compile-remove(file-sharing) */\n options?: {\n attachedFilesMetadata?: FileMetadata[];\n }\n) => Promise<void>;\n\n/**\n * Props for {@link MessageThread}.\n *\n * @public\n */\nexport type MessageThreadProps = {\n /**\n * UserId of the current user.\n */\n userId: string;\n /**\n * Messages to render in message thread. A message can be of type `ChatMessage`, `SystemMessage` or `CustomMessage`.\n */\n messages: (ChatMessage | SystemMessage | CustomMessage)[];\n /**\n * number of participants in the thread\n */\n participantCount?: number;\n /**\n * read receipts for each sender in the chat\n */\n readReceiptsBySenderId?: ReadReceiptsBySenderId;\n /**\n * Allows users to pass an object containing custom CSS styles.\n * @Example\n * ```\n * <MessageThread styles={{ root: { background: 'blue' } }} />\n * ```\n */\n styles?: MessageThreadStyles;\n /**\n * Whether the new message button is disabled or not.\n *\n * @defaultValue `false`\n */\n disableJumpToNewMessageButton?: boolean;\n /**\n * Whether the date of each message is displayed or not.\n * It is ignored when onDisplayDateTimeString is supplied.\n *\n * @defaultValue `false`\n */\n showMessageDate?: boolean;\n /**\n * Whether the status indicator for each message is displayed or not.\n *\n * @defaultValue `false`\n */\n showMessageStatus?: boolean;\n /**\n * Number of chat messages to reload each time onLoadPreviousChatMessages is called.\n *\n * @defaultValue 0\n */\n numberOfChatMessagesToReload?: number;\n /**\n * Optional callback to override actions on message being seen.\n *\n * @param messageId - message Id\n */\n onMessageSeen?: (messageId: string) => Promise<void>;\n /**\n * Optional callback to override render of the message status indicator.\n *\n * @param messageStatusIndicatorProps - props of type MessageStatusIndicatorProps\n */\n onRenderMessageStatus?: (messageStatusIndicatorProps: MessageStatusIndicatorProps) => JSX.Element | null;\n /**\n * Optional callback to override render of the avatar.\n *\n * @param userId - user Id\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n /**\n * Optional callback to override render of the button for jumping to the new message.\n *\n * @param newMessageButtonProps - button props of type JumpToNewMessageButtonProps\n */\n onRenderJumpToNewMessageButton?: (newMessageButtonProps: JumpToNewMessageButtonProps) => JSX.Element;\n /**\n * Optional callback to override loading of previous messages.\n * It accepts the number of history chat messages that we want to load and return a boolean Promise indicating if we have got all the history messages.\n * If the promise resolves to `true`, we have load all chat messages into the message thread and `loadPreviousMessagesButton` will not be rendered anymore.\n */\n onLoadPreviousChatMessages?: (messagesToLoad: number) => Promise<boolean>;\n /**\n * Optional callback to override render of a message.\n *\n * @param messageProps - props of type {@link communication-react#MessageProps}\n * @param defaultOnRender - default render of type {@link communication-react#MessageRenderer}\n *\n * @remarks\n * `messageRenderer` is not provided for `CustomMessage` and thus only available for `ChatMessage` and `SystemMessage`.\n */\n onRenderMessage?: (messageProps: MessageProps, messageRenderer?: MessageRenderer) => JSX.Element;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optional callback to render uploaded files in the message component.\n * @beta\n */\n onRenderFileDownloads?: (userId: string, message: ChatMessage) => JSX.Element;\n /**\n * Optional callback to edit a message.\n *\n * @param messageId - message id from chatClient\n * @param content - new content of the message\n *\n */\n onUpdateMessage?: UpdateMessageCallback;\n\n /**\n * Optional callback to delete a message.\n *\n * @param messageId - message id from chatClient\n *\n */\n onDeleteMessage?: (messageId: string) => Promise<void>;\n\n /**\n * Optional callback to send a message.\n *\n * @param messageId - message id from chatClient\n *\n */\n onSendMessage?: (messageId: string) => Promise<void>;\n\n /**\n /**\n * Disable editing messages.\n *\n * @remarks This removes the action menu on messages.\n *\n * @defaultValue `false`\n */\n disableEditing?: boolean;\n\n /**\n * Optional strings to override in component\n */\n strings?: Partial<MessageThreadStrings>;\n\n /* @conditional-compile-remove(file-sharing) */\n /**\n * @beta\n * Optional function called when someone clicks on the file download icon.\n * If file attachments are defined in the `message.metadata` property using the `fileSharingMetadata` key,\n * this function will be called with the data inside `fileSharingMetadata` key.\n */\n fileDownloadHandler?: FileDownloadHandler;\n\n /* @conditional-compile-remove(date-time-customization) */\n /**\n * Optional function to provide customized date format.\n * @beta\n */\n onDisplayDateTimeString?: (messageDate: Date) => string;\n};\n\n/**\n * Props to render a single message.\n *\n * See {@link MessageRenderer}.\n *\n * @public\n */\nexport type MessageProps = {\n /**\n * Message to render. It can type `ChatMessage` or `SystemMessage` or `CustomMessage`.\n */\n message: Message;\n /**\n * Strings from parent MessageThread component\n */\n strings: MessageThreadStrings;\n /**\n * Custom CSS styles for chat message container.\n */\n messageContainerStyle?: ComponentSlotStyle;\n /**\n * Whether the date of a message is displayed or not.\n *\n * @defaultValue `false`\n */\n showDate?: boolean;\n /**\n * Disable editing messages.\n *\n * @remarks This removes the action menu on messages.\n *\n * @defaultValue `false`\n */\n disableEditing?: boolean;\n /**\n * Optional callback to edit a message.\n *\n * @param messageId - message id from chatClient\n * @param content - new content of the message\n */\n onUpdateMessage?: UpdateMessageCallback;\n\n /**\n * Optional callback to delete a message.\n *\n * @param messageId - message id from chatClient\n *\n */\n onDeleteMessage?: (messageId: string) => Promise<void>;\n\n /**\n * Optional callback to send a message.\n *\n * @param messageId - message id from chatClient\n *\n */\n onSendMessage?: (messageId: string) => Promise<void>;\n};\n\n/**\n * `MessageThread` allows you to easily create a component for rendering chat messages, handling scrolling behavior of new/old messages and customizing icons & controls inside the chat thread.\n * @param props - of type MessageThreadProps\n *\n * Users will need to provide at least chat messages and userId to render the `MessageThread` component.\n * Users can also customize `MessageThread` by passing in their own Avatar, `MessageStatusIndicator` icon, `JumpToNewMessageButton`, `LoadPreviousMessagesButton` and the behavior of these controls.\n *\n * `MessageThread` internally uses the `Chat` & `Chat.Message` component from `@fluentui/react-northstar`. You can checkout the details about these [two components](https://fluentsite.z22.web.core.windows.net/0.53.0/components/chat/props).\n *\n * @public\n */\nexport const MessageThread = (props: MessageThreadProps): JSX.Element => {\n const {\n messages: newMessages,\n userId,\n participantCount,\n readReceiptsBySenderId,\n styles,\n disableJumpToNewMessageButton = false,\n showMessageDate = false,\n showMessageStatus = false,\n numberOfChatMessagesToReload = 5,\n onMessageSeen,\n onRenderMessageStatus,\n onRenderAvatar,\n onLoadPreviousChatMessages,\n onRenderJumpToNewMessageButton,\n onRenderMessage,\n onUpdateMessage,\n onDeleteMessage,\n onSendMessage,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString\n } = props;\n const onRenderFileDownloads = onRenderFileDownloadsTrampoline(props);\n\n const [messages, setMessages] = useState<(ChatMessage | SystemMessage | CustomMessage)[]>([]);\n // We need this state to wait for one tick and scroll to bottom after messages have been initialized.\n // Otherwise chatScrollDivRef.current.clientHeight is wrong if we scroll to bottom before messages are initialized.\n const [chatMessagesInitialized, setChatMessagesInitialized] = useState<boolean>(false);\n const [isAtBottomOfScroll, setIsAtBottomOfScroll] = useState<boolean>(true);\n const [forceUpdate, setForceUpdate] = useState<number>(0);\n\n // Used to decide if should auto scroll to bottom or show \"new message\" button\n const [latestPreviousChatMessage, setLatestPreviousChatMessage] = useState<ChatMessage | undefined>(undefined);\n const [latestCurrentChatMessage, setLatestCurrentChatMessage] = useState<ChatMessage | undefined>(undefined);\n const [existsNewChatMessage, setExistsNewChatMessage] = useState<boolean>(false);\n\n const [lastSeenChatMessage, setLastSeenChatMessage] = useState<string | undefined>(undefined);\n const [lastDeliveredChatMessage, setLastDeliveredChatMessage] = useState<string | undefined>(undefined);\n const [lastSendingChatMessage, setLastSendingChatMessage] = useState<string | undefined>(undefined);\n\n // readCount and participantCount will only need to be updated on-fly when user hover on an indicator\n const [readCountForHoveredIndicator, setReadCountForHoveredIndicator] = useState<number | undefined>(undefined);\n\n const isAllChatMessagesLoadedRef = useRef(false);\n\n const previousTopRef = useRef<number>(-1);\n const previousHeightRef = useRef<number>(-1);\n\n const messageIdSeenByMeRef = useRef<string>('');\n\n const chatScrollDivRef = useRef<HTMLElement>(null);\n const chatThreadRef = useRef<HTMLElement>(null);\n const isLoadingChatMessagesRef = useRef(false);\n\n // When the chat thread is narrow, we perform space optimizations such as overlapping\n // the avatar on top of the chat message and moving the chat accept/reject edit buttons\n // to a new line\n const chatThreadWidth = _useContainerWidth(chatThreadRef);\n const isNarrow = chatThreadWidth ? isNarrowWidth(chatThreadWidth) : false;\n\n const messagesRef = useRef(messages);\n const setMessagesRef = (messagesWithAttachedValue: (ChatMessage | SystemMessage | CustomMessage)[]): void => {\n messagesRef.current = messagesWithAttachedValue;\n setMessages(messagesWithAttachedValue);\n };\n\n const isAtBottomOfScrollRef = useRef(isAtBottomOfScroll);\n const setIsAtBottomOfScrollRef = (isAtBottomOfScrollValue: boolean): void => {\n isAtBottomOfScrollRef.current = isAtBottomOfScrollValue;\n setIsAtBottomOfScroll(isAtBottomOfScrollValue);\n };\n\n const chatMessagesInitializedRef = useRef(chatMessagesInitialized);\n const setChatMessagesInitializedRef = (chatMessagesInitialized: boolean): void => {\n chatMessagesInitializedRef.current = chatMessagesInitialized;\n setChatMessagesInitialized(chatMessagesInitialized);\n };\n\n // we try to only send those message status if user is scrolled to the bottom.\n const sendMessageStatusIfAtBottom = useCallback(async (): Promise<void> => {\n if (\n !isAtBottomOfScrollRef.current ||\n !document.hasFocus() ||\n !messagesRef.current ||\n messagesRef.current.length === 0 ||\n !showMessageStatus\n ) {\n return;\n }\n const messagesWithId = messagesRef.current.filter((message) => {\n return message.messageType === 'chat' && !message.mine && !!message.messageId;\n });\n if (messagesWithId.length === 0) {\n return;\n }\n const lastMessage: ChatMessage = messagesWithId[messagesWithId.length - 1] as ChatMessage;\n try {\n if (\n onMessageSeen &&\n lastMessage &&\n lastMessage.messageId &&\n lastMessage.messageId !== messageIdSeenByMeRef.current\n ) {\n await onMessageSeen(lastMessage.messageId);\n messageIdSeenByMeRef.current = lastMessage.messageId;\n }\n } catch (e) {\n console.log('onMessageSeen Error', lastMessage, e);\n }\n }, [showMessageStatus, onMessageSeen]);\n\n const scrollToBottom = useCallback((): void => {\n if (chatScrollDivRef.current) {\n chatScrollDivRef.current.scrollTop = chatScrollDivRef.current.scrollHeight;\n }\n setExistsNewChatMessage(false);\n setIsAtBottomOfScrollRef(true);\n sendMessageStatusIfAtBottom();\n }, [sendMessageStatusIfAtBottom]);\n\n const handleScrollToTheBottom = useCallback((): void => {\n if (!chatScrollDivRef.current) {\n return;\n }\n\n const atBottom =\n Math.ceil(chatScrollDivRef.current.scrollTop) >=\n chatScrollDivRef.current.scrollHeight - chatScrollDivRef.current.clientHeight;\n if (atBottom) {\n sendMessageStatusIfAtBottom();\n if (!isAtBottomOfScrollRef.current) {\n scrollToBottom();\n }\n }\n setIsAtBottomOfScrollRef(atBottom);\n }, [scrollToBottom, sendMessageStatusIfAtBottom]);\n\n // Infinite scrolling + threadInitialize function\n const fetchNewMessageWhenAtTop = useCallback(async () => {\n if (!isLoadingChatMessagesRef.current) {\n if (onLoadPreviousChatMessages) {\n isLoadingChatMessagesRef.current = true;\n // Fetch message until scrollTop reach the threshold for fetching new message\n while (\n !isAllChatMessagesLoadedRef.current &&\n chatScrollDivRef.current &&\n chatScrollDivRef.current.scrollTop <= 500\n ) {\n isAllChatMessagesLoadedRef.current = await onLoadPreviousChatMessages(numberOfChatMessagesToReload);\n await delay(200);\n }\n isLoadingChatMessagesRef.current = false;\n }\n }\n }, [numberOfChatMessagesToReload, onLoadPreviousChatMessages]);\n\n // The below 2 of useEffects are design for fixing infinite scrolling problem\n // Scrolling element will behave differently when scrollTop = 0(it sticks at the top)\n // we need to get previousTop before it prepend contents\n // Execute order [newMessage useEffect] => get previousTop => dom update => [messages useEffect]\n useEffect(() => {\n if (!chatScrollDivRef.current) {\n return;\n }\n previousTopRef.current = chatScrollDivRef.current.scrollTop;\n previousHeightRef.current = chatScrollDivRef.current.scrollHeight;\n }, [newMessages]);\n\n useEffect(() => {\n if (!chatScrollDivRef.current) {\n return;\n }\n chatScrollDivRef.current.scrollTop =\n chatScrollDivRef.current.scrollHeight - (previousHeightRef.current - previousTopRef.current);\n }, [messages]);\n\n // Fetch more messages to make the scroll bar appear, infinity scroll is then handled in the handleScroll function.\n useEffect(() => {\n fetchNewMessageWhenAtTop();\n }, [fetchNewMessageWhenAtTop]);\n\n /**\n * One time run useEffects. Sets up listeners when component is mounted and tears down listeners when component\n * unmounts unless these function changed\n */\n useEffect(() => {\n window && window.addEventListener('click', sendMessageStatusIfAtBottom);\n window && window.addEventListener('focus', sendMessageStatusIfAtBottom);\n return () => {\n window && window.removeEventListener('click', sendMessageStatusIfAtBottom);\n window && window.removeEventListener('focus', sendMessageStatusIfAtBottom);\n };\n }, [sendMessageStatusIfAtBottom]);\n\n useEffect(() => {\n const chatScrollDiv = chatScrollDivRef.current;\n chatScrollDiv?.addEventListener('scroll', handleScrollToTheBottom);\n chatScrollDiv?.addEventListener('scroll', fetchNewMessageWhenAtTop);\n\n return () => {\n chatScrollDiv?.removeEventListener('scroll', handleScrollToTheBottom);\n chatScrollDiv?.removeEventListener('scroll', fetchNewMessageWhenAtTop);\n };\n }, [fetchNewMessageWhenAtTop, handleScrollToTheBottom]);\n\n /**\n * ClientHeight controls the number of messages to render. However ClientHeight will not be initialized after the\n * first render (not sure but I guess Fluent is updating it in hook which is after render maybe?) so we need to\n * trigger a re-render until ClientHeight is initialized. This force re-render should only happen once.\n */\n const clientHeight = chatThreadRef.current?.clientHeight;\n useEffect(() => {\n if (clientHeight === undefined) {\n setForceUpdate(forceUpdate + 1);\n return;\n }\n // Only scroll to bottom if isAtBottomOfScrollRef is true\n isAtBottomOfScrollRef.current && scrollToBottom();\n }, [clientHeight, forceUpdate, scrollToBottom, chatMessagesInitialized]);\n\n /**\n * This needs to run to update latestPreviousChatMessage & latestCurrentChatMessage.\n * These two states are used to manipulate scrollbar\n */\n useEffect(() => {\n setLatestPreviousChatMessage(getLatestChatMessage(messagesRef.current));\n setLatestCurrentChatMessage(getLatestChatMessage(newMessages));\n setMessagesRef(newMessages);\n !chatMessagesInitializedRef.current && setChatMessagesInitializedRef(true);\n setLastDeliveredChatMessage(getLastChatMessageIdWithStatus(newMessages, 'delivered'));\n setLastSeenChatMessage(getLastChatMessageIdWithStatus(newMessages, 'seen'));\n setLastSendingChatMessage(getLastChatMessageIdWithStatus(newMessages, 'sending'));\n }, [newMessages]);\n\n /**\n * This needs to run after messages are rendererd so we can manipulate the scroll bar.\n */\n useEffect(() => {\n // If user just sent the latest message then we assume we can move user to bottom of scroll.\n if (\n isThereNewMessageNotFromCurrentUser(userId, latestPreviousChatMessage, latestCurrentChatMessage) &&\n !isAtBottomOfScrollRef.current\n ) {\n setExistsNewChatMessage(true);\n } else if (\n didUserSendTheLatestMessage(userId, latestPreviousChatMessage, latestCurrentChatMessage) ||\n isAtBottomOfScrollRef.current\n ) {\n scrollToBottom();\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [messages]);\n\n const participantCountRef = useRef(participantCount);\n const readReceiptsBySenderIdRef = useRef(readReceiptsBySenderId);\n\n participantCountRef.current = participantCount;\n readReceiptsBySenderIdRef.current = readReceiptsBySenderId;\n\n const onActionButtonClickMemo = useCallback(\n (message: ChatMessage, setMessageReadBy: (readBy: { id: string; displayName: string }[]) => void) => {\n if (participantCountRef.current && participantCountRef.current - 1 > 1 && readReceiptsBySenderIdRef.current) {\n setMessageReadBy(getParticipantsWhoHaveReadMessage(message, readReceiptsBySenderIdRef.current));\n }\n },\n []\n );\n\n const localeStrings = useLocale().strings.messageThread;\n const strings = useMemo(() => ({ ...localeStrings, ...props.strings }), [localeStrings, props.strings]);\n // To rerender the defaultChatMessageRenderer if app running across days(every new day chat time stamp need to be regenerated)\n const defaultChatMessageRenderer = useCallback(\n (messageProps: MessageProps) => {\n if (messageProps.message.messageType === 'chat') {\n return (\n <ChatMessageComponent\n {...messageProps}\n onRenderFileDownloads={onRenderFileDownloads}\n /* @conditional-compile-remove(file-sharing) */\n strings={strings}\n message={messageProps.message}\n userId={props.userId}\n remoteParticipantsCount={participantCount ? participantCount - 1 : 0}\n inlineAcceptRejectEditButtons={!isNarrow}\n onRenderAvatar={onRenderAvatar}\n showMessageStatus={showMessageStatus}\n messageStatus={messageProps.message.status}\n onActionButtonClick={onActionButtonClickMemo}\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString={onDisplayDateTimeString}\n />\n );\n }\n return <></>;\n },\n [\n onRenderFileDownloads,\n /* @conditional-compile-remove(file-sharing) */\n strings,\n props.userId,\n participantCount,\n isNarrow,\n onRenderAvatar,\n showMessageStatus,\n onActionButtonClickMemo,\n /* @conditional-compile-remove(date-time-customization) */\n onDisplayDateTimeString\n ]\n );\n\n const defaultStatusRenderer = useCallback(\n (message: ChatMessage, status: MessageStatus, participantCount: number, readCount: number) => {\n const onToggleToolTip = (isToggled: boolean): void => {\n if (isToggled && readReceiptsBySenderIdRef.current) {\n setReadCountForHoveredIndicator(\n getParticipantsWhoHaveReadMessage(message, readReceiptsBySenderIdRef.current).length\n );\n } else {\n setReadCountForHoveredIndicator(undefined);\n }\n };\n return (\n <MessageStatusIndicator\n status={status}\n readCount={readCount}\n onToggleToolTip={onToggleToolTip}\n // -1 because participant count does not include myself\n remoteParticipantsCount={participantCount ? participantCount - 1 : 0}\n />\n );\n },\n []\n );\n\n const messagesToDisplay = useMemo(\n () =>\n memoizeAllMessages((memoizedMessageFn) => {\n return messages.map((message: Message, index: number): ShorthandValue<ChatItemProps> => {\n let key: string | undefined = message.messageId;\n let statusToRender: MessageStatus | undefined = undefined;\n\n if (message.messageType === 'chat') {\n if (!message.messageId || message.messageId === '') {\n key = message.clientMessageId;\n }\n if (showMessageStatus && message.mine) {\n switch (message.messageId) {\n case lastSeenChatMessage: {\n statusToRender = 'seen';\n break;\n }\n case lastSendingChatMessage: {\n statusToRender = 'sending';\n break;\n }\n case lastDeliveredChatMessage: {\n statusToRender = 'delivered';\n break;\n }\n }\n }\n if (message.mine && message.status === 'failed') {\n statusToRender = 'failed';\n }\n }\n\n return memoizedMessageFn(\n key ?? 'id_' + index,\n message,\n showMessageDate,\n showMessageStatus,\n onRenderAvatar,\n isNarrow,\n styles,\n onRenderMessageStatus,\n defaultStatusRenderer,\n defaultChatMessageRenderer,\n strings,\n // Temporary solution to make sure we re-render if attach attribute is changed.\n // The proper fix should be in selector.\n message.messageType === 'chat' ? message.attached : undefined,\n statusToRender,\n participantCount,\n readCountForHoveredIndicator,\n onRenderMessage,\n onUpdateMessage,\n onDeleteMessage,\n onSendMessage,\n props.disableEditing\n );\n });\n }),\n [\n messages,\n showMessageDate,\n showMessageStatus,\n onRenderAvatar,\n isNarrow,\n styles,\n onRenderMessageStatus,\n defaultStatusRenderer,\n defaultChatMessageRenderer,\n strings,\n participantCount,\n readCountForHoveredIndicator,\n onRenderMessage,\n onUpdateMessage,\n onDeleteMessage,\n onSendMessage,\n lastSeenChatMessage,\n lastSendingChatMessage,\n lastDeliveredChatMessage,\n props.disableEditing\n ]\n );\n\n const theme = useTheme();\n\n const chatBody = useMemo(() => {\n return (\n <LiveAnnouncer>\n <Chat\n styles={mergeNorthstarThemes(chatStyle, linkStyles(theme), styles?.chatContainer ?? {})}\n items={messagesToDisplay}\n />\n </LiveAnnouncer>\n );\n }, [theme, styles?.chatContainer, messagesToDisplay]);\n\n return (\n <Ref innerRef={chatThreadRef}>\n <Stack className={mergeStyles(messageThreadContainerStyle, styles?.root)} grow>\n {/* Always ensure New Messages button is above the chat body element in the DOM tree. This is to ensure correct\n tab ordering. Because the New Messages button floats on top of the chat body it is in a higher z-index and\n thus Users should be able to tab navigate to the new messages button _before_ tab focus is taken to the chat body.*/}\n {existsNewChatMessage && !disableJumpToNewMessageButton && (\n <div className={mergeStyles(newMessageButtonContainerStyle, styles?.newMessageButtonContainer)}>\n {onRenderJumpToNewMessageButton ? (\n onRenderJumpToNewMessageButton({ text: strings.newMessagesIndicator, onClick: scrollToBottom })\n ) : (\n <DefaultJumpToNewMessageButton text={strings.newMessagesIndicator} onClick={scrollToBottom} />\n )}\n </div>\n )}\n\n <Ref innerRef={chatScrollDivRef}>{chatBody}</Ref>\n </Stack>\n </Ref>\n );\n};\n\nconst onRenderFileDownloadsTrampoline = (\n props: MessageThreadProps\n): ((userId: string, message: ChatMessage) => JSX.Element) | undefined => {\n /* @conditional-compile-remove(file-sharing) */\n return props.onRenderFileDownloads;\n return undefined;\n};\n\nconst linkStyles = (theme: Theme): ComponentSlotStyle => {\n return {\n '& a:link': {\n color: theme.palette.themePrimary\n },\n '& a:visited': {\n color: theme.palette.themeDarker\n },\n '& a:hover': {\n color: theme.palette.themeDarker\n },\n '& a:selected': {\n color: theme.palette.themeDarker\n }\n };\n};\n\"../../../acs-ui-common/src\""]}
@@ -35,8 +35,6 @@ export interface ParticipantItemStrings {
35
35
  mutedIconLabel: string;
36
36
  /** placeholder text for participants who does not have a display name*/
37
37
  displayNamePlaceholder?: string;
38
- /** String shown when `participantState` is `Connecting` */
39
- participantStateConnecting?: string;
40
38
  /** String shown when `participantState` is `Ringing` */
41
39
  participantStateRinging?: string;
42
40
  /** String shown when `participantState` is `Hold` */