@azure/communication-react 1.5.1-alpha-202304070012 → 1.5.1-alpha-202304120012

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 (53) hide show
  1. package/dist/communication-react.d.ts +80 -0
  2. package/dist/dist-cjs/communication-react/index.js +158 -20
  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/communication-react/src/index.d.ts +1 -1
  7. package/dist/dist-esm/communication-react/src/index.js.map +1 -1
  8. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.d.ts +9 -0
  9. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js +5 -1
  10. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +1 -1
  11. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.d.ts +9 -0
  12. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js +5 -1
  13. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +1 -1
  14. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +3 -0
  15. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +54 -3
  16. package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
  17. package/dist/dist-esm/react-components/src/components/FileDownloadCards.d.ts +6 -0
  18. package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +1 -1
  19. package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +7 -0
  20. package/dist/dist-esm/react-components/src/components/MessageThread.js +23 -3
  21. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  22. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js +1 -0
  23. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js.map +1 -1
  24. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +2 -9
  25. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  26. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -1
  27. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +13 -0
  28. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  29. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +57 -0
  30. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  31. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +1 -1
  32. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  33. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +5 -0
  34. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +18 -0
  35. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  36. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +2 -1
  37. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +4 -0
  38. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  39. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +7 -1
  40. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  41. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +2 -1
  42. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +4 -0
  43. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  44. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.js +4 -0
  45. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.js.map +1 -1
  46. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +1 -0
  47. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
  48. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +17 -4
  49. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  50. package/dist/dist-esm/react-composites/src/composites/common/constants.d.ts +9 -0
  51. package/dist/dist-esm/react-composites/src/composites/common/constants.js +11 -0
  52. package/dist/dist-esm/react-composites/src/composites/common/constants.js.map +1 -0
  53. package/package.json +10 -10
@@ -217,6 +217,13 @@ export declare type AreParamEqual<A extends (props: any) => JSX.Element | undefi
217
217
  */
218
218
  export declare type AreTypeEqual<A, B> = A extends B ? (B extends A ? true : false) : false;
219
219
 
220
+ /**
221
+ * @beta
222
+ */
223
+ export declare interface AttachmentDownloadResult {
224
+ blobUrl: string;
225
+ }
226
+
220
227
  /**
221
228
  * Custom data attributes for displaying avatar for a user.
222
229
  *
@@ -763,6 +770,12 @@ export declare interface CallAdapterCallOperations {
763
770
  * @beta
764
771
  */
765
772
  updateBackgroundPickerImages(backgroundImages: VideoBackgroundImage[]): void;
773
+ /**
774
+ * Update the selected video background effect.
775
+ *
776
+ * @beta
777
+ */
778
+ updateSelectedVideoBackgroundEffect(selectedVideoBackground: SelectedVideoBackgroundEffect): void;
766
779
  }
767
780
 
768
781
  /**
@@ -804,6 +817,10 @@ export declare type CallAdapterClientState = {
804
817
  * Default set of background images for background replacement effect.
805
818
  */
806
819
  videoBackgroundImages?: VideoBackgroundImage[];
820
+ /**
821
+ * State to track the selected video background effect.
822
+ */
823
+ selectedVideoBackgroundEffect?: SelectedVideoBackgroundEffect;
807
824
  };
808
825
 
809
826
  /**
@@ -2324,6 +2341,12 @@ export declare interface CallWithChatAdapterManagement {
2324
2341
  * @beta
2325
2342
  */
2326
2343
  updateBackgroundPickerImages(backgroundImages: VideoBackgroundImage[]): void;
2344
+ /**
2345
+ * Update the selected video background effect
2346
+ *
2347
+ * @beta
2348
+ */
2349
+ updateSelectedVideoBackgroundEffect(selectedVideoBackground: SelectedVideoBackgroundEffect): void;
2327
2350
  }
2328
2351
 
