@azure/communication-react 1.11.1-alpha-202312220012 → 1.11.1-alpha-202312240013

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 (33) hide show
  1. package/dist/dist-cjs/communication-react/index.js +85 -61
  2. package/dist/dist-cjs/communication-react/index.js.map +1 -1
  3. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
  4. package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
  5. package/dist/dist-esm/react-components/src/components/MessageThread.js +7 -8
  6. package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
  7. package/dist/dist-esm/react-components/src/components/VideoTile.js +3 -10
  8. package/dist/dist-esm/react-components/src/components/VideoTile.js.map +1 -1
  9. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.d.ts +9 -1
  10. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js +25 -0
  11. package/dist/dist-esm/react-components/src/components/styles/VideoTile.styles.js.map +1 -1
  12. package/dist/dist-esm/react-components/src/theming/FluentThemeProvider.js +2 -20
  13. package/dist/dist-esm/react-components/src/theming/FluentThemeProvider.js.map +1 -1
  14. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +10 -0
  15. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  16. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +1 -1
  17. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  18. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.d.ts +1 -0
  19. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js +2 -2
  20. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js.map +1 -1
  21. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +1 -1
  22. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  23. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +7 -0
  24. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  25. package/dist/dist-esm/react-composites/src/composites/ChatComposite/styles/Chat.styles.js +7 -5
  26. package/dist/dist-esm/react-composites/src/composites/ChatComposite/styles/Chat.styles.js.map +1 -1
  27. package/dist/dist-esm/react-composites/src/composites/common/constants.d.ts +6 -0
  28. package/dist/dist-esm/react-composites/src/composites/common/constants.js +6 -0
  29. package/dist/dist-esm/react-composites/src/composites/common/constants.js.map +1 -1
  30. package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.d.ts +1 -1
  31. package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.js +6 -3
  32. package/dist/dist-esm/react-composites/src/composites/common/styles/Pane.styles.js.map +1 -1
  33. package/package.json +1 -1
