@azure/communication-react 1.5.1-alpha-202304172318 → 1.5.1-alpha-202304190014

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 (57) hide show
  1. package/dist/communication-react.d.ts +9 -3
  2. package/dist/dist-cjs/communication-react/index.js +142 -45
  3. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  5. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  6. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +30 -2
  7. package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
  8. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js +5 -1
  9. package/dist/dist-esm/chat-stateful-client/src/EventSubscriber.js.map +1 -1
  10. package/dist/dist-esm/communication-react/src/index.d.ts +3 -2
  11. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  12. package/dist/dist-esm/react-components/src/components/GridLayout.js +1 -1
  13. package/dist/dist-esm/react-components/src/components/GridLayout.js.map +1 -1
  14. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +3 -2
  15. package/dist/dist-esm/react-components/src/components/MessageThread.js +3 -1
  16. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/ModalClone/ModalClone.js +1 -1
  18. package/dist/dist-esm/react-components/src/components/ModalClone/ModalClone.js.map +1 -1
  19. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js +1 -1
  20. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideo.js.map +1 -1
  21. package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
  22. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +1 -1
  23. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  24. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +1 -1
  25. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  26. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/activeVideoBackgroundEffectSelector.d.ts +7 -0
  27. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/activeVideoBackgroundEffectSelector.js +21 -0
  28. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/activeVideoBackgroundEffectSelector.js.map +1 -0
  29. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.d.ts +5 -0
  30. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js +5 -0
  31. package/dist/dist-esm/react-composites/src/composites/CallComposite/selectors/baseSelectors.js.map +1 -1
  32. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +2 -1
  33. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  34. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +4 -0
  35. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +8 -0
  36. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  37. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +3 -1
  38. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  39. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +3 -1
  40. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  41. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.d.ts +4 -0
  42. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js +6 -0
  43. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedChatAdapter.js.map +1 -1
  44. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +3 -1
  45. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +6 -2
  46. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  47. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js +11 -1
  48. package/dist/dist-esm/react-composites/src/composites/ChatComposite/ChatScreen.js.map +1 -1
  49. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +4 -1
  50. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +27 -20
  51. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
  52. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.d.ts +3 -1
  53. package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/ChatAdapter.js.map +1 -1
  54. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.d.ts +0 -2
  55. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +20 -10
  56. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  57. package/package.json +10 -11
@@ -2445,7 +2445,9 @@ export declare interface CallWithChatAdapterManagement {
2445
2445
  updateFileUploadErrorMessage: (id: string, errorMessage: string) => void;
2446
2446
  /** @beta */
2447
2447
  updateFileUploadMetadata: (id: string, metadata: FileMetadata) => void;
2448
- downloadAuthenticatedAttachment?: (attachmentUrl: string) => Promise<AttachmentDownloadResult>;
2448
+ downloadAttachments: (options: {
2449
+ attachmentUrls: string[];
2450
+ }) => Promise<AttachmentDownloadResult[]>;
2449
2451
  /**
2450
2452
  * Puts the Call in a Localhold.
2451
2453
  *
@@ -2646,6 +2648,8 @@ export declare interface CallWithChatClientState {
2646
2648
  environmentInfo?: EnvironmentInfo;
2647
2649
  /** Default set of background images for background replacement effect */
2648
2650
  videoBackgroundImages?: VideoBackgroundImage[];
2651
+ /** State to track the selected video background effect */
2652
+ selectedVideoBackgroundEffect?: SelectedVideoBackgroundEffect;
2649
2653
  }
2650
2654
 
2651
2655
  /**
@@ -3486,7 +3490,9 @@ export declare interface ChatAdapterThreadManagement {
3486
3490
  *
3487
3491
  */
3488
3492
  loadPreviousChatMessages(messagesToLoad: number): Promise<boolean>;
3489
- downloadAuthenticatedAttachment?: (attachmentUrl: string) => Promise<AttachmentDownloadResult>;
3493
+ downloadAttachments: (options: {
3494
+ attachmentUrls: string[];
3495
+ }) => Promise<AttachmentDownloadResult[]>;
3490
3496
  }
3491
3497
 
3492
3498
  /**
@@ -6726,7 +6732,7 @@ export declare type MessageThreadProps = {
6726
6732
  * @param attachment - FileMetadata object we want to render
6727
6733
  * @beta
6728
6734
  */