2329
2352
  /**
@@ -6348,6 +6371,12 @@ export declare type MessageThreadProps = {
6348
6371
  * @beta
6349
6372
  */
6350
6373
  onRenderFileDownloads?: (userId: string, message: ChatMessage) => JSX.Element;
6374
+ /**
6375
+ * Optional callback to retrieve the inline image in a message.
6376
+ * @param attachment - FileMetadata object we want to render
6377
+ * @beta
6378
+ */
6379
+ onFetchAttachments?: (attachment: FileMetadata) => Promise<AttachmentDownloadResult>;
6351
6380
  /**
6352
6381
  * Optional callback to edit a message.
6353
6382
  *
@@ -7344,6 +7373,13 @@ export declare interface ScreenShareButtonStrings {
7344
7373
  tooltipOffContent?: string;
7345
7374
  }
7346
7375
 
7376
+ /**
7377
+ * Contains the attibutes of a selected video background effect
7378
+ *
7379
+ * @beta
7380
+ */
7381
+ export declare type SelectedVideoBackgroundEffect = VideoBackgroundNoneEffect | VideoBackgroundBlurEffect | VideoBackgroundReplacementEffect;
7382
+
7347
7383
  /**
7348
7384
  * An optimized selector that refines {@link ClientState} updates into props for React Components in this library.
7349
7385
  *
@@ -8438,6 +8474,18 @@ export declare interface VerticalGalleryStyles extends BaseCustomStyles {
8438
8474
  controlBar?: VerticalGalleryControlBarStyles;
8439
8475
  }
8440
8476
 
8477
+ /**
8478
+ * Contains the attibutes of the blur video background effect
8479
+ *
8480
+ * @beta
8481
+ */
8482
+ export declare interface VideoBackgroundBlurEffect {
8483
+ /**
8484
+ * Name of effect to blur video background effect
8485
+ */
8486
+ effectName: 'blur';
8487
+ }
8488
+
8441
8489
  /**
8442
8490
  * Contains the attibutes of a background image like url, name etc.
8443
8491
  *
@@ -8458,6 +8506,38 @@ export declare interface VideoBackgroundImage {
8458
8506
  tooltipText?: string;
8459
8507
  }
8460
8508
 
8509
+ /**
8510
+ * Contains the attibutes to remove video background effect
8511
+ *
8512
+ * @beta
8513
+ */
8514
+ export declare interface VideoBackgroundNoneEffect {
8515
+ /**
8516
+ * Name of effect to remove video background effect
8517
+ */
8518
+ effectName: 'none';
8519
+ }
8520
+
8521
+ /**
8522
+ * Contains the attibutes of a selected replacement video background effect
8523
+ *
8524
+ * @beta
8525
+ */
8526
+ export declare interface VideoBackgroundReplacementEffect {
8527
+ /**
8528
+ * Name of effect to replace video background effect
8529
+ */
8530
+ effectName: 'replacement';
8531
+ /**
8532
+ * key for unique identification of the custom background
8533
+ */
8534
+ effectKey: string;
8535
+ /**
8536
+ * URL of the custom background image.
8537
+ */
8538
+ backgroundImageUrl: string;
8539
+ }
8540
+
8461
8541
  /**
8462
8542
  * VideoGallery represents a layout of video tiles for a specific call.
8463
8543
  * It displays a {@link VideoTile} for the local user as well as for each remote participant who has joined the call.
@@ -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-202304070012';
165
+ var telemetryVersion = '1.5.1-alpha-202304120012';
166
166
 
167
167
  // Copyright (c) Microsoft Corporation.
168
168
  /**
@@ -6786,6 +6786,8 @@ const preventUnwantedDismissProps = {
6786
6786
  };
6787
6787
 
6788
6788
  // Copyright (c) Microsoft Corporation.
6789
+ const processNodeDefinitions = new htmlToReact.ProcessNodeDefinitions(React__default['default']);
6790
+ const isValidNode = () => true;
6789
6791
  /** @private */