@@ -170,7 +170,7 @@ function getDefaultExportFromCjs (x) {
170
170
  // Copyright (c) Microsoft Corporation.
171
171
  // Licensed under the MIT License.
172
172
  // GENERATED FILE. DO NOT EDIT MANUALLY.
173
- var telemetryVersion = '1.11.1-alpha-202312220012';
173
+ var telemetryVersion = '1.11.1-alpha-202312240013';
174
174
 
175
175
 
176
176
  var telemetryVersion$1 = /*@__PURE__*/getDefaultExportFromCjs(telemetryVersion);
@@ -6025,7 +6025,6 @@ const wrapper = react.mergeStyles({
6025
6025
  const defaultTheme = Object.assign({}, react.mergeThemes(react.getTheme(), lightTheme));
6026
6026
  /** Theme context for library's react components */
6027
6027
  const ThemeContext = React.createContext(defaultTheme);
6028
- const SingleUsageCheckContext = React.createContext(false);
6029
6028
  /**
6030
6029
  * Provider to apply a Fluent theme across this library's react components.
6031
6030
  *
@@ -6036,21 +6035,10 @@ const SingleUsageCheckContext = React.createContext(false);
6036
6035
  */
6037
6036
  const FluentThemeProvider = (props) => {
6038
6037
  const { fluentTheme, rtl, children } = props;
6039
- /**
6040
- * Pass only the children if we previously wrapped.
6041
- * This is to prevent the provider from being applied
6042
- * multiple times and wiping out configuration like RTL
6043
- * FluentThemeProvider
6044
- */
6045
- const alreadyWrapped = useSingleUsageCheck();
6046
- if (alreadyWrapped) {
6047
- return React.createElement(React.Fragment, null, children);
6048
- }
6049
6038
  let fluentV8Theme = react.mergeThemes(defaultTheme, fluentTheme);
6050
6039
  fluentV8Theme = react.mergeThemes(fluentV8Theme, { rtl });
6051
- return (React.createElement(SingleUsageCheckContext.Provider, { value: true },
6052
- React.createElement(ThemeContext.Provider, { value: fluentV8Theme },
6053
- React.createElement(react.ThemeProvider, { theme: fluentV8Theme, className: wrapper }, children))));
6040
+ return (React.createElement(ThemeContext.Provider, { value: fluentV8Theme },
6041
+ React.createElement(react.ThemeProvider, { theme: fluentV8Theme, className: wrapper }, children)));
6054
6042
  };
6055
6043
  /**
6056
6044
  * React hook to access theme
@@ -6058,12 +6046,6 @@ const FluentThemeProvider = (props) => {
6058
6046
  * @public
6059
6047
  */
6060
6048
  const useTheme = () => React.useContext(ThemeContext);
6061
- /**
6062
- * This is used to prevent the provider from being applied multiple times.
6063
- *
6064
- * @private
6065
- */
6066
- const useSingleUsageCheck = () => React.useContext(SingleUsageCheckContext);
6067
6049
 
6068
6050
  // Copyright (c) Microsoft Corporation.
6069
6051
  // Licensed under the MIT License.
@@ -11209,6 +11191,9 @@ const MessageThreadWrapper = (props) => {
11209
11191
  }), [onFetchAttachments]);
11210
11192
  const localeStrings = useLocale$1().strings.messageThread;
11211
11193
  const strings = React.useMemo(() => (Object.assign(Object.assign({}, localeStrings), props.strings)), [localeStrings, props.strings]);
11194
+ // it is required to use useState for messages
11195
+ // as the scrolling logic requires re - render at a specific point in time
11196
+ const [messages, setMessages] = React.useState([]);
11212
11197
  // id for the latest deleted message
11213
11198
  const [latestDeletedMessageId, setLatestDeletedMessageId] = React.useState(undefined);
11214
11199
  // this value is used to check if a message is deleted for the previous value of messages array
@@ -11220,10 +11205,12 @@ const MessageThreadWrapper = (props) => {
11220
11205
  return;
11221
11206
  }
11222
11207
  try {
11223
- yield onDeleteMessage(messageId);
11224
11208
  // reset deleted message label in case if there was a value already (messages are deleted 1 after another)
11225
11209
  setDeletedMessageAriaLabel(undefined);
11226
11210
  setLatestDeletedMessageId(messageId);
11211
+ // we should set up latestDeletedMessageId before the onDeleteMessage call
11212
+ // as otherwise in very rare cases the messages array can be updated before latestDeletedMessageId
11213
+ yield onDeleteMessage(messageId);
11227
11214
  }
11228
11215
  catch (e) {
11229
11216
  console.log('onDeleteMessage failed: messageId', messageId, 'error', e);
@@ -11237,17 +11224,11 @@ const MessageThreadWrapper = (props) => {
11237
11224
  isAllChatMessagesLoadedRef.current = false;
11238
11225
  }
11239
11226
  }, [onLoadPreviousChatMessages]);
11240
- React.useEffect(() => {
11241
- reactFileTypeIcons.initializeFileTypeIcons();
11242
- }, []);
11243
11227
  const previousTopRef = React.useRef(-1);
11244
11228
  const previousHeightRef = React.useRef(-1);
11245
11229
  const messageIdSeenByMeRef = React.useRef('');
11246
11230
  const chatScrollDivRef = React.useRef(null);
11247
11231
  const isLoadingChatMessagesRef = React.useRef(false);
