@azure/communication-react 1.5.1-alpha-202304110013 → 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 (49) hide show
  1. package/dist/communication-react.d.ts +80 -0
  2. package/dist/dist-cjs/communication-react/index.js +155 -12
  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-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +2 -1
  23. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +13 -0
  24. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  25. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +57 -0
  26. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  27. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +1 -1
  28. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  29. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.d.ts +5 -0
  30. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js +18 -0
  31. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  32. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +2 -1
  33. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +4 -0
  34. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  35. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +7 -1
  36. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  37. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +2 -1
  38. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +4 -0
  39. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  40. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.js +4 -0
  41. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/parseTeamsUrl.js.map +1 -1
  42. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js +1 -0
  43. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -1
  44. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +17 -4
  45. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  46. package/dist/dist-esm/react-composites/src/composites/common/constants.d.ts +9 -0
  47. package/dist/dist-esm/react-composites/src/composites/common/constants.js +11 -0
  48. package/dist/dist-esm/react-composites/src/composites/common/constants.js.map +1 -0
  49. 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-202304110013';
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) => {
@@ -16503,6 +16582,24 @@ const isCameraOn = (state) => {
16503
16582
  }
16504
16583
  return false;
16505
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
+ });
16506
16603
  /**
16507
16604
  * Reduce the set of call controls visible on mobile.
16508
16605
  * For example do not show screenshare button.
@@ -20577,6 +20674,7 @@ const MoreDrawer = (props) => {
20577
20674
  text: localeStrings.component.strings.holdButton.tooltipOffContent,
20578
20675
  onItemClick: () => {
20579
20676
  holdButtonProps.onToggleHold();
20677
+ onLightDismiss();
20580
20678
  },
20581
20679
  iconProps: { iconName: 'HoldCallContextualMenuItem', styles: { root: { lineHeight: 0 } } }
20582
20680
  });
@@ -20704,19 +20802,32 @@ const VideoEffectsPane = (props) => {
20704
20802
  }, [strings, props.adapter]);
20705
20803
  /* @conditional-compile-remove(video-background-effects) */
20706
20804
  const onEffectChange = React.useCallback((effectKey) => __awaiter$9(void 0, void 0, void 0, function* () {
20707
- console.log(props.adapter.getState());
20708
20805
  if (effectKey === 'blur') {
20709
- props.adapter.blurVideoBackground();
20806
+ const blurEffect = {
20807
+ effectName: effectKey
20808
+ };
20809
+ props.adapter.updateSelectedVideoBackgroundEffect(blurEffect);
20810
+ yield props.adapter.blurVideoBackground();
20710
20811
  }
20711
20812
  else if (effectKey === 'none') {
20712
- props.adapter.stopVideoBackgroundEffect();
20813
+ const noneEffect = {
20814
+ effectName: effectKey
20815
+ };
20816
+ props.adapter.updateSelectedVideoBackgroundEffect(noneEffect);
20817
+ yield props.adapter.stopVideoBackgroundEffect();
20713
20818
  }
20714
20819
  else {
20715
20820
  const backgroundImg = selectableVideoEffects.find((effect) => {
20716
20821
  return effect.key === effectKey;
20717
20822
  });
20718
20823
  if (backgroundImg && backgroundImg.backgroundProps) {
20719
- 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 });
20720
20831
  }
20721
20832
  }
20722
20833
  }), [props.adapter, selectableVideoEffects]);
@@ -22951,6 +23062,7 @@ class CallContext {
22951
23062
  /* @conditional-compile-remove(unsupported-browser) */ unsupportedBrowserVersionsAllowed: false,
22952
23063
  /* @conditional-compile-remove(rooms) */ roleHint: options === null || options === void 0 ? void 0 : options.roleHint,
22953
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,
22954
23066
  cameraStatus: undefined
22955
23067
  };
22956
23068
  this.emitter.setMaxListeners((_b = options === null || options === void 0 ? void 0 : options.maxListeners) !== null && _b !== void 0 ? _b : 50);