6790
6792
  const ChatMessageContent = (props) => {
6791
6793
  switch (props.message.contentType) {
@@ -6806,9 +6808,8 @@ const MessageContentWithLiveAria = (props) => {
6806
6808
  props.content));
6807
6809
  };
6808
6810
  const MessageContentAsRichTextHTML = (props) => {
6809
- const htmlToReactParser = new htmlToReact.Parser();
6810
6811
  const liveAuthor = _formatString(props.strings.liveAuthorIntro, { author: `${props.message.senderDisplayName}` });
6811
- return (React__default['default'].createElement(MessageContentWithLiveAria, { message: props.message, liveMessage: `${props.message.mine ? '' : liveAuthor} ${extractContent(props.message.content || '')}`, ariaLabel: messageContentAriaText(props), content: htmlToReactParser.parse(props.message.content) }));
6812
+ return (React__default['default'].createElement(MessageContentWithLiveAria, { message: props.message, liveMessage: `${props.message.mine ? '' : liveAuthor} ${extractContent(props.message.content || '')}`, ariaLabel: messageContentAriaText(props), content: processHtmlToReact(props) }));
6812
6813
  };
6813
6814
  const MessageContentAsText = (props) => {
6814
6815
  const liveAuthor = _formatString(props.strings.liveAuthorIntro, { author: `${props.message.senderDisplayName}` });
@@ -6857,6 +6858,56 @@ const messageContentAriaText = (props) => {
6857
6858
  })
6858
6859
  : undefined;
6859
6860
  };
6861
+ const processHtmlToReact = (props) => {
6862
+ const htmlToReactParser = new htmlToReact.Parser();
6863
+ /* @conditional-compile-remove(teams-inline-images) */
6864
+ const processInlineImage = {
6865
+ // Custom <img> processing
6866
+ shouldProcessNode: (node) => {
6867
+ var _a;
6868
+ // Process img node with id in attachments list
6869
+ return (node.name &&
6870
+ node.name === 'img' &&
6871
+ node.attribs &&
6872
+ node.attribs.id &&
6873
+ ((_a = props.message.attachedFilesMetadata) === null || _a === void 0 ? void 0 : _a.find((f) => f.id === node.attribs.id)));
6874
+ },
6875
+ processNode: (node, children, index) => {
6876
+ var _a;
6877
+ // logic to check id in map/list
6878
+ const fileMetadata = (_a = props.message.attachedFilesMetadata) === null || _a === void 0 ? void 0 : _a.find((f) => f.id === node.attribs.id);
6879
+ // if in cache, early return
6880
+ if (props.attachmentsMap && node.attribs.id in props.attachmentsMap) {
6881
+ node.attribs = Object.assign(Object.assign({}, node.attribs), { src: props.attachmentsMap[node.attribs.id] });
6882
+ return processNodeDefinitions.processDefaultNode(node, children, index);
6883
+ }
6884
+ // not yet in cache
6885
+ if (fileMetadata && props.onFetchAttachment && props.attachmentsMap) {
6886
+ props.onFetchAttachment(fileMetadata);
6887
+ if (node.attribs.id in props.attachmentsMap) {
6888
+ node.attribs = Object.assign(Object.assign({}, node.attribs), { src: props.attachmentsMap[node.attribs.id] });
6889
+ }
6890
+ }
6891
+ return processNodeDefinitions.processDefaultNode(node, children, index);
6892
+ }
6893
+ };
6894
+ const addProcessingStep = () => {
6895
+ const steps = [];
6896
+ /* @conditional-compile-remove(teams-inline-images) */
6897
+ steps.push(processInlineImage);
6898
+ return steps;
6899
+ };
6900
+ const processingInstructions = [
6901
+ ...addProcessingStep(),
6902
+ {
6903
+ shouldProcessNode: () => {
6904
+ return true;
6905
+ },
6906
+ processNode: processNodeDefinitions.processDefaultNode
6907
+ }
6908
+ ];
6909
+ return htmlToReactParser.parseWithInstructions(props.message.content, isValidNode, processingInstructions);
6910
+ };
6860
6911
 