6729
- onFetchAttachments?: (attachment: FileMetadata) => Promise<AttachmentDownloadResult>;
6735
+ onFetchAttachments?: (attachment: FileMetadata) => Promise<AttachmentDownloadResult[]>;
6730
6736
  /**
6731
6737
  * Optional callback to edit a message.
6732
6738
  *
@@ -162,7 +162,7 @@ const _toCommunicationIdentifier = (id) => {
162
162
  // Copyright (c) Microsoft Corporation.
163
163
  // Licensed under the MIT license.
164
164
  // GENERATED FILE. DO NOT EDIT MANUALLY.
165
- var telemetryVersion = '1.5.1-alpha-202304172318';
165
+ var telemetryVersion = '1.5.1-alpha-202304190014';
166
166
 
167
167
  // Copyright (c) Microsoft Corporation.
168
168
  /**
@@ -5094,7 +5094,7 @@ const GridLayout = (props) => {
5094
5094
  return calculateGridProps(numberOfChildren, currentWidth, currentHeight);
5095
5095
  }, [numberOfChildren, currentWidth, currentHeight]);
5096
5096
  const cssGridStyles = React.useMemo(() => createGridStyles(numberOfChildren, gridProps), [numberOfChildren, gridProps]);
5097
- return (React__default['default'].createElement("div", { ref: containerRef, className: react.mergeStyles(gridLayoutStyle, cssGridStyles, styles === null || styles === void 0 ? void 0 : styles.root) }, children));
5097
+ return (React__default['default'].createElement("div", { ref: containerRef, className: react.mergeStyles(gridLayoutStyle, cssGridStyles, styles === null || styles === void 0 ? void 0 : styles.root), "data-ui-id": "grid-layout" }, children));
5098
5098
  };
5099
5099
  /**
5100
5100
  * The cell aspect ratio we aim for in a grid
@@ -7840,7 +7840,9 @@ const MessageThread = (props) => {
7840
7840
  return;
7841
7841
  }
7842
7842
  const attachmentDownloadResult = yield onFetchAttachments(attachment);
7843
- setInlineAttachments((prev) => (Object.assign(Object.assign({}, prev), { [attachment.id]: attachmentDownloadResult.blobUrl })));
7843
+ if (attachmentDownloadResult[0]) {
7844
+ setInlineAttachments((prev) => (Object.assign(Object.assign({}, prev), { [attachment.id]: attachmentDownloadResult[0].blobUrl })));
7845
+ }
7844
7846
  }), [inlineAttachments, onFetchAttachments]);
7845
7847
  const isAllChatMessagesLoadedRef = React.useRef(false);
7846
7848
  // isAllChatMessagesLoadedRef needs to be updated every time when a new adapter is set in order to display correct data
@@ -11049,7 +11051,7 @@ const ModalBase = React__namespace.forwardRef((propsWithoutDefaults, ref) => {
11049
11051
  internalState.events.dispose();
11050
11052
  });
11051
11053
  useComponentRef(props, focusTrapZone);
11052
- const modalContent = (React__namespace.createElement(react.FocusTrapZone, { disabled: true, id: focusTrapZoneId, ref: focusTrapZoneElm, componentRef: focusTrapZone, className: classNames.main, elementToFocusOnDismiss: elementToFocusOnDismiss, isClickableOutsideFocusTrap: isModeless || isClickableOutsideFocusTrap || !isBlocking, ignoreExternalFocusing: ignoreExternalFocusing, forceFocusInsideTrap: forceFocusInsideTrap && !isModeless, firstFocusableSelector: firstFocusableSelector, focusPreviouslyFocusedInnerElement: true, onBlur: internalState.isInKeyboardMoveMode ? handleExitKeyboardMoveMode : undefined },
11054
+ const modalContent = (React__namespace.createElement(react.FocusTrapZone, { disabled: true, id: focusTrapZoneId, ref: focusTrapZoneElm, componentRef: focusTrapZone, className: classNames.main, elementToFocusOnDismiss: elementToFocusOnDismiss, isClickableOutsideFocusTrap: isModeless || isClickableOutsideFocusTrap || !isBlocking, ignoreExternalFocusing: ignoreExternalFocusing, forceFocusInsideTrap: forceFocusInsideTrap && !isModeless, firstFocusableSelector: firstFocusableSelector, focusPreviouslyFocusedInnerElement: true, onBlur: internalState.isInKeyboardMoveMode ? handleExitKeyboardMoveMode : undefined, "data-ui-id": props['data-ui-id'] },
11053
11055
  dragOptions && internalState.isInKeyboardMoveMode && (React__namespace.createElement("div", { className: classNames.keyboardMoveIconContainer }, dragOptions.keyboardMoveIconProps ? (React__namespace.createElement(react.Icon, Object.assign({}, dragOptions.keyboardMoveIconProps))) : (React__namespace.createElement(react.Icon, { iconName: "move", className: classNames.keyboardMoveIcon })))),
11054
11056
  React__namespace.createElement("div", { ref: allowScrollOnModal, className: classNames.scrollableContent, "data-is-scrollable": true },
11055
11057
  dragOptions && isModalMenuOpen && (React__namespace.createElement(dragOptions.menu, { items: [
@@ -11485,7 +11487,7 @@ const FloatingLocalVideo = (props) => {
11485
11487
  : undefined, [parentHeight, parentWidth, localVideoSizeRem.width, localVideoSizeRem.height]);
11486
11488
  const modalStyles = React.useMemo(() => floatingLocalVideoModalStyle(theme, localVideoSizeRem), [theme, localVideoSizeRem]);
11487
11489
  const layerProps = React.useMemo(() => ({ hostId: layerHostId }), [layerHostId]);
11488
- return (React__default['default'].createElement(_ModalClone, { isOpen: true, isModeless: true, dragOptions: DRAG_OPTIONS$1, styles: modalStyles, layerProps: layerProps, maxDragPosition: modalMaxDragPosition, minDragPosition: modalMinDragPosition }, localVideoComponent));
11490
+ return (React__default['default'].createElement(_ModalClone, { isOpen: true, isModeless: true, dragOptions: DRAG_OPTIONS$1, styles: modalStyles, layerProps: layerProps, maxDragPosition: modalMaxDragPosition, minDragPosition: modalMinDragPosition, "data-ui-id": "floating-local-video-host" }, localVideoComponent));
11489
11491
  };
11490
11492
 
11491
11493
  // Copyright (c) Microsoft Corporation.
@@ -15194,6 +15196,34 @@ const extractAttachedFilesMetadata = (metadata) => {
15194
15196
  return [];
15195
15197
  }
15196
15198
  };
15199
+ /* @conditional-compile-remove(teams-inline-images) */
15200
+ const extractInlineImageFilesMetadata = (attachments) => {
15201
+ return attachments.map((attachment) => {
15202
+ var _a, _b;
15203
+ return ({
15204
+ attachmentType: attachment.attachmentType,
15205
+ id: attachment.id,
15206
+ name: (_a = attachment.name) !== null && _a !== void 0 ? _a : '',
15207
+ extension: (_b = attachment.contentType) !== null && _b !== void 0 ? _b : '',
15208
+ url: attachment.url,
15209
+ previewUrl: attachment.previewUrl
15210
+ });
15211
+ });
15212
+ };
15213
+ /* @conditional-compile-remove(file-sharing) @conditional-compile-remove(teams-inline-images) */
15214
+ const extractFilesMetadata = (message) => {
15215
+ var _a, _b;
15216
+ let fileMetadata = [];
15217
+ /* @conditional-compile-remove(file-sharing) */
15218
+ if (message.metadata) {
15219
+ fileMetadata = fileMetadata.concat(extractAttachedFilesMetadata(message.metadata));
15220
+ }
15221
+ /* @conditional-compile-remove(teams-inline-images) */
15222
+ if ((_a = message.content) === null || _a === void 0 ? void 0 : _a.attachments) {
15223
+ fileMetadata = fileMetadata.concat(extractInlineImageFilesMetadata((_b = message.content) === null || _b === void 0 ? void 0 : _b.attachments));
15224
+ }
15225
+ return fileMetadata;
15226
+ };
15197
15227
  /* @conditional-compile-remove(data-loss-prevention) */
