@azure/communication-react 1.18.0-alpha-202406150014 → 1.18.0-alpha-202406191739

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 (170) hide show
  1. package/dist/communication-react.d.ts +54 -28
  2. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-XMNUmuTx.js → ChatMessageComponentAsRichTextEditBox-HBSSHZ2s.js} +2 -2
  3. package/dist/dist-cjs/communication-react/{ChatMessageComponentAsRichTextEditBox-XMNUmuTx.js.map → ChatMessageComponentAsRichTextEditBox-HBSSHZ2s.js.map} +1 -1
  4. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BLmR8ku0.js → RichTextSendBoxWrapper-DDN8Weyb.js} +2 -2
  5. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BLmR8ku0.js.map → RichTextSendBoxWrapper-DDN8Weyb.js.map} +1 -1
  6. package/dist/dist-cjs/communication-react/{index-CzkriUUT.js → index-CAm6Qb1t.js} +638 -197
  7. package/dist/dist-cjs/communication-react/index-CAm6Qb1t.js.map +1 -0
  8. package/dist/dist-cjs/communication-react/index.js +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/errorNotificationsSelector.d.ts +22 -0
  12. package/dist/dist-esm/calling-component-bindings/src/errorNotificationsSelector.js +146 -0
  13. package/dist/dist-esm/calling-component-bindings/src/errorNotificationsSelector.js.map +1 -0
  14. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +1 -0
  15. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +7 -1
  16. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  17. package/dist/dist-esm/calling-component-bindings/src/index.d.ts +2 -0
  18. package/dist/dist-esm/calling-component-bindings/src/index.js +2 -0
  19. package/dist/dist-esm/calling-component-bindings/src/index.js.map +1 -1
  20. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js +2 -1
  21. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
  22. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCard.js +5 -4
  23. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCard.js.map +1 -1
  24. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCardGroup.d.ts +1 -0
  25. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCardGroup.js +3 -3
  26. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentCardGroup.js.map +1 -1
  27. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js +1 -10
  28. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentDownloadCards.js.map +1 -1
  29. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentUploadCards.d.ts +4 -0
  30. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentUploadCards.js +18 -21
  31. package/dist/dist-esm/react-components/src/components/Attachment/AttachmentUploadCards.js.map +1 -1
  32. package/dist/dist-esm/react-components/src/components/ErrorBar.js +1 -1
  33. package/dist/dist-esm/react-components/src/components/ErrorBar.js.map +1 -1
  34. package/dist/dist-esm/react-components/src/components/Notifications.d.ts +23 -28
  35. package/dist/dist-esm/react-components/src/components/Notifications.js +17 -7
  36. package/dist/dist-esm/react-components/src/components/Notifications.js.map +1 -1
  37. package/dist/dist-esm/react-components/src/components/ParticipantList.js +3 -2
  38. package/dist/dist-esm/react-components/src/components/ParticipantList.js.map +1 -1
  39. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.d.ts +2 -2
  40. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js +1 -1
  41. package/dist/dist-esm/react-components/src/components/RichTextEditor/Plugins/PlaceholderPlugin.js.map +1 -1
  42. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +16 -29
  43. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
  44. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +10 -4
  45. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
  46. package/dist/dist-esm/react-components/src/components/SendBox.js +9 -3
  47. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  48. package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.js +1 -1
  49. package/dist/dist-esm/react-components/src/components/TroubleshootingGuideErrorBar.js.map +1 -1
  50. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js +1 -1
  51. package/dist/dist-esm/react-components/src/components/VideoEffects/VideoBackgroundEffectsPicker.js.map +1 -1
  52. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.d.ts +1 -0
  53. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js +3 -3
  54. package/dist/dist-esm/react-components/src/components/VideoGallery/useVideoTileContextualMenuProps.js.map +1 -1
  55. package/dist/dist-esm/react-components/src/components/VideoGallery.d.ts +2 -0
  56. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  57. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.d.ts +1 -1
  58. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.js +10 -0
  59. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.js.map +1 -1
  60. package/dist/dist-esm/react-components/src/components/styles/AttachmentCardGroup.styles.d.ts +4 -0
  61. package/dist/dist-esm/react-components/src/components/styles/AttachmentCardGroup.styles.js +8 -0
  62. package/dist/dist-esm/react-components/src/components/styles/AttachmentCardGroup.styles.js.map +1 -1
  63. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +1 -1
  64. package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
  65. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +24 -13
  66. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +1 -1
  67. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.d.ts +4 -0
  68. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js +9 -0
  69. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js.map +1 -1
  70. package/dist/dist-esm/react-components/src/components/utils.d.ts +32 -1
  71. package/dist/dist-esm/react-components/src/components/utils.js +84 -0
  72. package/dist/dist-esm/react-components/src/components/utils.js.map +1 -1
  73. package/dist/dist-esm/react-components/src/localization/locales/ar-SA/strings.json +170 -3
  74. package/dist/dist-esm/react-components/src/localization/locales/cs-CZ/strings.json +168 -1
  75. package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +170 -3
  76. package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +168 -1
  77. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +2 -23
  78. package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +170 -3
  79. package/dist/dist-esm/react-components/src/localization/locales/fi-FI/strings.json +168 -1
  80. package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +170 -3
  81. package/dist/dist-esm/react-components/src/localization/locales/he-IL/strings.json +168 -1
  82. package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +170 -3
  83. package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +168 -1
  84. package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +168 -1
  85. package/dist/dist-esm/react-components/src/localization/locales/nb-NO/strings.json +168 -1
  86. package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +168 -1
  87. package/dist/dist-esm/react-components/src/localization/locales/pl-PL/strings.json +168 -1
  88. package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +170 -3
  89. package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +168 -1
  90. package/dist/dist-esm/react-components/src/localization/locales/sv-SE/strings.json +170 -3
  91. package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +170 -3
  92. package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +170 -3
  93. package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +170 -3
  94. package/dist/dist-esm/react-components/src/theming/FluentV9ThemeProvider.d.ts +1 -0
  95. package/dist/dist-esm/react-components/src/theming/FluentV9ThemeProvider.js +4 -4
  96. package/dist/dist-esm/react-components/src/theming/FluentV9ThemeProvider.js.map +1 -1
  97. package/dist/dist-esm/react-components/src/theming/themes.js +13 -12
  98. package/dist/dist-esm/react-components/src/theming/themes.js.map +1 -1
  99. package/dist/dist-esm/react-components/src/theming/v9ThemeShim.js +1 -1
  100. package/dist/dist-esm/react-components/src/theming/v9ThemeShim.js.map +1 -1
  101. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +24 -5
  102. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  103. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +20 -0
  104. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  105. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +1 -0
  106. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +8 -0
  107. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  108. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +4 -0
  109. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  110. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.d.ts +4 -2
  111. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +33 -5
  112. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  113. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.d.ts +1 -1
  114. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +68 -4
  115. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -1
  116. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.d.ts +3 -2
  117. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js +1 -1
  118. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js.map +1 -1
  119. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +4 -0
  120. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  121. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.d.ts +3 -2
  122. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +5 -3
  123. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  124. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js +4 -2
  125. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js.map +1 -1
  126. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js +4 -2
  127. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js.map +1 -1
  128. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js +4 -2
  129. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/TransferPage.js.map +1 -1
  130. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +1 -0
  131. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +6 -0
  132. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  133. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +4 -0
  134. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  135. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +1 -0
  136. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +6 -0
  137. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  138. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +26 -6
  139. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  140. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js +5 -4
  141. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.js.map +1 -1
  142. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.d.ts +1 -0
  143. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
  144. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.d.ts +3 -2
  145. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +40 -2
  146. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  147. package/dist/dist-esm/react-composites/src/composites/localization/locales/ar-SA/strings.json +7 -1
  148. package/dist/dist-esm/react-composites/src/composites/localization/locales/cs-CZ/strings.json +7 -1
  149. package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +7 -1
  150. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +7 -1
  151. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +6 -1
  152. package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +7 -1
  153. package/dist/dist-esm/react-composites/src/composites/localization/locales/fi-FI/strings.json +7 -1
  154. package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +7 -1
  155. package/dist/dist-esm/react-composites/src/composites/localization/locales/he-IL/strings.json +7 -1
  156. package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +7 -1
  157. package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +7 -1
  158. package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +7 -1
  159. package/dist/dist-esm/react-composites/src/composites/localization/locales/nb-NO/strings.json +7 -1
  160. package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +7 -1
  161. package/dist/dist-esm/react-composites/src/composites/localization/locales/pl-PL/strings.json +7 -1
  162. package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +7 -1
  163. package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +7 -1
  164. package/dist/dist-esm/react-composites/src/composites/localization/locales/sv-SE/strings.json +7 -1
  165. package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +7 -1
  166. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +7 -1
  167. package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +7 -1
  168. package/dist/tsdoc-metadata.json +1 -1
  169. package/package.json +10 -10
  170. package/dist/dist-cjs/communication-react/index-CzkriUUT.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"CallWithChatAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/adjacent-overload-signatures */\n\nimport {\n CallIdChangedListener,\n DisplayNameChangedListener,\n IsMutedChangedListener,\n IsLocalScreenSharingActiveChangedListener,\n IsSpeakingChangedListener,\n ParticipantsJoinedListener,\n ParticipantsLeftListener,\n CallEndedListener\n} from '../../CallComposite';\nimport {\n MessageDeletedListener,\n MessageEditedListener,\n MessageReadListener,\n MessageReceivedListener,\n MessageSentListener,\n ParticipantsAddedListener,\n ParticipantsRemovedListener\n} from '../../ChatComposite';\nimport { ResourceDetails } from '../../ChatComposite';\nimport { CallWithChatAdapterState } from '../state/CallWithChatAdapterState';\nimport type { AdapterError, AdapterState, Disposable } from '../../common/adapters';\nimport {\n AudioDeviceInfo,\n Call,\n PermissionConstraints,\n PropertyChangedEvent,\n StartCallOptions,\n VideoDeviceInfo\n} from '@azure/communication-calling';\nimport { Reaction } from '@azure/communication-calling';\nimport { StartCaptionsOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { DtmfTone } from '@azure/communication-calling';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\nimport { SendMessageOptions } from '@azure/communication-chat';\nimport { JoinCallOptions } from '../../CallComposite/adapter/CallAdapter';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { PhoneNumberIdentifier } from '@azure/communication-common';\nimport { UnknownIdentifier, MicrosoftTeamsAppIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { CommunicationUserIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(teams-adhoc-call) */\nimport { MicrosoftTeamsUserIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { CommunicationIdentifier } from '@azure/communication-common';\nimport {\n CaptionsReceivedListener,\n IsCaptionsActiveChangedListener,\n IsCaptionLanguageChangedListener,\n IsSpokenLanguageChangedListener\n} from '../../CallComposite/adapter/CallAdapter';\n\nimport { CapabilitiesChangedListener } from '../../CallComposite/adapter/CallAdapter';\nimport { SpotlightChangedListener } from '../../CallComposite/adapter/CallAdapter';\n\nimport { VideoBackgroundImage, VideoBackgroundEffect } from '../../CallComposite';\n\nimport { CallSurvey, CallSurveyResponse } from '@azure/communication-calling';\n\n/**\n * Functionality for managing the current call with chat.\n * @public\n */\nexport interface CallWithChatAdapterManagement {\n // CallWithChat-specific Interface methods\n /**\n * Remove a participant from a Call.\n *\n * @param userId - UserId of the participant to remove.\n *\n * @public\n */\n removeParticipant(userId: string): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Remove a participant from the call.\n * @param participant - {@link @azure/communication-common#CommunicationIdentifier} of the participant to be removed\n * @beta\n */\n removeParticipant(participant: CommunicationIdentifier): Promise<void>;\n\n // Call Interface Methods\n /**\n * Join the call with microphone initially on/off.\n * @deprecated Use joinCall(options?:JoinCallOptions) instead.\n * @param microphoneOn - Whether microphone is initially enabled\n *\n * @public\n */\n joinCall(microphoneOn?: boolean): Call | undefined;\n /**\n * Join the call with options bag to set microphone/camera initial state when joining call\n * true = turn on the device when joining call\n * false = turn off the device when joining call\n * 'keep'/undefined = retain devices' precall state\n *\n * @param options - param to set microphone/camera initially on/off/use precall state.\n *\n * @public\n */\n joinCall(options?: JoinCallOptions): Call | undefined;\n /**\n * Leave the call.\n *\n * @param forEveryone - Whether to remove all participants when leaving\n *\n * @public\n */\n leaveCall(forEveryone?: boolean): Promise<void>;\n /**\n * Start the camera.\n *\n * This method will start rendering a local camera view when the call is not active.\n *\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n startCamera(options?: VideoStreamOptions): Promise<void>;\n /**\n * Stop the camera.\n *\n * This method will stop rendering a local camera view when the call is not active.\n *\n * @public\n */\n stopCamera(): Promise<void>;\n /**\n * Mute the current user during the call or disable microphone locally.\n *\n * @public\n */\n mute(): Promise<void>;\n /**\n * Unmute the current user during the call or enable microphone locally.\n *\n * @public\n */\n unmute(): Promise<void>;\n /**\n * Start the call.\n *\n * @param participants - An array of participant ids to join\n *\n * @public\n */\n startCall(participants: string[], options?: StartCallOptions): Call | undefined;\n /**\n * Start the call.\n * @param participants - An array of {@link @azure/communication-common#CommunicationIdentifier} to be called\n * @public\n */\n startCall(\n participants: (\n | MicrosoftTeamsAppIdentifier\n | /* @conditional-compile-remove(PSTN-calls) */ PhoneNumberIdentifier\n | /* @conditional-compile-remove(one-to-n-calling) */ CommunicationUserIdentifier\n | /* @conditional-compile-remove(teams-adhoc-call) */ MicrosoftTeamsUserIdentifier\n | UnknownIdentifier\n )[],\n options?: StartCallOptions\n ): Call | undefined;\n /**\n * Start sharing the screen during a call.\n *\n * @public\n */\n startScreenShare(): Promise<void>;\n /**\n * Stop sharing the screen.\n *\n * @public\n */\n stopScreenShare(): Promise<void>;\n /**\n * Raise hand for local user.\n *\n * @public\n */\n raiseHand(): Promise<void>;\n /**\n * Lower hand for local user.\n *\n * @public\n */\n lowerHand(): Promise<void>;\n /**\n * Send Reaction to ongoing meeting.\n * @param reaction - A value of type {@link @azure/communication-calling#Reaction}\n *\n * @public\n */\n onReactionClick(reaction: Reaction): Promise<void>;\n /**\n * Create the html view for a stream.\n *\n * @remarks\n * This method is implemented for composite.\n *\n * @param remoteUserId - Id of the participant to render, leave it undefined to create the local camera view\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n createStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void | CreateVideoStreamViewResult>;\n /**\n * Dispose the html view for a stream.\n *\n * @remarks\n * This method is implemented for composite.\n *\n * @param remoteUserId - Id of the participant to render, leave it undefined to dispose the local camera view\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n disposeStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void>;\n /**\n * Dispose the html view for a screen share stream\n *\n * @remarks\n * this method is implemented for composite\n *\n * @param remoteUserId - Id of the participant to dispose the screen share stream view for.\n *\n * @public\n */\n disposeScreenShareStreamView(remoteUserId: string): Promise<void>;\n /**\n * Dispose the html view for a remote video stream\n *\n * @param remoteUserId - Id of the participant to dispose\n *\n * @public\n */\n disposeRemoteVideoStreamView(remoteUserId: string): Promise<void>;\n /**\n * Dispose the html view for a local video stream\n *\n * @public\n */\n disposeLocalVideoStreamView(): Promise<void>;\n /**\n * Ask for permissions of devices.\n *\n * @remarks\n * Browser permission window will pop up if permissions are not granted yet.\n *\n * @param constrain - Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }\n *\n * @public\n */\n askDevicePermission(constrain: PermissionConstraints): Promise<void>;\n /**\n * Query for available camera devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of video device information entities {@link @azure/communication-calling#VideoDeviceInfo }\n *\n * @public\n */\n queryCameras(): Promise<VideoDeviceInfo[]>;\n /**\n * Query for available microphone devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of audio device information entities {@link @azure/communication-calling#AudioDeviceInfo }\n *\n * @public\n */\n queryMicrophones(): Promise<AudioDeviceInfo[]>;\n /**\n * Query for available microphone devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of audio device information entities {@link @azure/communication-calling#AudioDeviceInfo }\n *\n * @public\n */\n querySpeakers(): Promise<AudioDeviceInfo[]>;\n /**\n * Set the camera to use in the call.\n *\n * @param sourceInfo - Camera device to choose, pick one returned by {@link CallAdapterDeviceManagement#queryCameras }\n * @param options - Options to control how the camera stream is rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n setCamera(sourceInfo: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void>;\n /**\n * Set the microphone to use in the call.\n *\n * @param sourceInfo - Microphone device to choose, pick one returned by {@link CallAdapterDeviceManagement#queryMicrophones }\n *\n * @public\n */\n setMicrophone(sourceInfo: AudioDeviceInfo): Promise<void>;\n /**\n * Set the speaker to use in the call.\n *\n * @param sourceInfo - Speaker device to choose, pick one returned by {@link CallAdapterDeviceManagement#querySpeakers }\n *\n * @public\n */\n setSpeaker(sourceInfo: AudioDeviceInfo): Promise<void>;\n\n // Chat Interface Methods\n /**\n * Fetch initial state for the Chat adapter.\n *\n * Performs the minimal fetch necessary for ChatComposite and API methods.\n *\n * @public\n */\n fetchInitialData(): Promise<void>;\n /**\n * Send a message in the thread.\n *\n * @public\n */\n sendMessage(\n content: string,\n options?: SendMessageOptions | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions\n ): Promise<void>;\n /**\n * Send a read receipt for a message.\n *\n * @public\n */\n sendReadReceipt(chatMessageId: string): Promise<void>;\n /**\n * Send typing indicator in the thread.\n *\n * @public\n */\n sendTypingIndicator(): Promise<void>;\n /**\n * Update a message content.\n *\n * @public\n */\n updateMessage(\n messageId: string,\n content: string,\n options?: Record<string, string> | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions\n ): Promise<void>;\n /**\n * Delete a message in the thread.\n *\n * @public\n */\n deleteMessage(messageId: string): Promise<void>;\n /**\n * Load more previous messages in the chat thread history.\n *\n * @remarks\n * This method is usually used to control incremental fetch/infinite scroll.\n *\n * @public\n */\n loadPreviousChatMessages(messagesToLoad: number): Promise<boolean>;\n /** @public */\n downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void>;\n /** @public */\n removeResourceFromCache(resourceDetails: ResourceDetails): void;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Puts the Call in a Localhold.\n *\n * @beta\n */\n holdCall: () => Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Resumes the call from a LocalHold state.\n *\n * @beta\n */\n resumeCall: () => Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Adds a new Participant to the call.\n *\n * @beta\n */\n addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n addParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n /**\n * send dtmf tone to another participant in the call in 1:1 calls\n *\n * @public\n */\n sendDtmfTone: (dtmfTone: DtmfTone) => Promise<void>;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * Continues into a call when the browser version is not supported.\n */\n allowUnsupportedBrowserVersion(): void;\n /**\n * Function to Start captions\n * @param options - options for start captions\n */\n startCaptions(options?: StartCaptionsOptions): Promise<void>;\n /**\n * Function to set caption language\n * @param language - language set for caption\n */\n setCaptionLanguage(language: string): Promise<void>;\n /**\n * Function to set spoken language\n * @param language - spoken language\n */\n setSpokenLanguage(language: string): Promise<void>;\n /**\n * Funtion to stop captions\n */\n stopCaptions(): Promise<void>;\n\n /**\n * Start the video background effect.\n *\n * @public\n */\n startVideoBackgroundEffect(videoBackgroundEffect: VideoBackgroundEffect): Promise<void>;\n\n /**\n * Stop the video background effect.\n *\n * @public\n */\n stopVideoBackgroundEffects(): Promise<void>;\n\n /**\n * Override the background picker images for background replacement effect.\n *\n * @param backgroundImages - Array of custom background images.\n *\n * @public\n */\n updateBackgroundPickerImages(backgroundImages: VideoBackgroundImage[]): void;\n\n /**\n * Update the selected video background effect\n *\n * @public\n */\n updateSelectedVideoBackgroundEffect(selectedVideoBackground: VideoBackgroundEffect): void;\n /**\n * Send the end of call survey result\n *\n * @public\n */\n submitSurvey(survey: CallSurvey): Promise<CallSurveyResponse | undefined>;\n /**\n * Start spotlight\n */\n startSpotlight(userIds?: string[]): Promise<void>;\n /**\n * Stop spotlight\n */\n stopSpotlight(userIds?: string[]): Promise<void>;\n /**\n * Stop all spotlights\n */\n stopAllSpotlight(): Promise<void>;\n /* @conditional-compile-remove(soft-mute) */\n /**\n * Mute a participant\n */\n muteParticipant(userIds: string): Promise<void>;\n}\n\n/**\n * Call and Chat events that can be subscribed to in the {@link CallWithChatAdapter}.\n * @public\n */\nexport interface CallWithChatAdapterSubscriptions {\n // Call subscriptions\n on(event: 'callEnded', listener: CallEndedListener): void;\n on(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n on(event: 'callIdChanged', listener: CallIdChangedListener): void;\n on(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n on(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n on(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n on(event: 'callParticipantsJoined', listener: ParticipantsJoinedListener): void;\n on(event: 'callParticipantsLeft', listener: ParticipantsLeftListener): void;\n on(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n on(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n on(event: 'callError', listener: (e: AdapterError) => void): void;\n on(event: 'captionsReceived', listener: CaptionsReceivedListener): void;\n on(event: 'isCaptionsActiveChanged', listener: IsCaptionsActiveChangedListener): void;\n on(event: 'isCaptionLanguageChanged', listener: IsCaptionLanguageChangedListener): void;\n on(event: 'isSpokenLanguageChanged', listener: IsSpokenLanguageChangedListener): void;\n on(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;\n on(event: 'spotlightChanged', listener: SpotlightChangedListener): void;\n off(event: 'callEnded', listener: CallEndedListener): void;\n off(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n off(event: 'callIdChanged', listener: CallIdChangedListener): void;\n off(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n off(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n off(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n off(event: 'callParticipantsJoined', listener: ParticipantsJoinedListener): void;\n off(event: 'callParticipantsLeft', listener: ParticipantsLeftListener): void;\n off(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n off(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n off(event: 'callError', listener: (e: AdapterError) => void): void;\n off(event: 'captionsReceived', listener: CaptionsReceivedListener): void;\n off(event: 'isCaptionsActiveChanged', listener: IsCaptionsActiveChangedListener): void;\n off(event: 'isCaptionLanguageChanged', listener: IsCaptionLanguageChangedListener): void;\n off(event: 'isSpokenLanguageChanged', listener: IsSpokenLanguageChangedListener): void;\n off(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;\n off(event: 'spotlightChanged', listener: SpotlightChangedListener): void;\n\n // Chat subscriptions\n on(event: 'messageReceived', listener: MessageReceivedListener): void;\n on(event: 'messageEdited', listener: MessageEditedListener): void;\n on(event: 'messageDeleted', listener: MessageDeletedListener): void;\n on(event: 'messageSent', listener: MessageSentListener): void;\n on(event: 'messageRead', listener: MessageReadListener): void;\n on(event: 'chatParticipantsAdded', listener: ParticipantsAddedListener): void;\n on(event: 'chatParticipantsRemoved', listener: ParticipantsRemovedListener): void;\n on(event: 'chatError', listener: (e: AdapterError) => void): void;\n\n off(event: 'messageReceived', listener: MessageReceivedListener): void;\n off(event: 'messageEdited', listener: MessageEditedListener): void;\n off(event: 'messageDeleted', listener: MessageDeletedListener): void;\n off(event: 'messageSent', listener: MessageSentListener): void;\n off(event: 'messageRead', listener: MessageReadListener): void;\n off(event: 'chatParticipantsAdded', listener: ParticipantsAddedListener): void;\n off(event: 'chatParticipantsRemoved', listener: ParticipantsRemovedListener): void;\n off(event: 'chatError', listener: (e: AdapterError) => void): void;\n\n // CallWithChat subscriptions\n on(event: 'chatInitialized', listener: ChatInitializedListener): void;\n off(event: 'chatInitialized', listener: ChatInitializedListener): void;\n}\n\n/**\n * Callback for {@link CallWithChatAdapterSubscribers} 'chatInitialized' event.\n *\n * @public\n */\nexport type ChatInitializedListener = (event: { adapter: CallWithChatAdapter }) => void;\n\n/**\n * {@link CallWithChatComposite} Adapter interface.\n *\n * @public\n */\nexport interface CallWithChatAdapter\n extends CallWithChatAdapterManagement,\n AdapterState<CallWithChatAdapterState>,\n Disposable,\n CallWithChatAdapterSubscriptions {}\n\n/**\n * Events fired off by the {@link CallWithChatAdapter}.\n *\n * @public\n */\nexport type CallWithChatEvent =\n | 'callError'\n | 'chatError'\n | 'callEnded'\n | 'isMutedChanged'\n | 'callIdChanged'\n | 'isLocalScreenSharingActiveChanged'\n | 'displayNameChanged'\n | 'isSpeakingChanged'\n | 'callParticipantsJoined'\n | 'callParticipantsLeft'\n | 'selectedMicrophoneChanged'\n | 'selectedSpeakerChanged'\n | 'isCaptionsActiveChanged'\n | 'captionsReceived'\n | 'isCaptionLanguageChanged'\n | 'isSpokenLanguageChanged'\n | 'capabilitiesChanged'\n | 'spotlightChanged'\n | 'messageReceived'\n | 'messageEdited'\n | 'messageDeleted'\n | 'messageSent'\n | 'messageRead'\n | 'chatParticipantsAdded'\n | 'chatParticipantsRemoved'\n | 'chatInitialized';\n"]}