6861
6912
  // Copyright (c) Microsoft Corporation.
6862
6913
  /**
@@ -7053,7 +7104,11 @@ const MessageBubble = (props) => {
7053
7104
  React__default['default'].createElement(BlockedMessageContent, { message: message, strings: strings })));
7054
7105
  }
7055
7106
  return (React__default['default'].createElement("div", { tabIndex: 0 },
7056
- React__default['default'].createElement(ChatMessageContent, { message: message, strings: strings }),
7107
+ React__default['default'].createElement(ChatMessageContent, { message: message, strings: strings,
7108
+ /* @conditional-compile-remove(teams-inline-images) */
7109
+ onFetchAttachment: props.onFetchAttachments,
7110
+ /* @conditional-compile-remove(teams-inline-images) */
7111
+ attachmentsMap: props.attachmentsMap }),
7057
7112
  props.onRenderFileDownloads ? props.onRenderFileDownloads(userId, message) : defaultOnRenderFileDownloads()));
7058
7113
  }, [defaultOnRenderFileDownloads, message, props, strings, userId]);
7059
7114
  const chatMessage = (React__default['default'].createElement(React__default['default'].Fragment, null,
@@ -7125,7 +7180,11 @@ const ChatMessageComponent = (props) => {
7125
7180
  else {
7126
7181
  return (React__default['default'].createElement(ChatMessageComponentAsMessageBubble, Object.assign({}, props, { onRemoveClick: onRemoveClick, onEditClick: onEditClick, onResendClick: onResendClick, onRenderAvatar: props.onRenderAvatar,
7127
7182
  /* @conditional-compile-remove(date-time-customization) */
7128
- onDisplayDateTimeString: props.onDisplayDateTimeString, strings: props.strings })));
7183
+ onDisplayDateTimeString: props.onDisplayDateTimeString, strings: props.strings,
7184
+ /* @conditional-compile-remove(teams-inline-images) */
7185
+ onFetchAttachments: props.onFetchAttachments,
7186
+ /* @conditional-compile-remove(teams-inline-images) */
7187
+ attachmentsMap: props.attachmentsMap })));
7129
7188
  }
7130
7189
  };
7131
7190
 
@@ -7417,7 +7476,9 @@ const MessageThread = (props) => {
7417
7476
  var _a;
7418
7477
  const { messages: newMessages, userId, participantCount, readReceiptsBySenderId, styles, disableJumpToNewMessageButton = false, showMessageDate = false, showMessageStatus = false, numberOfChatMessagesToReload = 5, onMessageSeen, onRenderMessageStatus, onRenderAvatar, onLoadPreviousChatMessages, onRenderJumpToNewMessageButton, onRenderMessage, onUpdateMessage, onCancelMessageEdit, onDeleteMessage, onSendMessage,
7419
7478
  /* @conditional-compile-remove(date-time-customization) */
7420
- onDisplayDateTimeString } = props;
7479
+ onDisplayDateTimeString,
7480
+ /* @conditional-compile-remove(teams-inline-images) */
7481
+ onFetchAttachments } = props;
7421
7482
  const onRenderFileDownloads = onRenderFileDownloadsTrampoline(props);
7422
7483
  const [messages, setMessages] = React.useState([]);
7423
7484
  // We need this state to wait for one tick and scroll to bottom after messages have been initialized.