15198
15228
  const convertToUiBlockedMessage = (message, userId, isSeen, isLargeGroup) => {
15199
15229
  var _a;
@@ -15228,8 +15258,8 @@ const convertToUiChatMessage = (message, userId, isSeen, isLargeGroup) => {
15228
15258
  deletedOn: message.deletedOn,
15229
15259
  mine: messageSenderId === userId,
15230
15260
  metadata: message.metadata,
15231
- /* @conditional-compile-remove(file-sharing) */
15232
- attachedFilesMetadata: extractAttachedFilesMetadata(message.metadata || {})
15261
+ /* @conditional-compile-remove(file-sharing) @conditional-compile-remove(teams-inline-images) */
15262
+ attachedFilesMetadata: extractFilesMetadata(message)
15233
15263
  };
15234
15264
  };
15235
15265
  const convertToUiSystemMessage = (message) => {
@@ -16017,7 +16047,11 @@ class EventSubscriber {
16017
16047
  return convertChatMessage({
16018
16048
  id: event.id,
16019
16049
  version: event.version,
16020
- content: { message: event.message },
16050
+ content: {
16051
+ message: event.message,
16052
+ /* @conditional-compile-remove(teams-inline-images) */
16053
+ attachments: event.attachments
16054
+ },
16021
16055
  type: this.convertEventType(event.type),
16022
16056
  sender: event.sender,
16023
16057
  senderDisplayName: event.senderDisplayName,
@@ -17591,7 +17625,7 @@ class AzureCommunicationChatAdapter {
17591
17625
  /* @conditional-compile-remove(file-sharing) */
17592
17626
  this.updateFileUploadMetadata = this.updateFileUploadMetadata.bind(this);
17593
17627
  /* @conditional-compile-remove(teams-inline-images) */
17594
- this.downloadAuthenticatedAttachment = this.downloadAuthenticatedAttachment.bind(this);
17628
+ this.downloadAttachments = this.downloadAttachments.bind(this);
17595
17629
  }
17596
17630
  dispose() {
17597
17631
  this.unsubscribeAllEvents();
@@ -17729,7 +17763,7 @@ class AzureCommunicationChatAdapter {
17729
17763
  this.fileUploadAdapter.updateFileUploadMetadata(id, metadata);
17730
17764
  }
17731
17765
  /* @conditional-compile-remove(teams-inline-images) */
17732
- downloadAuthenticatedAttachment(attachmentUrl) {
17766
+ downloadAttachments(options) {
17733
17767
  return __awaiter$i(this, void 0, void 0, function* () {
17734
17768
  return this.asyncTeeErrorToEventEmitter(() => __awaiter$i(this, void 0, void 0, function* () {
17735
17769
  if (this.credential === undefined) {
@@ -17745,27 +17779,34 @@ class AzureCommunicationChatAdapter {
17745
17779
  e['innerError'] = new Error('AccessToken is null');
17746
17780
  throw e;
17747
17781
  }
17748
- function fetchWithAuthentication(url, token) {
17749
- return __awaiter$i(this, void 0, void 0, function* () {
17750
- const headers = new Headers();
17751
- headers.append('Authorization', `Bearer ${token}`);
17752
- try {
17753
- return yield fetch(url, { headers });
17754
- }
17755
- catch (err) {
17756
- const e = new Error();
17757
- e['target'] = 'ChatThreadClient.getMessage';
17758
- e['innerError'] = err;
17759
- throw e;
17760
- }
17761
- });
17762
- }
17763
- const response = yield fetchWithAuthentication(attachmentUrl, accessToken.token);
17764
- const blob = yield response.blob();
17765
- return { blobUrl: URL.createObjectURL(blob) };
17782
+ return this.downloadAuthenticatedFile(accessToken.token, options);
17766
17783
  }));
17767
17784
  });
17768
17785
  }
17786
+ /* @conditional-compile-remove(teams-inline-images) */
17787
+ downloadAuthenticatedFile(accessToken, options) {
17788
+ return __awaiter$i(this, void 0, void 0, function* () {
17789
+ function fetchWithAuthentication(url, token) {
17790
+ return __awaiter$i(this, void 0, void 0, function* () {
17791
+ const headers = new Headers();
17792
+ headers.append('Authorization', `Bearer ${token}`);
17793
+ try {
17794
+ return yield fetch(url, { headers });
17795
+ }
17796
+ catch (err) {
17797
+ const e = new Error();
17798
+ e['target'] = 'ChatThreadClient.getMessage';
17799
+ e['innerError'] = err;
17800
+ throw e;
17801
+ }
17802
+ });
17803
+ }
17804
+ const attachmentUrl = options.attachmentUrls[0];
17805
+ const response = yield fetchWithAuthentication(attachmentUrl, accessToken);
17806
+ const blob = yield response.blob();
17807
+ return [{ blobUrl: URL.createObjectURL(blob) }];
17808
+ });
17809
+ }
17769
17810
  messageReceivedListener(event) {
17770
17811
  const message = convertEventToChatMessage(event);
17771
17812
  this.emitter.emit('messageReceived', { message });
@@ -18633,6 +18674,14 @@ const ChatScreen = (props) => {
18633
18674
  const onRenderFileDownloads = React.useCallback((userId, message) => (React__default['default'].createElement(_FileDownloadCards, { userId: userId, fileMetadata: message.attachedFilesMetadata || [], downloadHandler: fileSharing === null || fileSharing === void 0 ? void 0 : fileSharing.downloadHandler, onDownloadErrorMessage: (errorMessage) => {
18634
18675
  setDownloadErrorMessage(errorMessage);
18635
18676
  } })), [fileSharing === null || fileSharing === void 0 ? void 0 : fileSharing.downloadHandler]);
18677
+ /* @conditional-compile-remove(teams-inline-images) */
18678
+ const onRenderInlineAttachment = React.useCallback((attachment) => __awaiter$g(void 0, void 0, void 0, function* () {
18679
+ if (attachment.previewUrl) {
18680
+ const blob = yield adapter.downloadAttachments({ attachmentUrls: [attachment.previewUrl] });
18681
+ return blob;
18682
+ }
18683
+ return [{ blobUrl: '' }];
18684
+ }), [adapter]);
18636
18685
  const AttachFileButton = React.useCallback(() => {
18637
18686
  if (!(fileSharing === null || fileSharing === void 0 ? void 0 : fileSharing.uploadHandler)) {
18638
18687
  return null;
@@ -18650,7 +18699,9 @@ const ChatScreen = (props) => {
18650
18699
  }, []), fileDownloadErrorMessage: downloadErrorMessage || '' }),
18651
18700
  React__default['default'].createElement(MessageThread, Object.assign({}, messageThreadProps, { onRenderAvatar: onRenderAvatarCallback, onRenderMessage: onRenderMessage,
18652
18701
  /* @conditional-compile-remove(file-sharing) */
18653
- onRenderFileDownloads: onRenderFileDownloads, numberOfChatMessagesToReload: defaultNumberOfChatMessagesToReload, styles: messageThreadStyles })),
18702
+ onRenderFileDownloads: onRenderFileDownloads,
18703
+ /* @conditional-compile-remove(teams-inline-images) */
18704
+ onFetchAttachments: onRenderInlineAttachment, numberOfChatMessagesToReload: defaultNumberOfChatMessagesToReload, styles: messageThreadStyles })),
18654
18705
  React__default['default'].createElement(react.Stack, { className: react.mergeStyles(sendboxContainerStyles) },
18655
18706
  React__default['default'].createElement("div", { className: react.mergeStyles(typingIndicatorContainerStyles) }, onRenderTypingIndicator ? (onRenderTypingIndicator(typingIndicatorProps.typingUsers)) : (React__default['default'].createElement(TypingIndicator, Object.assign({}, typingIndicatorProps, { styles: typingIndicatorStyles })))),
18656
18707
  React__default['default'].createElement(react.Stack, { horizontal: formFactor === 'mobile' },
@@ -19365,6 +19416,11 @@ const getDominantSpeakerInfo = (state) => { var _a; return (_a = state.call) ===
19365
19416
  * @private
19366
19417
  */
19367
19418
  const getRemoteParticipants = (state) => { var _a; return (_a = state.call) === null || _a === void 0 ? void 0 : _a.remoteParticipants; };
19419
+ /* @conditional-compile-remove(video-background-effects) */
19420
+ /**
19421
+ * @private
19422
+ */
19423
+ const getSelectedVideoEffect = (state) => state.selectedVideoBackgroundEffect;
19368
19424
  /* @conditional-compile-remove(close-captions) */
19369
19425
  /**
19370
19426
  * @private
@@ -21788,6 +21844,22 @@ const PreparedMoreDrawer = (props) => {
21788
21844
  return React__default['default'].createElement(MoreDrawer, Object.assign({}, props, deviceProps, callHandlers, { strings: moreDrawerStrings }));
21789
21845
  };
21790
21846
 
21847
+ // Copyright (c) Microsoft Corporation.
21848
+ /* @conditional-compile-remove(video-background-effects) */
21849
+ /**
21850
+ * @private
21851
+ */
21852
+ const activeVideoBackgroundEffectSelector = reselect__namespace.createSelector([getSelectedVideoEffect], (selectedVideoBackgroundEffect) => {
21853
+ if (selectedVideoBackgroundEffect &&
21854
+ (selectedVideoBackgroundEffect.effectName === 'blur' || selectedVideoBackgroundEffect.effectName === 'none')) {
21855
+ return selectedVideoBackgroundEffect.effectName;
21856
+ }
21857
+ else if (selectedVideoBackgroundEffect && selectedVideoBackgroundEffect.effectName === 'replacement') {
21858
+ return selectedVideoBackgroundEffect === null || selectedVideoBackgroundEffect === void 0 ? void 0 : selectedVideoBackgroundEffect.effectKey;
21859
+ }
21860
+ return 'none';
21861
+ });
21862
+
21791
21863
  var __awaiter$9 = (window && window.__awaiter) || function (thisArg, _arguments, P, generator) {
21792
21864
  function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
21793
21865
  return new (P || (P = Promise))(function (resolve, reject) {
@@ -21807,6 +21879,8 @@ const VideoEffectsPane = (props) => {
21807
21879
  /* @conditional-compile-remove(video-background-effects) */
21808
21880
  const locale = useLocale();
21809
21881
  /* @conditional-compile-remove(video-background-effects) */
21882
+ const adapter = useAdapter();
21883
+ /* @conditional-compile-remove(video-background-effects) */
21810
21884
  const strings = locale.strings.call;
21811
21885
  /* @conditional-compile-remove(video-background-effects) */
21812
21886
  const selectableVideoEffects = React.useMemo(() => {
@@ -21832,7 +21906,7 @@ const VideoEffectsPane = (props) => {
21832
21906
  }
21833
21907
  }
21834
21908
  ];
21835
- const videoEffectImages = props.adapter.getState().videoBackgroundImages;
21909
+ const videoEffectImages = adapter.getState().videoBackgroundImages;
21836
21910
  if (videoEffectImages) {
21837
21911
  videoEffectImages.forEach((img) => {
21838
21912
  var _a;
@@ -21848,22 +21922,22 @@ const VideoEffectsPane = (props) => {
21848
21922
  });
21849
21923
  }
21850
21924
  return videoEffects;
21851
- }, [strings, props.adapter]);
21925
+ }, [strings, adapter]);
21852
21926
  /* @conditional-compile-remove(video-background-effects) */
21853
21927
  const onEffectChange = React.useCallback((effectKey) => __awaiter$9(void 0, void 0, void 0, function* () {
21854
21928
  if (effectKey === 'blur') {
21855
21929
  const blurEffect = {
21856
21930
  effectName: effectKey
21857
21931
  };
21858
- props.adapter.updateSelectedVideoBackgroundEffect(blurEffect);
21859
- yield props.adapter.blurVideoBackground();
21932
+ adapter.updateSelectedVideoBackgroundEffect(blurEffect);
21933
+ yield adapter.blurVideoBackground();
21860
21934
  }
21861
21935
  else if (effectKey === 'none') {
21862
21936
  const noneEffect = {
21863
21937
  effectName: effectKey
21864
21938
  };
21865
- props.adapter.updateSelectedVideoBackgroundEffect(noneEffect);
21866
- yield props.adapter.stopVideoBackgroundEffect();
21939
+ adapter.updateSelectedVideoBackgroundEffect(noneEffect);
21940
+ yield adapter.stopVideoBackgroundEffect();
21867
21941
  }
21868
21942
  else {
21869
21943
  const backgroundImg = selectableVideoEffects.find((effect) => {
@@ -21875,11 +21949,11 @@ const VideoEffectsPane = (props) => {
21875
21949
  effectKey,
21876
21950
  backgroundImageUrl: backgroundImg.backgroundProps.url
21877
21951
  };
21878
- props.adapter.updateSelectedVideoBackgroundEffect(replaceEffect);
21879
- yield props.adapter.replaceVideoBackground({ backgroundImageUrl: backgroundImg.backgroundProps.url });
21952
+ adapter.updateSelectedVideoBackgroundEffect(replaceEffect);
21953
+ yield adapter.replaceVideoBackground({ backgroundImageUrl: backgroundImg.backgroundProps.url });
21880
21954
  }
21881
21955
  }
21882
- }), [props.adapter, selectableVideoEffects]);
21956
+ }), [adapter, selectableVideoEffects]);
21883
21957
  return VideoEffectsPaneTrampoline(showVideoEffectsOptions, setshowVideoEffectsOptions,
21884
21958
  /* @conditional-compile-remove(video-background-effects) */
21885
21959
  selectableVideoEffects,
@@ -21890,7 +21964,9 @@ const VideoEffectsPaneTrampoline = (showVideoEffectsOptions, setshowVideoEffects
21890
21964
  /* @conditional-compile-remove(video-background-effects) */
21891
21965
  const locale = useLocale();
21892
21966
  /* @conditional-compile-remove(video-background-effects) */
21893
- return (React__default['default'].createElement(react.Panel, { headerText: locale.strings.call.effects, isOpen: showVideoEffectsOptions, onDismiss: () => setshowVideoEffectsOptions(false), hasCloseButton: true, closeButtonAriaLabel: "Close", isLightDismiss: true }, selectableVideoEffects && (React__default['default'].createElement(_VideoBackgroundEffectsPicker, { options: selectableVideoEffects, onChange: onEffectChange }))));
21967
+ const selectedEffect = useSelector$1(activeVideoBackgroundEffectSelector);
21968
+ /* @conditional-compile-remove(video-background-effects) */
21969
+ return (React__default['default'].createElement(react.Panel, { headerText: locale.strings.call.effects, isOpen: showVideoEffectsOptions, onDismiss: () => setshowVideoEffectsOptions(false), hasCloseButton: true, closeButtonAriaLabel: "Close", isLightDismiss: true }, selectableVideoEffects && (React__default['default'].createElement(_VideoBackgroundEffectsPicker, { options: selectableVideoEffects, onChange: onEffectChange, selectedEffectKey: selectedEffect }))));
21894
21970
  };
21895
21971
 
21896
21972
  // Copyright (c) Microsoft Corporation.
@@ -22045,7 +22121,7 @@ const CallArrangement = (props) => {
22045
22121
  /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */
22046
22122
  callPaneContent()),
22047
22123
  /* @conditional-compile-remove(video-background-effects) */
22048
- React__default['default'].createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setShowVideoEffectsPane, adapter: adapter })))));
22124
+ React__default['default'].createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setShowVideoEffectsPane })))));
22049
22125
  };