1
+ {"version":3,"file":"CallWithChatAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable @typescript-eslint/adjacent-overload-signatures */\n\nimport {\n CallIdChangedListener,\n DisplayNameChangedListener,\n IsMutedChangedListener,\n IsLocalScreenSharingActiveChangedListener,\n IsSpeakingChangedListener,\n ParticipantsJoinedListener,\n ParticipantsLeftListener,\n CallEndedListener\n} from '../../CallComposite';\nimport {\n MessageDeletedListener,\n MessageEditedListener,\n MessageReadListener,\n MessageReceivedListener,\n MessageSentListener,\n ParticipantsAddedListener,\n ParticipantsRemovedListener\n} from '../../ChatComposite';\nimport { ResourceDetails } from '../../ChatComposite';\nimport { CallWithChatAdapterState } from '../state/CallWithChatAdapterState';\nimport type { AdapterError, AdapterState, Disposable } from '../../common/adapters';\nimport {\n AudioDeviceInfo,\n Call,\n PermissionConstraints,\n PropertyChangedEvent,\n StartCallOptions,\n VideoDeviceInfo\n} from '@azure/communication-calling';\nimport { Reaction } from '@azure/communication-calling';\nimport { StartCaptionsOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { DtmfTone } from '@azure/communication-calling';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\nimport { SendMessageOptions } from '@azure/communication-chat';\nimport { JoinCallOptions } from '../../CallComposite/adapter/CallAdapter';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { PhoneNumberIdentifier } from '@azure/communication-common';\nimport { UnknownIdentifier, MicrosoftTeamsAppIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { CommunicationUserIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(teams-adhoc-call) */\nimport { MicrosoftTeamsUserIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { CommunicationIdentifier } from '@azure/communication-common';\nimport {\n CaptionsReceivedListener,\n IsCaptionsActiveChangedListener,\n IsCaptionLanguageChangedListener,\n IsSpokenLanguageChangedListener\n} from '../../CallComposite/adapter/CallAdapter';\n\nimport { CapabilitiesChangedListener } from '../../CallComposite/adapter/CallAdapter';\nimport { SpotlightChangedListener } from '../../CallComposite/adapter/CallAdapter';\n\nimport { VideoBackgroundImage, VideoBackgroundEffect } from '../../CallComposite';\n\nimport { CallSurvey, CallSurveyResponse } from '@azure/communication-calling';\n\n/**\n * Functionality for managing the current call with chat.\n * @public\n */\nexport interface CallWithChatAdapterManagement {\n // CallWithChat-specific Interface methods\n /**\n * Remove a participant from a Call.\n *\n * @param userId - UserId of the participant to remove.\n *\n * @public\n */\n removeParticipant(userId: string): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Remove a participant from the call.\n * @param participant - {@link @azure/communication-common#CommunicationIdentifier} of the participant to be removed\n * @beta\n */\n removeParticipant(participant: CommunicationIdentifier): Promise<void>;\n\n // Call Interface Methods\n /**\n * Join the call with microphone initially on/off.\n * @deprecated Use joinCall(options?:JoinCallOptions) instead.\n * @param microphoneOn - Whether microphone is initially enabled\n *\n * @public\n */\n joinCall(microphoneOn?: boolean): Call | undefined;\n /**\n * Join the call with options bag to set microphone/camera initial state when joining call\n * true = turn on the device when joining call\n * false = turn off the device when joining call\n * 'keep'/undefined = retain devices' precall state\n *\n * @param options - param to set microphone/camera initially on/off/use precall state.\n *\n * @public\n */\n joinCall(options?: JoinCallOptions): Call | undefined;\n /**\n * Leave the call.\n *\n * @param forEveryone - Whether to remove all participants when leaving\n *\n * @public\n */\n leaveCall(forEveryone?: boolean): Promise<void>;\n /**\n * Start the camera.\n *\n * This method will start rendering a local camera view when the call is not active.\n *\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n startCamera(options?: VideoStreamOptions): Promise<void>;\n /**\n * Stop the camera.\n *\n * This method will stop rendering a local camera view when the call is not active.\n *\n * @public\n */\n stopCamera(): Promise<void>;\n /**\n * Mute the current user during the call or disable microphone locally.\n *\n * @public\n */\n mute(): Promise<void>;\n /**\n * Unmute the current user during the call or enable microphone locally.\n *\n * @public\n */\n unmute(): Promise<void>;\n /**\n * Start the call.\n *\n * @param participants - An array of participant ids to join\n *\n * @public\n */\n startCall(participants: string[], options?: StartCallOptions): Call | undefined;\n /**\n * Start the call.\n * @param participants - An array of {@link @azure/communication-common#CommunicationIdentifier} to be called\n * @public\n */\n startCall(\n participants: (\n | MicrosoftTeamsAppIdentifier\n | /* @conditional-compile-remove(PSTN-calls) */ PhoneNumberIdentifier\n | /* @conditional-compile-remove(one-to-n-calling) */ CommunicationUserIdentifier\n | /* @conditional-compile-remove(teams-adhoc-call) */ MicrosoftTeamsUserIdentifier\n | UnknownIdentifier\n )[],\n options?: StartCallOptions\n ): Call | undefined;\n /**\n * Start sharing the screen during a call.\n *\n * @public\n */\n startScreenShare(): Promise<void>;\n /**\n * Stop sharing the screen.\n *\n * @public\n */\n stopScreenShare(): Promise<void>;\n /**\n * Raise hand for local user.\n *\n * @public\n */\n raiseHand(): Promise<void>;\n /**\n * Lower hand for local user.\n *\n * @public\n */\n lowerHand(): Promise<void>;\n /**\n * Send Reaction to ongoing meeting.\n * @param reaction - A value of type {@link @azure/communication-calling#Reaction}\n *\n * @public\n */\n onReactionClick(reaction: Reaction): Promise<void>;\n /**\n * Create the html view for a stream.\n *\n * @remarks\n * This method is implemented for composite.\n *\n * @param remoteUserId - Id of the participant to render, leave it undefined to create the local camera view\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n createStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void | CreateVideoStreamViewResult>;\n /**\n * Dispose the html view for a stream.\n *\n * @remarks\n * This method is implemented for composite.\n *\n * @param remoteUserId - Id of the participant to render, leave it undefined to dispose the local camera view\n * @param options - Options to control how video streams are rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n disposeStreamView(remoteUserId?: string, options?: VideoStreamOptions): Promise<void>;\n /**\n * Dispose the html view for a screen share stream\n *\n * @remarks\n * this method is implemented for composite\n *\n * @param remoteUserId - Id of the participant to dispose the screen share stream view for.\n *\n * @public\n */\n disposeScreenShareStreamView(remoteUserId: string): Promise<void>;\n /**\n * Dispose the html view for a remote video stream\n *\n * @param remoteUserId - Id of the participant to dispose\n *\n * @public\n */\n disposeRemoteVideoStreamView(remoteUserId: string): Promise<void>;\n /**\n * Dispose the html view for a local video stream\n *\n * @public\n */\n disposeLocalVideoStreamView(): Promise<void>;\n /**\n * Ask for permissions of devices.\n *\n * @remarks\n * Browser permission window will pop up if permissions are not granted yet.\n *\n * @param constrain - Define constraints for accessing local devices {@link @azure/communication-calling#PermissionConstraints }\n *\n * @public\n */\n askDevicePermission(constrain: PermissionConstraints): Promise<void>;\n /**\n * Query for available camera devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of video device information entities {@link @azure/communication-calling#VideoDeviceInfo }\n *\n * @public\n */\n queryCameras(): Promise<VideoDeviceInfo[]>;\n /**\n * Query for available microphone devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of audio device information entities {@link @azure/communication-calling#AudioDeviceInfo }\n *\n * @public\n */\n queryMicrophones(): Promise<AudioDeviceInfo[]>;\n /**\n * Query for available microphone devices.\n *\n * @remarks\n * This method should be called after askDevicePermission()\n *\n * @return An array of audio device information entities {@link @azure/communication-calling#AudioDeviceInfo }\n *\n * @public\n */\n querySpeakers(): Promise<AudioDeviceInfo[]>;\n /**\n * Set the camera to use in the call.\n *\n * @param sourceInfo - Camera device to choose, pick one returned by {@link CallAdapterDeviceManagement#queryCameras }\n * @param options - Options to control how the camera stream is rendered {@link @azure/communication-calling#VideoStreamOptions }\n *\n * @public\n */\n setCamera(sourceInfo: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void>;\n /**\n * Set the microphone to use in the call.\n *\n * @param sourceInfo - Microphone device to choose, pick one returned by {@link CallAdapterDeviceManagement#queryMicrophones }\n *\n * @public\n */\n setMicrophone(sourceInfo: AudioDeviceInfo): Promise<void>;\n /**\n * Set the speaker to use in the call.\n *\n * @param sourceInfo - Speaker device to choose, pick one returned by {@link CallAdapterDeviceManagement#querySpeakers }\n *\n * @public\n */\n setSpeaker(sourceInfo: AudioDeviceInfo): Promise<void>;\n\n // Chat Interface Methods\n /**\n * Fetch initial state for the Chat adapter.\n *\n * Performs the minimal fetch necessary for ChatComposite and API methods.\n *\n * @public\n */\n fetchInitialData(): Promise<void>;\n /**\n * Send a message in the thread.\n *\n * @public\n */\n sendMessage(\n content: string,\n options?: SendMessageOptions | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions\n ): Promise<void>;\n /**\n * Send a read receipt for a message.\n *\n * @public\n */\n sendReadReceipt(chatMessageId: string): Promise<void>;\n /**\n * Send typing indicator in the thread.\n *\n * @public\n */\n sendTypingIndicator(): Promise<void>;\n /**\n * Update a message content.\n *\n * @public\n */\n updateMessage(\n messageId: string,\n content: string,\n options?: Record<string, string> | /* @conditional-compile-remove(file-sharing-acs) */ MessageOptions\n ): Promise<void>;\n /**\n * Delete a message in the thread.\n *\n * @public\n */\n deleteMessage(messageId: string): Promise<void>;\n /**\n * Load more previous messages in the chat thread history.\n *\n * @remarks\n * This method is usually used to control incremental fetch/infinite scroll.\n *\n * @public\n */\n loadPreviousChatMessages(messagesToLoad: number): Promise<boolean>;\n /** @public */\n downloadResourceToCache(resourceDetails: ResourceDetails): Promise<void>;\n /** @public */\n removeResourceFromCache(resourceDetails: ResourceDetails): void;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Puts the Call in a Localhold.\n *\n * @beta\n */\n holdCall: () => Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Resumes the call from a LocalHold state.\n *\n * @beta\n */\n resumeCall: () => Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n /**\n * Adds a new Participant to the call.\n *\n * @beta\n */\n addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n addParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n /**\n * send dtmf tone to another participant in the call in 1:1 calls\n *\n * @public\n */\n sendDtmfTone: (dtmfTone: DtmfTone) => Promise<void>;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * Continues into a call when the browser version is not supported.\n */\n allowUnsupportedBrowserVersion(): void;\n /**\n * Function to Start captions\n * @param options - options for start captions\n */\n startCaptions(options?: StartCaptionsOptions): Promise<void>;\n /**\n * Function to set caption language\n * @param language - language set for caption\n */\n setCaptionLanguage(language: string): Promise<void>;\n /**\n * Function to set spoken language\n * @param language - spoken language\n */\n setSpokenLanguage(language: string): Promise<void>;\n /**\n * Funtion to stop captions\n */\n stopCaptions(): Promise<void>;\n\n /**\n * Start the video background effect.\n *\n * @public\n */\n startVideoBackgroundEffect(videoBackgroundEffect: VideoBackgroundEffect): Promise<void>;\n\n /**\n * Stop the video background effect.\n *\n * @public\n */\n stopVideoBackgroundEffects(): Promise<void>;\n\n /**\n * Override the background picker images for background replacement effect.\n *\n * @param backgroundImages - Array of custom background images.\n *\n * @public\n */\n updateBackgroundPickerImages(backgroundImages: VideoBackgroundImage[]): void;\n\n /**\n * Update the selected video background effect\n *\n * @public\n */\n updateSelectedVideoBackgroundEffect(selectedVideoBackground: VideoBackgroundEffect): void;\n /**\n * Send the end of call survey result\n *\n * @public\n */\n submitSurvey(survey: CallSurvey): Promise<CallSurveyResponse | undefined>;\n /**\n * Start spotlight\n */\n startSpotlight(userIds?: string[]): Promise<void>;\n /**\n * Stop spotlight\n */\n stopSpotlight(userIds?: string[]): Promise<void>;\n /**\n * Stop all spotlights\n */\n stopAllSpotlight(): Promise<void>;\n /* @conditional-compile-remove(soft-mute) */\n /**\n * Mute a participant\n */\n muteParticipant(userIds: string): Promise<void>;\n /* @conditional-compile-remove(soft-mute) */\n /**\n * Mute a participant\n */\n muteAllRemoteParticipants(): Promise<void>;\n}\n\n/**\n * Call and Chat events that can be subscribed to in the {@link CallWithChatAdapter}.\n * @public\n */\nexport interface CallWithChatAdapterSubscriptions {\n // Call subscriptions\n on(event: 'callEnded', listener: CallEndedListener): void;\n on(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n on(event: 'callIdChanged', listener: CallIdChangedListener): void;\n on(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n on(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n on(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n on(event: 'callParticipantsJoined', listener: ParticipantsJoinedListener): void;\n on(event: 'callParticipantsLeft', listener: ParticipantsLeftListener): void;\n on(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n on(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n on(event: 'callError', listener: (e: AdapterError) => void): void;\n on(event: 'captionsReceived', listener: CaptionsReceivedListener): void;\n on(event: 'isCaptionsActiveChanged', listener: IsCaptionsActiveChangedListener): void;\n on(event: 'isCaptionLanguageChanged', listener: IsCaptionLanguageChangedListener): void;\n on(event: 'isSpokenLanguageChanged', listener: IsSpokenLanguageChangedListener): void;\n on(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;\n on(event: 'spotlightChanged', listener: SpotlightChangedListener): void;\n off(event: 'callEnded', listener: CallEndedListener): void;\n off(event: 'isMutedChanged', listener: IsMutedChangedListener): void;\n off(event: 'callIdChanged', listener: CallIdChangedListener): void;\n off(event: 'isLocalScreenSharingActiveChanged', listener: IsLocalScreenSharingActiveChangedListener): void;\n off(event: 'displayNameChanged', listener: DisplayNameChangedListener): void;\n off(event: 'isSpeakingChanged', listener: IsSpeakingChangedListener): void;\n off(event: 'callParticipantsJoined', listener: ParticipantsJoinedListener): void;\n off(event: 'callParticipantsLeft', listener: ParticipantsLeftListener): void;\n off(event: 'selectedMicrophoneChanged', listener: PropertyChangedEvent): void;\n off(event: 'selectedSpeakerChanged', listener: PropertyChangedEvent): void;\n off(event: 'callError', listener: (e: AdapterError) => void): void;\n off(event: 'captionsReceived', listener: CaptionsReceivedListener): void;\n off(event: 'isCaptionsActiveChanged', listener: IsCaptionsActiveChangedListener): void;\n off(event: 'isCaptionLanguageChanged', listener: IsCaptionLanguageChangedListener): void;\n off(event: 'isSpokenLanguageChanged', listener: IsSpokenLanguageChangedListener): void;\n off(event: 'capabilitiesChanged', listener: CapabilitiesChangedListener): void;\n off(event: 'spotlightChanged', listener: SpotlightChangedListener): void;\n\n // Chat subscriptions\n on(event: 'messageReceived', listener: MessageReceivedListener): void;\n on(event: 'messageEdited', listener: MessageEditedListener): void;\n on(event: 'messageDeleted', listener: MessageDeletedListener): void;\n on(event: 'messageSent', listener: MessageSentListener): void;\n on(event: 'messageRead', listener: MessageReadListener): void;\n on(event: 'chatParticipantsAdded', listener: ParticipantsAddedListener): void;\n on(event: 'chatParticipantsRemoved', listener: ParticipantsRemovedListener): void;\n on(event: 'chatError', listener: (e: AdapterError) => void): void;\n\n off(event: 'messageReceived', listener: MessageReceivedListener): void;\n off(event: 'messageEdited', listener: MessageEditedListener): void;\n off(event: 'messageDeleted', listener: MessageDeletedListener): void;\n off(event: 'messageSent', listener: MessageSentListener): void;\n off(event: 'messageRead', listener: MessageReadListener): void;\n off(event: 'chatParticipantsAdded', listener: ParticipantsAddedListener): void;\n off(event: 'chatParticipantsRemoved', listener: ParticipantsRemovedListener): void;\n off(event: 'chatError', listener: (e: AdapterError) => void): void;\n\n // CallWithChat subscriptions\n on(event: 'chatInitialized', listener: ChatInitializedListener): void;\n off(event: 'chatInitialized', listener: ChatInitializedListener): void;\n}\n\n/**\n * Callback for {@link CallWithChatAdapterSubscribers} 'chatInitialized' event.\n *\n * @public\n */\nexport type ChatInitializedListener = (event: { adapter: CallWithChatAdapter }) => void;\n\n/**\n * {@link CallWithChatComposite} Adapter interface.\n *\n * @public\n */\nexport interface CallWithChatAdapter\n extends CallWithChatAdapterManagement,\n AdapterState<CallWithChatAdapterState>,\n Disposable,\n CallWithChatAdapterSubscriptions {}\n\n/**\n * Events fired off by the {@link CallWithChatAdapter}.\n *\n * @public\n */\nexport type CallWithChatEvent =\n | 'callError'\n | 'chatError'\n | 'callEnded'\n | 'isMutedChanged'\n | 'callIdChanged'\n | 'isLocalScreenSharingActiveChanged'\n | 'displayNameChanged'\n | 'isSpeakingChanged'\n | 'callParticipantsJoined'\n | 'callParticipantsLeft'\n | 'selectedMicrophoneChanged'\n | 'selectedSpeakerChanged'\n | 'isCaptionsActiveChanged'\n | 'captionsReceived'\n | 'isCaptionLanguageChanged'\n | 'isSpokenLanguageChanged'\n | 'capabilitiesChanged'\n | 'spotlightChanged'\n | 'messageReceived'\n | 'messageEdited'\n | 'messageDeleted'\n | 'messageSent'\n | 'messageRead'\n | 'chatParticipantsAdded'\n | 'chatParticipantsRemoved'\n | 'chatInitialized';\n"]}
@@ -70,5 +70,6 @@ export declare class CallWithChatBackedCallAdapter implements CallAdapter {
70
70
  stopSpotlight(userIds?: string[]): Promise<void>;
71
71
  stopAllSpotlight(): Promise<void>;
72
72
  muteParticipant(userId: string): Promise<void>;
73
+ muteAllRemoteParticipants(): Promise<void>;
73
74
  }