@@ -7434,6 +7495,16 @@ const MessageThread = (props) => {
7434
7495
  const [lastSendingChatMessage, setLastSendingChatMessage] = React.useState(undefined);
7435
7496
  // readCount and participantCount will only need to be updated on-fly when user hover on an indicator
7436
7497
  const [readCountForHoveredIndicator, setReadCountForHoveredIndicator] = React.useState(undefined);
7498
+ /* @conditional-compile-remove(teams-inline-images) */
7499
+ const [inlineAttachments, setInlineAttachments] = React.useState({});
7500
+ /* @conditional-compile-remove(teams-inline-images) */
7501
+ const onFetchInlineAttachment = React.useCallback((attachment) => __awaiter$r(void 0, void 0, void 0, function* () {
7502
+ if (!onFetchAttachments || attachment.id in inlineAttachments) {
7503
+ return;
7504
+ }
7505
+ const attachmentDownloadResult = yield onFetchAttachments(attachment);
7506
+ setInlineAttachments((prev) => (Object.assign(Object.assign({}, prev), { [attachment.id]: attachmentDownloadResult.blobUrl })));
7507
+ }), [inlineAttachments, onFetchAttachments]);
7437
7508
  const isAllChatMessagesLoadedRef = React.useRef(false);
7438
7509
  // isAllChatMessagesLoadedRef needs to be updated every time when a new adapter is set in order to display correct data
7439
7510
  // onLoadPreviousChatMessages is updated when a new adapter is set
@@ -7644,7 +7715,11 @@ const MessageThread = (props) => {
7644
7715
  /* @conditional-compile-remove(file-sharing) */
7645
7716
  strings: strings, message: messageProps.message, userId: props.userId, remoteParticipantsCount: participantCount ? participantCount - 1 : 0, inlineAcceptRejectEditButtons: !isNarrow, onRenderAvatar: onRenderAvatar, showMessageStatus: showMessageStatus, messageStatus: messageProps.message.status, onActionButtonClick: onActionButtonClickMemo,
7646
7717
  /* @conditional-compile-remove(date-time-customization) */
7647
- onDisplayDateTimeString: onDisplayDateTimeString })));
7718
+ onDisplayDateTimeString: onDisplayDateTimeString,
7719
+ /* @conditional-compile-remove(teams-inline-images) */
7720
+ onFetchAttachments: onFetchInlineAttachment,
7721
+ /* @conditional-compile-remove(teams-inline-images) */
7722
+ attachmentsMap: inlineAttachments })));
7648
7723
  }
7649
7724
  return React__default['default'].createElement(React__default['default'].Fragment, null);
7650
7725
  }, [
@@ -7658,7 +7733,11 @@ const MessageThread = (props) => {
7658
7733
  showMessageStatus,
7659
7734
  onActionButtonClickMemo,
7660
7735
  /* @conditional-compile-remove(date-time-customization) */
7661
- onDisplayDateTimeString
7736
+ onDisplayDateTimeString,
7737
+ /* @conditional-compile-remove(teams-inline-images) */
7738
+ onFetchInlineAttachment,
7739
+ /* @conditional-compile-remove(teams-inline-images) */
7740
+ inlineAttachments
7662
7741
  ]);
