@azure/communication-react 1.14.1-alpha-202403261958 → 1.14.1-alpha-202403280012

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 (168) hide show
  1. package/dist/communication-react.d.ts +70 -3
  2. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BRqOsupu.js → RichTextSendBoxWrapper-D3ER8Kz9.js} +9 -6
  3. package/dist/dist-cjs/communication-react/{RichTextSendBoxWrapper-BRqOsupu.js.map → RichTextSendBoxWrapper-D3ER8Kz9.js.map} +1 -1
  4. package/dist/dist-cjs/communication-react/{index-Ba2HAv_Y.js → index-BI61bnOi.js} +1401 -761
  5. package/dist/dist-cjs/communication-react/index-BI61bnOi.js.map +1 -0
  6. package/dist/dist-cjs/communication-react/index.js +6 -3
  7. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  8. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  9. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  10. package/dist/dist-esm/calling-stateful-client/src/CallClientState.d.ts +5 -0
  11. package/dist/dist-esm/calling-stateful-client/src/CallClientState.js.map +1 -1
  12. package/dist/dist-esm/calling-stateful-client/src/CallContext.js +2 -0
  13. package/dist/dist-esm/calling-stateful-client/src/CallContext.js.map +1 -1
  14. package/dist/dist-esm/calling-stateful-client/src/Converter.js +6 -2
  15. package/dist/dist-esm/calling-stateful-client/src/Converter.js.map +1 -1
  16. package/dist/dist-esm/chat-component-bindings/src/handlers/createHandlers.js.map +1 -1
  17. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +6 -6
  18. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  19. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  20. package/dist/dist-esm/react-components/src/components/AttachmentCard.d.ts +3 -1
  21. package/dist/dist-esm/react-components/src/components/AttachmentCard.js +75 -59
  22. package/dist/dist-esm/react-components/src/components/AttachmentCard.js.map +1 -1
  23. package/dist/dist-esm/react-components/src/components/AttachmentDownloadCards.d.ts +1 -1
  24. package/dist/dist-esm/react-components/src/components/AttachmentDownloadCards.js +11 -10
  25. package/dist/dist-esm/react-components/src/components/AttachmentDownloadCards.js.map +1 -1
  26. package/dist/dist-esm/react-components/src/components/AttachmentUploadCards.js +2 -12
  27. package/dist/dist-esm/react-components/src/components/AttachmentUploadCards.js.map +1 -1
  28. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js +8 -8
  29. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsEditBox.js.map +1 -1
  30. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsRichTextEditBox.js +5 -5
  31. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsRichTextEditBox.js.map +1 -1
  32. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentWrapper.js.map +1 -1
  33. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js +6 -6
  34. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/ChatMessageComponentAsMessageBubble.js.map +1 -1
  35. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js +10 -8
  36. package/dist/dist-esm/react-components/src/components/ChatMessage/MessageComponents/FluentChatMessageComponent.js.map +1 -1
  37. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js +6 -6
  38. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/ChatMyMessageComponentAsMessageBubble.js.map +1 -1
  39. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js +10 -8
  40. package/dist/dist-esm/react-components/src/components/ChatMessage/MyMessageComponents/FluentChatMyMessageComponent.js.map +1 -1
  41. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.d.ts +4 -0
  42. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js +2 -2
  43. package/dist/dist-esm/react-components/src/components/Dialpad/Dialpad.js.map +1 -1
  44. package/dist/dist-esm/react-components/src/components/MessageStatusIcon.js +1 -1
  45. package/dist/dist-esm/react-components/src/components/MessageStatusIcon.js.map +1 -1
  46. package/dist/dist-esm/react-components/src/components/MessageThread.js +14 -13
  47. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  48. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/RichTextRibbonButtons.d.ts +7 -0
  49. package/dist/dist-esm/react-components/src/components/RichTextEditor/{RichTextRibbonButtons.js → Buttons/RichTextRibbonButtons.js} +16 -20
  50. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/RichTextRibbonButtons.js.map +1 -0
  51. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.d.ts +7 -0
  52. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.js +56 -0
  53. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTableButton.js.map +1 -0
  54. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTablePane.d.ts +16 -0
  55. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTablePane.js +62 -0
  56. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextInsertTablePane.js.map +1 -0
  57. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextTableContextMenu.d.ts +8 -0
  58. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextTableContextMenu.js +57 -0
  59. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/RichTextTableContextMenu.js.map +1 -0
  60. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/insertTableAction.d.ts +9 -0
  61. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/insertTableAction.js +34 -0
  62. package/dist/dist-esm/react-components/src/components/RichTextEditor/Buttons/Table/insertTableAction.js.map +1 -0
  63. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js +23 -11
  64. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextEditor.js.map +1 -1
  65. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js +7 -6
  66. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextInputBoxComponent.js.map +1 -1
  67. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.d.ts +44 -0
  68. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js +40 -30
  69. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBox.js.map +1 -1
  70. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js +6 -6
  71. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextSendBoxErrors.js.map +1 -1
  72. package/dist/dist-esm/react-components/src/components/SendBox.js +33 -23
  73. package/dist/dist-esm/react-components/src/components/SendBox.js.map +1 -1
  74. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js +2 -2
  75. package/dist/dist-esm/react-components/src/components/VideoGallery/DefaultLayout.js.map +1 -1
  76. package/dist/dist-esm/react-components/src/components/VideoGallery/LargeGalleryLayout.js +5 -3
  77. package/dist/dist-esm/react-components/src/components/VideoGallery/LargeGalleryLayout.js.map +1 -1
  78. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  79. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.d.ts +9 -0
  80. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.js +27 -0
  81. package/dist/dist-esm/react-components/src/components/styles/AttachmentCard.styles.js.map +1 -0
  82. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.d.ts +25 -1
  83. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js +132 -2
  84. package/dist/dist-esm/react-components/src/components/styles/RichTextEditor.styles.js.map +1 -1
  85. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js +3 -2
  86. package/dist/dist-esm/react-components/src/components/styles/SendBox.styles.js.map +1 -1
  87. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js +6 -5
  88. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentAsEditBoxUtils.js.map +1 -1
  89. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js +10 -10
  90. package/dist/dist-esm/react-components/src/components/utils/ChatMessageComponentUtils.js.map +1 -1
  91. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorStringsUtils.d.ts +15 -0
  92. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorStringsUtils.js +39 -0
  93. package/dist/dist-esm/react-components/src/components/utils/RichTextEditorStringsUtils.js.map +1 -0
  94. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.d.ts +22 -0
  95. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js +29 -0
  96. package/dist/dist-esm/react-components/src/components/utils/RichTextTableUtils.js.map +1 -0
  97. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js +2 -2
  98. package/dist/dist-esm/react-components/src/components/utils/SendBoxUtils.js.map +1 -1
  99. package/dist/dist-esm/react-components/src/components/utils/common.js +2 -2
  100. package/dist/dist-esm/react-components/src/components/utils/common.js.map +1 -1
  101. package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +12 -1
  102. package/dist/dist-esm/react-components/src/theming/FluentV9ThemeProvider.js +1 -1
  103. package/dist/dist-esm/react-components/src/theming/FluentV9ThemeProvider.js.map +1 -1
  104. package/dist/dist-esm/react-components/src/theming/icons.d.ts +4 -0
  105. package/dist/dist-esm/react-components/src/theming/icons.js +13 -5
  106. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  107. package/dist/dist-esm/react-components/src/types/Attachment.d.ts +9 -0
  108. package/dist/dist-esm/react-components/src/types/Attachment.js.map +1 -1
  109. package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
  110. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +2 -1
  111. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  112. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +4 -0
  113. package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
  114. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -1
  115. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +22 -4
  116. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  117. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.d.ts +1 -0
  118. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +2 -2
  119. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  120. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.d.ts +1 -0
  121. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js +2 -2
  122. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/DtmfDialpadPage.js.map +1 -1
  123. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +13 -1
  124. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  125. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +3 -3
  126. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  127. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +53 -3
  128. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +210 -71
  129. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  130. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  131. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +8 -8
  132. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
  133. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +2 -2
  134. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +6 -7
  135. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  136. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js +4 -4
  137. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatComposite.js.map +1 -1
  138. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +8 -8
  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/Strings.js.map +1 -1
  141. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +6 -0
  142. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +44 -22
  143. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  144. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js +6 -6
  145. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js.map +1 -1
  146. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
  147. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapterProvider.js +1 -1
  148. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapterProvider.js.map +1 -1
  149. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadButton.js +4 -4
  150. package/dist/dist-esm/react-composites/src/composites/ChatComposite/file-sharing/FileUploadButton.js.map +1 -1
  151. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js +3 -3
  152. package/dist/dist-esm/react-composites/src/composites/ChatComposite/hooks/useHandlers.js.map +1 -1
  153. package/dist/dist-esm/react-composites/src/composites/ChatComposite/index.js.map +1 -1
  154. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js +1 -1
  155. package/dist/dist-esm/react-composites/src/composites/ChatComposite/selectors/baseSelectors.js.map +1 -1
  156. package/dist/dist-esm/react-composites/src/composites/common/SendBox.js +8 -8
  157. package/dist/dist-esm/react-composites/src/composites/common/SendBox.js.map +1 -1
  158. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +4 -0
  159. package/dist/dist-esm/react-composites/src/composites/common/icons.js +2 -2
  160. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  161. package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +2 -1
  162. package/package.json +2 -1
  163. package/dist/dist-cjs/communication-react/index-Ba2HAv_Y.js.map +0 -1
  164. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextRibbonButtons.d.ts +0 -12
  165. package/dist/dist-esm/react-components/src/components/RichTextEditor/RichTextRibbonButtons.js.map +0 -1
  166. package/dist/dist-esm/react-components/src/components/styles/IconButton.styles.d.ts +0 -5
  167. package/dist/dist-esm/react-components/src/components/styles/IconButton.styles.js +0 -17
  168. package/dist/dist-esm/react-components/src/components/styles/IconButton.styles.js.map +0 -1