74
75
  //# sourceMappingURL=CallWithChatBackedCallAdapter.d.ts.map
@@ -201,6 +201,12 @@ export class CallWithChatBackedCallAdapter {
201
201
  return this.callWithChatAdapter.muteParticipant(userId);
202
202
  });
203
203
  }
204
+ /* @conditional-compile-remove(soft-mute) */
205
+ muteAllRemoteParticipants() {
206
+ return __awaiter(this, void 0, void 0, function* () {
207
+ return this.callWithChatAdapter.muteAllRemoteParticipants();
208
+ });
209
+ }
204
210
  }
205
211
  function callAdapterStateFromCallWithChatAdapterState(callWithChatAdapterState) {
206
212
  return {
@@ -1 +1 @@
1
- {"version":3,"file":"CallWithChatBackedCallAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAoBlC,6CAA6C;AAC7C,OAAO,EAA2B,uBAAuB,EAAyB,MAAM,6BAA6B,CAAC;AAGtH,OAAO,EAAE,0BAA0B,EAAE,yCAAgC;AAIrE,uDAAuD;AACvD,sEAAsE;AAEtE;;;;GAIG;AACH,MAAM,OAAO,6BAA6B;IAOxC,YAAY,mBAAwC;QAJpD,gJAAgJ;QAChJ,iJAAiJ;QACzI,eAAU,GAAsF,IAAI,GAAG,EAAE,CAAC;QAM3G,OAAE,GAAG,CAAC,KAAU,EAAE,QAAa,EAAQ,EAAE;YAC9C,QAAQ,KAAK,EAAE,CAAC;gBACd,KAAK,OAAO;oBACV,OAAO,IAAI,CAAC,mBAAmB,CAAC,EAAE,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;gBAC5D,KAAK,oBAAoB;oBACvB,OAAO,IAAI,CAAC,mBAA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IAAI,CAAC,mBAAmB,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;QAC1D,CAAC;KAAA;CACF;AAED,SAAS,4CAA4C,CACnD,wBAAkD;IAElD,OAAO;QACL,+BAA+B,EAAE,wBAAwB,CAAC,+BAA+B;QACzF,IAAI,EAAE,wBAAwB,CAAC,IAAI;QACnC,MAAM,EAAE,wBAAwB,CAAC,MAAM;QACvC,WAAW,EAAE,wBAAwB,CAAC,WAAW;QACjD,IAAI,EAAE,wBAAwB,CAAC,IAAI;QACnC,OAAO,EAAE,wBAAwB,CAAC,OAAO;QACzC,WAAW,EAAE,wBAAwB,CAAC,WAAW;QACjD,cAAc,EAAE,wBAAwB,CAAC,cAAc;QACvD,WAAW,EAAE,KAAK;QAClB,YAAY,EAAE,wBAAwB,CAAC,gBAAgB;QACvD,6CAA6C;QAC7C,iBAAiB,EAAE,wBAAwB,CAAC,iBAAiB;QAC7D,sDAAsD;QACtD,eAAe,EAAE,wBAAwB,CAAC,eAAe;QAEzD,qBAAqB,EAAE,wBAAwB,CAAC,qBAAqB;QAErE,8BAA8B,EAAE,wBAAwB,CAAC,8BAA8B;QAEvF,6BAA6B,EAAE,wBAAwB,CAAC,6BAA6B;QACrF,SAAS,EAAE,wBAAwB,CAAC,SAAS;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CallWithChatAdapter } from './CallWithChatAdapter';\nimport { CallAdapter, CallAdapterState } from '../../CallComposite';\n\nimport { VideoBackgroundImage, VideoBackgroundEffect } from '../../CallComposite';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\nimport {\n AudioDeviceInfo,\n VideoDeviceInfo,\n Call,\n PermissionConstraints,\n StartCallOptions\n} from '@azure/communication-calling';\nimport { Reaction } from '@azure/communication-calling';\nimport { StartCaptionsOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { DtmfTone } from '@azure/communication-calling';\nimport { CallWithChatAdapterState } from '../state/CallWithChatAdapterState';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { CommunicationIdentifier, isPhoneNumberIdentifier, PhoneNumberIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { CommunicationUserIdentifier } from '@azure/communication-common';\nimport { _toCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { JoinCallOptions, StartCallIdentifier } from '../../CallComposite/adapter/CallAdapter';\nimport { CallSurvey, CallSurveyResponse } from '@azure/communication-calling';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\n/**\n * Facade around the CallWithChatAdapter to satisfy the call adapter interface.\n *\n * @private\n */\nexport class CallWithChatBackedCallAdapter implements CallAdapter {\n private callWithChatAdapter: CallWithChatAdapter;\n\n // For onStateChange we must convert CallWithChat state to chat state. This involves creating a new handler to be passed into the onStateChange.\n // In order to unsubscribe the handler when offStateChange is called we must have a mapping of the original handler to the newly created handler.\n private eventStore: Map<(state: CallAdapterState) => void, (state: CallWithChatAdapterState) => void> = new Map();\n\n constructor(callWithChatAdapter: CallWithChatAdapter) {\n this.callWithChatAdapter = callWithChatAdapter;\n }\n\n public on = (event: any, listener: any): void => {\n switch (event) {\n case 'error':\n return this.callWithChatAdapter.on('callError', listener);\n case 'participantsJoined':\n return this.callWithChatAdapter.on('callParticipantsJoined', listener);\n case 'participantsLeft':\n return this.callWithChatAdapter.on('callParticipantsLeft', listener);\n default:\n return this.callWithChatAdapter.on(event, listener);\n }\n };\n public off = (event: any, listener: any): void => {\n switch (event) {\n case 'error':\n return this.callWithChatAdapter.off('callError', listener);\n case 'participantsJoined':\n return this.callWithChatAdapter.off('callParticipantsJoined', listener);\n case 'participantsLeft':\n return this.callWithChatAdapter.off('callParticipantsLeft', listener);\n default:\n return this.callWithChatAdapter.off(event, listener);\n }\n };\n public onStateChange = (handler: (state: CallAdapterState) => void): void => {\n const convertedHandler = (state: CallWithChatAdapterState): void => {\n handler(callAdapterStateFromCallWithChatAdapterState(state));\n };\n this.callWithChatAdapter.onStateChange(convertedHandler);\n this.eventStore.set(handler, convertedHandler);\n };\n public offStateChange = (handler: (state: CallAdapterState) => void): void => {\n const convertedHandler = this.eventStore.get(handler);\n convertedHandler && this.callWithChatAdapter.offStateChange(convertedHandler);\n };\n public getState = (): CallAdapterState =>\n callAdapterStateFromCallWithChatAdapterState(this.callWithChatAdapter.getState());\n public dispose = (): void => this.callWithChatAdapter.dispose();\n public joinCall = (options?: boolean | JoinCallOptions): Call | undefined => {\n if (typeof options === 'boolean') {\n return this.callWithChatAdapter.joinCall(options);\n } else {\n return this.callWithChatAdapter.joinCall(options);\n }\n };\n public leaveCall = async (forEveryone?: boolean): Promise<void> =>\n await this.callWithChatAdapter.leaveCall(forEveryone);\n\n public startCall = (participants: (string | StartCallIdentifier)[], options: StartCallOptions): Call | undefined => {\n if (participants.every((participant: string | StartCallIdentifier) => typeof participant === 'string')) {\n return this.callWithChatAdapter.startCall(participants as string[], options);\n } else {\n return this.callWithChatAdapter.startCall(participants as StartCallIdentifier[], options);\n }\n };\n public setCamera = async (sourceId: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void> =>\n await this.callWithChatAdapter.setCamera(sourceId, options);\n public setMicrophone = async (sourceId: AudioDeviceInfo): Promise<void> =>\n await this.callWithChatAdapter.setMicrophone(sourceId);\n public setSpeaker = async (sourceId: AudioDeviceInfo): Promise<void> =>\n await this.callWithChatAdapter.setSpeaker(sourceId);\n public askDevicePermission = async (constraints: PermissionConstraints): Promise<void> =>\n await this.callWithChatAdapter.askDevicePermission(constraints);\n public queryCameras = async (): Promise<VideoDeviceInfo[]> => await this.callWithChatAdapter.queryCameras();\n public queryMicrophones = async (): Promise<AudioDeviceInfo[]> => await this.callWithChatAdapter.queryMicrophones();\n public querySpeakers = async (): Promise<AudioDeviceInfo[]> => await this.callWithChatAdapter.querySpeakers();\n public startCamera = async (options?: VideoStreamOptions): Promise<void> =>\n await this.callWithChatAdapter.startCamera(options);\n public stopCamera = async (): Promise<void> => await this.callWithChatAdapter.stopCamera();\n public mute = async (): Promise<void> => await this.callWithChatAdapter.mute();\n public unmute = async (): Promise<void> => await this.callWithChatAdapter.unmute();\n public startScreenShare = async (): Promise<void> => await this.callWithChatAdapter.startScreenShare();\n public stopScreenShare = async (): Promise<void> => await this.callWithChatAdapter.stopScreenShare();\n public raiseHand = async (): Promise<void> => await this.callWithChatAdapter.raiseHand();\n public lowerHand = async (): Promise<void> => await this.callWithChatAdapter.lowerHand();\n public onReactionClick = async (reaction: Reaction): Promise<void> =>\n await this.callWithChatAdapter.onReactionClick(reaction);\n public removeParticipant = async (\n userId: string | /* @conditional-compile-remove(PSTN-calls) */ CommunicationIdentifier\n ): Promise<void> => {\n let participant = userId;\n /* @conditional-compile-remove(PSTN-calls) */\n participant = _toCommunicationIdentifier(userId);\n await this.callWithChatAdapter.removeParticipant(participant);\n };\n public createStreamView = async (\n remoteUserId?: string,\n options?: VideoStreamOptions\n ): Promise<void | CreateVideoStreamViewResult> =>\n await this.callWithChatAdapter.createStreamView(remoteUserId, options);\n public disposeStreamView = async (remoteUserId?: string, options?: VideoStreamOptions): Promise<void> =>\n await this.callWithChatAdapter.disposeStreamView(remoteUserId, options);\n public disposeScreenShareStreamView(remoteUserId: string): Promise<void> {\n return this.callWithChatAdapter.disposeScreenShareStreamView(remoteUserId);\n }\n public disposeRemoteVideoStreamView(remoteUserId: string): Promise<void> {\n return this.callWithChatAdapter.disposeRemoteVideoStreamView(remoteUserId);\n }\n public disposeLocalVideoStreamView(): Promise<void> {\n return this.callWithChatAdapter.disposeLocalVideoStreamView();\n }\n /* @conditional-compile-remove(PSTN-calls) */\n public holdCall = async (): Promise<void> => {\n await this.callWithChatAdapter.holdCall();\n };\n /* @conditional-compile-remove(PSTN-calls) */\n public resumeCall = async (): Promise<void> => {\n await this.callWithChatAdapter.resumeCall();\n };\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(\n participant: PhoneNumberIdentifier | CommunicationUserIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> {\n if (isPhoneNumberIdentifier(participant) && options) {\n return this.callWithChatAdapter.addParticipant(participant as PhoneNumberIdentifier, options);\n } else {\n return this.callWithChatAdapter.addParticipant(participant as CommunicationUserIdentifier);\n }\n }\n\n /* @conditional-compile-remove(unsupported-browser) */\n public allowUnsupportedBrowserVersion(): void {\n return this.callWithChatAdapter.allowUnsupportedBrowserVersion();\n }\n\n public sendDtmfTone = async (dtmfTone: DtmfTone): Promise<void> => {\n await this.callWithChatAdapter.sendDtmfTone(dtmfTone);\n };\n\n public async startCaptions(options?: StartCaptionsOptions): Promise<void> {\n this.callWithChatAdapter.startCaptions(options);\n }\n\n public async stopCaptions(): Promise<void> {\n this.callWithChatAdapter.stopCaptions();\n }\n\n public async setCaptionLanguage(language: string): Promise<void> {\n this.callWithChatAdapter.setCaptionLanguage(language);\n }\n\n public async setSpokenLanguage(language: string): Promise<void> {\n this.callWithChatAdapter.setSpokenLanguage(language);\n }\n\n public async startVideoBackgroundEffect(videoBackgroundEffect: VideoBackgroundEffect): Promise<void> {\n await this.callWithChatAdapter.startVideoBackgroundEffect(videoBackgroundEffect);\n }\n\n public async stopVideoBackgroundEffects(): Promise<void> {\n await this.callWithChatAdapter.stopVideoBackgroundEffects();\n }\n\n public updateBackgroundPickerImages(backgroundImages: VideoBackgroundImage[]): void {\n return this.callWithChatAdapter.updateBackgroundPickerImages(backgroundImages);\n }\n\n public updateSelectedVideoBackgroundEffect(selectedVideoBackground: VideoBackgroundEffect): void {\n return this.callWithChatAdapter.updateSelectedVideoBackgroundEffect(selectedVideoBackground);\n }\n public async submitSurvey(survey: CallSurvey): Promise<CallSurveyResponse | undefined> {\n return this.callWithChatAdapter.submitSurvey(survey);\n }\n\n public async startSpotlight(userIds?: string[]): Promise<void> {\n return this.callWithChatAdapter.startSpotlight(userIds);\n }\n\n public async stopSpotlight(userIds?: string[]): Promise<void> {\n return this.callWithChatAdapter.stopSpotlight(userIds);\n }\n\n public async stopAllSpotlight(): Promise<void> {\n return this.callWithChatAdapter.stopAllSpotlight();\n }\n\n /* @conditional-compile-remove(soft-mute) */\n public async muteParticipant(userId: string): Promise<void> {\n return this.callWithChatAdapter.muteParticipant(userId);\n }\n}\n\nfunction callAdapterStateFromCallWithChatAdapterState(\n callWithChatAdapterState: CallWithChatAdapterState\n): CallAdapterState {\n return {\n isLocalPreviewMicrophoneEnabled: callWithChatAdapterState.isLocalPreviewMicrophoneEnabled,\n page: callWithChatAdapterState.page,\n userId: callWithChatAdapterState.userId,\n displayName: callWithChatAdapterState.displayName,\n call: callWithChatAdapterState.call,\n devices: callWithChatAdapterState.devices,\n isTeamsCall: callWithChatAdapterState.isTeamsCall,\n isTeamsMeeting: callWithChatAdapterState.isTeamsMeeting,\n isRoomsCall: false,\n latestErrors: callWithChatAdapterState.latestCallErrors,\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId: callWithChatAdapterState.alternateCallerId,\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo: callWithChatAdapterState.environmentInfo,\n\n videoBackgroundImages: callWithChatAdapterState.videoBackgroundImages,\n\n onResolveVideoEffectDependency: callWithChatAdapterState.onResolveVideoEffectDependency,\n\n selectedVideoBackgroundEffect: callWithChatAdapterState.selectedVideoBackgroundEffect,\n reactions: callWithChatAdapterState.reactions\n };\n}\n"]}
1
+ {"version":3,"file":"CallWithChatBackedCallAdapter.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;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,EAAE,wBAAwB,CAAC,eAAe;QAEzD,qBAAqB,EAAE,wBAAwB,CAAC,qBAAqB;QAErE,8BAA8B,EAAE,wBAAwB,CAAC,8BAA8B;QAEvF,6BAA6B,EAAE,wBAAwB,CAAC,6BAA6B;QACrF,SAAS,EAAE,wBAAwB,CAAC,SAAS;KAC9C,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CallWithChatAdapter } from './CallWithChatAdapter';\nimport { CallAdapter, CallAdapterState } from '../../CallComposite';\n\nimport { VideoBackgroundImage, VideoBackgroundEffect } from '../../CallComposite';\nimport { CreateVideoStreamViewResult, VideoStreamOptions } from '@internal/react-components';\nimport {\n AudioDeviceInfo,\n VideoDeviceInfo,\n Call,\n PermissionConstraints,\n StartCallOptions\n} from '@azure/communication-calling';\nimport { Reaction } from '@azure/communication-calling';\nimport { StartCaptionsOptions } from '@azure/communication-calling';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { AddPhoneNumberOptions } from '@azure/communication-calling';\nimport { DtmfTone } from '@azure/communication-calling';\nimport { CallWithChatAdapterState } from '../state/CallWithChatAdapterState';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { CommunicationIdentifier, isPhoneNumberIdentifier, PhoneNumberIdentifier } from '@azure/communication-common';\n/* @conditional-compile-remove(one-to-n-calling) */\nimport { CommunicationUserIdentifier } from '@azure/communication-common';\nimport { _toCommunicationIdentifier } from '@internal/acs-ui-common';\nimport { JoinCallOptions, StartCallIdentifier } from '../../CallComposite/adapter/CallAdapter';\nimport { CallSurvey, CallSurveyResponse } from '@azure/communication-calling';\n\n/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/explicit-module-boundary-types */\n\n/**\n * Facade around the CallWithChatAdapter to satisfy the call adapter interface.\n *\n * @private\n */\nexport class CallWithChatBackedCallAdapter implements CallAdapter {\n private callWithChatAdapter: CallWithChatAdapter;\n\n // For onStateChange we must convert CallWithChat state to chat state. This involves creating a new handler to be passed into the onStateChange.\n // In order to unsubscribe the handler when offStateChange is called we must have a mapping of the original handler to the newly created handler.\n private eventStore: Map<(state: CallAdapterState) => void, (state: CallWithChatAdapterState) => void> = new Map();\n\n constructor(callWithChatAdapter: CallWithChatAdapter) {\n this.callWithChatAdapter = callWithChatAdapter;\n }\n\n public on = (event: any, listener: any): void => {\n switch (event) {\n case 'error':\n return this.callWithChatAdapter.on('callError', listener);\n case 'participantsJoined':\n return this.callWithChatAdapter.on('callParticipantsJoined', listener);\n case 'participantsLeft':\n return this.callWithChatAdapter.on('callParticipantsLeft', listener);\n default:\n return this.callWithChatAdapter.on(event, listener);\n }\n };\n public off = (event: any, listener: any): void => {\n switch (event) {\n case 'error':\n return this.callWithChatAdapter.off('callError', listener);\n case 'participantsJoined':\n return this.callWithChatAdapter.off('callParticipantsJoined', listener);\n case 'participantsLeft':\n return this.callWithChatAdapter.off('callParticipantsLeft', listener);\n default:\n return this.callWithChatAdapter.off(event, listener);\n }\n };\n public onStateChange = (handler: (state: CallAdapterState) => void): void => {\n const convertedHandler = (state: CallWithChatAdapterState): void => {\n handler(callAdapterStateFromCallWithChatAdapterState(state));\n };\n this.callWithChatAdapter.onStateChange(convertedHandler);\n this.eventStore.set(handler, convertedHandler);\n };\n public offStateChange = (handler: (state: CallAdapterState) => void): void => {\n const convertedHandler = this.eventStore.get(handler);\n convertedHandler && this.callWithChatAdapter.offStateChange(convertedHandler);\n };\n public getState = (): CallAdapterState =>\n callAdapterStateFromCallWithChatAdapterState(this.callWithChatAdapter.getState());\n public dispose = (): void => this.callWithChatAdapter.dispose();\n public joinCall = (options?: boolean | JoinCallOptions): Call | undefined => {\n if (typeof options === 'boolean') {\n return this.callWithChatAdapter.joinCall(options);\n } else {\n return this.callWithChatAdapter.joinCall(options);\n }\n };\n public leaveCall = async (forEveryone?: boolean): Promise<void> =>\n await this.callWithChatAdapter.leaveCall(forEveryone);\n\n public startCall = (participants: (string | StartCallIdentifier)[], options: StartCallOptions): Call | undefined => {\n if (participants.every((participant: string | StartCallIdentifier) => typeof participant === 'string')) {\n return this.callWithChatAdapter.startCall(participants as string[], options);\n } else {\n return this.callWithChatAdapter.startCall(participants as StartCallIdentifier[], options);\n }\n };\n public setCamera = async (sourceId: VideoDeviceInfo, options?: VideoStreamOptions): Promise<void> =>\n await this.callWithChatAdapter.setCamera(sourceId, options);\n public setMicrophone = async (sourceId: AudioDeviceInfo): Promise<void> =>\n await this.callWithChatAdapter.setMicrophone(sourceId);\n public setSpeaker = async (sourceId: AudioDeviceInfo): Promise<void> =>\n await this.callWithChatAdapter.setSpeaker(sourceId);\n public askDevicePermission = async (constraints: PermissionConstraints): Promise<void> =>\n await this.callWithChatAdapter.askDevicePermission(constraints);\n public queryCameras = async (): Promise<VideoDeviceInfo[]> => await this.callWithChatAdapter.queryCameras();\n public queryMicrophones = async (): Promise<AudioDeviceInfo[]> => await this.callWithChatAdapter.queryMicrophones();\n public querySpeakers = async (): Promise<AudioDeviceInfo[]> => await this.callWithChatAdapter.querySpeakers();\n public startCamera = async (options?: VideoStreamOptions): Promise<void> =>\n await this.callWithChatAdapter.startCamera(options);\n public stopCamera = async (): Promise<void> => await this.callWithChatAdapter.stopCamera();\n public mute = async (): Promise<void> => await this.callWithChatAdapter.mute();\n public unmute = async (): Promise<void> => await this.callWithChatAdapter.unmute();\n public startScreenShare = async (): Promise<void> => await this.callWithChatAdapter.startScreenShare();\n public stopScreenShare = async (): Promise<void> => await this.callWithChatAdapter.stopScreenShare();\n public raiseHand = async (): Promise<void> => await this.callWithChatAdapter.raiseHand();\n public lowerHand = async (): Promise<void> => await this.callWithChatAdapter.lowerHand();\n public onReactionClick = async (reaction: Reaction): Promise<void> =>\n await this.callWithChatAdapter.onReactionClick(reaction);\n public removeParticipant = async (\n userId: string | /* @conditional-compile-remove(PSTN-calls) */ CommunicationIdentifier\n ): Promise<void> => {\n let participant = userId;\n /* @conditional-compile-remove(PSTN-calls) */\n participant = _toCommunicationIdentifier(userId);\n await this.callWithChatAdapter.removeParticipant(participant);\n };\n public createStreamView = async (\n remoteUserId?: string,\n options?: VideoStreamOptions\n ): Promise<void | CreateVideoStreamViewResult> =>\n await this.callWithChatAdapter.createStreamView(remoteUserId, options);\n public disposeStreamView = async (remoteUserId?: string, options?: VideoStreamOptions): Promise<void> =>\n await this.callWithChatAdapter.disposeStreamView(remoteUserId, options);\n public disposeScreenShareStreamView(remoteUserId: string): Promise<void> {\n return this.callWithChatAdapter.disposeScreenShareStreamView(remoteUserId);\n }\n public disposeRemoteVideoStreamView(remoteUserId: string): Promise<void> {\n return this.callWithChatAdapter.disposeRemoteVideoStreamView(remoteUserId);\n }\n public disposeLocalVideoStreamView(): Promise<void> {\n return this.callWithChatAdapter.disposeLocalVideoStreamView();\n }\n /* @conditional-compile-remove(PSTN-calls) */\n public holdCall = async (): Promise<void> => {\n await this.callWithChatAdapter.holdCall();\n };\n /* @conditional-compile-remove(PSTN-calls) */\n public resumeCall = async (): Promise<void> => {\n await this.callWithChatAdapter.resumeCall();\n };\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(participant: PhoneNumberIdentifier, options?: AddPhoneNumberOptions): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(participant: CommunicationUserIdentifier): Promise<void>;\n /* @conditional-compile-remove(PSTN-calls) */\n public async addParticipant(\n participant: PhoneNumberIdentifier | CommunicationUserIdentifier,\n options?: AddPhoneNumberOptions\n ): Promise<void> {\n if (isPhoneNumberIdentifier(participant) && options) {\n return this.callWithChatAdapter.addParticipant(participant as PhoneNumberIdentifier, options);\n } else {\n return this.callWithChatAdapter.addParticipant(participant as CommunicationUserIdentifier);\n }\n }\n\n /* @conditional-compile-remove(unsupported-browser) */\n public allowUnsupportedBrowserVersion(): void {\n return this.callWithChatAdapter.allowUnsupportedBrowserVersion();\n }\n\n public sendDtmfTone = async (dtmfTone: DtmfTone): Promise<void> => {\n await this.callWithChatAdapter.sendDtmfTone(dtmfTone);\n };\n\n public async startCaptions(options?: StartCaptionsOptions): Promise<void> {\n this.callWithChatAdapter.startCaptions(options);\n }\n\n public async stopCaptions(): Promise<void> {\n this.callWithChatAdapter.stopCaptions();\n }\n\n public async setCaptionLanguage(language: string): Promise<void> {\n this.callWithChatAdapter.setCaptionLanguage(language);\n }\n\n public async setSpokenLanguage(language: string): Promise<void> {\n this.callWithChatAdapter.setSpokenLanguage(language);\n }\n\n public async startVideoBackgroundEffect(videoBackgroundEffect: VideoBackgroundEffect): Promise<void> {\n await this.callWithChatAdapter.startVideoBackgroundEffect(videoBackgroundEffect);\n }\n\n public async stopVideoBackgroundEffects(): Promise<void> {\n await this.callWithChatAdapter.stopVideoBackgroundEffects();\n }\n\n public updateBackgroundPickerImages(backgroundImages: VideoBackgroundImage[]): void {\n return this.callWithChatAdapter.updateBackgroundPickerImages(backgroundImages);\n }\n\n public updateSelectedVideoBackgroundEffect(selectedVideoBackground: VideoBackgroundEffect): void {\n return this.callWithChatAdapter.updateSelectedVideoBackgroundEffect(selectedVideoBackground);\n }\n public async submitSurvey(survey: CallSurvey): Promise<CallSurveyResponse | undefined> {\n return this.callWithChatAdapter.submitSurvey(survey);\n }\n\n public async startSpotlight(userIds?: string[]): Promise<void> {\n return this.callWithChatAdapter.startSpotlight(userIds);\n }\n\n public async stopSpotlight(userIds?: string[]): Promise<void> {\n return this.callWithChatAdapter.stopSpotlight(userIds);\n }\n\n public async stopAllSpotlight(): Promise<void> {\n return this.callWithChatAdapter.stopAllSpotlight();\n }\n\n /* @conditional-compile-remove(soft-mute) */\n public async muteParticipant(userId: string): Promise<void> {\n return this.callWithChatAdapter.muteParticipant(userId);\n }\n\n /* @conditional-compile-remove(soft-mute) */\n public async muteAllRemoteParticipants(): Promise<void> {\n return this.callWithChatAdapter.muteAllRemoteParticipants();\n }\n}\n\nfunction callAdapterStateFromCallWithChatAdapterState(\n callWithChatAdapterState: CallWithChatAdapterState\n): CallAdapterState {\n return {\n isLocalPreviewMicrophoneEnabled: callWithChatAdapterState.isLocalPreviewMicrophoneEnabled,\n page: callWithChatAdapterState.page,\n userId: callWithChatAdapterState.userId,\n displayName: callWithChatAdapterState.displayName,\n call: callWithChatAdapterState.call,\n devices: callWithChatAdapterState.devices,\n isTeamsCall: callWithChatAdapterState.isTeamsCall,\n isTeamsMeeting: callWithChatAdapterState.isTeamsMeeting,\n isRoomsCall: false,\n latestErrors: callWithChatAdapterState.latestCallErrors,\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId: callWithChatAdapterState.alternateCallerId,\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo: callWithChatAdapterState.environmentInfo,\n\n videoBackgroundImages: callWithChatAdapterState.videoBackgroundImages,\n\n onResolveVideoEffectDependency: callWithChatAdapterState.onResolveVideoEffectDependency,\n\n selectedVideoBackgroundEffect: callWithChatAdapterState.selectedVideoBackgroundEffect,\n reactions: callWithChatAdapterState.reactions\n };\n}\n"]}
@@ -44,7 +44,7 @@ import { loadRichTextSendBox } from '../common/SendBoxPicker';
44
44
  * @private