7663
7742
  const defaultStatusRenderer = React.useCallback((message, status, participantCount, readCount) => {
7664
7743
  const onToggleToolTip = (isToggled) => {
@@ -8738,6 +8817,7 @@ const moreButtonStyles = {
8738
8817
  // To ensure that the button is clickable when there is a floating video tile
8739
8818
  zIndex: 1,
8740
8819
  color: 'inherit',
8820
+ top: '-0.125rem',
8741
8821
  height: '100%'
8742
8822
  },
8743
8823
  rootHovered: {
@@ -16502,6 +16582,24 @@ const isCameraOn = (state) => {
16502
16582
  }
16503
16583
  return false;
16504
16584
  };
16585
+ /* @conditional-compile-remove(video-background-effects) */
16586
+ /**
16587
+ * @private
16588
+ */
16589
+ const startSelectedVideoEffect = (adapter) => __awaiter$g(void 0, void 0, void 0, function* () {
16590
+ if (adapter.getState().selectedVideoBackgroundEffect) {
16591
+ const selectedVideoBackgroundEffect = adapter.getState().selectedVideoBackgroundEffect;
16592
+ if ((selectedVideoBackgroundEffect === null || selectedVideoBackgroundEffect === void 0 ? void 0 : selectedVideoBackgroundEffect.effectName) === 'blur') {
16593
+ yield adapter.blurVideoBackground();
16594
+ }
16595
+ else if ((selectedVideoBackgroundEffect === null || selectedVideoBackgroundEffect === void 0 ? void 0 : selectedVideoBackgroundEffect.effectName) === 'none') {
16596
+ yield adapter.stopVideoBackgroundEffect();
16597
+ }
16598
+ else if ((selectedVideoBackgroundEffect === null || selectedVideoBackgroundEffect === void 0 ? void 0 : selectedVideoBackgroundEffect.effectName) === 'replacement') {
16599
+ yield adapter.replaceVideoBackground({ backgroundImageUrl: selectedVideoBackgroundEffect.backgroundImageUrl });
16600
+ }
16601
+ }
16602
+ });
16505
16603
  /**
16506
16604
  * Reduce the set of call controls visible on mobile.
16507
16605
  * For example do not show screenshare button.
@@ -20576,6 +20674,7 @@ const MoreDrawer = (props) => {
20576
20674
  text: localeStrings.component.strings.holdButton.tooltipOffContent,
20577
20675
  onItemClick: () => {
20578
20676
  holdButtonProps.onToggleHold();
20677
+ onLightDismiss();
20579
20678
  },
20580
20679
  iconProps: { iconName: 'HoldCallContextualMenuItem', styles: { root: { lineHeight: 0 } } }
20581
20680
  });
@@ -20703,19 +20802,32 @@ const VideoEffectsPane = (props) => {
20703
20802
  }, [strings, props.adapter]);
20704
20803
  /* @conditional-compile-remove(video-background-effects) */
20705
20804
  const onEffectChange = React.useCallback((effectKey) => __awaiter$9(void 0, void 0, void 0, function* () {
20706
- console.log(props.adapter.getState());
20707
20805
  if (effectKey === 'blur') {
20708
- props.adapter.blurVideoBackground();
20806
+ const blurEffect = {
20807
+ effectName: effectKey
20808
+ };
20809
+ props.adapter.updateSelectedVideoBackgroundEffect(blurEffect);
20810
+ yield props.adapter.blurVideoBackground();
20709
20811
  }
20710
20812
  else if (effectKey === 'none') {
20711
- props.adapter.stopVideoBackgroundEffect();
20813
+ const noneEffect = {
20814
+ effectName: effectKey
20815
+ };
20816
+ props.adapter.updateSelectedVideoBackgroundEffect(noneEffect);
20817
+ yield props.adapter.stopVideoBackgroundEffect();
20712
20818
  }
20713
20819
  else {
20714
20820
  const backgroundImg = selectableVideoEffects.find((effect) => {
20715
20821
  return effect.key === effectKey;
20716
20822
  });
20717
20823
  if (backgroundImg && backgroundImg.backgroundProps) {
20718
- props.adapter.replaceVideoBackground({ backgroundImageUrl: backgroundImg.backgroundProps.url });
20824
+ const replaceEffect = {
20825
+ effectName: 'replacement',
20826
+ effectKey,
20827
+ backgroundImageUrl: backgroundImg.backgroundProps.url
20828
+ };
20829
+ props.adapter.updateSelectedVideoBackgroundEffect(replaceEffect);
20830
+ yield props.adapter.replaceVideoBackground({ backgroundImageUrl: backgroundImg.backgroundProps.url });
20719
20831
  }
20720
20832
  }
20721
20833
  }), [props.adapter, selectableVideoEffects]);
@@ -22703,9 +22815,8 @@ const MainScreen = (props) => {
22703
22815
  modalLayerHostId: props.modalLayerHostId, options: props.options }));
22704
22816
  break;
22705
22817
  /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
22706
- case holdPageTrampoline():
22707
- pageElement = (React__default['default'].createElement(React__default['default'].Fragment, null,
22708
- /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ React__default['default'].createElement(HoldPage, { mobileView: props.mobileView, modalLayerHostId: props.modalLayerHostId, options: props.options })));
22818
+ case 'hold':
22819
+ pageElement = (React__default['default'].createElement(React__default['default'].Fragment, null, React__default['default'].createElement(HoldPage, { mobileView: props.mobileView, modalLayerHostId: props.modalLayerHostId, options: props.options })));
22709
22820
  break;
22710
22821
  }