22050
22126
  /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) */
22051
22127
  const showShowPeopleTabHeaderButton$1 = (callControls) => {
@@ -23383,7 +23459,7 @@ const ConfigurationPage = (props) => {
23383
23459
  React__default['default'].createElement(react.Stack, { styles: mobileWithPreview ? startCallButtonContainerStyleMobile : startCallButtonContainerStyleDesktop },
23384
23460
  React__default['default'].createElement(StartCallButton, { className: mobileWithPreview ? startCallButtonStyleMobile : undefined, onClick: startCallHandler, disabled: disableStartCallButton })))),
23385
23461
  /* @conditional-compile-remove(video-background-effects) */
23386
- React__default['default'].createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setVideoEffectsPane, adapter: adapter })));
23462
+ React__default['default'].createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setVideoEffectsPane })));
23387
23463
  };
23388
23464
  const localPreviewTrampoline = (mobileView, doNotShow) => {
23389
23465
  /* @conditional-compile-remove(rooms) */
@@ -25275,7 +25351,9 @@ function callAdapterStateFromCallWithChatAdapterState(callWithChatAdapterState)
25275
25351
  /* @conditional-compile-remove(unsupported-browser) */
25276
25352
  environmentInfo: callWithChatAdapterState.environmentInfo,
25277
25353
  /* @conditional-compile-remove(video-background-effects) */
25278
- videoBackgroundImages: callWithChatAdapterState.videoBackgroundImages
25354
+ videoBackgroundImages: callWithChatAdapterState.videoBackgroundImages,
25355
+ /* @conditional-compile-remove(video-background-effects) */
25356
+ selectedVideoBackgroundEffect: callWithChatAdapterState.selectedVideoBackgroundEffect
25279
25357
  };