45
45
  */
46
46
  export const ChatScreen = (props) => {
47
- var _a, _b, _c, _d;
47
+ var _a, _b, _c, _d, _e;
48
48
  const { onFetchAvatarPersonaData, onRenderMessage, onRenderTypingIndicator, options, styles,
49
49
  /* @conditional-compile-remove(file-sharing-acs) */
50
50
  attachmentOptions, formFactor } = props;
@@ -123,8 +123,28 @@ export const ChatScreen = (props) => {
123
123
  }, [styles === null || styles === void 0 ? void 0 : styles.sendBox]);
124
124
  const userId = toFlatCommunicationIdentifier(adapter.getState().userId);
125
125
  /* @conditional-compile-remove(file-sharing-acs) */
126
+ const setKeyboardFocusAfterFileSelection = useCallback(() => {
127
+ var _a;
128
+ // look up sendbox by ID for now, we will use `useRef`
129
+ // once attachment button is moved inside of send box component
130
+ // see ADO workitem #3764245
131
+ /* @conditional-compile-remove(rich-text-editor-composite-support) */
132
+ if ((_a = props.options) === null || _a === void 0 ? void 0 : _a.richTextEditor) {
133
+ const richTextSendBox = document === null || document === void 0 ? void 0 : document.querySelector(`[id="richTextSendBox"]`);
134
+ richTextSendBox === null || richTextSendBox === void 0 ? void 0 : richTextSendBox.focus();
135
+ return;
136
+ }
137
+ const sendBox = document === null || document === void 0 ? void 0 : document.querySelector(`[id="sendbox"]`);
138
+ // set send box on focus after file selection per A11y requirement
139
+ sendBox === null || sendBox === void 0 ? void 0 : sendBox.focus();
140
+ }, [
141
+ /* @conditional-compile-remove(rich-text-editor-composite-support) */
142
+ (_a = props.options) === null || _a === void 0 ? void 0 : _a.richTextEditor
143
+ ]);
144
+ /* @conditional-compile-remove(file-sharing-acs) */
126
145
  const attachmentUploadButtonOnChange = useCallback((files) => {
127
146
  var _a;
147
+ setKeyboardFocusAfterFileSelection();
128
148
  if (!files) {
129
149
  return;
130
150
  }
@@ -157,14 +177,14 @@ export const ChatScreen = (props) => {
157
177
  });
158
178
  handleUploadAction({ type: AttachmentUploadActionType.Set, newUploads });
159
179
  (_a = attachmentOptions === null || attachmentOptions === void 0 ? void 0 : attachmentOptions.uploadOptions) === null || _a === void 0 ? void 0 : _a.handleAttachmentSelection(newUploads);
160
- }, [attachmentOptions === null || attachmentOptions === void 0 ? void 0 : attachmentOptions.uploadOptions]);
180
+ }, [attachmentOptions === null || attachmentOptions === void 0 ? void 0 : attachmentOptions.uploadOptions, setKeyboardFocusAfterFileSelection]);
161
181
  /* @conditional-compile-remove(file-sharing-acs) */