@@ -4,7 +4,7 @@ import { ChatThreadClientState } from "../../../../../chat-stateful-client/src";
4
4
  import { CallAdapter, CallAdapterState, CallCompositePage } from '../../CallComposite';
5
5
  import { VideoBackgroundImage, VideoBackgroundEffect } from '../../CallComposite';
6
6
  import { VideoBackgroundEffectsDependency } from "../../../../../calling-component-bindings/src";
7
- import { ChatAdapter, ChatAdapterState } from '../../ChatComposite';
7
+ import { ChatAdapterState } from '../../ChatComposite';
8
8
  import { FileUploadsUiState } from '../../ChatComposite';
9
9
  import { AdapterErrors } from '../../common/adapters';
10
10
  import { EnvironmentInfo } from '@azure/communication-calling';
@@ -95,7 +95,7 @@ export interface CallWithChatAdapterState extends CallWithChatAdapterUiState, Ca
95
95
  /**
96
96
  * @private
97
97
  */
98
- export declare function callWithChatAdapterStateFromBackingStates(callAdapter: CallAdapter, chatAdapter: ChatAdapter): CallWithChatAdapterState;
98
+ export declare function callWithChatAdapterStateFromBackingStates(callAdapter: CallAdapter): CallWithChatAdapterState;
99
99
  /**
100
100
  * @private
101
101
  */
@@ -3,12 +3,11 @@
3
3
  /**
4
4
  * @private
5
5
  */