25280
25358
  }
25281
25359
 
@@ -25384,6 +25462,12 @@ class CallWithChatBackedChatAdapter {
25384
25462
  };
25385
25463
  this.callWithChatAdapter = callWithChatAdapter;
25386
25464
  }
25465
+ /* @conditional-compile-remove(teams-inline-images) */
25466
+ downloadAttachments(options) {
25467
+ return __awaiter$2(this, void 0, void 0, function* () {
25468
+ return yield this.callWithChatAdapter.downloadAttachments(options);
25469
+ });
25470
+ }
25387
25471
  }
25388
25472
  function chatAdapterStateFromCallWithChatAdapterState(callWithChatAdapterState) {
25389
25473
  if (!callWithChatAdapterState.chat) {
@@ -25628,7 +25712,8 @@ const CallWithChatScreen = (props) => {
25628
25712
  style: callCompositeContainerCSS },
25629
25713
  React__default['default'].createElement(CallComposite, Object.assign({}, props, { formFactor: formFactor, options: callCompositeOptions, adapter: callAdapter, fluentTheme: fluentTheme }))),
25630
25714
  /* @conditional-compile-remove(video-background-effects) */
25631
- React__default['default'].createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setShowVideoEffectsPane, adapter: callAdapter }),
25715
+ React__default['default'].createElement(CallAdapterProvider, { adapter: callAdapter },
25716
+ React__default['default'].createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setShowVideoEffectsPane })),
25632
25717
  chatProps.adapter && callAdapter && hasJoinedCall && (React__default['default'].createElement(CallWithChatPane, { chatCompositeProps: chatProps, inviteLink: props.joinInvitationURL, onClose: closePane, chatAdapter: chatProps.adapter, callAdapter: callAdapter, onFetchAvatarPersonaData: props.onFetchAvatarPersonaData, onFetchParticipantMenuItems: props.onFetchParticipantMenuItems, onChatButtonClicked: showShowChatTabHeaderButton(props.callControls) ? selectChat : undefined, onPeopleButtonClicked: showShowPeopleTabHeaderButton(props.callControls) ? selectPeople : undefined, modalLayerHostId: modalLayerHostId, mobileView: mobileView, activePane: activePane,
25633
25718
  /* @conditional-compile-remove(file-sharing) */
25634
25719
  fileSharing: props.fileSharing, rtl: props.rtl, callControls: typeof props.callControls !== 'boolean' ? props.callControls : undefined }))),