162
182
  const onRenderAttachmentDownloads = useCallback((message) => {
163
183
  var _a, _b, _c;
164
184
  return ((_b = (_a = message === null || message === void 0 ? void 0 : message.attachments) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0 > 0) ? (React.createElement(_AttachmentDownloadCards, { attachments: message.attachments, message: message, actionsForAttachment: (_c = attachmentOptions === null || attachmentOptions === void 0 ? void 0 : attachmentOptions.downloadOptions) === null || _c === void 0 ? void 0 : _c.actionsForAttachment, onActionHandlerFailed: (errorMessage) => {
165
185
  setDownloadErrorMessage(errorMessage);
166
186
  } })) : (React.createElement(React.Fragment, null));
167
- }, [(_a = attachmentOptions === null || attachmentOptions === void 0 ? void 0 : attachmentOptions.downloadOptions) === null || _a === void 0 ? void 0 : _a.actionsForAttachment]);
187
+ }, [(_b = attachmentOptions === null || attachmentOptions === void 0 ? void 0 : attachmentOptions.downloadOptions) === null || _b === void 0 ? void 0 : _b.actionsForAttachment]);
168
188
  const onInlineImageClicked = useCallback((attachmentId, messageId) => {
169
189
  var _a, _b;
170
190
  const message = adapter.getState().thread.chatMessages[messageId];
@@ -262,9 +282,9 @@ export const ChatScreen = (props) => {
262
282
  return (React.createElement(AttachmentUploadButton, { supportedMediaTypes: (_b = attachmentOptions === null || attachmentOptions === void 0 ? void 0 : attachmentOptions.uploadOptions) === null || _b === void 0 ? void 0 : _b.supportedMediaTypes, disableMultipleUploads: (_c = attachmentOptions === null || attachmentOptions === void 0 ? void 0 : attachmentOptions.uploadOptions) === null || _c === void 0 ? void 0 : _c.disableMultipleUploads, onChange: attachmentUploadButtonOnChange }));
263
283
  return React.createElement(React.Fragment, null);
264
284
  }, [
265
- (_b = attachmentOptions === null || attachmentOptions === void 0 ? void 0 : attachmentOptions.uploadOptions) === null || _b === void 0 ? void 0 : _b.handleAttachmentSelection,
266
- (_c = attachmentOptions === null || attachmentOptions === void 0 ? void 0 : attachmentOptions.uploadOptions) === null || _c === void 0 ? void 0 : _c.supportedMediaTypes,
267
- (_d = attachmentOptions === null || attachmentOptions === void 0 ? void 0 : attachmentOptions.uploadOptions) === null || _d === void 0 ? void 0 : _d.disableMultipleUploads,
285
+ (_c = attachmentOptions === null || attachmentOptions === void 0 ? void 0 : attachmentOptions.uploadOptions) === null || _c === void 0 ? void 0 : _c.handleAttachmentSelection,
286
+ (_d = attachmentOptions === null || attachmentOptions === void 0 ? void 0 : attachmentOptions.uploadOptions) === null || _d === void 0 ? void 0 : _d.supportedMediaTypes,
287
+ (_e = attachmentOptions === null || attachmentOptions === void 0 ? void 0 : attachmentOptions.uploadOptions) === null || _e === void 0 ? void 0 : _e.disableMultipleUploads,
268
288
  attachmentUploadButtonOnChange
269
289
  ]);
270
290
  /* @conditional-compile-remove(file-sharing-acs) */
@@ -1 +1 @@
1
- {"version":3,"file":"ChatScreen.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/ChatComposite/ChatScreen.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;;;;;;;;;AAElC,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAEL,QAAQ,EAGR,aAAa,EAIb,eAAe,EAEf,QAAQ,EACT,yCAAmC;AAGpC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC/D,mDAAmD;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,aAAa,EAAiD,MAAM,yBAAyB,CAAC;AACvG,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1D,mDAAmD;AACnD,OAAO,EAAE,6BAA6B,IAAI,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AACzF,OAAO,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EACL,QAAQ,EACR,aAAa,EACb,WAAW,EACX,gCAAgC,EAChC,sBAAsB,EACtB,8BAA8B,EAC/B,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,+BAA+B,EAAE,MAAM,8CAA8C,CAAC;AAC/F,kEAAkE;AA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BACP,gBAAgB,IACpB,MAAM,EAAE,kBAAkB,EAC1B,SAAS,EAAE,GAAG,EAAE;gBACd,mBAAmB,CAAC,SAAS,CAAC,CAAC;gBAC/B,qBAAqB,CAAC,KAAK,CAAC,CAAC;gBAC7B,OAAO,CAAC,uBAAuB,CAAC;oBAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,QAAQ;oBAC5C,SAAS,EAAE,gBAAgB,CAAC,SAAS;oBACrC,WAAW,EAAE,gBAAgB,CAAC,QAAQ;iBACvC,CAAC,CAAC;YACL,CAAC,EACD,uBAAuB,EAAE,uBAAuB,IAChD,CACH,CACK,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { isIOS } from '@fluentui/react';\nimport { mergeStyles, Stack } from '@fluentui/react';\nimport { PersonaSize } from '@fluentui/react';\nimport {\n CommunicationParticipant,\n ErrorBar,\n MessageProps,\n MessageRenderer,\n MessageThread,\n MessageThreadStyles,\n ParticipantMenuItemsCallback,\n SendBoxStylesProps,\n TypingIndicator,\n TypingIndicatorStylesProps,\n useTheme\n} from '@internal/react-components';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { ChatMessage } from '@internal/react-components';\nimport React, { useCallback, useEffect, useMemo } from 'react';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { useReducer } from 'react';\nimport { useState } from 'react';\nimport { AvatarPersona, AvatarPersonaDataCallback, AvatarPersonaProps } from '../common/AvatarPersona';\nimport { useAdapter } from './adapter/ChatAdapterProvider';\nimport { ChatCompositeOptions } from './ChatComposite';\nimport { ChatHeader, getHeaderProps } from './ChatHeader';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentUploadButtonWrapper as AttachmentUploadButton } from './file-sharing';\nimport { useAdaptedSelector } from './hooks/useAdaptedSelector';\nimport { usePropsFor } from './hooks/usePropsFor';\n\nimport {\n chatArea,\n chatContainer,\n chatWrapper,\n messageThreadChatCompositeStyles,\n sendboxContainerStyles,\n typingIndicatorContainerStyles\n} from './styles/Chat.styles';\nimport { participantListContainerPadding } from '../common/styles/ParticipantContainer.styles';\n/* @conditional-compile-remove(chat-composite-participant-pane) */\nimport { ChatScreenPeoplePane } from './ChatScreenPeoplePane';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentDownloadErrorBar } from './AttachmentDownloadErrorBar';\nimport { _AttachmentDownloadCards } from '@internal/react-components';\nimport { ImageOverlay } from '@internal/react-components';\nimport { InlineImage } from '@internal/react-components';\nimport { ResourceFetchResult } from '@internal/chat-stateful-client';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentOptions } from '@internal/react-components';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { nanoid } from 'nanoid';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentUploadActionType, AttachmentUpload, AttachmentUploadReducer } from './file-sharing/AttachmentUpload';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\nimport { SendBoxPicker } from '../common/SendBoxPicker';\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport { loadRichTextSendBox } from '../common/SendBoxPicker';\n\n/**\n * @private\n */\nexport type ChatScreenProps = {\n options?: ChatCompositeOptions;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onRenderMessage?: (messageProps: MessageProps, defaultOnRender?: MessageRenderer) => JSX.Element;\n onRenderTypingIndicator?: (typingUsers: CommunicationParticipant[]) => JSX.Element;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n styles?: ChatScreenStyles;\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentOptions?: AttachmentOptions;\n formFactor?: 'desktop' | 'mobile';\n};\n\n/**\n * @private\n */\nexport type ChatScreenStyles = {\n messageThread?: MessageThreadStyles;\n sendBox?: SendBoxStylesProps;\n typingIndicator?: TypingIndicatorStylesProps;\n};\n\n/**\n * @private\n */\ninterface OverlayImageItem {\n imageSrc: string;\n title: string;\n titleIcon: JSX.Element;\n attachmentId: string;\n messageId: string;\n imageUrl: string;\n}\n\n/**\n * @private\n */\nexport const ChatScreen = (props: ChatScreenProps): JSX.Element => {\n const {\n onFetchAvatarPersonaData,\n onRenderMessage,\n onRenderTypingIndicator,\n options,\n styles,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentOptions,\n formFactor\n } = props;\n\n const defaultNumberOfChatMessagesToReload = 5;\n /* @conditional-compile-remove(file-sharing-acs) */\n const [downloadErrorMessage, setDownloadErrorMessage] = React.useState('');\n const [overlayImageItem, setOverlayImageItem] = useState<OverlayImageItem>();\n const [isImageOverlayOpen, setIsImageOverlayOpen] = useState<boolean>(false);\n /* @conditional-compile-remove(file-sharing-acs) */\n const [uploads, handleUploadAction] = useReducer(AttachmentUploadReducer, []);\n\n const adapter = useAdapter();\n const theme = useTheme();\n\n useEffect(() => {\n // Initial data should be always fetched by the composite(or external caller) instead of the adapter\n const fetchData: () => Promise<void> = async () => {\n // Fetch initial data for adapter\n await adapter.fetchInitialData();\n // Fetch initial set of messages. Without fetching messages here, if the Composite's adapter is changed the message thread does not load new messages.\n await adapter.loadPreviousChatMessages(defaultNumberOfChatMessagesToReload);\n };\n fetchData();\n }, [adapter]);\n\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n useEffect(() => {\n // if rich text editor is enabled, the rich text editor component should be loaded early for good UX\n if (options?.richTextEditor) {\n // this line is needed to load the Rooster JS dependencies early in the lifecycle\n // when the rich text editor is enabled\n loadRichTextSendBox();\n }\n }, [options?.richTextEditor]);\n\n const messageThreadProps = usePropsFor(MessageThread);\n const typingIndicatorProps = usePropsFor(TypingIndicator);\n const headerProps = useAdaptedSelector(getHeaderProps);\n const errorBarProps = usePropsFor(ErrorBar);\n\n useEffect(() => {\n if (overlayImageItem === undefined) {\n return;\n }\n const message = adapter.getState().thread.chatMessages[overlayImageItem.messageId];\n if (message === undefined) {\n return;\n }\n const resourceCache = message.resourceCache;\n if (overlayImageItem.imageSrc === '' && resourceCache && resourceCache[overlayImageItem.imageUrl]) {\n const fullSizeImageSrc = getResourceSourceUrl(resourceCache[overlayImageItem.imageUrl]);\n if (fullSizeImageSrc === undefined || fullSizeImageSrc === '' || overlayImageItem.imageSrc === fullSizeImageSrc) {\n return;\n }\n setOverlayImageItem({\n ...overlayImageItem,\n imageSrc: fullSizeImageSrc\n });\n }\n // Disable eslint because we are using the overlayImageItem in this effect but don't want to have it as a dependency, as it will cause an infinite loop.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [messageThreadProps.messages]);\n\n const getResourceSourceUrl = (result: ResourceFetchResult): string => {\n let src = '';\n if (result.error || !result.sourceUrl) {\n src = 'blob://';\n } else {\n src = result.sourceUrl;\n }\n\n return src;\n };\n\n const onRenderAvatarCallback = useCallback(\n (userId?: string, defaultOptions?: AvatarPersonaProps) => {\n return (\n <AvatarPersona\n userId={userId}\n hidePersonaDetails={true}\n {...defaultOptions}\n dataProvider={onFetchAvatarPersonaData}\n />\n );\n },\n [onFetchAvatarPersonaData]\n );\n\n const messageThreadStyles = useMemo(() => {\n return Object.assign(\n {},\n messageThreadChatCompositeStyles(theme.semanticColors.bodyBackground),\n styles?.messageThread\n );\n }, [styles?.messageThread, theme.semanticColors.bodyBackground]);\n\n const typingIndicatorStyles = useMemo(() => {\n return Object.assign({}, styles?.typingIndicator);\n }, [styles?.typingIndicator]);\n\n const sendBoxStyles = useMemo(() => {\n return Object.assign({}, styles?.sendBox);\n }, [styles?.sendBox]);\n\n const userId = toFlatCommunicationIdentifier(adapter.getState().userId);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const attachmentUploadButtonOnChange = useCallback(\n (files: FileList | null): void => {\n if (!files) {\n return;\n }\n\n // Get files, change to tasks, store locally and pass back to Contoso\n const newUploads = Array.from(files).map((file): AttachmentUpload => {\n const taskId = nanoid();\n return {\n file,\n taskId,\n metadata: {\n id: taskId,\n name: file.name,\n progress: 0\n },\n notifyUploadProgressChanged: (value: number) => {\n handleUploadAction({ type: AttachmentUploadActionType.Progress, taskId, progress: value });\n },\n notifyUploadCompleted: (id: string, url: string) => {\n handleUploadAction({ type: AttachmentUploadActionType.Completed, taskId, id, url });\n },\n notifyUploadFailed: (message: string) => {\n handleUploadAction({ type: AttachmentUploadActionType.Failed, taskId, message });\n // remove the failed upload task when error banner is auto dismissed after 10 seconds\n // so the banner won't be shown again on UI re-rendering.\n setTimeout(() => {\n handleUploadAction({ type: AttachmentUploadActionType.Remove, id: taskId });\n }, 10 * 1000);\n }\n };\n });\n\n handleUploadAction({ type: AttachmentUploadActionType.Set, newUploads });\n attachmentOptions?.uploadOptions?.handleAttachmentSelection(newUploads);\n },\n [attachmentOptions?.uploadOptions]\n );\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const onRenderAttachmentDownloads = useCallback(\n (message: ChatMessage) =>\n message?.attachments?.length ?? 0 > 0 ? (\n <_AttachmentDownloadCards\n attachments={message.attachments}\n message={message}\n actionsForAttachment={attachmentOptions?.downloadOptions?.actionsForAttachment}\n onActionHandlerFailed={(errorMessage: string) => {\n setDownloadErrorMessage(errorMessage);\n }}\n />\n ) : (\n <></>\n ),\n [attachmentOptions?.downloadOptions?.actionsForAttachment]\n );\n\n const onInlineImageClicked = useCallback(\n (attachmentId: string, messageId: string) => {\n const message = adapter.getState().thread.chatMessages[messageId];\n const inlinedImages = message.content?.attachments?.filter((attachment) => {\n return attachment.attachmentType === 'image' && attachment.id === attachmentId;\n });\n\n if (!inlinedImages || inlinedImages.length <= 0) {\n return;\n }\n\n const attachment = inlinedImages[0];\n\n const resourceCache = message.resourceCache;\n let imageSrc = '';\n\n if (attachment.url) {\n if (resourceCache && resourceCache[attachment.url]) {\n imageSrc = getResourceSourceUrl(resourceCache[attachment.url]);\n } else {\n adapter.downloadResourceToCache({\n threadId: adapter.getState().thread.threadId,\n messageId: messageId,\n resourceUrl: attachment.url\n });\n }\n }\n\n const titleIconRenderOptions = {\n text: message.senderDisplayName,\n size: PersonaSize.size32,\n showOverflowTooltip: false,\n imageAlt: message.senderDisplayName\n };\n\n const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;\n const titleIcon = onRenderAvatarCallback && onRenderAvatarCallback(messageSenderId, titleIconRenderOptions);\n const overlayImage: OverlayImageItem = {\n title: message.senderDisplayName || '',\n titleIcon: titleIcon,\n attachmentId: attachment.id,\n imageSrc: imageSrc,\n messageId: messageId,\n imageUrl: attachment.url || ''\n };\n\n setIsImageOverlayOpen(true);\n setOverlayImageItem(overlayImage);\n },\n [adapter, onRenderAvatarCallback, userId]\n );\n\n const onRenderInlineImage = useCallback(\n (inlineImage: InlineImage, defaultOnRender: (inlineImage: InlineImage) => JSX.Element): JSX.Element => {\n const message = adapter.getState().thread.chatMessages[inlineImage.messageId];\n const attachment = message?.content?.attachments?.find(\n (attachment) => attachment.id === inlineImage.imageAttributes.id\n );\n\n if (attachment === undefined) {\n return defaultOnRender(inlineImage);\n }\n\n let pointerEvents: 'none' | 'auto' = inlineImage.imageAttributes.src === '' ? 'none' : 'auto';\n const resourceCache = message.resourceCache;\n if (\n resourceCache &&\n attachment.previewUrl &&\n resourceCache[attachment.previewUrl] &&\n resourceCache[attachment.previewUrl].error\n ) {\n pointerEvents = 'none';\n }\n\n return (\n <span\n key={inlineImage.imageAttributes.id}\n onClick={() => onInlineImageClicked(inlineImage.imageAttributes.id || '', inlineImage.messageId)}\n tabIndex={0}\n role=\"button\"\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n onInlineImageClicked(inlineImage.imageAttributes.id || '', inlineImage.messageId);\n }\n }}\n style={{ cursor: 'pointer', pointerEvents }}\n >\n {defaultOnRender(inlineImage)}\n </span>\n );\n },\n [adapter, onInlineImageClicked]\n );\n\n const inlineImageOptions = useMemo(() => {\n return { onRenderInlineImage: onRenderInlineImage };\n }, [onRenderInlineImage]);\n\n const onDownloadButtonClicked = useCallback(\n (imageSrc: string): void => {\n if (imageSrc === '') {\n return;\n }\n if (isIOS()) {\n window.open(imageSrc, '_blank');\n } else {\n // Create a new anchor element\n const a = document.createElement('a');\n // Set the href and download attributes for the anchor element\n a.href = imageSrc;\n a.download = overlayImageItem?.attachmentId || '';\n a.rel = 'noopener noreferrer';\n a.target = '_blank';\n\n // Programmatically click the anchor element to trigger the download\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n }\n },\n [overlayImageItem?.attachmentId]\n );\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const AttachmentButton = useCallback(() => {\n if (!attachmentOptions?.uploadOptions?.handleAttachmentSelection) {\n return null;\n }\n return (\n <AttachmentUploadButton\n supportedMediaTypes={attachmentOptions?.uploadOptions?.supportedMediaTypes}\n disableMultipleUploads={attachmentOptions?.uploadOptions?.disableMultipleUploads}\n onChange={attachmentUploadButtonOnChange}\n />\n );\n return <></>;\n }, [\n attachmentOptions?.uploadOptions?.handleAttachmentSelection,\n attachmentOptions?.uploadOptions?.supportedMediaTypes,\n attachmentOptions?.uploadOptions?.disableMultipleUploads,\n attachmentUploadButtonOnChange\n ]);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const attachments = useMemo(() => {\n return uploads?.map((v) => v.metadata);\n }, [uploads]);\n\n const onSendMessageHandler = useCallback(\n async function (\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */ /* @conditional-compile-remove(rich-text-editor-composite-support) */ options?: MessageOptions\n ) {\n /* @conditional-compile-remove(file-sharing-acs) */\n const attachments = options?.attachments ?? [];\n /* @conditional-compile-remove(file-sharing-acs) */\n handleUploadAction({ type: AttachmentUploadActionType.Clear });\n /* @conditional-compile-remove(file-sharing-acs) */\n await adapter.sendMessage(content, {\n attachments: attachments,\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n type: options?.type\n });\n /* @conditional-compile-remove(file-sharing-acs) */\n return;\n await adapter.sendMessage(content, {\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n type: options?.type\n });\n },\n [adapter]\n );\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const onCancelUploadHandler = useCallback(\n (id: string) => {\n handleUploadAction({ type: AttachmentUploadActionType.Remove, id });\n attachmentOptions?.uploadOptions?.handleAttachmentRemoval?.(id);\n },\n [attachmentOptions?.uploadOptions]\n );\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n const removeImageTags = useCallback((event: { content: DocumentFragment }) => {\n event.content.querySelectorAll('img').forEach((image) => {\n // If the image is the only child of its parent, remove all the parents of this img element.\n let parentNode: HTMLElement | null = image.parentElement;\n let currentNode: HTMLElement = image;\n while (parentNode?.childNodes.length === 1) {\n currentNode = parentNode;\n parentNode = parentNode.parentElement;\n }\n currentNode?.remove();\n });\n }, []);\n\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n const richTextEditorOptions = useMemo(() => {\n return options?.richTextEditor\n ? {\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ onPaste: removeImageTags\n }\n : undefined;\n }, [options?.richTextEditor, removeImageTags]);\n\n return (\n <Stack className={chatContainer} grow>\n {options?.topic !== false && <ChatHeader {...headerProps} />}\n <Stack className={chatArea} tokens={participantListContainerPadding} horizontal grow>\n <Stack className={chatWrapper} grow>\n {options?.errorBar !== false && <ErrorBar {...errorBarProps} />}\n {\n /* @conditional-compile-remove(file-sharing-acs) */\n <AttachmentDownloadErrorBar\n onDismissDownloadErrorMessage={useCallback(() => {\n setDownloadErrorMessage('');\n }, [])}\n attachmentDownloadErrorMessage={downloadErrorMessage || ''}\n />\n }\n <MessageThread\n {...messageThreadProps}\n onRenderAvatar={onRenderAvatarCallback}\n onRenderMessage={onRenderMessage}\n /* @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentDownloads={onRenderAttachmentDownloads}\n inlineImageOptions={inlineImageOptions}\n numberOfChatMessagesToReload={defaultNumberOfChatMessagesToReload}\n styles={messageThreadStyles}\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditorOptions={richTextEditorOptions}\n />\n <Stack className={mergeStyles(sendboxContainerStyles)}>\n <div className={mergeStyles(typingIndicatorContainerStyles)}>\n {onRenderTypingIndicator ? (\n onRenderTypingIndicator(typingIndicatorProps.typingUsers)\n ) : (\n <TypingIndicator {...typingIndicatorProps} styles={typingIndicatorStyles} />\n )}\n </div>\n <Stack horizontal={formFactor === 'mobile'}>\n {formFactor === 'mobile' && (\n /* @conditional-compile-remove(file-sharing-acs) */\n <Stack verticalAlign=\"center\">\n <AttachmentButton />\n </Stack>\n )}\n <Stack grow>\n <SendBoxPicker\n styles={sendBoxStyles}\n autoFocus={options?.autoFocus}\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditorOptions={richTextEditorOptions}\n /* @conditional-compile-remove(file-sharing-acs) */\n attachments={attachments}\n /* @conditional-compile-remove(file-sharing-acs) */\n onCancelAttachmentUpload={onCancelUploadHandler}\n // we need to overwrite onSendMessage for SendBox because we need to clear attachment state\n // when submit button is clicked\n onSendMessage={onSendMessageHandler}\n />\n </Stack>\n {formFactor !== 'mobile' && (\n /* @conditional-compile-remove(file-sharing-acs) */\n <AttachmentButton />\n )}\n </Stack>\n </Stack>\n </Stack>\n {\n /* @conditional-compile-remove(chat-composite-participant-pane) */\n options?.participantPane === true && (\n <ChatScreenPeoplePane\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={props.onFetchParticipantMenuItems}\n isMobile={formFactor === 'mobile'}\n />\n )\n }\n </Stack>\n {overlayImageItem && (\n <ImageOverlay\n {...overlayImageItem}\n isOpen={isImageOverlayOpen}\n onDismiss={() => {\n setOverlayImageItem(undefined);\n setIsImageOverlayOpen(false);\n adapter.removeResourceFromCache({\n threadId: adapter.getState().thread.threadId,\n messageId: overlayImageItem.messageId,\n resourceUrl: overlayImageItem.imageUrl\n });\n }}\n onDownloadButtonClicked={onDownloadButtonClicked}\n />\n )}\n </Stack>\n );\n};\n"]}
1
+ {"version":3,"file":"ChatScreen.js","sour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B;gCAC5C,mDAAmD;gCACnD,WAAW,EAAE,WAAW;gCACxB,mDAAmD;gCACnD,wBAAwB,EAAE,qBAAqB;gCAC/C,2FAA2F;gCAC3F,gCAAgC;gCAChC,aAAa,EAAE,oBAAoB,GACnC,CACI;wBACP,UAAU,KAAK,QAAQ,IAAI;wBAC1B,mDAAmD;wBACnD,oBAAC,gBAAgB,OAAG,CACrB,CACK,CACF,CACF;YAEN,kEAAkE;YAClE,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,eAAe,MAAK,IAAI,IAAI,CACnC,oBAAC,oBAAoB,IACnB,wBAAwB,EAAE,wBAAwB,EAClD,2BAA2B,EAAE,KAAK,CAAC,2BAA2B,EAC9D,QAAQ,EAAE,UAAU,KAAK,QAAQ,GACjC,CACH,CAEG;QACP,gBAAgB,IAAI,CACnB,oBAAC,YAAY,oBACP,gBAAgB,IACpB,MAAM,EAAE,kBAAkB,EAC1B,SAAS,EAAE,GAAG,EAAE;gBACd,mBAAmB,CAAC,SAAS,CAAC,CAAC;gBAC/B,qBAAqB,CAAC,KAAK,CAAC,CAAC;gBAC7B,OAAO,CAAC,uBAAuB,CAAC;oBAC9B,QAAQ,EAAE,OAAO,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,QAAQ;oBAC5C,SAAS,EAAE,gBAAgB,CAAC,SAAS;oBACrC,WAAW,EAAE,gBAAgB,CAAC,QAAQ;iBACvC,CAAC,CAAC;YACL,CAAC,EACD,uBAAuB,EAAE,uBAAuB,IAChD,CACH,CACK,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { isIOS } from '@fluentui/react';\nimport { mergeStyles, Stack } from '@fluentui/react';\nimport { PersonaSize } from '@fluentui/react';\nimport {\n CommunicationParticipant,\n ErrorBar,\n MessageProps,\n MessageRenderer,\n MessageThread,\n MessageThreadStyles,\n ParticipantMenuItemsCallback,\n SendBoxStylesProps,\n TypingIndicator,\n TypingIndicatorStylesProps,\n useTheme\n} from '@internal/react-components';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { ChatMessage } from '@internal/react-components';\nimport React, { useCallback, useEffect, useMemo } from 'react';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { useReducer } from 'react';\nimport { useState } from 'react';\nimport { AvatarPersona, AvatarPersonaDataCallback, AvatarPersonaProps } from '../common/AvatarPersona';\nimport { useAdapter } from './adapter/ChatAdapterProvider';\nimport { ChatCompositeOptions } from './ChatComposite';\nimport { ChatHeader, getHeaderProps } from './ChatHeader';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentUploadButtonWrapper as AttachmentUploadButton } from './file-sharing';\nimport { useAdaptedSelector } from './hooks/useAdaptedSelector';\nimport { usePropsFor } from './hooks/usePropsFor';\n\nimport {\n chatArea,\n chatContainer,\n chatWrapper,\n messageThreadChatCompositeStyles,\n sendboxContainerStyles,\n typingIndicatorContainerStyles\n} from './styles/Chat.styles';\nimport { participantListContainerPadding } from '../common/styles/ParticipantContainer.styles';\n/* @conditional-compile-remove(chat-composite-participant-pane) */\nimport { ChatScreenPeoplePane } from './ChatScreenPeoplePane';\nimport { toFlatCommunicationIdentifier } from '@internal/acs-ui-common';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentDownloadErrorBar } from './AttachmentDownloadErrorBar';\nimport { _AttachmentDownloadCards } from '@internal/react-components';\nimport { ImageOverlay } from '@internal/react-components';\nimport { InlineImage } from '@internal/react-components';\nimport { ResourceFetchResult } from '@internal/chat-stateful-client';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentOptions } from '@internal/react-components';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { nanoid } from 'nanoid';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { AttachmentUploadActionType, AttachmentUpload, AttachmentUploadReducer } from './file-sharing/AttachmentUpload';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { MessageOptions } from '@internal/acs-ui-common';\nimport { SendBoxPicker } from '../common/SendBoxPicker';\n/* @conditional-compile-remove(rich-text-editor-composite-support) */\nimport { loadRichTextSendBox } from '../common/SendBoxPicker';\n\n/**\n * @private\n */\nexport type ChatScreenProps = {\n options?: ChatCompositeOptions;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onRenderMessage?: (messageProps: MessageProps, defaultOnRender?: MessageRenderer) => JSX.Element;\n onRenderTypingIndicator?: (typingUsers: CommunicationParticipant[]) => JSX.Element;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n styles?: ChatScreenStyles;\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentOptions?: AttachmentOptions;\n formFactor?: 'desktop' | 'mobile';\n};\n\n/**\n * @private\n */\nexport type ChatScreenStyles = {\n messageThread?: MessageThreadStyles;\n sendBox?: SendBoxStylesProps;\n typingIndicator?: TypingIndicatorStylesProps;\n};\n\n/**\n * @private\n */\ninterface OverlayImageItem {\n imageSrc: string;\n title: string;\n titleIcon: JSX.Element;\n attachmentId: string;\n messageId: string;\n imageUrl: string;\n}\n\n/**\n * @private\n */\nexport const ChatScreen = (props: ChatScreenProps): JSX.Element => {\n const {\n onFetchAvatarPersonaData,\n onRenderMessage,\n onRenderTypingIndicator,\n options,\n styles,\n /* @conditional-compile-remove(file-sharing-acs) */\n attachmentOptions,\n formFactor\n } = props;\n\n const defaultNumberOfChatMessagesToReload = 5;\n /* @conditional-compile-remove(file-sharing-acs) */\n const [downloadErrorMessage, setDownloadErrorMessage] = React.useState('');\n const [overlayImageItem, setOverlayImageItem] = useState<OverlayImageItem>();\n const [isImageOverlayOpen, setIsImageOverlayOpen] = useState<boolean>(false);\n /* @conditional-compile-remove(file-sharing-acs) */\n const [uploads, handleUploadAction] = useReducer(AttachmentUploadReducer, []);\n\n const adapter = useAdapter();\n const theme = useTheme();\n\n useEffect(() => {\n // Initial data should be always fetched by the composite(or external caller) instead of the adapter\n const fetchData: () => Promise<void> = async () => {\n // Fetch initial data for adapter\n await adapter.fetchInitialData();\n // Fetch initial set of messages. Without fetching messages here, if the Composite's adapter is changed the message thread does not load new messages.\n await adapter.loadPreviousChatMessages(defaultNumberOfChatMessagesToReload);\n };\n fetchData();\n }, [adapter]);\n\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n useEffect(() => {\n // if rich text editor is enabled, the rich text editor component should be loaded early for good UX\n if (options?.richTextEditor) {\n // this line is needed to load the Rooster JS dependencies early in the lifecycle\n // when the rich text editor is enabled\n loadRichTextSendBox();\n }\n }, [options?.richTextEditor]);\n\n const messageThreadProps = usePropsFor(MessageThread);\n const typingIndicatorProps = usePropsFor(TypingIndicator);\n const headerProps = useAdaptedSelector(getHeaderProps);\n const errorBarProps = usePropsFor(ErrorBar);\n\n useEffect(() => {\n if (overlayImageItem === undefined) {\n return;\n }\n const message = adapter.getState().thread.chatMessages[overlayImageItem.messageId];\n if (message === undefined) {\n return;\n }\n const resourceCache = message.resourceCache;\n if (overlayImageItem.imageSrc === '' && resourceCache && resourceCache[overlayImageItem.imageUrl]) {\n const fullSizeImageSrc = getResourceSourceUrl(resourceCache[overlayImageItem.imageUrl]);\n if (fullSizeImageSrc === undefined || fullSizeImageSrc === '' || overlayImageItem.imageSrc === fullSizeImageSrc) {\n return;\n }\n setOverlayImageItem({\n ...overlayImageItem,\n imageSrc: fullSizeImageSrc\n });\n }\n // Disable eslint because we are using the overlayImageItem in this effect but don't want to have it as a dependency, as it will cause an infinite loop.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [messageThreadProps.messages]);\n\n const getResourceSourceUrl = (result: ResourceFetchResult): string => {\n let src = '';\n if (result.error || !result.sourceUrl) {\n src = 'blob://';\n } else {\n src = result.sourceUrl;\n }\n\n return src;\n };\n\n const onRenderAvatarCallback = useCallback(\n (userId?: string, defaultOptions?: AvatarPersonaProps) => {\n return (\n <AvatarPersona\n userId={userId}\n hidePersonaDetails={true}\n {...defaultOptions}\n dataProvider={onFetchAvatarPersonaData}\n />\n );\n },\n [onFetchAvatarPersonaData]\n );\n\n const messageThreadStyles = useMemo(() => {\n return Object.assign(\n {},\n messageThreadChatCompositeStyles(theme.semanticColors.bodyBackground),\n styles?.messageThread\n );\n }, [styles?.messageThread, theme.semanticColors.bodyBackground]);\n\n const typingIndicatorStyles = useMemo(() => {\n return Object.assign({}, styles?.typingIndicator);\n }, [styles?.typingIndicator]);\n\n const sendBoxStyles = useMemo(() => {\n return Object.assign({}, styles?.sendBox);\n }, [styles?.sendBox]);\n\n const userId = toFlatCommunicationIdentifier(adapter.getState().userId);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const setKeyboardFocusAfterFileSelection = useCallback(() => {\n // look up sendbox by ID for now, we will use `useRef`\n // once attachment button is moved inside of send box component\n // see ADO workitem #3764245\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n if (props.options?.richTextEditor) {\n const richTextSendBox = document?.querySelector(`[id=\"richTextSendBox\"]`) as HTMLDivElement;\n richTextSendBox?.focus();\n return;\n }\n const sendBox = document?.querySelector(`[id=\"sendbox\"]`) as HTMLTextAreaElement;\n // set send box on focus after file selection per A11y requirement\n sendBox?.focus();\n }, [\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n props.options?.richTextEditor\n ]);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const attachmentUploadButtonOnChange = useCallback(\n (files: FileList | null): void => {\n setKeyboardFocusAfterFileSelection();\n\n if (!files) {\n return;\n }\n\n // Get files, change to tasks, store locally and pass back to Contoso\n const newUploads = Array.from(files).map((file): AttachmentUpload => {\n const taskId = nanoid();\n return {\n file,\n taskId,\n metadata: {\n id: taskId,\n name: file.name,\n progress: 0\n },\n notifyUploadProgressChanged: (value: number) => {\n handleUploadAction({ type: AttachmentUploadActionType.Progress, taskId, progress: value });\n },\n notifyUploadCompleted: (id: string, url: string) => {\n handleUploadAction({ type: AttachmentUploadActionType.Completed, taskId, id, url });\n },\n notifyUploadFailed: (message: string) => {\n handleUploadAction({ type: AttachmentUploadActionType.Failed, taskId, message });\n // remove the failed upload task when error banner is auto dismissed after 10 seconds\n // so the banner won't be shown again on UI re-rendering.\n setTimeout(() => {\n handleUploadAction({ type: AttachmentUploadActionType.Remove, id: taskId });\n }, 10 * 1000);\n }\n };\n });\n\n handleUploadAction({ type: AttachmentUploadActionType.Set, newUploads });\n attachmentOptions?.uploadOptions?.handleAttachmentSelection(newUploads);\n },\n [attachmentOptions?.uploadOptions, setKeyboardFocusAfterFileSelection]\n );\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const onRenderAttachmentDownloads = useCallback(\n (message: ChatMessage) =>\n message?.attachments?.length ?? 0 > 0 ? (\n <_AttachmentDownloadCards\n attachments={message.attachments}\n message={message}\n actionsForAttachment={attachmentOptions?.downloadOptions?.actionsForAttachment}\n onActionHandlerFailed={(errorMessage: string) => {\n setDownloadErrorMessage(errorMessage);\n }}\n />\n ) : (\n <></>\n ),\n [attachmentOptions?.downloadOptions?.actionsForAttachment]\n );\n\n const onInlineImageClicked = useCallback(\n (attachmentId: string, messageId: string) => {\n const message = adapter.getState().thread.chatMessages[messageId];\n const inlinedImages = message.content?.attachments?.filter((attachment) => {\n return attachment.attachmentType === 'image' && attachment.id === attachmentId;\n });\n\n if (!inlinedImages || inlinedImages.length <= 0) {\n return;\n }\n\n const attachment = inlinedImages[0];\n\n const resourceCache = message.resourceCache;\n let imageSrc = '';\n\n if (attachment.url) {\n if (resourceCache && resourceCache[attachment.url]) {\n imageSrc = getResourceSourceUrl(resourceCache[attachment.url]);\n } else {\n adapter.downloadResourceToCache({\n threadId: adapter.getState().thread.threadId,\n messageId: messageId,\n resourceUrl: attachment.url\n });\n }\n }\n\n const titleIconRenderOptions = {\n text: message.senderDisplayName,\n size: PersonaSize.size32,\n showOverflowTooltip: false,\n imageAlt: message.senderDisplayName\n };\n\n const messageSenderId = message.sender !== undefined ? toFlatCommunicationIdentifier(message.sender) : userId;\n const titleIcon = onRenderAvatarCallback && onRenderAvatarCallback(messageSenderId, titleIconRenderOptions);\n const overlayImage: OverlayImageItem = {\n title: message.senderDisplayName || '',\n titleIcon: titleIcon,\n attachmentId: attachment.id,\n imageSrc: imageSrc,\n messageId: messageId,\n imageUrl: attachment.url || ''\n };\n\n setIsImageOverlayOpen(true);\n setOverlayImageItem(overlayImage);\n },\n [adapter, onRenderAvatarCallback, userId]\n );\n\n const onRenderInlineImage = useCallback(\n (inlineImage: InlineImage, defaultOnRender: (inlineImage: InlineImage) => JSX.Element): JSX.Element => {\n const message = adapter.getState().thread.chatMessages[inlineImage.messageId];\n const attachment = message?.content?.attachments?.find(\n (attachment) => attachment.id === inlineImage.imageAttributes.id\n );\n\n if (attachment === undefined) {\n return defaultOnRender(inlineImage);\n }\n\n let pointerEvents: 'none' | 'auto' = inlineImage.imageAttributes.src === '' ? 'none' : 'auto';\n const resourceCache = message.resourceCache;\n if (\n resourceCache &&\n attachment.previewUrl &&\n resourceCache[attachment.previewUrl] &&\n resourceCache[attachment.previewUrl].error\n ) {\n pointerEvents = 'none';\n }\n\n return (\n <span\n key={inlineImage.imageAttributes.id}\n onClick={() => onInlineImageClicked(inlineImage.imageAttributes.id || '', inlineImage.messageId)}\n tabIndex={0}\n role=\"button\"\n onKeyDown={(e) => {\n if (e.key === 'Enter') {\n onInlineImageClicked(inlineImage.imageAttributes.id || '', inlineImage.messageId);\n }\n }}\n style={{ cursor: 'pointer', pointerEvents }}\n >\n {defaultOnRender(inlineImage)}\n </span>\n );\n },\n [adapter, onInlineImageClicked]\n );\n\n const inlineImageOptions = useMemo(() => {\n return { onRenderInlineImage: onRenderInlineImage };\n }, [onRenderInlineImage]);\n\n const onDownloadButtonClicked = useCallback(\n (imageSrc: string): void => {\n if (imageSrc === '') {\n return;\n }\n if (isIOS()) {\n window.open(imageSrc, '_blank');\n } else {\n // Create a new anchor element\n const a = document.createElement('a');\n // Set the href and download attributes for the anchor element\n a.href = imageSrc;\n a.download = overlayImageItem?.attachmentId || '';\n a.rel = 'noopener noreferrer';\n a.target = '_blank';\n\n // Programmatically click the anchor element to trigger the download\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n }\n },\n [overlayImageItem?.attachmentId]\n );\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const AttachmentButton = useCallback(() => {\n if (!attachmentOptions?.uploadOptions?.handleAttachmentSelection) {\n return null;\n }\n return (\n <AttachmentUploadButton\n supportedMediaTypes={attachmentOptions?.uploadOptions?.supportedMediaTypes}\n disableMultipleUploads={attachmentOptions?.uploadOptions?.disableMultipleUploads}\n onChange={attachmentUploadButtonOnChange}\n />\n );\n return <></>;\n }, [\n attachmentOptions?.uploadOptions?.handleAttachmentSelection,\n attachmentOptions?.uploadOptions?.supportedMediaTypes,\n attachmentOptions?.uploadOptions?.disableMultipleUploads,\n attachmentUploadButtonOnChange\n ]);\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const attachments = useMemo(() => {\n return uploads?.map((v) => v.metadata);\n }, [uploads]);\n\n const onSendMessageHandler = useCallback(\n async function (\n content: string,\n /* @conditional-compile-remove(file-sharing-acs) */ /* @conditional-compile-remove(rich-text-editor-composite-support) */ options?: MessageOptions\n ) {\n /* @conditional-compile-remove(file-sharing-acs) */\n const attachments = options?.attachments ?? [];\n /* @conditional-compile-remove(file-sharing-acs) */\n handleUploadAction({ type: AttachmentUploadActionType.Clear });\n /* @conditional-compile-remove(file-sharing-acs) */\n await adapter.sendMessage(content, {\n attachments: attachments,\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n type: options?.type\n });\n /* @conditional-compile-remove(file-sharing-acs) */\n return;\n await adapter.sendMessage(content, {\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n type: options?.type\n });\n },\n [adapter]\n );\n\n /* @conditional-compile-remove(file-sharing-acs) */\n const onCancelUploadHandler = useCallback(\n (id: string) => {\n handleUploadAction({ type: AttachmentUploadActionType.Remove, id });\n attachmentOptions?.uploadOptions?.handleAttachmentRemoval?.(id);\n },\n [attachmentOptions?.uploadOptions]\n );\n\n /* @conditional-compile-remove(rich-text-editor-image-upload) */\n const removeImageTags = useCallback((event: { content: DocumentFragment }) => {\n event.content.querySelectorAll('img').forEach((image) => {\n // If the image is the only child of its parent, remove all the parents of this img element.\n let parentNode: HTMLElement | null = image.parentElement;\n let currentNode: HTMLElement = image;\n while (parentNode?.childNodes.length === 1) {\n currentNode = parentNode;\n parentNode = parentNode.parentElement;\n }\n currentNode?.remove();\n });\n }, []);\n\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n const richTextEditorOptions = useMemo(() => {\n return options?.richTextEditor\n ? {\n /* @conditional-compile-remove(rich-text-editor-image-upload) */ onPaste: removeImageTags\n }\n : undefined;\n }, [options?.richTextEditor, removeImageTags]);\n\n return (\n <Stack className={chatContainer} grow>\n {options?.topic !== false && <ChatHeader {...headerProps} />}\n <Stack className={chatArea} tokens={participantListContainerPadding} horizontal grow>\n <Stack className={chatWrapper} grow>\n {options?.errorBar !== false && <ErrorBar {...errorBarProps} />}\n {\n /* @conditional-compile-remove(file-sharing-acs) */\n <AttachmentDownloadErrorBar\n onDismissDownloadErrorMessage={useCallback(() => {\n setDownloadErrorMessage('');\n }, [])}\n attachmentDownloadErrorMessage={downloadErrorMessage || ''}\n />\n }\n <MessageThread\n {...messageThreadProps}\n onRenderAvatar={onRenderAvatarCallback}\n onRenderMessage={onRenderMessage}\n /* @conditional-compile-remove(file-sharing-acs) */\n onRenderAttachmentDownloads={onRenderAttachmentDownloads}\n inlineImageOptions={inlineImageOptions}\n numberOfChatMessagesToReload={defaultNumberOfChatMessagesToReload}\n styles={messageThreadStyles}\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditorOptions={richTextEditorOptions}\n />\n <Stack className={mergeStyles(sendboxContainerStyles)}>\n <div className={mergeStyles(typingIndicatorContainerStyles)}>\n {onRenderTypingIndicator ? (\n onRenderTypingIndicator(typingIndicatorProps.typingUsers)\n ) : (\n <TypingIndicator {...typingIndicatorProps} styles={typingIndicatorStyles} />\n )}\n </div>\n <Stack horizontal={formFactor === 'mobile'}>\n {formFactor === 'mobile' && (\n /* @conditional-compile-remove(file-sharing-acs) */\n <Stack verticalAlign=\"center\">\n <AttachmentButton />\n </Stack>\n )}\n <Stack grow>\n <SendBoxPicker\n styles={sendBoxStyles}\n autoFocus={options?.autoFocus}\n /* @conditional-compile-remove(rich-text-editor-composite-support) */\n richTextEditorOptions={richTextEditorOptions}\n /* @conditional-compile-remove(file-sharing-acs) */\n attachments={attachments}\n /* @conditional-compile-remove(file-sharing-acs) */\n onCancelAttachmentUpload={onCancelUploadHandler}\n // we need to overwrite onSendMessage for SendBox because we need to clear attachment state\n // when submit button is clicked\n onSendMessage={onSendMessageHandler}\n />\n </Stack>\n {formFactor !== 'mobile' && (\n /* @conditional-compile-remove(file-sharing-acs) */\n <AttachmentButton />\n )}\n </Stack>\n </Stack>\n </Stack>\n {\n /* @conditional-compile-remove(chat-composite-participant-pane) */\n options?.participantPane === true && (\n <ChatScreenPeoplePane\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={props.onFetchParticipantMenuItems}\n isMobile={formFactor === 'mobile'}\n />\n )\n }\n </Stack>\n {overlayImageItem && (\n <ImageOverlay\n {...overlayImageItem}\n isOpen={isImageOverlayOpen}\n onDismiss={() => {\n setOverlayImageItem(undefined);\n setIsImageOverlayOpen(false);\n adapter.removeResourceFromCache({\n threadId: adapter.getState().thread.threadId,\n messageId: overlayImageItem.messageId,\n resourceUrl: overlayImageItem.imageUrl\n });\n }}\n onDownloadButtonClicked={onDownloadButtonClicked}\n />\n )}\n </Stack>\n );\n};\n"]}
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
  /* @conditional-compile-remove(file-sharing-acs) */