6
- export function callWithChatAdapterStateFromBackingStates(callAdapter, chatAdapter) {
6
+ export function callWithChatAdapterStateFromBackingStates(callAdapter) {
7
7
  const callAdapterState = callAdapter.getState();
8
- const chatAdapterState = chatAdapter.getState();
9
8
  return {
10
9
  call: callAdapterState.call,
11
- chat: chatAdapterState.thread,
10
+ chat: undefined,
12
11
  userId: callAdapterState.userId,
13
12
  page: callAdapterState.page,
14
13
  displayName: callAdapterState.displayName,
@@ -16,9 +15,9 @@ export function callWithChatAdapterStateFromBackingStates(callAdapter, chatAdapt
16
15
  isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled,
17
16
  isTeamsCall: callAdapterState.isTeamsCall,
18
17
  latestCallErrors: callAdapterState.latestErrors,
19
- latestChatErrors: chatAdapterState.latestErrors,
20
- /* @conditional-compile-remove(file-sharing) */
21
- fileUploads: chatAdapterState.fileUploads,
18
+ latestChatErrors: {},
19
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
20
+ fileUploads: {},
22
21
  /* @conditional-compile-remove(PSTN-calls) */
23
22
  alternateCallerId: callAdapterState.alternateCallerId,
24
23
  /* @conditional-compile-remove(unsupported-browser) */
@@ -38,7 +37,7 @@ export function callWithChatAdapterStateFromBackingStates(callAdapter, chatAdapt
38
37
  */
39
38
  export function mergeChatAdapterStateIntoCallWithChatAdapterState(existingCallWithChatAdapterState, chatAdapterState) {
40
39
  return Object.assign(Object.assign({}, existingCallWithChatAdapterState), { chat: chatAdapterState.thread, latestChatErrors: chatAdapterState.latestErrors,
41
- /* @conditional-compile-remove(file-sharing) */
40
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
42
41
  fileUploads: chatAdapterState.fileUploads });
43
42
  }
44
43
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CallWithChatAdapterState.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAiHlC;;GAEG;AACH,MAAM,UAAU,yCAAyC,CACvD,WAAwB,EACxB,WAAwB;IAExB,MAAM,gBAAgB,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;IAChD,MAAM,gBAAgB,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;IAEhD,OAAO;QACL,IAAI,EAAE,gBAAgB,CAAC,IAAI;QAC3B,IAAI,EAAE,gBAAgB,CAAC,MAAM;QAC7B,MAAM,EAAE,gBAAgB,CAAC,MAAM;QAC/B,IAAI,EAAE,gBAAgB,CAAC,IAAI;QAC3B,WAAW,EAAE,gBAAgB,CAAC,WAAW;QACzC,OAAO,EAAE,gBAAgB,CAAC,OAAO;QACjC,+BAA+B,EAAE,gBAAgB,CAAC,+BAA+B;QACjF,WAAW,EAAE,gBAAgB,CAAC,WAAW;QACzC,gBAAgB,EAAE,gBAAgB,CAAC,YAAY;QAC/C,gBA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6BAA6B,EAAE,gBAAgB,CAAC,6BAA6B,IAC7E;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CommunicationIdentifierKind } from '@azure/communication-common';\nimport { CallState, DeviceManagerState } from '@internal/calling-stateful-client';\nimport { ChatThreadClientState } from '@internal/chat-stateful-client';\nimport { CallAdapter, CallAdapterState, CallCompositePage } from '../../CallComposite';\n\nimport { VideoBackgroundImage, VideoBackgroundEffect } from '../../CallComposite';\n\nimport { VideoBackgroundEffectsDependency } from '@internal/calling-component-bindings';\nimport { ChatAdapter, ChatAdapterState } from '../../ChatComposite';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileUploadsUiState } from '../../ChatComposite';\nimport { AdapterErrors } from '../../common/adapters';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(reaction) */\nimport { ReactionResources } from '@internal/react-components';\n\n/**\n * UI state pertaining to the {@link CallWithChatComposite}.\n *\n * @public\n */\nexport interface CallWithChatAdapterUiState {\n /**\n * Microphone state before a call has joined.\n *\n * @public\n */\n isLocalPreviewMicrophoneEnabled: boolean;\n /**\n * Current page of the Composite.\n *\n * @public\n */\n page: CallCompositePage;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Files being uploaded by a user in the current thread.\n * Should be set to null once the upload is complete.\n * Array of type {@link FileUploadsUiState}\n *\n * @beta\n */\n fileUploads?: FileUploadsUiState;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * State to track whether the end user has opted in to using a\n * out of date version of a supported browser. Allows the user\n * to start a call in this state.\n *\n * @beta\n */\n unsupportedBrowserVersionsAllowed?: boolean;\n}\n\n/**\n * State from the backend services that drives {@link CallWithChatComposite}.\n *\n * @public\n */\nexport interface CallWithChatClientState {\n /** ID of the call participant using this CallWithChatAdapter. */\n userId: CommunicationIdentifierKind;\n /** Display name of the participant using this CallWithChatAdapter. */\n displayName: string | undefined;\n /** State of the current call. */\n call?: CallState;\n /** State of the current chat. */\n chat?: ChatThreadClientState;\n /** Latest call error encountered for each operation performed via the adapter. */\n latestCallErrors: AdapterErrors;\n /** Latest chat error encountered for each operation performed via the adapter. */\n latestChatErrors: AdapterErrors;\n /** State of available and currently selected devices */\n devices: DeviceManagerState;\n /** State of whether the active call is a Teams interop call */\n isTeamsCall: boolean;\n /* @conditional-compile-remove(PSTN-calls) */\n /** alternateCallerId for PSTN call */\n alternateCallerId?: string | undefined;\n /* @conditional-compile-remove(unsupported-browser) */\n /** Environment information for system adapter is made on */\n environmentInfo?: EnvironmentInfo;\n\n /** Default set of background images for background replacement effect */\n videoBackgroundImages?: VideoBackgroundImage[];\n\n /** Dependency to be injected for video background effects */\n onResolveVideoEffectDependency?: () => Promise<VideoBackgroundEffectsDependency>;\n\n /** State to track the selected video background effect */\n selectedVideoBackgroundEffect?: VideoBackgroundEffect;\n /* @conditional-compile-remove(hide-attendee-name) */\n /** Hide attendee names in teams meeting */\n hideAttendeeNames?: boolean;\n /* @conditional-compile-remove(reaction) */\n /**\n * Reaction resources to render in meetings\n * @beta\n * */\n reactions?: ReactionResources;\n}\n\n/**\n * CallWithChat State is a combination of Stateful Chat and Stateful Calling clients with some\n * state specific to the CallWithChat Composite only.\n *\n * @public\n */\nexport interface CallWithChatAdapterState extends CallWithChatAdapterUiState, CallWithChatClientState {}\n\n/**\n * @private\n */\nexport function callWithChatAdapterStateFromBackingStates(\n callAdapter: CallAdapter,\n chatAdapter: ChatAdapter\n): CallWithChatAdapterState {\n const callAdapterState = callAdapter.getState();\n const chatAdapterState = chatAdapter.getState();\n\n return {\n call: callAdapterState.call,\n chat: chatAdapterState.thread,\n userId: callAdapterState.userId,\n page: callAdapterState.page,\n displayName: callAdapterState.displayName,\n devices: callAdapterState.devices,\n isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled,\n isTeamsCall: callAdapterState.isTeamsCall,\n latestCallErrors: callAdapterState.latestErrors,\n latestChatErrors: chatAdapterState.latestErrors,\n /* @conditional-compile-remove(file-sharing) */\n fileUploads: chatAdapterState.fileUploads,\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId: callAdapterState.alternateCallerId,\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo: callAdapterState.environmentInfo,\n\n videoBackgroundImages: callAdapterState.videoBackgroundImages,\n\n onResolveVideoEffectDependency: callAdapterState.onResolveVideoEffectDependency,\n\n selectedVideoBackgroundEffect: callAdapterState.selectedVideoBackgroundEffect,\n /* @conditional-compile-remove(hide-attendee-name) */\n /** Hide attendee names in teams meeting */\n hideAttendeeNames: callAdapterState.hideAttendeeNames,\n /* @conditional-compile-remove(reaction) */\n reactions: callAdapterState.reactions\n };\n}\n\n/**\n * @private\n */\nexport function mergeChatAdapterStateIntoCallWithChatAdapterState(\n existingCallWithChatAdapterState: CallWithChatAdapterState,\n chatAdapterState: ChatAdapterState\n): CallWithChatAdapterState {\n return {\n ...existingCallWithChatAdapterState,\n chat: chatAdapterState.thread,\n latestChatErrors: chatAdapterState.latestErrors,\n /* @conditional-compile-remove(file-sharing) */\n fileUploads: chatAdapterState.fileUploads\n };\n}\n\n/**\n * @private\n */\nexport function mergeCallAdapterStateIntoCallWithChatAdapterState(\n existingCallWithChatAdapterState: CallWithChatAdapterState,\n callAdapterState: CallAdapterState\n): CallWithChatAdapterState {\n return {\n ...existingCallWithChatAdapterState,\n userId: callAdapterState.userId,\n page: callAdapterState.page,\n displayName: callAdapterState.displayName,\n devices: callAdapterState.devices,\n call: callAdapterState.call,\n isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled,\n isTeamsCall: callAdapterState.isTeamsCall,\n latestCallErrors: callAdapterState.latestErrors,\n\n videoBackgroundImages: callAdapterState.videoBackgroundImages,\n\n onResolveVideoEffectDependency: callAdapterState.onResolveVideoEffectDependency,\n\n selectedVideoBackgroundEffect: callAdapterState.selectedVideoBackgroundEffect\n };\n}\n"]}
1
+ {"version":3,"file":"CallWithChatAdapterState.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAiHlC;;GAEG;AACH,MAAM,UAAU,yCAAyC,CAAC,WAAwB;IAChF,MAAM,gBAAgB,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;IAEhD,OAAO;QACL,IAAI,EAAE,gBAAgB,CAAC,IAAI;QAC3B,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,gBAAgB,CAAC,MAAM;QAC/B,IAAI,EAAE,gBAAgB,CAAC,IAAI;QAC3B,WAAW,EAAE,gBAAgB,CAAC,WAAW;QACzC,OAAO,EAAE,gBAAgB,CAAC,OAAO;QACjC,+BAA+B,EAAE,gBAAgB,CAAC,+BAA+B;QACjF,WAAW,EAAE,gBAAgB,CAAC,WAAW;QACzC,gBAAgB,EAAE,gBAAgB,CAAC,YAAY;QAC/C,gBAAgB,EAAE,EAAE;QACpB,qGAAqG;QACrG,WAAW,EAAE,EAAE;QACf,6CAA6C;QAC7C,iBAAiB,EAAE,gBAAgB,CAAC,iBAAiB;QACrD,sDAAsD;QACtD,eAAe,EAAE,gBAAgB,CAAC,eAAe;QACjD,qBAAqB,EAAE,gBAAgB,CAAC,qBAAqB;QAC7D,8BAA8B,EAAE,gBAAgB,CAAC,8BAA8B;QAC/E,6BAA6B,EAAE,gBAAgB,CAAC,6BAA6B;QAC7E,qDAAqD;QACrD,2CAA2C;QAC3C,iBAAiB,EAAE,gBAAgB,CAAC,iBAAiB;QACrD,2CAA2C;QAC3C,SAAS,EAAE,gBAAgB,CAAC,SAAS;KACtC,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iDAAiD,CAC/D,gCAA0D,EAC1D,gBAAkC;IAElC,uCACK,gCAAgC,KACnC,IAAI,EAAE,gBAAgB,CAAC,MAAM,EAC7B,gBAAgB,EAAE,gBAAgB,CAAC,YAAY;QAC/C,qGAAqG;QACrG,WAAW,EAAE,gBAAgB,CAAC,WAAW,IACzC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iDAAiD,CAC/D,gCAA0D,EAC1D,gBAAkC;IAElC,uCACK,gCAAgC,KACnC,MAAM,EAAE,gBAAgB,CAAC,MAAM,EAC/B,IAAI,EAAE,gBAAgB,CAAC,IAAI,EAC3B,WAAW,EAAE,gBAAgB,CAAC,WAAW,EACzC,OAAO,EAAE,gBAAgB,CAAC,OAAO,EACjC,IAAI,EAAE,gBAAgB,CAAC,IAAI,EAC3B,+BAA+B,EAAE,gBAAgB,CAAC,+BAA+B,EACjF,WAAW,EAAE,gBAAgB,CAAC,WAAW,EACzC,gBAAgB,EAAE,gBAAgB,CAAC,YAAY,EAE/C,qBAAqB,EAAE,gBAAgB,CAAC,qBAAqB,EAE7D,8BAA8B,EAAE,gBAAgB,CAAC,8BAA8B,EAE/E,6BAA6B,EAAE,gBAAgB,CAAC,6BAA6B,IAC7E;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CommunicationIdentifierKind } from '@azure/communication-common';\nimport { CallState, DeviceManagerState } from '@internal/calling-stateful-client';\nimport { ChatThreadClientState } from '@internal/chat-stateful-client';\nimport { CallAdapter, CallAdapterState, CallCompositePage } from '../../CallComposite';\n\nimport { VideoBackgroundImage, VideoBackgroundEffect } from '../../CallComposite';\n\nimport { VideoBackgroundEffectsDependency } from '@internal/calling-component-bindings';\nimport { ChatAdapterState } from '../../ChatComposite';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { FileUploadsUiState } from '../../ChatComposite';\nimport { AdapterErrors } from '../../common/adapters';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\n/* @conditional-compile-remove(reaction) */\nimport { ReactionResources } from '@internal/react-components';\n\n/**\n * UI state pertaining to the {@link CallWithChatComposite}.\n *\n * @public\n */\nexport interface CallWithChatAdapterUiState {\n /**\n * Microphone state before a call has joined.\n *\n * @public\n */\n isLocalPreviewMicrophoneEnabled: boolean;\n /**\n * Current page of the Composite.\n *\n * @public\n */\n page: CallCompositePage;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n /**\n * Files being uploaded by a user in the current thread.\n * Should be set to null once the upload is complete.\n * Array of type {@link FileUploadsUiState}\n *\n * @beta\n */\n fileUploads?: FileUploadsUiState;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * State to track whether the end user has opted in to using a\n * out of date version of a supported browser. Allows the user\n * to start a call in this state.\n *\n * @beta\n */\n unsupportedBrowserVersionsAllowed?: boolean;\n}\n\n/**\n * State from the backend services that drives {@link CallWithChatComposite}.\n *\n * @public\n */\nexport interface CallWithChatClientState {\n /** ID of the call participant using this CallWithChatAdapter. */\n userId: CommunicationIdentifierKind;\n /** Display name of the participant using this CallWithChatAdapter. */\n displayName: string | undefined;\n /** State of the current call. */\n call?: CallState;\n /** State of the current chat. */\n chat?: ChatThreadClientState;\n /** Latest call error encountered for each operation performed via the adapter. */\n latestCallErrors: AdapterErrors;\n /** Latest chat error encountered for each operation performed via the adapter. */\n latestChatErrors: AdapterErrors;\n /** State of available and currently selected devices */\n devices: DeviceManagerState;\n /** State of whether the active call is a Teams interop call */\n isTeamsCall: boolean;\n /* @conditional-compile-remove(PSTN-calls) */\n /** alternateCallerId for PSTN call */\n alternateCallerId?: string | undefined;\n /* @conditional-compile-remove(unsupported-browser) */\n /** Environment information for system adapter is made on */\n environmentInfo?: EnvironmentInfo;\n\n /** Default set of background images for background replacement effect */\n videoBackgroundImages?: VideoBackgroundImage[];\n\n /** Dependency to be injected for video background effects */\n onResolveVideoEffectDependency?: () => Promise<VideoBackgroundEffectsDependency>;\n\n /** State to track the selected video background effect */\n selectedVideoBackgroundEffect?: VideoBackgroundEffect;\n /* @conditional-compile-remove(hide-attendee-name) */\n /** Hide attendee names in teams meeting */\n hideAttendeeNames?: boolean;\n /* @conditional-compile-remove(reaction) */\n /**\n * Reaction resources to render in meetings\n * @beta\n * */\n reactions?: ReactionResources;\n}\n\n/**\n * CallWithChat State is a combination of Stateful Chat and Stateful Calling clients with some\n * state specific to the CallWithChat Composite only.\n *\n * @public\n */\nexport interface CallWithChatAdapterState extends CallWithChatAdapterUiState, CallWithChatClientState {}\n\n/**\n * @private\n */\nexport function callWithChatAdapterStateFromBackingStates(callAdapter: CallAdapter): CallWithChatAdapterState {\n const callAdapterState = callAdapter.getState();\n\n return {\n call: callAdapterState.call,\n chat: undefined,\n userId: callAdapterState.userId,\n page: callAdapterState.page,\n displayName: callAdapterState.displayName,\n devices: callAdapterState.devices,\n isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled,\n isTeamsCall: callAdapterState.isTeamsCall,\n latestCallErrors: callAdapterState.latestErrors,\n latestChatErrors: {},\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n fileUploads: {},\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId: callAdapterState.alternateCallerId,\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo: callAdapterState.environmentInfo,\n videoBackgroundImages: callAdapterState.videoBackgroundImages,\n onResolveVideoEffectDependency: callAdapterState.onResolveVideoEffectDependency,\n selectedVideoBackgroundEffect: callAdapterState.selectedVideoBackgroundEffect,\n /* @conditional-compile-remove(hide-attendee-name) */\n /** Hide attendee names in teams meeting */\n hideAttendeeNames: callAdapterState.hideAttendeeNames,\n /* @conditional-compile-remove(reaction) */\n reactions: callAdapterState.reactions\n };\n}\n\n/**\n * @private\n */\nexport function mergeChatAdapterStateIntoCallWithChatAdapterState(\n existingCallWithChatAdapterState: CallWithChatAdapterState,\n chatAdapterState: ChatAdapterState\n): CallWithChatAdapterState {\n return {\n ...existingCallWithChatAdapterState,\n chat: chatAdapterState.thread,\n latestChatErrors: chatAdapterState.latestErrors,\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n fileUploads: chatAdapterState.fileUploads\n };\n}\n\n/**\n * @private\n */\nexport function mergeCallAdapterStateIntoCallWithChatAdapterState(\n existingCallWithChatAdapterState: CallWithChatAdapterState,\n callAdapterState: CallAdapterState\n): CallWithChatAdapterState {\n return {\n ...existingCallWithChatAdapterState,\n userId: callAdapterState.userId,\n page: callAdapterState.page,\n displayName: callAdapterState.displayName,\n devices: callAdapterState.devices,\n call: callAdapterState.call,\n isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled,\n isTeamsCall: callAdapterState.isTeamsCall,\n latestCallErrors: callAdapterState.latestErrors,\n\n videoBackgroundImages: callAdapterState.videoBackgroundImages,\n\n onResolveVideoEffectDependency: callAdapterState.onResolveVideoEffectDependency,\n\n selectedVideoBackgroundEffect: callAdapterState.selectedVideoBackgroundEffect\n };\n}\n"]}
@@ -14,17 +14,17 @@ import { ChatScreen } from './ChatScreen';
14
14
  */
15
15
  export const ChatComposite = (props) => {
16
16
  const { adapter, options, onFetchAvatarPersonaData, onRenderTypingIndicator, onRenderMessage, onFetchParticipantMenuItems } = props;
17
- /* @conditional-compile-remove(file-sharing) */
17
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
18
18
  const formFactor = props['formFactor'] || 'desktop';
19
19
  return (React.createElement("div", { className: chatScreenContainerStyle },
20
20
  React.createElement(BaseProvider, Object.assign({}, props),
21
21
  React.createElement(ChatAdapterProvider, { adapter: adapter },
22
22
  React.createElement(ChatScreen
23
- /* @conditional-compile-remove(file-sharing) */
23
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
24
24
  , {
25
- /* @conditional-compile-remove(file-sharing) */
25
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
26
26
  formFactor: formFactor, options: options, onFetchAvatarPersonaData: onFetchAvatarPersonaData, onRenderTypingIndicator: onRenderTypingIndicator, onRenderMessage: onRenderMessage, onFetchParticipantMenuItems: onFetchParticipantMenuItems,
27
- /* @conditional-compile-remove(file-sharing) */
27
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
28
28
  fileSharing: options === null || options === void 0 ? void 0 : options.fileSharing })))));
29
29
  };
30
30
  //# sourceMappingURL=ChatComposite.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ChatComposite.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/ChatComposite/ChatComposite.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAsB,MAAM,yBAAyB,CAAC;AAG3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA+F1C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAyB,EAAe,EAAE;IACtE,MAAM,EACJ,OAAO,EACP,OAAO,EACP,wBAAwB,EACxB,uBAAuB,EACvB,eAAe,EACf,2BAA2B,EAC5B,GAAG,KAAK,CAAC;IAEV,+CAA+C;IAC/C,MAAM,UAAU,GAAG,KAAK,CAAC,YAAY,CAAC,IAAI,SAAS,CAAC;IAEpD,OAAO,CACL,6BAAK,SAAS,EAAE,wBAAwB;QACtC,oBAAC,YAAY,oBAAK,KAAK;YACrB,oBAAC,mBAAmB,IAAC,OAAO,EAAE,OAAO;gBACnC,oBAAC,UAAU;gBACT,+CAA+C;;oBAA/C,+CAA+C;oBAC/C,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,wBAAwB,EAAE,wBAAwB,EAClD,uBAAuB,EAAE,uBAAuB,EAChD,eAAe,EAAE,eAAe,EAChC,2BAA2B,EAAE,2BAA2B;oBACxD,+CAA+C;oBAC/C,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,GACjC,CACkB,CACT,CACX,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CommunicationParticipant, MessageRenderer, MessageProps } from '@internal/react-components';\nimport React from 'react';\nimport { BaseProvider, BaseCompositeProps } from '../common/BaseComposite';\nimport { ChatCompositeIcons } from '../common/icons';\nimport { ChatAdapter } from './adapter/ChatAdapter';\nimport { ChatAdapterProvider } from './adapter/ChatAdapterProvider';\nimport { chatScreenContainerStyle } from './styles/Chat.styles';\nimport { ChatScreen } from './ChatScreen';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileSharingOptions } from './ChatScreen';\n\n/**\n * Props for {@link ChatComposite}.\n *\n * @public\n */\nexport interface ChatCompositeProps extends BaseCompositeProps<ChatCompositeIcons> {\n /**\n * An adapter provides logic and data to the composite.\n * Composite can also be controlled using the adapter.\n */\n adapter: ChatAdapter;\n /**\n * `(messageProps: MessageProps, defaultOnRender?: MessageRenderer) => JSX.Element`\n * A callback for customizing the message renderer.\n */\n onRenderMessage?: (messageProps: MessageProps, defaultOnRender?: MessageRenderer) => JSX.Element;\n /**\n * `(typingUsers: CommunicationParticipant[]) => JSX.Element`\n * A callback for customizing the typing indicator renderer.\n */\n onRenderTypingIndicator?: (typingUsers: CommunicationParticipant[]) => JSX.Element;\n /**\n * Flags to enable/disable visual elements of the {@link ChatComposite}.\n */\n options?: ChatCompositeOptions;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Optimizes the composite form factor for either desktop or mobile.\n * @remarks `mobile` is currently only optimized for Portrait mode on mobile devices and does not support landscape.\n * @defaultValue 'desktop'\n */\n formFactor?: 'desktop' | 'mobile';\n}\n\n/**\n * Optional features of the {@link ChatComposite}.\n *\n * @public\n */\nexport type ChatCompositeOptions = {\n /**\n * Surface Azure Communication Services backend errors in the UI with {@link @azure/communication-react#ErrorBar}.\n * Hide or show the error bar.\n * @defaultValue true\n */\n errorBar?: boolean;\n /* @conditional-compile-remove(chat-composite-participant-pane) */\n /**\n * Show or hide the participant pane. This feature is in beta and not supported on mobile or narrow screen views.\n * @defaultValue false\n *\n * @beta\n */\n participantPane?: boolean;\n /**\n * Show or hide the topic at the top of the chat. Hidden if set to `false`\n * @defaultValue true\n */\n topic?: boolean;\n /**\n * enumerable to determine if the input box has focus on render or not.\n * When undefined nothing has focus on render\n */\n autoFocus?: 'sendBoxTextField';\n\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Properties for configuring the File Sharing feature.\n * If undefined, file sharing feature will be disabled.\n * @beta\n */\n fileSharing?: FileSharingOptions;\n\n /* @conditional-compile-remove(rich-text-editor) */\n /**\n * Properties for configuring the richTextEditor feature.\n * @defaultValue false\n *\n * @beta\n */\n richTextEditor?: boolean | RichTextEditorOptions;\n};\n\n/* @conditional-compile-remove(rich-text-editor) */\n/**\n * Options for configuring the rich text editor.\n *\n * @beta\n */\nexport interface RichTextEditorOptions {}\n\n/**\n * A customizable UI composite for the chat experience.\n *\n * @remarks Chat composite min width and height are respectively 17.5rem and 20rem (280px and 320px, with default rem at 16px)\n *\n * @public\n */\nexport const ChatComposite = (props: ChatCompositeProps): JSX.Element => {\n const {\n adapter,\n options,\n onFetchAvatarPersonaData,\n onRenderTypingIndicator,\n onRenderMessage,\n onFetchParticipantMenuItems\n } = props;\n\n /* @conditional-compile-remove(file-sharing) */\n const formFactor = props['formFactor'] || 'desktop';\n\n return (\n <div className={chatScreenContainerStyle}>\n <BaseProvider {...props}>\n <ChatAdapterProvider adapter={adapter}>\n <ChatScreen\n /* @conditional-compile-remove(file-sharing) */\n formFactor={formFactor}\n options={options}\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n onRenderTypingIndicator={onRenderTypingIndicator}\n onRenderMessage={onRenderMessage}\n onFetchParticipantMenuItems={onFetchParticipantMenuItems}\n /* @conditional-compile-remove(file-sharing) */\n fileSharing={options?.fileSharing}\n />\n </ChatAdapterProvider>\n </BaseProvider>\n </div>\n );\n};\n"]}
1
+ {"version":3,"file":"ChatComposite.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/ChatComposite/ChatComposite.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAsB,MAAM,yBAAyB,CAAC;AAG3E,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AACpE,OAAO,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAC;AAChE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AA+F1C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAAyB,EAAe,EAAE;IACtE,MAAM,EACJ,OAAO,EACP,OAAO,EACP,wBAAwB,EACxB,uBAAuB,EACvB,eAAe,EACf,2BAA2B,EAC5B,GAAG,KAAK,CAAC;IAEV,qGAAqG;IACrG,MAAM,UAAU,GAAG,KAAK,CAAC,YAAY,CAAC,IAAI,SAAS,CAAC;IAEpD,OAAO,CACL,6BAAK,SAAS,EAAE,wBAAwB;QACtC,oBAAC,YAAY,oBAAK,KAAK;YACrB,oBAAC,mBAAmB,IAAC,OAAO,EAAE,OAAO;gBACnC,oBAAC,UAAU;gBACT,qGAAqG;;oBAArG,qGAAqG;oBACrG,UAAU,EAAE,UAAU,EACtB,OAAO,EAAE,OAAO,EAChB,wBAAwB,EAAE,wBAAwB,EAClD,uBAAuB,EAAE,uBAAuB,EAChD,eAAe,EAAE,eAAe,EAChC,2BAA2B,EAAE,2BAA2B;oBACxD,qGAAqG;oBACrG,WAAW,EAAE,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,WAAW,GACjC,CACkB,CACT,CACX,CACP,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport { CommunicationParticipant, MessageRenderer, MessageProps } from '@internal/react-components';\nimport React from 'react';\nimport { BaseProvider, BaseCompositeProps } from '../common/BaseComposite';\nimport { ChatCompositeIcons } from '../common/icons';\nimport { ChatAdapter } from './adapter/ChatAdapter';\nimport { ChatAdapterProvider } from './adapter/ChatAdapterProvider';\nimport { chatScreenContainerStyle } from './styles/Chat.styles';\nimport { ChatScreen } from './ChatScreen';\n/* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { FileSharingOptions } from './ChatScreen';\n\n/**\n * Props for {@link ChatComposite}.\n *\n * @public\n */\nexport interface ChatCompositeProps extends BaseCompositeProps<ChatCompositeIcons> {\n /**\n * An adapter provides logic and data to the composite.\n * Composite can also be controlled using the adapter.\n */\n adapter: ChatAdapter;\n /**\n * `(messageProps: MessageProps, defaultOnRender?: MessageRenderer) => JSX.Element`\n * A callback for customizing the message renderer.\n */\n onRenderMessage?: (messageProps: MessageProps, defaultOnRender?: MessageRenderer) => JSX.Element;\n /**\n * `(typingUsers: CommunicationParticipant[]) => JSX.Element`\n * A callback for customizing the typing indicator renderer.\n */\n onRenderTypingIndicator?: (typingUsers: CommunicationParticipant[]) => JSX.Element;\n /**\n * Flags to enable/disable visual elements of the {@link ChatComposite}.\n */\n options?: ChatCompositeOptions;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n /**\n * Optimizes the composite form factor for either desktop or mobile.\n * @remarks `mobile` is currently only optimized for Portrait mode on mobile devices and does not support landscape.\n * @defaultValue 'desktop'\n */\n formFactor?: 'desktop' | 'mobile';\n}\n\n/**\n * Optional features of the {@link ChatComposite}.\n *\n * @public\n */\nexport type ChatCompositeOptions = {\n /**\n * Surface Azure Communication Services backend errors in the UI with {@link @azure/communication-react#ErrorBar}.\n * Hide or show the error bar.\n * @defaultValue true\n */\n errorBar?: boolean;\n /* @conditional-compile-remove(chat-composite-participant-pane) */\n /**\n * Show or hide the participant pane. This feature is in beta and not supported on mobile or narrow screen views.\n * @defaultValue false\n *\n * @beta\n */\n participantPane?: boolean;\n /**\n * Show or hide the topic at the top of the chat. Hidden if set to `false`\n * @defaultValue true\n */\n topic?: boolean;\n /**\n * enumerable to determine if the input box has focus on render or not.\n * When undefined nothing has focus on render\n */\n autoFocus?: 'sendBoxTextField';\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n /**\n * Properties for configuring the File Sharing feature.\n * If undefined, file sharing feature will be disabled.\n * @beta\n */\n fileSharing?: FileSharingOptions;\n\n /* @conditional-compile-remove(rich-text-editor) */\n /**\n * Properties for configuring the richTextEditor feature.\n * @defaultValue false\n *\n * @beta\n */\n richTextEditor?: boolean | RichTextEditorOptions;\n};\n\n/* @conditional-compile-remove(rich-text-editor) */\n/**\n * Options for configuring the rich text editor.\n *\n * @beta\n */\nexport interface RichTextEditorOptions {}\n\n/**\n * A customizable UI composite for the chat experience.\n *\n * @remarks Chat composite min width and height are respectively 17.5rem and 20rem (280px and 320px, with default rem at 16px)\n *\n * @public\n */\nexport const ChatComposite = (props: ChatCompositeProps): JSX.Element => {\n const {\n adapter,\n options,\n onFetchAvatarPersonaData,\n onRenderTypingIndicator,\n onRenderMessage,\n onFetchParticipantMenuItems\n } = props;\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const formFactor = props['formFactor'] || 'desktop';\n\n return (\n <div className={chatScreenContainerStyle}>\n <BaseProvider {...props}>\n <ChatAdapterProvider adapter={adapter}>\n <ChatScreen\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n formFactor={formFactor}\n options={options}\n onFetchAvatarPersonaData={onFetchAvatarPersonaData}\n onRenderTypingIndicator={onRenderTypingIndicator}\n onRenderMessage={onRenderMessage}\n onFetchParticipantMenuItems={onFetchParticipantMenuItems}\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n fileSharing={options?.fileSharing}\n />\n </ChatAdapterProvider>\n </BaseProvider>\n </div>\n );\n};\n"]}
@@ -26,7 +26,7 @@ import { participantListContainerPadding } from '../common/styles/ParticipantCon
26
26
  /* @conditional-compile-remove(chat-composite-participant-pane) */
27
27
  import { ChatScreenPeoplePane } from './ChatScreenPeoplePane';
28
28
  import { toFlatCommunicationIdentifier } from "../../../../acs-ui-common/src";
29
- /* @conditional-compile-remove(file-sharing) */
29
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
30
30
  import { FileDownloadErrorBar } from './FileDownloadErrorBar';
31
31
  import { _AttachmentDownloadCards } from "../../../../react-components/src";
32
32
  import { ImageOverlay } from "../../../../react-components/src";
@@ -37,7 +37,7 @@ import { SendBox } from '../common/SendBox';
37
37
  export const ChatScreen = (props) => {
38
38
  const { onFetchAvatarPersonaData, onRenderMessage, onRenderTypingIndicator, options, styles, fileSharing, formFactor } = props;
39
39
  const defaultNumberOfChatMessagesToReload = 5;
40
- /* @conditional-compile-remove(file-sharing) */
40
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
41
41
  const [downloadErrorMessage, setDownloadErrorMessage] = React.useState('');
42
42
  const [overlayImageItem, setOverlayImageItem] = useState();
43
43
  const [isImageOverlayOpen, setIsImageOverlayOpen] = useState(false);
@@ -100,12 +100,12 @@ export const ChatScreen = (props) => {
100
100
  if (!files) {
101
101
  return;
102
102
  }
103
- /* @conditional-compile-remove(file-sharing) */
103
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
104
104
  const fileUploads = adapter.registerActiveFileUploads(Array.from(files));
105
- /* @conditional-compile-remove(file-sharing) */
105
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
106
106
  fileSharing === null || fileSharing === void 0 ? void 0 : fileSharing.uploadHandler(userId, fileUploads);
107
107
  }, [adapter, fileSharing, userId]);
108
- /* @conditional-compile-remove(file-sharing) */
108
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
109
109
  const onRenderFileDownloads = useCallback((userId, message) => (React.createElement(_AttachmentDownloadCards, { userId: userId, fileMetadata: message.files || [], downloadHandler: fileSharing === null || fileSharing === void 0 ? void 0 : fileSharing.downloadHandler, onDownloadErrorMessage: (errorMessage) => {
110
110
  setDownloadErrorMessage(errorMessage);
111
111
  } })), [fileSharing === null || fileSharing === void 0 ? void 0 : fileSharing.downloadHandler]);
@@ -207,12 +207,12 @@ export const ChatScreen = (props) => {
207
207
  React.createElement(Stack, { className: chatArea, tokens: participantListContainerPadding, horizontal: true, grow: true },
208
208
  React.createElement(Stack, { className: chatWrapper, grow: true },
209
209
  (options === null || options === void 0 ? void 0 : options.errorBar) !== false && React.createElement(ErrorBar, Object.assign({}, errorBarProps)),
210
- /* @conditional-compile-remove(file-sharing) */
210
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
211
211
  React.createElement(FileDownloadErrorBar, { onDismissDownloadErrorMessage: useCallback(() => {
212
212
  setDownloadErrorMessage('');
213
213
  }, []), fileDownloadErrorMessage: downloadErrorMessage || '' }),
214
214
  React.createElement(MessageThread, Object.assign({}, messageThreadProps, { onRenderAvatar: onRenderAvatarCallback, onRenderMessage: onRenderMessage,
215
- /* @conditional-compile-remove(file-sharing) */
215
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
216
216
  onRenderFileDownloads: onRenderFileDownloads, inlineImageOptions: inlineImageOptions, numberOfChatMessagesToReload: defaultNumberOfChatMessagesToReload, styles: messageThreadStyles })),
217
217
  React.createElement(Stack, { className: mergeStyles(sendboxContainerStyles) },
218
218
  React.createElement("div", { className: mergeStyles(typingIndicatorContainerStyles) }, onRenderTypingIndicator ? (onRenderTypingIndicator(typingIndicatorProps.typingUsers)) : (React.createElement(TypingIndicator, Object.assign({}, typingIndicatorProps, { styles: typingIndicatorStyles })))),
@@ -221,7 +221,7 @@ export const ChatScreen = (props) => {
221
221
  React.createElement(AttachFileButton, null))),
222
222
  React.createElement(Stack, { grow: true },
223
223
  React.createElement(SendBox, { options: options, styles: styles === null || styles === void 0 ? void 0 : styles.sendBox,
224
- /* @conditional-compile-remove(file-sharing) */
224
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
225
225
  adapter: adapter })),
226
226
  formFactor !== 'mobile' && React.createElement(AttachFileButton, null)))),
227
227
  /* @conditional-compile-remove(chat-composite-participant-pane) */
@@ -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,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;AAI1D,OAAO,EAAE,uBAAuB,IAAI,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC7E,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,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AAG,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) */\nimport { ChatMessage } from '@internal/react-components';\nimport React, { useCallback, useEffect, useMemo } 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) */\nimport { FileDownloadHandler } from '@internal/react-components';\nimport { FileUploadHandler } from '@internal/react-components';\nimport { FileUploadButtonWrapper as FileUploadButton } 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) */\nimport { FileDownloadErrorBar } from './FileDownloadErrorBar';\nimport { _AttachmentDownloadCards } from '@internal/react-components';\nimport { ImageOverlay } from '@internal/react-components';\nimport { InlineImage } from '@internal/react-components';\nimport { SendBox } from '../common/SendBox';\nimport { ResourceFetchResult } from '@internal/chat-stateful-client';\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 fileSharing?: FileSharingOptions;\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 * Properties for configuring the File Sharing feature.\n * @beta\n */\nexport interface FileSharingOptions {\n /**\n * A string containing the comma separated list of accepted file types.\n * Similar to the `accept` attribute of the `<input type=\"file\" />` element.\n * Accepts any type of file if not specified.\n * @beta\n */\n accept?: string;\n /**\n * Allows multiple files to be selected if set to `true`.\n * Similar to the `multiple` attribute of the `<input type=\"file\" />` element.\n * @defaultValue false\n * @beta\n */\n multiple?: boolean;\n /**\n * A function of type {@link FileUploadHandler} for handling file uploads.\n * @beta\n */\n uploadHandler: FileUploadHandler;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * A function of type {@link FileDownloadHandler} for handling file downloads.\n * If the function is not specified, the file's `url` will be opened in a new tab to\n * initiate the download.\n */\n downloadHandler?: FileDownloadHandler;\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 fileSharing,\n formFactor\n } = props;\n\n const defaultNumberOfChatMessagesToReload = 5;\n /* @conditional-compile-remove(file-sharing) */\n const [downloadErrorMessage, setDownloadErrorMessage] = React.useState('');\n const [overlayImageItem, setOverlayImageItem] = useState<OverlayImageItem>();\n const [isImageOverlayOpen, setIsImageOverlayOpen] = useState<boolean>(false);\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 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 userId = toFlatCommunicationIdentifier(adapter.getState().userId);\n\n const fileUploadButtonOnChange = useCallback(\n (files: FileList | null): void => {\n if (!files) {\n return;\n }\n\n /* @conditional-compile-remove(file-sharing) */\n const fileUploads = adapter.registerActiveFileUploads(Array.from(files));\n /* @conditional-compile-remove(file-sharing) */\n fileSharing?.uploadHandler(userId, fileUploads);\n },\n [adapter, fileSharing, userId]\n );\n\n /* @conditional-compile-remove(file-sharing) */\n const onRenderFileDownloads = useCallback(\n (userId: string, message: ChatMessage) => (\n <_AttachmentDownloadCards\n userId={userId}\n fileMetadata={message.files || []}\n downloadHandler={fileSharing?.downloadHandler}\n onDownloadErrorMessage={(errorMessage: string) => {\n setDownloadErrorMessage(errorMessage);\n }}\n />\n ),\n [fileSharing?.downloadHandler]\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 inlineImageOptions = {\n onRenderInlineImage: (\n inlineImage: InlineImage,\n defaultOnRender: (inlineImage: InlineImage) => JSX.Element\n ): 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 };\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 const AttachFileButton = useCallback(() => {\n if (!fileSharing?.uploadHandler) {\n return null;\n }\n return (\n <FileUploadButton\n accept={fileSharing?.accept}\n multiple={fileSharing?.multiple}\n onChange={fileUploadButtonOnChange}\n />\n );\n }, [fileSharing?.accept, fileSharing?.multiple, fileSharing?.uploadHandler, fileUploadButtonOnChange]);\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) */\n <FileDownloadErrorBar\n onDismissDownloadErrorMessage={useCallback(() => {\n setDownloadErrorMessage('');\n }, [])}\n fileDownloadErrorMessage={downloadErrorMessage || ''}\n />\n }\n <MessageThread\n {...messageThreadProps}\n onRenderAvatar={onRenderAvatarCallback}\n onRenderMessage={onRenderMessage}\n /* @conditional-compile-remove(file-sharing) */\n onRenderFileDownloads={onRenderFileDownloads}\n inlineImageOptions={inlineImageOptions}\n numberOfChatMessagesToReload={defaultNumberOfChatMessagesToReload}\n styles={messageThreadStyles}\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 <Stack verticalAlign=\"center\">\n <AttachFileButton />\n </Stack>\n )}\n <Stack grow>\n <SendBox\n options={options}\n styles={styles?.sendBox}\n /* @conditional-compile-remove(file-sharing) */\n adapter={adapter}\n />\n </Stack>\n {formFactor !== 'mobile' && <AttachFileButton />}\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","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,M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BACvC,UAAU,KAAK,QAAQ,IAAI,CAC1B,oBAAC,KAAK,IAAC,aAAa,EAAC,QAAQ;4BAC3B,oBAAC,gBAAgB,OAAG,CACd,CACT;wBACD,oBAAC,KAAK,IAAC,IAAI;4BACT,oBAAC,OAAO,IACN,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO;gCACvB,qGAAqG;gCACrG,OAAO,EAAE,OAAO,GAChB,CACI;wBACP,UAAU,KAAK,QAAQ,IAAI,oBAAC,gBAAgB,OAAG,CAC1C,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(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { ChatMessage } from '@internal/react-components';\nimport React, { useCallback, useEffect, useMemo } 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(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { FileDownloadHandler } from '@internal/react-components';\nimport { FileUploadHandler } from '@internal/react-components';\nimport { FileUploadButtonWrapper as FileUploadButton } 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(attachment-download) @conditional-compile-remove(attachment-upload) */\nimport { FileDownloadErrorBar } from './FileDownloadErrorBar';\nimport { _AttachmentDownloadCards } from '@internal/react-components';\nimport { ImageOverlay } from '@internal/react-components';\nimport { InlineImage } from '@internal/react-components';\nimport { SendBox } from '../common/SendBox';\nimport { ResourceFetchResult } from '@internal/chat-stateful-client';\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 fileSharing?: FileSharingOptions;\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 * Properties for configuring the File Sharing feature.\n * @beta\n */\nexport interface FileSharingOptions {\n /**\n * A string containing the comma separated list of accepted file types.\n * Similar to the `accept` attribute of the `<input type=\"file\" />` element.\n * Accepts any type of file if not specified.\n * @beta\n */\n accept?: string;\n /**\n * Allows multiple files to be selected if set to `true`.\n * Similar to the `multiple` attribute of the `<input type=\"file\" />` element.\n * @defaultValue false\n * @beta\n */\n multiple?: boolean;\n /**\n * A function of type {@link FileUploadHandler} for handling file uploads.\n * @beta\n */\n uploadHandler: FileUploadHandler;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n /**\n * A function of type {@link FileDownloadHandler} for handling file downloads.\n * If the function is not specified, the file's `url` will be opened in a new tab to\n * initiate the download.\n */\n downloadHandler?: FileDownloadHandler;\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 fileSharing,\n formFactor\n } = props;\n\n const defaultNumberOfChatMessagesToReload = 5;\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const [downloadErrorMessage, setDownloadErrorMessage] = React.useState('');\n const [overlayImageItem, setOverlayImageItem] = useState<OverlayImageItem>();\n const [isImageOverlayOpen, setIsImageOverlayOpen] = useState<boolean>(false);\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 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 userId = toFlatCommunicationIdentifier(adapter.getState().userId);\n\n const fileUploadButtonOnChange = useCallback(\n (files: FileList | null): void => {\n if (!files) {\n return;\n }\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const fileUploads = adapter.registerActiveFileUploads(Array.from(files));\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n fileSharing?.uploadHandler(userId, fileUploads);\n },\n [adapter, fileSharing, userId]\n );\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n const onRenderFileDownloads = useCallback(\n (userId: string, message: ChatMessage) => (\n <_AttachmentDownloadCards\n userId={userId}\n fileMetadata={message.files || []}\n downloadHandler={fileSharing?.downloadHandler}\n onDownloadErrorMessage={(errorMessage: string) => {\n setDownloadErrorMessage(errorMessage);\n }}\n />\n ),\n [fileSharing?.downloadHandler]\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 inlineImageOptions = {\n onRenderInlineImage: (\n inlineImage: InlineImage,\n defaultOnRender: (inlineImage: InlineImage) => JSX.Element\n ): 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 };\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 const AttachFileButton = useCallback(() => {\n if (!fileSharing?.uploadHandler) {\n return null;\n }\n return (\n <FileUploadButton\n accept={fileSharing?.accept}\n multiple={fileSharing?.multiple}\n onChange={fileUploadButtonOnChange}\n />\n );\n }, [fileSharing?.accept, fileSharing?.multiple, fileSharing?.uploadHandler, fileUploadButtonOnChange]);\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(attachment-download) @conditional-compile-remove(attachment-upload) */\n <FileDownloadErrorBar\n onDismissDownloadErrorMessage={useCallback(() => {\n setDownloadErrorMessage('');\n }, [])}\n fileDownloadErrorMessage={downloadErrorMessage || ''}\n />\n }\n <MessageThread\n {...messageThreadProps}\n onRenderAvatar={onRenderAvatarCallback}\n onRenderMessage={onRenderMessage}\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n onRenderFileDownloads={onRenderFileDownloads}\n inlineImageOptions={inlineImageOptions}\n numberOfChatMessagesToReload={defaultNumberOfChatMessagesToReload}\n styles={messageThreadStyles}\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 <Stack verticalAlign=\"center\">\n <AttachFileButton />\n </Stack>\n )}\n <Stack grow>\n <SendBox\n options={options}\n styles={styles?.sendBox}\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n adapter={adapter}\n />\n </Stack>\n {formFactor !== 'mobile' && <AttachFileButton />}\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 +1 @@
1
- {"version":3,"file":"Strings.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/ChatComposite/Strings.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Strings used by the {@link ChatComposite} directly.\n *\n * This strings are in addition to those used by the components from the component library.\n *\n * @public\n */\nexport interface ChatCompositeStrings {\n /**\n * Chat list header text\n */\n chatListHeader: string;\n\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Upload File Button text\n */\n uploadFile: string;\n}\n"]}
1
+ {"version":3,"file":"Strings.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/ChatComposite/Strings.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Strings used by the {@link ChatComposite} directly.\n *\n * This strings are in addition to those used by the components from the component library.\n *\n * @public\n */\nexport interface ChatCompositeStrings {\n /**\n * Chat list header text\n */\n chatListHeader: string;\n\n /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */\n /**\n * Upload File Button text\n */\n uploadFile: string;\n}\n"]}
@@ -114,6 +114,12 @@ export declare const createAzureCommunicationChatAdapter: ({ endpoint: endpointU
114
114
  * @internal
115
115
  */
116
116
  export declare const _createAzureCommunicationChatAdapterInner: (endpoint: string, userId: CommunicationUserIdentifier, displayName: string, credential: CommunicationTokenCredential, threadId: string, telemetryImplementationHint?: _TelemetryImplementationHint) => Promise<ChatAdapter>;
117
+ /**
118
+ * This inner function to create ChatAdapterPromise in case when threadID is not avaialble.
119
+ * ThreadId is a promise to allow for lazy initialization of the adapter.
120
+ * @internal
121
+ */
122
+ export declare const _createLazyAzureCommunicationChatAdapterInner: (endpoint: string, userId: CommunicationUserIdentifier, displayName: string, credential: CommunicationTokenCredential, threadId: Promise<string>, telemetryImplementationHint?: _TelemetryImplementationHint) => Promise<ChatAdapter>;
117
123
  /**
118
124
  * A custom React hook to simplify the creation of {@link ChatAdapter}.
119
125
  *
@@ -20,9 +20,9 @@ import { _createStatefulChatClientInner } from "../../../../../chat-stateful-cli
20
20
  import { createDefaultChatHandlers } from "../../../../../chat-component-bindings/src";
21
21
  import { toFlatCommunicationIdentifier } from "../../../../../acs-ui-common/src";
22
22
  import EventEmitter from 'events';
23
- /* @conditional-compile-remove(file-sharing) */
23
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
24
24
  import { convertFileUploadsUiStateToMessageMetadata } from './AzureCommunicationFileUploadAdapter';
25
- /* @conditional-compile-remove(file-sharing) */
25
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
26
26
  import { AzureCommunicationFileUploadAdapter } from './AzureCommunicationFileUploadAdapter';
27
27
  import { useEffect, useRef, useState } from 'react';
28
28
  import { _isValidIdentifier } from "../../../../../acs-ui-common/src";
@@ -72,7 +72,7 @@ export class ChatContext {
72
72
  thread,
73
73
  latestErrors: clientState.latestErrors
74
74
  };
75
- /* @conditional-compile-remove(file-sharing) */
75
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
76
76
  updatedState = Object.assign(Object.assign({}, updatedState), { fileUploads: this.state.fileUploads });
77
77
  this.setState(updatedState);
78
78
  }
@@ -87,7 +87,7 @@ export class AzureCommunicationChatAdapter {
87
87
  this.chatClient = chatClient;
88
88
  this.chatThreadClient = chatThreadClient;
89
89
  this.context = new ChatContext(chatClient.getState(), chatThreadClient.threadId);
90
- /* @conditional-compile-remove(file-sharing) */
90
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
91
91
  this.fileUploadAdapter = new AzureCommunicationFileUploadAdapter(this.context);
92
92
  const onStateChange = (clientState) => {
93
93
  // unsubscribe when the instance gets disposed
@@ -117,19 +117,19 @@ export class AzureCommunicationChatAdapter {
117
117
  this.loadPreviousChatMessages = this.loadPreviousChatMessages.bind(this);
118
118
  this.on = this.on.bind(this);
119
119
  this.off = this.off.bind(this);
120
- /* @conditional-compile-remove(file-sharing) */
120
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
121
121
  this.registerActiveFileUploads = this.registerActiveFileUploads.bind(this);
122
- /* @conditional-compile-remove(file-sharing) */
122
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
123
123
  this.registerCompletedFileUploads = this.registerCompletedFileUploads.bind(this);
124
- /* @conditional-compile-remove(file-sharing) */
124
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
125
125
  this.clearFileUploads = this.clearFileUploads.bind(this);
126
- /* @conditional-compile-remove(file-sharing) */
126
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
127
127
  this.cancelFileUpload = this.cancelFileUpload.bind(this);
128
- /* @conditional-compile-remove(file-sharing) */
128
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
129
129
  this.updateFileUploadProgress = this.updateFileUploadProgress.bind(this);
130
- /* @conditional-compile-remove(file-sharing) */
130
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
131
131
  this.updateFileUploadErrorMessage = this.updateFileUploadErrorMessage.bind(this);
132
- /* @conditional-compile-remove(file-sharing) */
132
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
133
133
  this.updateFileUploadMetadata = this.updateFileUploadMetadata.bind(this);
134
134
  this.downloadResourceToCache = this.downloadResourceToCache.bind(this);
135
135
  this.removeResourceFromCache = this.removeResourceFromCache.bind(this);
@@ -179,9 +179,9 @@ export class AzureCommunicationChatAdapter {
179
179
  sendMessage(content_1) {
180
180
  return __awaiter(this, arguments, void 0, function* (content, options = {}) {
181
181
  yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
182
- /* @conditional-compile-remove(file-sharing) */
182
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
183
183
  options.metadata = Object.assign(Object.assign({}, options.metadata), convertFileUploadsUiStateToMessageMetadata(this.context.getState().fileUploads));
184
- /* @conditional-compile-remove(file-sharing) */
184
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
185
185
  /**
186
186
  * All the current uploads need to be clear from the state before a message has been sent.
187
187
  * This ensures the following behavior:
@@ -232,9 +232,9 @@ export class AzureCommunicationChatAdapter {
232
232
  updateMessage(messageId, content, metadata, options) {
233
233
  return __awaiter(this, void 0, void 0, function* () {
234
234
  return yield this.asyncTeeErrorToEventEmitter(() => __awaiter(this, void 0, void 0, function* () {
235
- /* @conditional-compile-remove(file-sharing) */
235
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
236
236
  const updatedOptions = { attachmentMetadata: options === null || options === void 0 ? void 0 : options.attachmentMetadata, metadata: metadata };
237
- /* @conditional-compile-remove(file-sharing) */
237
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
238
238
  return yield this.handlers.onUpdateMessage(messageId, content, updatedOptions);
239
239
  return yield this.handlers.onUpdateMessage(messageId, content);
240
240
  }));
@@ -247,31 +247,31 @@ export class AzureCommunicationChatAdapter {
247
247
  }));
248
248
  });
249
249
  }