@@ -23026,6 +23138,10 @@ class CallContext {
23026
23138
  setBackroundPickerImages(videoBackgroundImages) {
23027
23139
  this.setState(Object.assign(Object.assign({}, this.state), { videoBackgroundImages }));
23028
23140
  }
23141
+ /* @conditional-compile-remove(video-background-effects) */
23142
+ setSelectedVideoBackgroundEffect(selectedVideoBackgroundEffect) {
23143
+ this.setState(Object.assign(Object.assign({}, this.state), { selectedVideoBackgroundEffect }));
23144
+ }
23029
23145
  }
23030
23146
  const findLatestEndedCall = (calls) => {
23031
23147
  var _a, _b, _c, _d;
@@ -23294,6 +23410,8 @@ class AzureCommunicationCallAdapter {
23294
23410
  return yield this.asyncTeeErrorToEventEmitter(() => __awaiter$4(this, void 0, void 0, function* () {
23295
23411
  if (!isCameraOn(this.getState())) {
23296
23412
  yield this.handlers.onToggleCamera(options);
23413
+ /* @conditional-compile-remove(video-background-effects) */
23414
+ yield startSelectedVideoEffect(this);
23297
23415
  }
23298
23416
  }));
23299
23417
  });
@@ -23376,6 +23494,10 @@ class AzureCommunicationCallAdapter {
23376
23494
  updateBackgroundPickerImages(backgroundImages) {
23377
23495
  this.context.setBackroundPickerImages(backgroundImages);
23378
23496
  }
23497
+ /* @conditional-compile-remove(video-background-effects) */
23498
+ updateSelectedVideoBackgroundEffect(selectedVideoBackground) {
23499
+ this.context.setSelectedVideoBackgroundEffect(selectedVideoBackground);
23500
+ }
23379
23501
  startCall(participants, options) {
23380
23502
  var _a, _b;
23381
23503
  if (_isInCall((_b = (_a = this.getState().call) === null || _a === void 0 ? void 0 : _a.state) !== null && _b !== void 0 ? _b : 'None')) {
@@ -23991,6 +24113,10 @@ class CallWithChatBackedCallAdapter {
23991
24113
  updateBackgroundPickerImages(backgroundImages) {
23992
24114
  return this.callWithChatAdapter.updateBackgroundPickerImages(backgroundImages);
23993
24115
  }
24116
+ /* @conditional-compile-remove(video-background-effects) */
24117
+ updateSelectedVideoBackgroundEffect(selectedVideoBackground) {
24118
+ return this.callWithChatAdapter.updateSelectedVideoBackgroundEffect(selectedVideoBackground);
24119
+ }
23994
24120
  }
23995
24121
  function callAdapterStateFromCallWithChatAdapterState(callWithChatAdapterState) {
23996
24122
  return {
@@ -24476,6 +24602,16 @@ function mergeCallAdapterStateIntoCallWithChatAdapterState(existingCallWithChatA
24476
24602
 
24477
24603
  // Copyright (c) Microsoft Corporation.
24478
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.
24479
24615
  /**
24480
24616
  * Get chat thread from a teams url.
24481
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
@@ -24490,6 +24626,9 @@ const getChatThreadFromTeamsLink = (teamsMeetingLink) => {
24490
24626
  // Extract just the chat guid from the link, stripping away the call locator ID
24491
24627
  threadId = threadId.split(/^(.*?@thread\.v2)/gm)[1];
24492
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
+ }
24493
24632
  throw new Error('Could not get chat thread from teams link');
24494
24633
  }
24495
24634
  return threadId;
@@ -24888,6 +25027,10 @@ class AzureCommunicationCallWithChatAdapter {
24888
25027
  updateBackgroundPickerImages(backgroundImages) {
24889
25028
  return this.callAdapter.updateBackgroundPickerImages(backgroundImages);
24890
25029
  }
25030
+ /* @conditional-compile-remove(video-background-effects) */
25031
+ updateSelectedVideoBackgroundEffect(selectedVideoBackground) {
25032
+ return this.callAdapter.updateSelectedVideoBackgroundEffect(selectedVideoBackground);
25033
+ }
24891
25034
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
24892
25035
  on(event, listener) {
24893
25036
  switch (event) {