@@ -25728,7 +25813,9 @@ function callWithChatAdapterStateFromBackingStates(callAdapter, chatAdapter) {
25728
25813
  /* @conditional-compile-remove(unsupported-browser) */
25729
25814
  environmentInfo: callAdapterState.environmentInfo,
25730
25815
  /* @conditional-compile-remove(video-background-effects) */
25731
- videoBackgroundImages: callAdapterState.videoBackgroundImages
25816
+ videoBackgroundImages: callAdapterState.videoBackgroundImages,
25817
+ /* @conditional-compile-remove(video-background-effects) */
25818
+ selectedVideoBackgroundEffect: callAdapterState.selectedVideoBackgroundEffect
25732
25819
  };
25733
25820
  }
25734
25821
  /**
@@ -25745,7 +25832,9 @@ function mergeChatAdapterStateIntoCallWithChatAdapterState(existingCallWithChatA
25745
25832
  function mergeCallAdapterStateIntoCallWithChatAdapterState(existingCallWithChatAdapterState, callAdapterState) {
25746
25833
  return Object.assign(Object.assign({}, existingCallWithChatAdapterState), { userId: callAdapterState.userId, page: callAdapterState.page, displayName: callAdapterState.displayName, devices: callAdapterState.devices, call: callAdapterState.call, isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled, isTeamsCall: callAdapterState.isTeamsCall, latestCallErrors: callAdapterState.latestErrors,
25747
25834
  /* @conditional-compile-remove(video-background-effects) */