250
- /* @conditional-compile-remove(file-sharing) */
250
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
251
251
  registerActiveFileUploads(files) {
252
252
  return this.fileUploadAdapter.registerActiveFileUploads(files);
253
253
  }
254
- /* @conditional-compile-remove(file-sharing) */
254
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
255
255
  registerCompletedFileUploads(metadata) {
256
256
  return this.fileUploadAdapter.registerCompletedFileUploads(metadata);
257
257
  }
258
- /* @conditional-compile-remove(file-sharing) */
258
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
259
259
  clearFileUploads() {
260
260
  this.fileUploadAdapter.clearFileUploads();
261
261
  }
262
- /* @conditional-compile-remove(file-sharing) */
262
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
263
263
  cancelFileUpload(id) {
264
264
  this.fileUploadAdapter.cancelFileUpload(id);
265
265
  }
266
- /* @conditional-compile-remove(file-sharing) */
266
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
267
267
  updateFileUploadProgress(id, progress) {
268
268
  this.fileUploadAdapter.updateFileUploadProgress(id, progress);
269
269
  }
270
- /* @conditional-compile-remove(file-sharing) */
270
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
271
271
  updateFileUploadErrorMessage(id, errorMessage) {
272
272
  this.fileUploadAdapter.updateFileUploadErrorMessage(id, errorMessage);
273
273
  }