22711
22822
  /* @conditional-compile-remove(unsupported-browser) */
@@ -22776,11 +22887,6 @@ const CallComposite = (props) => {
22776
22887
  /* @conditional-compile-remove(one-to-n-calling) @conditional-compile-remove(PSTN-calls) @conditional-compile-remove(call-readiness) */
22777
22888
  React__default['default'].createElement(react.LayerHost, { id: modalLayerHostId, className: react.mergeStyles(modalLayerHostStyle) })))));
22778
22889
  };
22779
- const holdPageTrampoline = () => {
22780
- /* @conditional-compile-remove(one-to-n-calling) */
22781
- /* @conditional-compile-remove(PSTN-calls) */
22782
- return 'hold';
22783
- };
22784
22890
  const getQueryOptions = (options) => {
22785
22891
  /* @conditional-compile-remove(rooms) */
22786
22892
  if (options.role === 'Consumer') {
@@ -22956,6 +23062,7 @@ class CallContext {
22956
23062
  /* @conditional-compile-remove(unsupported-browser) */ unsupportedBrowserVersionsAllowed: false,
22957
23063
  /* @conditional-compile-remove(rooms) */ roleHint: options === null || options === void 0 ? void 0 : options.roleHint,
22958
23064
  /* @conditional-compile-remove(video-background-effects) */ videoBackgroundImages: options === null || options === void 0 ? void 0 : options.videoBackgroundImages,
23065
+ /* @conditional-compile-remove(video-background-effects) */ selectedVideoBackgroundEffect: undefined,
22959
23066
  cameraStatus: undefined
22960
23067
  };
22961
23068
  this.emitter.setMaxListeners((_b = options === null || options === void 0 ? void 0 : options.maxListeners) !== null && _b !== void 0 ? _b : 50);
@@ -23031,6 +23138,10 @@ class CallContext {
23031
23138
  setBackroundPickerImages(videoBackgroundImages) {
23032
23139
  this.setState(Object.assign(Object.assign({}, this.state), { videoBackgroundImages }));
23033
23140
  }
23141
+ /* @conditional-compile-remove(video-background-effects) */
23142
+ setSelectedVideoBackgroundEffect(selectedVideoBackgroundEffect) {
23143
+ this.setState(Object.assign(Object.assign({}, this.state), { selectedVideoBackgroundEffect }));
23144
+ }
23034
23145
  }
23035
23146
  const findLatestEndedCall = (calls) => {
23036
23147
  var _a, _b, _c, _d;
@@ -23299,6 +23410,8 @@ class AzureCommunicationCallAdapter {
23299
23410
  return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
23300
23411
  if (!isCameraOn(this.getState())) {
23301
23412
  yield this.handlers.onToggleCamera(options);
23413
+ /* @conditional-compile-remove(video-background-effects) */
23414
+ yield startSelectedVideoEffect(this);
23302
23415
  }
23303
23416
  }));
23304
23417
  });