25748
- videoBackgroundImages: callAdapterState.videoBackgroundImages });
25835
+ videoBackgroundImages: callAdapterState.videoBackgroundImages,
25836
+ /* @conditional-compile-remove(video-background-effects) */
25837
+ selectedVideoBackgroundEffect: callAdapterState.selectedVideoBackgroundEffect });
25749
25838
  }
25750
25839
 
25751
25840
  // Copyright (c) Microsoft Corporation.
@@ -25919,6 +26008,8 @@ class AzureCommunicationCallWithChatAdapter {
25919
26008
  this.updateFileUploadErrorMessage = this.updateFileUploadErrorMessage.bind(this);
25920
26009
  /* @conditional-compile-remove(file-sharing) */
25921
26010
  this.updateFileUploadMetadata = this.updateFileUploadMetadata.bind(this);
26011
+ /* @conditional-compile-remove(teams-inline-images) */
26012
+ this.downloadAttachments = this.downloadAttachments.bind(this);
25922
26013
  /* @conditional-compile-remove(PSTN-calls) */
25923
26014
  this.holdCall.bind(this);
25924
26015
  /* @conditional-compile-remove(PSTN-calls) */
@@ -26126,6 +26217,12 @@ class AzureCommunicationCallWithChatAdapter {
26126
26217
  return yield this.chatAdapter.deleteMessage(messageId);
26127
26218
  });
26128
26219
  }
26220
+ /* @conditional-compile-remove(teams-inline-images) */
26221
+ downloadAttachments(options) {
26222
+ return __awaiter(this, void 0, void 0, function* () {
26223
+ return yield this.chatAdapter.downloadAttachments(options);
26224
+ });
26225
+ }
26129
26226
  /* @conditional-compile-remove(PSTN-calls) */
26130
26227
  holdCall() {
26131
26228
  return __awaiter(this, void 0, void 0, function* () {