274
- /* @conditional-compile-remove(file-sharing) */
274
+ /* @conditional-compile-remove(attachment-download) @conditional-compile-remove(attachment-upload) */
275
275
  updateFileUploadMetadata(id, metadata) {
276
276
  this.fileUploadAdapter.updateFileUploadMetadata(id, metadata);
277
277
  }
@@ -428,6 +428,28 @@ export const _createAzureCommunicationChatAdapterInner = (endpoint_1, userId_1,
428
428
  const adapter = yield createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient);
429
429
  return adapter;
430
430
  });
431
+ /**
432
+ * This inner function to create ChatAdapterPromise in case when threadID is not avaialble.
433
+ * ThreadId is a promise to allow for lazy initialization of the adapter.
434
+ * @internal
435
+ */
436
+ export const _createLazyAzureCommunicationChatAdapterInner = (endpoint_2, userId_2, displayName_2, credential_2, threadId_2, ...args_2) => __awaiter(void 0, [endpoint_2, userId_2, displayName_2, credential_2, threadId_2, ...args_2], void 0, function* (endpoint, userId, displayName, credential, threadId, telemetryImplementationHint = 'Chat') {
437
+ if (!_isValidIdentifier(userId)) {
438
+ throw new Error('Provided userId is invalid. Please provide valid identifier object.');
439
+ }
440
+ const chatClient = _createStatefulChatClientInner({
441
+ userId,
442
+ displayName,
443
+ endpoint,
444
+ credential
445
+ }, undefined, telemetryImplementationHint);
446
+ return threadId.then((threadId) => __awaiter(void 0, void 0, void 0, function* () {
447
+ const chatThreadClient = yield chatClient.getChatThreadClient(threadId);
448
+ yield chatClient.startRealtimeNotifications();
449
+ const adapter = yield createAzureCommunicationChatAdapterFromClient(chatClient, chatThreadClient);
450
+ return adapter;
451
+ }));
452
+ });
431
453
  /**
432
454
  * A custom React hook to simplify the creation of {@link ChatAdapter}.
433
455
  *