@@ -23381,6 +23494,10 @@ class AzureCommunicationCallAdapter {
23381
23494
  updateBackgroundPickerImages(backgroundImages) {
23382
23495
  this.context.setBackroundPickerImages(backgroundImages);
23383
23496
  }
23497
+ /* @conditional-compile-remove(video-background-effects) */
23498
+ updateSelectedVideoBackgroundEffect(selectedVideoBackground) {
23499
+ this.context.setSelectedVideoBackgroundEffect(selectedVideoBackground);
23500
+ }
23384
23501
  startCall(participants, options) {
23385
23502
  var _a, _b;
23386
23503
  if (_isInCall((_b = (_a = this.getState().call) === null || _a === void 0 ? void 0 : _a.state) !== null && _b !== void 0 ? _b : 'None')) {
@@ -23996,6 +24113,10 @@ class CallWithChatBackedCallAdapter {
23996
24113
  updateBackgroundPickerImages(backgroundImages) {
23997
24114
  return this.callWithChatAdapter.updateBackgroundPickerImages(backgroundImages);
23998
24115
  }
24116
+ /* @conditional-compile-remove(video-background-effects) */
24117
+ updateSelectedVideoBackgroundEffect(selectedVideoBackground) {
24118
+ return this.callWithChatAdapter.updateSelectedVideoBackgroundEffect(selectedVideoBackground);
24119
+ }
23999
24120
  }
24000
24121
  function callAdapterStateFromCallWithChatAdapterState(callWithChatAdapterState) {
24001
24122
  return {
@@ -24481,6 +24602,16 @@ function mergeCallAdapterStateIntoCallWithChatAdapterState(existingCallWithChatA
24481
24602
 
24482
24603
  // Copyright (c) Microsoft Corporation.
24483
24604
  // Licensed under the MIT license.
24605
+ /**
24606
+ * @private
24607
+ */
24608
+ const UNSUPPORTED_CHAT_THREAD_TYPE = ['@thread.tacv2', '@thread.skype'];
24609
+ /**
24610
+ * @private
24611
+ */
24612
+ const TEAMS_LIMITATION_LEARN_MORE = 'https://learn.microsoft.com/en-us/azure/communication-services/concepts/join-teams-meeting#limitations-and-known-issues';
24613
+
24614
+ // Copyright (c) Microsoft Corporation.
24484
24615
  /**
24485
24616
  * Get chat thread from a teams url.
24486
24617
  * As per documented on the Chat SDK: https://docs.microsoft.com/en-us/azure/communication-services/quickstarts/chat/meeting-interop?pivots=platform-web#get-a-teams-meeting-chat-thread-for-a-communication-services-user
@@ -24495,6 +24626,9 @@ const getChatThreadFromTeamsLink = (teamsMeetingLink) => {
24495
24626
  // Extract just the chat guid from the link, stripping away the call locator ID
24496
24627
  threadId = threadId.split(/^(.*?@thread\.v2)/gm)[1];
24497
24628
  if (!threadId || threadId.length === 0) {
24629
+ if (UNSUPPORTED_CHAT_THREAD_TYPE.some((t) => teamsMeetingLink.includes(t))) {
24630
+ throw new Error(`Teams Channel Meetings are not currently supported, read more ${TEAMS_LIMITATION_LEARN_MORE}`);
24631
+ }
24498
24632
  throw new Error('Could not get chat thread from teams link');
24499
24633
  }
24500
24634
  return threadId;
@@ -24893,6 +25027,10 @@ class AzureCommunicationCallWithChatAdapter {
24893
25027
  updateBackgroundPickerImages(backgroundImages) {
24894
25028
  return this.callAdapter.updateBackgroundPickerImages(backgroundImages);
24895
25029
  }
25030
+ /* @conditional-compile-remove(video-background-effects) */
25031
+ updateSelectedVideoBackgroundEffect(selectedVideoBackground) {
25032
+ return this.callAdapter.updateSelectedVideoBackgroundEffect(selectedVideoBackground);
25033
+ }
24896
25034
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
24897
25035
  on(event, listener) {
24898
25036
  switch (event) {