11248
- const messages = React.useMemo(() => {
11249
- return newMessages;
11250
- }, [newMessages]);
11251
11232
  React.useEffect(() => {
11252
11233
  if (latestDeletedMessageId === undefined) {
11253
11234
  setDeletedMessageAriaLabel(undefined);
@@ -11274,6 +11255,7 @@ const MessageThreadWrapper = (props) => {
11274
11255
  const messagesRef = React.useRef(messages);
11275
11256
  const setMessagesRef = (messagesWithAttachedValue) => {
11276
11257
  messagesRef.current = messagesWithAttachedValue;
11258
+ setMessages(messagesWithAttachedValue);
11277
11259
  };
11278
11260
  const isAtBottomOfScrollRef = React.useRef(isAtBottomOfScroll);
11279
11261
  const setIsAtBottomOfScrollRef = (isAtBottomOfScrollValue) => {
@@ -12774,6 +12756,31 @@ const moreButtonStyles = {
12774
12756
  background: 'none'
12775
12757
  }
12776
12758
  };
12759
+ /**
12760
+ * @private
12761
+ */
12762
+ const raiseHandContainerStyles = (theme, limitedSpace) => react.mergeStyles({
12763
+ alignItems: 'center',
12764
+ padding: '0.2rem 0.3rem',
12765
+ backgroundColor: theme.palette.white,
12766
+ opacity: 0.9,
12767
+ borderRadius: '1rem',
12768
+ margin: '0.5rem',
12769
+ width: 'fit-content',
12770
+ position: 'absolute'
12771
+ }, limitedSpace && raiseHandLimitedSpaceStyles);
12772
+ /**
12773
+ * @private
12774
+ */
12775
+ const raiseHandLimitedSpaceStyles = {
12776
+ // position centrally
12777
+ marginLeft: 'auto',
12778
+ marginRight: 'auto',
12779
+ left: 0,
12780
+ right: 0,
12781
+ // position at the bottom
12782
+ bottom: 0
12783
+ };
12777
12784
 
12778
12785
  // Copyright (c) Microsoft Corporation.
12779
12786
  // Licensed under the MIT License.
@@ -13029,16 +13036,7 @@ const VideoTile = (props) => {
13029
13036
  isPinned && (React.createElement(react.Stack, { className: react.mergeStyles(iconContainerStyle) },
13030
13037
  React.createElement(react.Icon, { iconName: "VideoTilePinned", className: react.mergeStyles(pinIconStyle) })))))),
13031
13038
  children && (React.createElement(react.Stack, { className: react.mergeStyles(overlayContainerStyles, styles === null || styles === void 0 ? void 0 : styles.overlayContainer) }, children)),
13032
- /* @conditional-compile-remove(raise-hand) */ raisedHand && canShowLabel && (React.createElement(react.Stack, { horizontal: true, tokens: { childrenGap: '0.2rem' }, style: {
13033
- alignItems: 'center',
13034
- padding: '0.2rem 0.3rem',
13035
- backgroundColor: theme.palette.white,
13036
- opacity: 0.9,
13037
- borderRadius: '1rem',
13038
- margin: '0.5rem',
13039
- width: 'fit-content',
13040
- position: 'absolute'
13041
- } },
13039
+ /* @conditional-compile-remove(raise-hand) */ raisedHand && (React.createElement(react.Stack, { horizontal: true, tokens: { childrenGap: '0.2rem' }, className: raiseHandContainerStyles(theme, !canShowLabel) },
13042
13040
  React.createElement(react.Stack.Item, null,
13043
13041
  React.createElement(react.Text, null, raisedHand.raisedHandOrderPosition)),
13044
13042
  React.createElement(react.Stack.Item, null,
@@ -22780,7 +22778,25 @@ const useAdapter$1 = () => {
22780
22778
 
22781
22779
  // Copyright (c) Microsoft Corporation.
22782
22780
  // Licensed under the MIT License.
22783
- const MESSAGE_THREAD_WIDTH = '41.25rem';
22781
+ /**
22782
+ * @private
22783
+ */
22784
+ const UNSUPPORTED_CHAT_THREAD_TYPE = ['@thread.tacv2', '@thread.skype'];
22785
+ /**
22786
+ * @private
22787
+ */
22788
+ const TEAMS_LIMITATION_LEARN_MORE = 'https://learn.microsoft.com/en-us/azure/communication-services/concepts/join-teams-meeting#limitations-and-known-issues';
22789
+ /**
22790
+ * @remarks
22791
+ * This value is publicly documented in the ChatComposite API documentation.
22792
+ * Changing this value will require updating the API documentation.
22793
+ */
22794
+ const CHAT_CONTAINER_MIN_WIDTH_REM = 17.5;
22795
+
22796
+ // Copyright (c) Microsoft Corporation.
22797
+ // Licensed under the MIT License.
22798
+ const CHAT_CONTAINER_MAX_WIDTH_REM = 41.25;
22799
+ const CHAT_CONTAINER_MIN_HEIGHT_REM = 13;
22784
22800
  /**
22785
22801
  * @private
22786
22802
  * z-index to ensure that chat container has lower z-index than participant pane
@@ -22792,8 +22808,8 @@ const CHAT_CONTAINER_ZINDEX = 1;
22792
22808
  const chatScreenContainerStyle = react.mergeStyles({
22793
22809
  height: '100%',
22794
22810
  width: '100%',
22795
- minHeight: '13rem',
22796
- minWidth: '17.5rem'
22811
+ minHeight: `${CHAT_CONTAINER_MIN_HEIGHT_REM}rem`,
22812
+ minWidth: `${CHAT_CONTAINER_MIN_WIDTH_REM}rem`
22797
22813
  });
22798
22814
  /**
22799
22815
  * @private
@@ -22861,7 +22877,7 @@ const topicNameLabelStyle = react.mergeStyles({
22861
22877
  * @private
22862
22878
  */
22863
22879
  const messageThreadChatCompositeStyles = react.memoizeFunction((background) => ({
22864
- root: { maxWidth: MESSAGE_THREAD_WIDTH },
22880
+ root: { maxWidth: `${CHAT_CONTAINER_MAX_WIDTH_REM}rem` },
22865
22881
  chatContainer: { background: background }
22866
22882
  }));
22867
22883
  /**
@@ -22874,7 +22890,7 @@ const typingIndicatorContainerStyles = {
22874
22890
  * @private
22875
22891
  */
22876
22892
  const sendboxContainerStyles = {
22877
- maxWidth: MESSAGE_THREAD_WIDTH,
22893
+ maxWidth: `${CHAT_CONTAINER_MAX_WIDTH_REM}rem`,
22878
22894
  width: '100%',
22879
22895
  alignSelf: 'center'
22880
22896
  };
@@ -26642,6 +26658,7 @@ const PreparedMoreDrawer = (props) => {
26642
26658
 
26643
26659
  // Copyright (c) Microsoft Corporation.
26644
26660
  // Licensed under the MIT License.
26661
+ const SIDE_PANE_PADDING_LR_REM = 0.25;
26645
26662
  /**
26646
26663
  * @private
26647
26664
  */
@@ -26704,12 +26721,13 @@ const hiddenStyles = {
26704
26721
  /**
26705
26722
  * @private
26706
26723
  */
26707
- const sidePaneStyles = (maxWidth) => ({
26724
+ const sidePaneStyles = (maxWidth, minWidth) => ({
26708
26725
  root: {
26709
26726
  height: 'auto',
26710
26727
  width: '100%',
26711
- padding: '0.5rem 0.25rem',
26712
- maxWidth: maxWidth !== null && maxWidth !== void 0 ? maxWidth : '21.5rem'
26728
+ padding: `0.5rem ${SIDE_PANE_PADDING_LR_REM}rem`,
26729
+ maxWidth: maxWidth !== null && maxWidth !== void 0 ? maxWidth : '21.5rem',
26730
+ minWidth: minWidth !== null && minWidth !== void 0 ? minWidth : `${CHAT_CONTAINER_MIN_WIDTH_REM + SIDE_PANE_PADDING_LR_REM * 2}rem`
26713
26731
  }
26714
26732
  });
26715
26733
  /**
@@ -26798,12 +26816,12 @@ const SidePane = (props) => {
26798
26816
  overrideSidePane.persistRenderingWhenClosed &&
26799
26817
  !overrideSidePane.isActive;
26800
26818
  const renderingOnlyHiddenContent = renderingHiddenOverrideContent && !sidePaneRenderer;
26801
- const maxWidthStyles = React.useMemo(() => sidePaneStyles(props.maxWidth), [props.maxWidth]);
26819
+ const widthConstrainedStyles = React.useMemo(() => sidePaneStyles(props.maxWidth, props.minWidth), [props.maxWidth, props.minWidth]);
26802
26820
  const paneStyles = renderingOnlyHiddenContent
26803
26821
  ? hiddenStyles
26804
26822
  : props.mobileView
26805
26823
  ? availableSpaceStyles
26806
- : maxWidthStyles;
26824
+ : widthConstrainedStyles;
26807
26825
  const Header = (_a = ((overrideSidePane === null || overrideSidePane === void 0 ? void 0 : overrideSidePane.isActive) ? overrideSidePane.renderer.headerRenderer : sidePaneRenderer === null || sidePaneRenderer === void 0 ? void 0 : sidePaneRenderer.headerRenderer)) !== null && _a !== void 0 ? _a : EmptyElement;
26808
26826
  /**
26809
26827
  * Legacy code to support old behavior of showing chat and people tab headers on mobile side pane.
@@ -28269,7 +28287,7 @@ const CallArrangement = (props) => {
28269
28287
  /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ !isInLocalHold && (React.createElement(CaptionsBanner, { isMobile: props.mobileView, onFetchAvatarPersonaData: props.onFetchAvatarPersonaData }))))),
28270
28288
  React.createElement(SidePane, { mobileView: props.mobileView,
28271
28289
  /* @conditional-compile-remove(video-background-effects) */
28272
- maxWidth: isVideoPaneOpen ? `${VIDEO_EFFECTS_SIDE_PANE_WIDTH_REM}rem` : undefined, updateSidePaneRenderer: props.updateSidePaneRenderer, onPeopleButtonClicked: props.mobileView && !shouldShowPeopleTabHeaderButton(props.callControlProps.options)
28290
+ maxWidth: isVideoPaneOpen ? `${VIDEO_EFFECTS_SIDE_PANE_WIDTH_REM}rem` : undefined, minWidth: isVideoPaneOpen ? `${VIDEO_EFFECTS_SIDE_PANE_WIDTH_REM}rem` : undefined, updateSidePaneRenderer: props.updateSidePaneRenderer, onPeopleButtonClicked: props.mobileView && !shouldShowPeopleTabHeaderButton(props.callControlProps.options)
28273
28291
  ? undefined
28274
28292
  : togglePeoplePane, disablePeopleButton: typeof props.callControlProps.options !== 'boolean' &&
28275
28293
  isDisabled$3((_j = props.callControlProps.options) === null || _j === void 0 ? void 0 : _j.participantsButton), onChatButtonClicked: (_k = props.mobileChatTabHeader) === null || _k === void 0 ? void 0 : _k.onClick, disableChatButton: (_l = props.mobileChatTabHeader) === null || _l === void 0 ? void 0 : _l.disabled }),
@@ -30019,7 +30037,7 @@ const ConfigurationPage = (props) => {
30019
30037
  isOpen: isVideoEffectsPaneOpen, hasCloseButton: false, isBlocking: false, isHiddenOnDismiss: false, styles: panelStyles, focusTrapZoneProps: panelFocusProps, layerProps: panelLayerProps, type: react.PanelType.custom,
30020
30038
  /* @conditional-compile-remove(video-background-effects) */
30021
30039
  customWidth: `${VIDEO_EFFECTS_SIDE_PANE_WIDTH_REM}rem` },
30022
- React.createElement(SidePane, { mobileView: props.mobileView, updateSidePaneRenderer: props.updateSidePaneRenderer })))));
30040
+ React.createElement(SidePane, { mobileView: props.mobileView, updateSidePaneRenderer: props.updateSidePaneRenderer, maxWidth: `${VIDEO_EFFECTS_SIDE_PANE_WIDTH_REM}rem`, minWidth: `${VIDEO_EFFECTS_SIDE_PANE_WIDTH_REM}rem` })))));
30023
30041
  };
30024
30042
  const localPreviewTrampoline = (mobileView, doNotShow) => {
30025
30043
  /* @conditional-compile-remove(rooms) */
@@ -30967,6 +30985,16 @@ const MainScreen = (props) => {
30967
30985
  React.useEffect(() => {
30968
30986
  onSidePaneIdChange === null || onSidePaneIdChange === void 0 ? void 0 : onSidePaneIdChange(sidePaneRenderer === null || sidePaneRenderer === void 0 ? void 0 : sidePaneRenderer.id);
30969
30987
  }, [sidePaneRenderer === null || sidePaneRenderer === void 0 ? void 0 : sidePaneRenderer.id, onSidePaneIdChange]);
30988
+ // When the call ends ensure the side pane is set to closed to prevent the side pane being open if the call is re-joined.
30989
+ React.useEffect(() => {
30990
+ const closeSidePane = () => {
30991
+ setSidePaneRenderer(undefined);
30992
+ };
30993
+ adapter.on('callEnded', closeSidePane);
30994
+ return () => {
30995
+ adapter.off('callEnded', closeSidePane);
30996
+ };
30997
+ }, [adapter]);
30970
30998
  /* @conditional-compile-remove(capabilities) */
30971
30999
  const capabilitiesChangedInfoAndRole = useSelector$1(capabilitiesChangedInfoAndRoleSelector);
30972
31000
  /* @conditional-compile-remove(capabilities) */
@@ -33370,6 +33398,13 @@ const CallWithChatScreen = (props) => {
33370
33398
  closeChat();
33371
33399
  }
33372
33400
  }, [closeChat]);
33401
+ // When the call ends ensure the side pane is set to closed to prevent the side pane being open if the call is re-joined.
33402
+ React.useEffect(() => {
33403
+ callAdapter.on('callEnded', closeChat);
33404
+ return () => {
33405
+ callAdapter.off('callEnded', closeChat);
33406
+ };
33407
+ }, [callAdapter, closeChat]);
33373
33408
  return (React.createElement("div", { ref: containerRef, className: react.mergeStyles(containerDivStyles) },
33374
33409
  React.createElement(react.Stack, { verticalFill: true, grow: true, styles: compositeOuterContainerStyles, id: compositeParentDivId },
33375
33410
  React.createElement(react.Stack, { horizontal: true, grow: true },
@@ -33483,17 +33518,6 @@ function mergeCallAdapterStateIntoCallWithChatAdapterState(existingCallWithChatA
33483
33518
  selectedVideoBackgroundEffect: callAdapterState.selectedVideoBackgroundEffect });
33484
33519
  }
33485
33520
 
33486
- // Copyright (c) Microsoft Corporation.
33487
- // Licensed under the MIT License.
33488
- /**
33489
- * @private
33490
- */
33491
- const UNSUPPORTED_CHAT_THREAD_TYPE = ['@thread.tacv2', '@thread.skype'];
33492
- /**
33493
- * @private
33494
- */
33495
- const TEAMS_LIMITATION_LEARN_MORE = 'https://learn.microsoft.com/en-us/azure/communication-services/concepts/join-teams-meeting#limitations-and-known-issues';
33496
-
33497
33521
  // Copyright (c) Microsoft Corporation.
33498
33522
  // Licensed under the MIT License.
33499
33523
  /**