4
- import { IconButton, mergeStyles, Stack, useTheme } from '@fluentui/react';
4
+ import { IconButton, mergeStyles, Stack, TooltipHost, useTheme } from '@fluentui/react';
5
5
  /* @conditional-compile-remove(file-sharing-acs) */
6
6
  import React from 'react';
7
7
  /* @conditional-compile-remove(file-sharing-acs) */
@@ -41,9 +41,10 @@ export const AttachmentUploadButton = (props) => {
41
41
  var _a;
42
42
  (_a = inputRef.current) === null || _a === void 0 ? void 0 : _a.click();
43
43
  } },
44
- React.createElement(IconButton, { className: iconButtonClassName, ariaLabel: uploadAttachmentButtonStringTrampoline() },
45
- React.createElement(SendBoxAttachFileIconTrampoline, null))),
46
- React.createElement("input", { "data-testid": "attachment-upload-button", ref: inputRef, hidden: true, multiple: !disableMultipleUploads, accept: supportedMediaTypes.join(','), type: "file", onClick: (e) => {
44
+ React.createElement(TooltipHost, { content: uploadAttachmentButtonStringTrampoline(), "data-ui-id": "chat-composite-message-tooltip" },
45
+ React.createElement(IconButton, { className: iconButtonClassName, ariaLabel: uploadAttachmentButtonStringTrampoline(), autoFocus: false },
46
+ React.createElement(SendBoxAttachFileIconTrampoline, null)))),
47
+ React.createElement("input", { "data-testid": "attachment-upload-button", ref: inputRef, autoFocus: false, hidden: true, multiple: !disableMultipleUploads, accept: supportedMediaTypes.join(','), type: "file", onClick: (e) => {
47
48
  // To ensure that `onChange` is fired even if the same file is picked again.
48
49
  e.currentTarget.value = '';
49
50
  }, onChange: (e) => {
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentUploadButton.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,mDAAmD;AACnD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC3E,mDAAmD;AACnD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,mDAAmD;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,mDAAmD;AACnD,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AA8B/C,mDAAmD;AACnD;;GAEG;AACH,MAAM,CA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,EACX,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE;gBACb,4EAA4E;gBAC5E,CAAC,CAAC,aAAa,CAAC,KAAK,GAAG,EAAE,CAAC;YAC7B,CAAC,EACD,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE;gBACd,QAAQ,IAAI,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;YAC9C,CAAC,GACD,CACD,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,mDAAmD;AACnD,MAAM,+BAA+B,GAAG,GAAgB,EAAE;IACxD,mDAAmD;IACnD,OAAO,oBAAC,iBAAiB,IAAC,QAAQ,EAAC,mBAAmB,GAAG,CAAC;IAC1D,+DAA+D;IAC/D,OAAO,oBAAC,iBAAiB,IAAC,QAAQ,EAAC,eAAe,GAAG,CAAC;AACxD,CAAC,CAAC;AAEF,mDAAmD;AACnD;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG;AAC3C,oDAAoD;AACpD,6DAA6D;AAC7D,KAAuG,EAC1F,EAAE;IACf,OAAO,CACL;IAEI,mDAAmD;IACnD,oBAAC,sBAAsB,oBAAK,KAAK,EAAI,CAEtC,CACJ,CAAC;AACJ,CAAC,CAAC;AAEF,mDAAmD;AACnD,MAAM,sCAAsC,GAAG,GAAW,EAAE;IAC1D,mDAAmD;IACnD,qDAAqD;IACrD,OAAO,SAAS,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC;IACjD,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { IconButton, mergeStyles, Stack, useTheme } from '@fluentui/react';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport React from 'react';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { ChatCompositeIcon } from '../../common/icons';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { useLocale } from '../../localization';\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * Props for {@link AttachmentUploadButton} component.\n * @internal\n */\nexport interface AttachmentUploadButtonProps {\n /**\n * A list of strings containing the comma separated list of supported media (aka. mime) types.\n * i.e. ['image/*', 'video/*', 'audio/*']\n * Default value is `['*']`, meaning all media types are supported.\n * Similar to the `accept` attribute of the `<input type=\"file\" />` element.\n */\n supportedMediaTypes?: string[];\n /**\n * Disable multiple files to be selected if set to `true`.\n * Default value is `false`, meaning multiple files can be selected.\n * Similar to the `multiple` attribute of the `<input type=\"file\" />` element.\n */\n disableMultipleUploads?: boolean;\n /**\n * onChange handler for the attachment upload button.\n * Similar to the `onChange` attribute of the `<input type=\"file\" />` element.\n * Called every time files are selected through the attachment upload button with a {@link FileList}\n * of selected files.\n */\n onChange?: (files: FileList | null) => void;\n}\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * @internal\n */\nexport const AttachmentUploadButton = (props: AttachmentUploadButtonProps): JSX.Element => {\n const inputRef = React.useRef<HTMLInputElement>(null);\n const theme = useTheme();\n // default supportedMediaTypes is ['*'], meaning all media types are supported.\n // default disableMultipleUploads is false, meaning multiple files can be selected.\n const { supportedMediaTypes = ['*'], disableMultipleUploads = false, onChange } = props;\n\n const attachmentUploadButtonClassName = mergeStyles({\n width: '1.5rem',\n height: '1.5rem',\n cursor: 'pointer',\n padding: '0.15rem',\n ':hover': {\n backgroundColor: theme.palette.neutralLighter\n }\n });\n\n const iconButtonClassName = mergeStyles({\n color: 'unset',\n width: '1.5rem',\n height: '1.5rem',\n ':hover': {\n color: 'unset',\n background: 'transparent'\n }\n });\n\n return (\n <>\n <Stack\n verticalAlign=\"center\"\n horizontalAlign=\"center\"\n className={attachmentUploadButtonClassName}\n onClick={() => {\n inputRef.current?.click();\n }}\n >\n <IconButton className={iconButtonClassName} ariaLabel={uploadAttachmentButtonStringTrampoline()}>\n <SendBoxAttachFileIconTrampoline />\n </IconButton>\n </Stack>\n <input\n data-testid=\"attachment-upload-button\"\n ref={inputRef}\n hidden\n multiple={!disableMultipleUploads}\n accept={supportedMediaTypes.join(',')}\n type=\"file\"\n onClick={(e) => {\n // To ensure that `onChange` is fired even if the same file is picked again.\n e.currentTarget.value = '';\n }}\n onChange={(e) => {\n onChange && onChange(e.currentTarget.files);\n }}\n />\n </>\n );\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\nconst SendBoxAttachFileIconTrampoline = (): JSX.Element => {\n /* @conditional-compile-remove(file-sharing-acs) */\n return <ChatCompositeIcon iconName=\"SendBoxAttachFile\" />;\n // Return _some_ available icon, as the real icon is beta-only.\n return <ChatCompositeIcon iconName=\"EditBoxCancel\" />;\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * A wrapper to return {@link AttachmentUploadButton} component conditionally.\n * It will return `<></>` for stable builds.\n * @internal\n */\nexport const AttachmentUploadButtonWrapper = (\n // To make conditional compilation not throw errors.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n props: Pick<AttachmentUploadButtonProps, 'supportedMediaTypes' | 'disableMultipleUploads' | 'onChange'>\n): JSX.Element => {\n return (\n <>\n {\n /* @conditional-compile-remove(file-sharing-acs) */\n <AttachmentUploadButton {...props} />\n }\n </>\n );\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\nconst uploadAttachmentButtonStringTrampoline = (): string => {\n /* @conditional-compile-remove(file-sharing-acs) */\n //eslint-disable-next-line react-hooks/rules-of-hooks\n return useLocale().strings.chat.uploadAttachment;\n return '';\n};\n"]}
1
+ {"version":3,"file":"AttachmentUploadButton.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/ChatComposite/file-sharing/AttachmentUploadButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,mDAAmD;AACnD,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACxF,mDAAmD;AACnD,OAAO,KAAK,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;IACjD,OAAO,EAAE,CAAC;AACZ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { IconButton, mergeStyles, Stack, TooltipHost, useTheme } from '@fluentui/react';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport React from 'react';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { ChatCompositeIcon } from '../../common/icons';\n/* @conditional-compile-remove(file-sharing-acs) */\nimport { useLocale } from '../../localization';\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * Props for {@link AttachmentUploadButton} component.\n * @internal\n */\nexport interface AttachmentUploadButtonProps {\n /**\n * A list of strings containing the comma separated list of supported media (aka. mime) types.\n * i.e. ['image/*', 'video/*', 'audio/*']\n * Default value is `['*']`, meaning all media types are supported.\n * Similar to the `accept` attribute of the `<input type=\"file\" />` element.\n */\n supportedMediaTypes?: string[];\n /**\n * Disable multiple files to be selected if set to `true`.\n * Default value is `false`, meaning multiple files can be selected.\n * Similar to the `multiple` attribute of the `<input type=\"file\" />` element.\n */\n disableMultipleUploads?: boolean;\n /**\n * onChange handler for the attachment upload button.\n * Similar to the `onChange` attribute of the `<input type=\"file\" />` element.\n * Called every time files are selected through the attachment upload button with a {@link FileList}\n * of selected files.\n */\n onChange?: (files: FileList | null) => void;\n}\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * @internal\n */\nexport const AttachmentUploadButton = (props: AttachmentUploadButtonProps): JSX.Element => {\n const inputRef = React.useRef<HTMLInputElement>(null);\n const theme = useTheme();\n // default supportedMediaTypes is ['*'], meaning all media types are supported.\n // default disableMultipleUploads is false, meaning multiple files can be selected.\n const { supportedMediaTypes = ['*'], disableMultipleUploads = false, onChange } = props;\n\n const attachmentUploadButtonClassName = mergeStyles({\n width: '1.5rem',\n height: '1.5rem',\n cursor: 'pointer',\n padding: '0.15rem',\n ':hover': {\n backgroundColor: theme.palette.neutralLighter\n }\n });\n\n const iconButtonClassName = mergeStyles({\n color: 'unset',\n width: '1.5rem',\n height: '1.5rem',\n ':hover': {\n color: 'unset',\n background: 'transparent'\n }\n });\n\n return (\n <>\n <Stack\n verticalAlign=\"center\"\n horizontalAlign=\"center\"\n className={attachmentUploadButtonClassName}\n onClick={() => {\n inputRef.current?.click();\n }}\n >\n <TooltipHost content={uploadAttachmentButtonStringTrampoline()} data-ui-id=\"chat-composite-message-tooltip\">\n <IconButton\n className={iconButtonClassName}\n ariaLabel={uploadAttachmentButtonStringTrampoline()}\n autoFocus={false}\n >\n <SendBoxAttachFileIconTrampoline />\n </IconButton>\n </TooltipHost>\n </Stack>\n <input\n data-testid=\"attachment-upload-button\"\n ref={inputRef}\n autoFocus={false}\n hidden\n multiple={!disableMultipleUploads}\n accept={supportedMediaTypes.join(',')}\n type=\"file\"\n onClick={(e) => {\n // To ensure that `onChange` is fired even if the same file is picked again.\n e.currentTarget.value = '';\n }}\n onChange={(e) => {\n onChange && onChange(e.currentTarget.files);\n }}\n />\n </>\n );\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\nconst SendBoxAttachFileIconTrampoline = (): JSX.Element => {\n /* @conditional-compile-remove(file-sharing-acs) */\n return <ChatCompositeIcon iconName=\"SendBoxAttachFile\" />;\n // Return _some_ available icon, as the real icon is beta-only.\n return <ChatCompositeIcon iconName=\"EditBoxCancel\" />;\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\n/**\n * A wrapper to return {@link AttachmentUploadButton} component conditionally.\n * It will return `<></>` for stable builds.\n * @internal\n */\nexport const AttachmentUploadButtonWrapper = (\n // To make conditional compilation not throw errors.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n props: Pick<AttachmentUploadButtonProps, 'supportedMediaTypes' | 'disableMultipleUploads' | 'onChange'>\n): JSX.Element => {\n return (\n <>\n {\n /* @conditional-compile-remove(file-sharing-acs) */\n <AttachmentUploadButton {...props} />\n }\n </>\n );\n};\n\n/* @conditional-compile-remove(file-sharing-acs) */\nconst uploadAttachmentButtonStringTrampoline = (): string => {\n /* @conditional-compile-remove(file-sharing-acs) */\n //eslint-disable-next-line react-hooks/rules-of-hooks\n return useLocale().strings.chat.uploadAttachment;\n return '';\n};\n"]}
@@ -107,6 +107,7 @@ export interface MoreDrawerProps extends MoreDrawerDevicesMenuProps {
107
107
  reactionResources?: ReactionResources;
108
108
  onReactionClick?: (reaction: string) => Promise<void>;
109
109
  onClickMeetingPhoneInfo?: () => void;
110
+ onMuteAllRemoteParticipants?: () => void;
110
111
  }
111
112
  /** @private */
112
113
  export declare const MoreDrawer: (props: MoreDrawerProps) => JSX.Element;