@azure/communication-react 1.5.1-alpha-202305030013 → 1.5.1-alpha-202305040013

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 (104) hide show
  1. package/CHANGELOG.beta.md +9 -1
  2. package/dist/dist-cjs/communication-react/index.js +1874 -1843
  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/react-components/src/components/Caption.js +1 -2
  7. package/dist/dist-esm/react-components/src/components/Caption.js.map +1 -1
  8. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js +3 -2
  9. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js.map +1 -1
  10. package/dist/dist-esm/react-components/src/theming/icons.js +12 -5
  11. package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
  12. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.d.ts +12 -0
  13. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js +33 -19
  14. package/dist/dist-esm/react-composites/src/composites/CallComposite/CallComposite.js.map +1 -1
  15. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.d.ts +4 -0
  16. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +70 -65
  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/CallControls.js +2 -3
  19. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallControls.js.map +1 -1
  20. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.js +16 -3
  21. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/LocalPreview.js.map +1 -1
  22. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.d.ts +14 -0
  23. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js +63 -0
  24. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePane.js.map +1 -0
  25. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePaneProvider.d.ts +58 -0
  26. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePaneProvider.js +31 -0
  27. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/SidePaneProvider.js.map +1 -0
  28. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.d.ts +17 -0
  29. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js +43 -0
  30. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/usePeoplePane.js.map +1 -0
  31. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.d.ts +9 -0
  32. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js +58 -0
  33. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/SidePane/useVideoEffectsPane.js.map +1 -0
  34. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.d.ts +0 -1
  35. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.js +2 -2
  36. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.js.map +1 -1
  37. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.d.ts +4 -0
  38. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js +2 -4
  39. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/CallPage.js.map +1 -1
  40. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.d.ts +2 -0
  41. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +29 -29
  42. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
  43. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.d.ts +4 -0
  44. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js +1 -3
  45. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/HoldPage.js.map +1 -1
  46. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.d.ts +4 -0
  47. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js +1 -3
  48. package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/LobbyPage.js.map +1 -1
  49. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.d.ts +2 -0
  50. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js +4 -0
  51. package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js.map +1 -1
  52. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CallControlOptions.d.ts +9 -1
  53. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CallControlOptions.js.map +1 -1
  54. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +116 -162
  55. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  56. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/{ChatButton.d.ts → ChatButton/ChatButton.d.ts} +1 -1
  57. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/{ChatButton.js → ChatButton/ChatButton.js} +1 -1
  58. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButton.js.map +1 -0
  59. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/{ChatButtonWithUnreadMessagesBadge.d.ts → ChatButton/ChatButtonWithUnreadMessagesBadge.d.ts} +2 -2
  60. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/{ChatButtonWithUnreadMessagesBadge.js → ChatButton/ChatButtonWithUnreadMessagesBadge.js} +3 -3
  61. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButtonWithUnreadMessagesBadge.js.map +1 -0
  62. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton/NotificationIcon.js.map +1 -0
  63. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js +2 -2
  64. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleButton.js.map +1 -1
  65. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.js +1 -1
  66. package/dist/dist-esm/react-composites/src/composites/common/AddPeopleDropdown.js.map +1 -1
  67. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.d.ts +4 -5
  68. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +11 -24
  69. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -1
  70. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.js +5 -2
  71. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.js.map +1 -1
  72. package/dist/dist-esm/react-composites/src/composites/common/ConvertContextualMenuItemToDrawerMenuItem.js.map +1 -0
  73. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.d.ts +0 -9
  74. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js +32 -12
  75. package/dist/dist-esm/react-composites/src/composites/common/PeoplePaneContent.js.map +1 -1
  76. package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.d.ts +4 -4
  77. package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.js +27 -2
  78. package/dist/dist-esm/react-composites/src/composites/common/SidePaneHeader.js.map +1 -1
  79. package/dist/dist-esm/react-composites/src/composites/common/TabHeader.d.ts +8 -5
  80. package/dist/dist-esm/react-composites/src/composites/common/TabHeader.js +11 -2
  81. package/dist/dist-esm/react-composites/src/composites/common/TabHeader.js.map +1 -1
  82. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.d.ts +1 -17
  83. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +17 -16
  84. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  85. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.d.ts +8 -0
  86. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.js.map +1 -1
  87. package/package.json +8 -8
  88. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallPane.d.ts +0 -24
  89. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallPane.js +0 -80
  90. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallPane.js.map +0 -1
  91. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useSidePaneState.d.ts +0 -16
  92. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useSidePaneState.js +0 -38
  93. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useSidePaneState.js.map +0 -1
  94. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatPane.d.ts +0 -34
  95. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatPane.js +0 -90
  96. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatPane.js.map +0 -1
  97. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButton.js.map +0 -1
  98. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ChatButtonWithUnreadMessagesBadge.js.map +0 -1
  99. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/ConvertContextualMenuItemToDrawerMenuItem.js.map +0 -1
  100. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/NotificationIcon.js.map +0 -1
  101. /package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/{NotificationIcon.d.ts → ChatButton/NotificationIcon.d.ts} +0 -0
  102. /package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/{NotificationIcon.js → ChatButton/NotificationIcon.js} +0 -0
  103. /package/dist/dist-esm/react-composites/src/composites/{CallWithChatComposite → common}/ConvertContextualMenuItemToDrawerMenuItem.d.ts +0 -0
  104. /package/dist/dist-esm/react-composites/src/composites/{CallWithChatComposite → common}/ConvertContextualMenuItemToDrawerMenuItem.js +0 -0
@@ -1,47 +1,32 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
3
  import React, { useCallback, useState, useMemo, useEffect, useRef } from 'react';
4
- import { LayerHost, mergeStyles, Stack } from '@fluentui/react';
5
- import { CallComposite } from '../CallComposite';
6
- import { CallAdapterProvider } from '../CallComposite/adapter/CallAdapterProvider';
7
- import { CommonCallControlBar } from '../common/ControlBar/CommonCallControlBar';
8
- import { callCompositeContainerStyles, compositeOuterContainerStyles, controlBarContainerStyles } from './styles/CallWithChatCompositeStyles';
4
+ import { mergeStyles, Stack } from '@fluentui/react';
5
+ import { callCompositeContainerStyles, compositeOuterContainerStyles } from './styles/CallWithChatCompositeStyles';
9
6
  import { CallWithChatBackedCallAdapter } from './adapter/CallWithChatBackedCallAdapter';
10
7
  import { CallWithChatBackedChatAdapter } from './adapter/CallWithChatBackedChatAdapter';
8
+ import { ChatComposite } from '../ChatComposite';
11
9
  import { BaseProvider } from '../common/BaseComposite';
12
- import { ChatAdapterProvider } from '../ChatComposite/adapter/ChatAdapterProvider';
13
- import { PreparedMoreDrawer } from '../common/Drawer/PreparedMoreDrawer';
14
- import { _useContainerHeight, _useContainerWidth } from "../../../../react-components/src";
10
+ import { useTheme } from "../../../../react-components/src";
15
11
  import { useId } from '@fluentui/react-hooks';
16
- import { CallWithChatPane } from './CallWithChatPane';
17
12
  import { containerDivStyles } from '../common/ContainerRectProps';
18
- import { modalLayerHostStyle } from '../common/styles/ModalLocalAndRemotePIP.styles';
19
- /* @conditional-compile-remove(PSTN-calls) */
20
- import { SendDtmfDialpad } from '../common/SendDtmfDialpad';
21
- /* @conditional-compile-remove(PSTN-calls) */
22
13
  import { useCallWithChatCompositeStrings } from './hooks/useCallWithChatCompositeStrings';
23
- import { drawerContainerStyles } from '../CallComposite/styles/CallComposite.styles';
24
- /* @conditional-compile-remove(video-background-effects) */
25
- import { VideoEffectsPane } from '../common/VideoEffectsPane';
14
+ import { CallCompositeInner } from '../CallComposite/CallComposite';
15
+ import { ChatButtonWithUnreadMessagesBadge } from './ChatButton/ChatButtonWithUnreadMessagesBadge';
16
+ import { getDesktopCommonButtonStyles } from '../common/ControlBar/CommonCallControlBar';
17
+ import { isDisabled } from '../CallComposite/utils';
18
+ import { SidePaneHeader } from '../common/SidePaneHeader';
26
19
  const CallWithChatScreen = (props) => {
27
20
  const { callWithChatAdapter, fluentTheme, formFactor = 'desktop' } = props;
28
21
  const mobileView = formFactor === 'mobile';
29
- /* @conditional-compile-remove(video-background-effects) */
30
- const [showVideoEffectsPane, setVideoEffectsPane] = useState(false);
31
- /* @conditional-compile-remove(video-background-effects) */
32
- const setShowVideoEffectsPane = useCallback((showVideoEffectsOptions) => {
33
- setVideoEffectsPane(showVideoEffectsOptions);
34
- }, [setVideoEffectsPane]);
35
22
  if (!callWithChatAdapter) {
36
23
  throw new Error('CallWithChatAdapter is undefined');
37
24
  }
38
25
  const callAdapter = useMemo(() => new CallWithChatBackedCallAdapter(callWithChatAdapter), [callWithChatAdapter]);
39
26
  const [currentCallState, setCurrentCallState] = useState();
40
27
  const [currentPage, setCurrentPage] = useState();
41
- const [activePane, setActivePane] = useState('none');
28
+ const [isChatOpen, setIsChatOpen] = useState(false);
42
29
  const containerRef = useRef(null);
43
- const containerWidth = _useContainerWidth(containerRef);
44
- const containerHeight = _useContainerHeight(containerRef);
45
30
  useEffect(() => {
46
31
  const updateCallWithChatPage = (newState) => {
47
32
  var _a;
@@ -54,105 +39,80 @@ const CallWithChatScreen = (props) => {
54
39
  callWithChatAdapter.offStateChange(updateCallWithChatPage);
55
40
  };
56
41
  }, [callWithChatAdapter]);
57
- const closePane = useCallback(() => {
58
- setActivePane('none');
59
- }, [setActivePane]);
60
42
  const chatProps = useMemo(() => {
61
43
  return {
62
44
  adapter: new CallWithChatBackedChatAdapter(callWithChatAdapter)
63
45
  };
64
46
  }, [callWithChatAdapter]);
65
- const modalLayerHostId = useId('modalLayerhost');
66
- const isInLobbyOrConnecting = currentPage === 'lobby';
67
- /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
68
- const isInLocalHold = currentPage === 'hold';
69
- const hasJoinedCall = !!(currentPage && hasJoinedCallFn(currentPage, currentCallState !== null && currentCallState !== void 0 ? currentCallState : 'None'));
70
- const showControlBar = isInLobbyOrConnecting || hasJoinedCall;
71
- const isMobileWithActivePane = mobileView && hasJoinedCall && activePane !== 'none';
72
47
  /** Constant setting of id for the parent stack of the composite */
73
48
  const compositeParentDivId = useId('callWithChatCompositeParentDiv-internal');
74
- const toggleChat = useCallback(() => {
75
- if (activePane === 'chat' || !hasJoinedCall) {
76
- setActivePane('none');
77
- }
78
- else {
79
- setActivePane('chat');
80
- // timeout is required to give the window time to render the sendbox so we have something to send focus to.
81
- // TODO: Selecting elements in the DOM via attributes is not stable. We should expose an API from ChatComposite to be able to focus on the sendbox.
82
- const chatFocusTimeout = setInterval(() => {
83
- const callWithChatCompositeRootDiv = document.querySelector(`[id="${compositeParentDivId}"]`);
84
- const sendbox = callWithChatCompositeRootDiv === null || callWithChatCompositeRootDiv === void 0 ? void 0 : callWithChatCompositeRootDiv.querySelector(`[id="sendbox"]`);
85
- if (sendbox !== null) {
86
- sendbox.focus();
87
- clearInterval(chatFocusTimeout);
88
- }
89
- }, 3);
90
- setTimeout(() => {
91
- clearInterval(chatFocusTimeout);
92
- }, 300);
93
- }
94
- }, [activePane, setActivePane, compositeParentDivId, hasJoinedCall]);
95
- const togglePeople = useCallback(() => {
96
- if (activePane === 'people' || !hasJoinedCall) {
97
- setActivePane('none');
98
- }
99
- else {
100
- setActivePane('people');
101
- }
102
- }, [activePane, setActivePane, hasJoinedCall]);
103
- const selectChat = useCallback(() => {
104
- if (hasJoinedCall) {
105
- setActivePane('chat');
106
- }
107
- }, [setActivePane, hasJoinedCall]);
108
- const selectPeople = useCallback(() => {
109
- if (hasJoinedCall) {
110
- setActivePane('people');
111
- }
112
- }, [setActivePane, hasJoinedCall]);
113
- const [showDrawer, setShowDrawer] = useState(false);
114
- const onMoreButtonClicked = useCallback(() => {
115
- closePane();
116
- setShowDrawer(true);
117
- }, [closePane]);
118
- const closeDrawer = useCallback(() => {
119
- setShowDrawer(false);
49
+ const closeChat = useCallback(() => {
50
+ setIsChatOpen(false);
120
51
  }, []);
121
- const onMoreDrawerPeopleClicked = useCallback(() => {
122
- setShowDrawer(false);
123
- togglePeople();
124
- }, [togglePeople]);
125
- // On mobile, when there is an active call and some side pane is active,
126
- // we hide the call composite via CSS to show only the pane.
127
- // We only set `display` to `none` instead of unmounting the call composite component tree
128
- // to avoid the performance cost of rerendering video streams when we later show the composite again.
129
- const callCompositeContainerCSS = useMemo(() => {
130
- return { display: isMobileWithActivePane ? 'none' : 'flex' };
131
- }, [isMobileWithActivePane]);
132
- /* @conditional-compile-remove(PSTN-calls) */
133
- const [showDtmfDialpad, setShowDtmfDialpad] = useState(false);
134
- /* @conditional-compile-remove(PSTN-calls) */
135
- const onDismissDtmfDialpad = () => {
136
- setShowDtmfDialpad(false);
137
- };
138
- /* @conditional-compile-remove(PSTN-calls) */
139
- const onClickShowDialpad = () => {
140
- setShowDtmfDialpad(true);
141
- };
142
- /* @conditional-compile-remove(PSTN-calls) */
52
+ const openChat = useCallback(() => {
53
+ setIsChatOpen(true);
54
+ // timeout is required to give the window time to render the sendbox so we have something to send focus to.
55
+ // TODO: Selecting elements in the DOM via attributes is not stable. We should expose an API from ChatComposite to be able to focus on the sendbox.
56
+ const chatFocusTimeout = setInterval(() => {
57
+ const callWithChatCompositeRootDiv = document.querySelector(`[id="${compositeParentDivId}"]`);
58
+ const sendbox = callWithChatCompositeRootDiv === null || callWithChatCompositeRootDiv === void 0 ? void 0 : callWithChatCompositeRootDiv.querySelector(`[id="sendbox"]`);
59
+ if (sendbox !== null) {
60
+ sendbox.focus();
61
+ clearInterval(chatFocusTimeout);
62
+ }
63
+ }, 3);
64
+ setTimeout(() => {
65
+ clearInterval(chatFocusTimeout);
66
+ }, 300);
67
+ }, [compositeParentDivId]);
68
+ const hasJoinedCall = !!(currentPage && hasJoinedCallFn(currentPage, currentCallState !== null && currentCallState !== void 0 ? currentCallState : 'None'));
69
+ const toggleChat = useCallback(() => {
70
+ isChatOpen || !hasJoinedCall ? closeChat() : openChat();
71
+ }, [closeChat, hasJoinedCall, isChatOpen, openChat]);
143
72
  const callWithChatStrings = useCallWithChatCompositeStrings();
144
- /* @conditional-compile-remove(PSTN-calls) */
145
- const dialpadStrings = useMemo(() => ({
146
- dialpadModalAriaLabel: callWithChatStrings.dialpadModalAriaLabel,
147
- dialpadCloseModalButtonAriaLabel: callWithChatStrings.dialpadCloseModalButtonAriaLabel,
148
- placeholderText: callWithChatStrings.dtmfDialpadPlaceholderText
73
+ const chatButtonStrings = useMemo(() => ({
74
+ label: callWithChatStrings.chatButtonLabel,
75
+ tooltipOffContent: callWithChatStrings.chatButtonTooltipOpen,
76
+ tooltipOnContent: callWithChatStrings.chatButtonTooltipClose
149
77
  }), [callWithChatStrings]);
150
- /* @conditional-compile-remove(PSTN-calls) */
151
- const alternateCallerId = callAdapter.getState().alternateCallerId;
152
- /* @conditional-compile-remove(close-captions) */
153
- const isTeamsCall = callAdapter.getState().isTeamsCall;
78
+ const theme = useTheme();
79
+ const commonButtonStyles = useMemo(() => (!mobileView ? getDesktopCommonButtonStyles(theme) : undefined), [mobileView, theme]);
80
+ const showChatButton = checkShowChatButton(props.callControls);
81
+ const chatButtonDisabled = showChatButton && (checkChatButtonIsDisabled(props.callControls) || !hasJoinedCall);
82
+ const chatTabHeaderProps = useMemo(() => mobileView && showChatButton
83
+ ? {
84
+ onClick: toggleChat,
85
+ disabled: chatButtonDisabled
86
+ }
87
+ : undefined, [chatButtonDisabled, mobileView, toggleChat, showChatButton]);
88
+ const customChatButton = useCallback((args) => ({
89
+ placement: mobileView ? 'primary' : 'secondary',
90
+ onRenderButton: () => (React.createElement(ChatButtonWithUnreadMessagesBadge, { chatAdapter: chatProps.adapter, isChatPaneVisible: isChatOpen, checked: isChatOpen, showLabel: args.displayType !== 'compact', onClick: toggleChat, disabled: chatButtonDisabled, strings: chatButtonStrings, styles: commonButtonStyles, newMessageLabel: callWithChatStrings.chatButtonNewMessageNotificationLabel }))
91
+ }), [
92
+ callWithChatStrings.chatButtonNewMessageNotificationLabel,
93
+ chatButtonStrings,
94
+ chatProps.adapter,
95
+ commonButtonStyles,
96
+ isChatOpen,
97
+ chatButtonDisabled,
98
+ mobileView,
99
+ toggleChat
100
+ ]);
101
+ const callControlOptionsFromProps = useMemo(() => (Object.assign({}, (typeof props.callControls === 'object' ? props.callControls : {}))), [props.callControls]);
102
+ const injectedCustomButtonsFromProps = useMemo(() => {
103
+ var _a;
104
+ /* @conditional-compile-remove(control-bar-button-injection) */
105
+ return [...((_a = callControlOptionsFromProps.onFetchCustomButtonProps) !== null && _a !== void 0 ? _a : [])];
106
+ return [];
107
+ }, [callControlOptionsFromProps]);
154
108
  const callCompositeOptions = useMemo(() => ({
155
- callControls: false,
109
+ callControls: props.callControls === false
110
+ ? false
111
+ : Object.assign(Object.assign({}, callControlOptionsFromProps), { onFetchCustomButtonProps: [
112
+ ...(showChatButton ? [customChatButton] : []),
113
+ /* @conditional-compile-remove(control-bar-button-injection) */
114
+ ...injectedCustomButtonsFromProps
115
+ ], legacyControlBarExperience: false }),
156
116
  /* @conditional-compile-remove(call-readiness) */
157
117
  deviceChecks: props.deviceChecks,
158
118
  /* @conditional-compile-remove(call-readiness) */
@@ -162,6 +122,11 @@ const CallWithChatScreen = (props) => {
162
122
  /* @conditional-compile-remove(unsupported-browser) */
163
123
  onEnvironmentInfoTroubleshootingClick: props.onEnvironmentInfoTroubleshootingClick
164
124
  }), [
125
+ props.callControls,
126
+ callControlOptionsFromProps,
127
+ showChatButton,
128
+ customChatButton,
129
+ injectedCustomButtonsFromProps,
165
130
  /* @conditional-compile-remove(call-readiness) */
166
131
  props.deviceChecks,
167
132
  /* @conditional-compile-remove(unsupported-browser) */
@@ -171,49 +136,44 @@ const CallWithChatScreen = (props) => {
171
136
  /* @conditional-compile-remove(call-readiness) */
172
137
  props.onPermissionsTroubleshootingClick
173
138
  ]);
139
+ const onRenderChatContent = useCallback(() => (React.createElement(ChatComposite, Object.assign({}, chatProps, { fluentTheme: theme, options: {
140
+ topic: false,
141
+ /* @conditional-compile-remove(chat-composite-participant-pane) */
142
+ participantPane: false,
143
+ /* @conditional-compile-remove(file-sharing) */
144
+ fileSharing: props.fileSharing
145
+ }, onFetchAvatarPersonaData: props.onFetchAvatarPersonaData }))), [
146
+ chatProps,
147
+ /* @conditional-compile-remove(file-sharing) */ props.fileSharing,
148
+ props.onFetchAvatarPersonaData,
149
+ theme
150
+ ]);
151
+ const sidePaneHeaderRenderer = useCallback(() => {
152
+ var _a;
153
+ return (React.createElement(SidePaneHeader, { headingText: callWithChatStrings.chatPaneTitle, onClose: closeChat, dismissSidePaneButtonAriaLabel: (_a = callWithChatStrings.dismissSidePaneButtonLabel) !== null && _a !== void 0 ? _a : '', mobileView: mobileView }));
154
+ }, [callWithChatStrings.chatPaneTitle, callWithChatStrings.dismissSidePaneButtonLabel, closeChat, mobileView]);
155
+ const sidePaneContentRenderer = useMemo(() => (hasJoinedCall ? onRenderChatContent : undefined), [hasJoinedCall, onRenderChatContent]);
156
+ const sidePaneRenderer = useMemo(() => ({
157
+ contentRenderer: sidePaneContentRenderer,
158
+ headerRenderer: sidePaneHeaderRenderer,
159
+ id: 'chat'
160
+ }), [sidePaneContentRenderer, sidePaneHeaderRenderer]);
161
+ const overrideSidePaneProps = useMemo(() => ({
162
+ renderer: sidePaneRenderer,
163
+ isActive: isChatOpen,
164
+ persistRenderingWhenClosed: true
165
+ }), [isChatOpen, sidePaneRenderer]);
166
+ const onSidePaneIdChange = useCallback((sidePaneId) => {
167
+ // If the pane is switched to something other than chat, removing rendering chat.
168
+ if (sidePaneId && sidePaneId !== 'chat') {
169
+ closeChat();
170
+ }
171
+ }, [closeChat]);
174
172
  return (React.createElement("div", { ref: containerRef, className: mergeStyles(containerDivStyles) },
175
173
  React.createElement(Stack, { verticalFill: true, grow: true, styles: compositeOuterContainerStyles, id: compositeParentDivId },
176
174
  React.createElement(Stack, { horizontal: true, grow: true },
177
- React.createElement(Stack.Item, { grow: true, styles: callCompositeContainerStyles(mobileView),
178
- // Perf: Instead of removing the video gallery from DOM, we hide it to prevent re-renders.
179
- style: callCompositeContainerCSS },
180
- React.createElement(CallComposite, Object.assign({}, props, { formFactor: formFactor, options: callCompositeOptions, adapter: callAdapter, fluentTheme: fluentTheme }))),
181
- /* @conditional-compile-remove(video-background-effects) */
182
- React.createElement(CallAdapterProvider, { adapter: callAdapter },
183
- React.createElement(VideoEffectsPane, { showVideoEffectsOptions: showVideoEffectsPane, setshowVideoEffectsOptions: setShowVideoEffectsPane })),
184
- chatProps.adapter && callAdapter && hasJoinedCall && (React.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,
185
- /* @conditional-compile-remove(file-sharing) */
186
- fileSharing: props.fileSharing, rtl: props.rtl, callControls: typeof props.callControls !== 'boolean' ? props.callControls : undefined }))),
187
- showControlBar && !isMobileWithActivePane && (React.createElement(ChatAdapterProvider, { adapter: chatProps.adapter },
188
- React.createElement(Stack.Item, { styles: controlBarContainerStyles },
189
- React.createElement(CommonCallControlBar, { callAdapter: callAdapter, chatAdapter: chatProps.adapter, chatButtonChecked: activePane === 'chat', onChatButtonClicked: toggleChat, peopleButtonChecked: activePane === 'people', onPeopleButtonClicked: togglePeople, onMoreButtonClicked: onMoreButtonClicked, mobileView: mobileView, disableButtonsForLobbyPage: isInLobbyOrConnecting,
190
- /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
191
- disableButtonsForHoldScreen: isInLocalHold, callControls: props.callControls, containerHeight: containerHeight, containerWidth: containerWidth,
192
- /* @conditional-compile-remove(PSTN-calls) */
193
- onClickShowDialpad: alternateCallerId ? onClickShowDialpad : undefined,
194
- /* @conditional-compile-remove(close-captions) */
195
- isCaptionsSupported: isTeamsCall && hasJoinedCall,
196
- /* @conditional-compile-remove(video-background-effects) */
197
- onShowVideoEffectsPicker: setShowVideoEffectsPane, rtl: props.rtl })))),
198
- showControlBar && showDrawer && (React.createElement(ChatAdapterProvider, { adapter: chatProps.adapter },
199
- React.createElement(CallAdapterProvider, { adapter: callAdapter },
200
- React.createElement(Stack, { styles: drawerContainerStyles() },
201
- React.createElement(PreparedMoreDrawer, { callControls: props.callControls, onLightDismiss: closeDrawer, onPeopleButtonClicked: onMoreDrawerPeopleClicked,
202
- /* @conditional-compile-remove(PSTN-calls) */
203
- onClickShowDialpad: alternateCallerId ? onClickShowDialpad : undefined,
204
- /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
205
- disableButtonsForHoldScreen: isInLocalHold,
206
- /* @conditional-compile-remove(close-captions) */
207
- isCaptionsSupported: isTeamsCall && hasJoinedCall }))))),
208
- /* @conditional-compile-remove(PSTN-calls) */
209
- showControlBar && showDtmfDialpad && (React.createElement(ChatAdapterProvider, { adapter: chatProps.adapter },
210
- React.createElement(CallAdapterProvider, { adapter: callAdapter },
211
- React.createElement(Stack, { styles: drawerContainerStyles() },
212
- React.createElement(SendDtmfDialpad, { isMobile: mobileView, strings: dialpadStrings, showDialpad: showDtmfDialpad, onDismissDialpad: onDismissDtmfDialpad }))))),
213
- // This layer host is for ModalLocalAndRemotePIP in CallWithChatPane. This LayerHost cannot be inside the CallWithChatPane
214
- // because when the CallWithChatPane is hidden, ie. style property display is 'none', it takes up no space. This causes problems when dragging
215
- // the Modal because the draggable bounds thinks it has no space and will always return to its initial position after dragging.
216
- mobileView && React.createElement(LayerHost, { id: modalLayerHostId, className: mergeStyles(modalLayerHostStyle) }))));
175
+ React.createElement(Stack.Item, { grow: true, styles: callCompositeContainerStyles(mobileView) },
176
+ React.createElement(CallCompositeInner, Object.assign({}, props, { formFactor: formFactor, options: callCompositeOptions, adapter: callAdapter, fluentTheme: fluentTheme, callInvitationUrl: props.joinInvitationURL, overrideSidePane: overrideSidePaneProps, onSidePaneIdChange: onSidePaneIdChange, mobileChatTabHeader: chatTabHeaderProps })))))));
217
177
  };
218
178
  /**
219
179
  * CallWithChatComposite brings together key components to provide a full call with chat experience out of the box.
@@ -236,7 +196,7 @@ const hasJoinedCallFn = (page, callStatus) => {
236
196
  (page === 'hold' && (callStatus === 'LocalHold' || callStatus === 'Disconnecting')));
237
197
  return page === 'call' && (callStatus === 'Connected' || callStatus === 'Disconnecting');
238
198
  };
239
- const showShowChatTabHeaderButton = (callControls) => {
199
+ const checkShowChatButton = (callControls) => {
240
200
  if (callControls === undefined || callControls === true) {
241
201
  return true;
242
202
  }
@@ -245,13 +205,7 @@ const showShowChatTabHeaderButton = (callControls) => {
245
205
  }
246
206
  return callControls.chatButton !== false;
247
207
  };
248
- const showShowPeopleTabHeaderButton = (callControls) => {
249
- if (callControls === undefined || callControls === true) {
250
- return true;
251
- }
252
- if (callControls === false) {
253
- return false;
254
- }
255
- return callControls.peopleButton !== false;
208
+ const checkChatButtonIsDisabled = (callControls) => {
209
+ return typeof callControls === 'object' && isDisabled(callControls === null || callControls === void 0 ? void 0 : callControls.chatButton);
256
210
  };
257
211
  //# sourceMappingURL=CallWithChatComposite.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CallWithChatComposite.js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QAC1B,OAAO,KAAK,CAAC;KACd;IACD,OAAO,YAAY,CAAC,YAAY,KAAK,KAAK,CAAC;AAC7C,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useCallback, useState, useMemo, useEffect, useRef } from 'react';\nimport { LayerHost, mergeStyles, PartialTheme, Stack, Theme } from '@fluentui/react';\nimport { CallComposite, CallCompositePage } from '../CallComposite';\nimport { CallAdapterProvider } from '../CallComposite/adapter/CallAdapterProvider';\nimport { CommonCallControlBar } from '../common/ControlBar/CommonCallControlBar';\nimport { CallState } from '@azure/communication-calling';\nimport {\n callCompositeContainerStyles,\n compositeOuterContainerStyles,\n controlBarContainerStyles\n} from './styles/CallWithChatCompositeStyles';\nimport { CallWithChatAdapter } from './adapter/CallWithChatAdapter';\nimport { CallWithChatBackedCallAdapter } from './adapter/CallWithChatBackedCallAdapter';\nimport { CallWithChatBackedChatAdapter } from './adapter/CallWithChatBackedChatAdapter';\nimport { CallAdapter } from '../CallComposite';\nimport { ChatCompositeProps } from '../ChatComposite';\nimport { BaseProvider, BaseCompositeProps } from '../common/BaseComposite';\nimport { CallWithChatCompositeIcons } from '../common/icons';\nimport { AvatarPersonaDataCallback } from '../common/AvatarPersona';\nimport { ChatAdapterProvider } from '../ChatComposite/adapter/ChatAdapterProvider';\nimport { CallWithChatAdapterState } from './state/CallWithChatAdapterState';\nimport { PreparedMoreDrawer } from '../common/Drawer/PreparedMoreDrawer';\nimport { ParticipantMenuItemsCallback, _useContainerHeight, _useContainerWidth } from '@internal/react-components';\nimport { useId } from '@fluentui/react-hooks';\nimport { CallWithChatPane, CallWithChatPaneOption } from './CallWithChatPane';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileSharingOptions } from '../ChatComposite';\nimport { containerDivStyles } from '../common/ContainerRectProps';\nimport { modalLayerHostStyle } from '../common/styles/ModalLocalAndRemotePIP.styles';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { SendDtmfDialpad } from '../common/SendDtmfDialpad';\n/* @conditional-compile-remove(PSTN-calls) */\nimport { useCallWithChatCompositeStrings } from './hooks/useCallWithChatCompositeStrings';\nimport { CallCompositeOptions } from '../CallComposite/CallComposite';\n/* @conditional-compile-remove(call-readiness) */\nimport { DeviceCheckOptions } from '../CallComposite/CallComposite';\nimport { drawerContainerStyles } from '../CallComposite/styles/CallComposite.styles';\n/* @conditional-compile-remove(video-background-effects) */\nimport { VideoEffectsPane } from '../common/VideoEffectsPane';\nimport { CommonCallControlOptions } from '../common/types/CommonCallControlOptions';\n\n/**\n * Props required for the {@link CallWithChatComposite}\n *\n * @public\n */\nexport interface CallWithChatCompositeProps extends BaseCompositeProps<CallWithChatCompositeIcons> {\n adapter: CallWithChatAdapter;\n /**\n * Fluent theme for the composite.\n *\n * Defaults to a light theme if undefined.\n */\n fluentTheme?: PartialTheme | Theme;\n /**\n * Optimizes the composite form factor for either desktop or mobile.\n * @remarks `mobile` is currently only optimized for Portrait mode on mobile devices and does not support landscape.\n * @defaultValue 'desktop'\n */\n formFactor?: 'desktop' | 'mobile';\n /**\n * URL that can be used to copy a call-with-chat invite to the Users clipboard.\n */\n joinInvitationURL?: string;\n /**\n * Flags to enable/disable or customize UI elements of the {@link CallWithChatComposite}\n */\n options?: CallWithChatCompositeOptions;\n}\n\n/**\n * Customization options for the control bar in calling with chat experience.\n *\n * @public\n */\nexport interface CallWithChatControlOptions extends CommonCallControlOptions {\n /**\n * Show or hide the chat button in the call-with-chat composite control bar.\n * @defaultValue true\n */\n chatButton?: boolean | /* @conditional-compile-remove(PSTN-calls) */ { disabled: boolean };\n}\n\n/**\n * Optional features of the {@link CallWithChatComposite}.\n *\n * @public\n */\nexport type CallWithChatCompositeOptions = {\n /**\n * Call control options to change what buttons show on the call-with-chat composite control bar.\n * If using the boolean values, true will cause default behavior across the whole control bar. False hides the whole control bar.\n */\n callControls?: boolean | CallWithChatControlOptions;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Properties for configuring the File Sharing feature.\n * If undefined, file sharing feature will be disabled.\n * @beta\n */\n fileSharing?: FileSharingOptions;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Device permissions check options for your call.\n * Here you can choose what device permissions you prompt the user for,\n * as well as what device permissions must be accepted before starting a call.\n */\n deviceChecks?: DeviceCheckOptions;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Callback you may provide to supply users with further steps to troubleshoot why they have been\n * unable to grant your site the required permissions for the call.\n *\n * @example\n * ```ts\n * onPermissionsTroubleshootingClick: () =>\n * window.open('https://contoso.com/permissions-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a 'further troubleshooting' link.\n */\n onPermissionsTroubleshootingClick?: (permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n }) => void;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Optional callback to supply users with further troubleshooting steps for network issues\n * experienced when connecting to a call.\n *\n * @example\n * ```ts\n * onNetworkingTroubleShootingClick?: () =>\n * window.open('https://contoso.com/network-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a 'network troubleshooting' link.\n */\n onNetworkingTroubleShootingClick?: () => void;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * Callback you may provide to supply users with a provided page to showcase supported browsers by ACS.\n *\n * @example\n * ```ts\n * onBrowserTroubleShootingClick?: () =>\n * window.open('https://contoso.com/browser-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a unsupported browser page.\n */\n onEnvironmentInfoTroubleshootingClick?: () => void;\n};\n\ntype CallWithChatScreenProps = {\n callWithChatAdapter: CallWithChatAdapter;\n fluentTheme?: PartialTheme | Theme;\n formFactor?: 'desktop' | 'mobile';\n joinInvitationURL?: string;\n callControls?: boolean | CallWithChatControlOptions;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n /* @conditional-compile-remove(file-sharing) */\n fileSharing?: FileSharingOptions;\n rtl?: boolean;\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks?: DeviceCheckOptions;\n /* @conditional-compile-remove(call-readiness) */\n onPermissionsTroubleshootingClick?: (permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n }) => void;\n /* @conditional-compile-remove(call-readiness) */\n onNetworkingTroubleShootingClick?: () => void;\n /* @conditional-compile-remove(unsupported-browser) */\n onEnvironmentInfoTroubleshootingClick?: () => void;\n};\n\nconst CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {\n const { callWithChatAdapter, fluentTheme, formFactor = 'desktop' } = props;\n const mobileView = formFactor === 'mobile';\n /* @conditional-compile-remove(video-background-effects) */\n const [showVideoEffectsPane, setVideoEffectsPane] = useState(false);\n\n /* @conditional-compile-remove(video-background-effects) */\n const setShowVideoEffectsPane = useCallback(\n (showVideoEffectsOptions: boolean): void => {\n setVideoEffectsPane(showVideoEffectsOptions);\n },\n [setVideoEffectsPane]\n );\n if (!callWithChatAdapter) {\n throw new Error('CallWithChatAdapter is undefined');\n }\n\n const callAdapter: CallAdapter = useMemo(\n () => new CallWithChatBackedCallAdapter(callWithChatAdapter),\n [callWithChatAdapter]\n );\n\n const [currentCallState, setCurrentCallState] = useState<CallState>();\n const [currentPage, setCurrentPage] = useState<CallCompositePage>();\n const [activePane, setActivePane] = useState<CallWithChatPaneOption>('none');\n\n const containerRef = useRef<HTMLDivElement>(null);\n const containerWidth = _useContainerWidth(containerRef);\n const containerHeight = _useContainerHeight(containerRef);\n\n useEffect(() => {\n const updateCallWithChatPage = (newState: CallWithChatAdapterState): void => {\n setCurrentPage(newState.page);\n setCurrentCallState(newState.call?.state);\n };\n updateCallWithChatPage(callWithChatAdapter.getState());\n callWithChatAdapter.onStateChange(updateCallWithChatPage);\n return () => {\n callWithChatAdapter.offStateChange(updateCallWithChatPage);\n };\n }, [callWithChatAdapter]);\n\n const closePane = useCallback(() => {\n setActivePane('none');\n }, [setActivePane]);\n\n const chatProps: ChatCompositeProps = useMemo(() => {\n return {\n adapter: new CallWithChatBackedChatAdapter(callWithChatAdapter)\n };\n }, [callWithChatAdapter]);\n\n const modalLayerHostId = useId('modalLayerhost');\n\n const isInLobbyOrConnecting = currentPage === 'lobby';\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n const isInLocalHold = currentPage === 'hold';\n const hasJoinedCall = !!(currentPage && hasJoinedCallFn(currentPage, currentCallState ?? 'None'));\n const showControlBar = isInLobbyOrConnecting || hasJoinedCall;\n const isMobileWithActivePane = mobileView && hasJoinedCall && activePane !== 'none';\n\n /** Constant setting of id for the parent stack of the composite */\n const compositeParentDivId = useId('callWithChatCompositeParentDiv-internal');\n\n const toggleChat = useCallback(() => {\n if (activePane === 'chat' || !hasJoinedCall) {\n setActivePane('none');\n } else {\n setActivePane('chat');\n // timeout is required to give the window time to render the sendbox so we have something to send focus to.\n // TODO: Selecting elements in the DOM via attributes is not stable. We should expose an API from ChatComposite to be able to focus on the sendbox.\n const chatFocusTimeout = setInterval(() => {\n const callWithChatCompositeRootDiv = document.querySelector(`[id=\"${compositeParentDivId}\"]`);\n const sendbox = callWithChatCompositeRootDiv?.querySelector(`[id=\"sendbox\"]`) as HTMLTextAreaElement;\n if (sendbox !== null) {\n sendbox.focus();\n clearInterval(chatFocusTimeout);\n }\n }, 3);\n setTimeout(() => {\n clearInterval(chatFocusTimeout);\n }, 300);\n }\n }, [activePane, setActivePane, compositeParentDivId, hasJoinedCall]);\n\n const togglePeople = useCallback(() => {\n if (activePane === 'people' || !hasJoinedCall) {\n setActivePane('none');\n } else {\n setActivePane('people');\n }\n }, [activePane, setActivePane, hasJoinedCall]);\n\n const selectChat = useCallback(() => {\n if (hasJoinedCall) {\n setActivePane('chat');\n }\n }, [setActivePane, hasJoinedCall]);\n\n const selectPeople = useCallback(() => {\n if (hasJoinedCall) {\n setActivePane('people');\n }\n }, [setActivePane, hasJoinedCall]);\n\n const [showDrawer, setShowDrawer] = useState(false);\n const onMoreButtonClicked = useCallback(() => {\n closePane();\n setShowDrawer(true);\n }, [closePane]);\n const closeDrawer = useCallback(() => {\n setShowDrawer(false);\n }, []);\n const onMoreDrawerPeopleClicked = useCallback(() => {\n setShowDrawer(false);\n togglePeople();\n }, [togglePeople]);\n\n // On mobile, when there is an active call and some side pane is active,\n // we hide the call composite via CSS to show only the pane.\n // We only set `display` to `none` instead of unmounting the call composite component tree\n // to avoid the performance cost of rerendering video streams when we later show the composite again.\n const callCompositeContainerCSS = useMemo(() => {\n return { display: isMobileWithActivePane ? 'none' : 'flex' };\n }, [isMobileWithActivePane]);\n\n /* @conditional-compile-remove(PSTN-calls) */\n const [showDtmfDialpad, setShowDtmfDialpad] = useState(false);\n\n /* @conditional-compile-remove(PSTN-calls) */\n const onDismissDtmfDialpad = (): void => {\n setShowDtmfDialpad(false);\n };\n\n /* @conditional-compile-remove(PSTN-calls) */\n const onClickShowDialpad = (): void => {\n setShowDtmfDialpad(true);\n };\n\n /* @conditional-compile-remove(PSTN-calls) */\n const callWithChatStrings = useCallWithChatCompositeStrings();\n\n /* @conditional-compile-remove(PSTN-calls) */\n const dialpadStrings = useMemo(\n () => ({\n dialpadModalAriaLabel: callWithChatStrings.dialpadModalAriaLabel,\n dialpadCloseModalButtonAriaLabel: callWithChatStrings.dialpadCloseModalButtonAriaLabel,\n placeholderText: callWithChatStrings.dtmfDialpadPlaceholderText\n }),\n [callWithChatStrings]\n );\n\n /* @conditional-compile-remove(PSTN-calls) */\n const alternateCallerId = callAdapter.getState().alternateCallerId;\n /* @conditional-compile-remove(close-captions) */\n const isTeamsCall = callAdapter.getState().isTeamsCall;\n\n const callCompositeOptions: CallCompositeOptions = useMemo(\n () => ({\n callControls: false,\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks: props.deviceChecks,\n /* @conditional-compile-remove(call-readiness) */\n onNetworkingTroubleShootingClick: props.onNetworkingTroubleShootingClick,\n /* @conditional-compile-remove(call-readiness) */\n onPermissionsTroubleshootingClick: props.onPermissionsTroubleshootingClick,\n /* @conditional-compile-remove(unsupported-browser) */\n onEnvironmentInfoTroubleshootingClick: props.onEnvironmentInfoTroubleshootingClick\n }),\n [\n /* @conditional-compile-remove(call-readiness) */\n props.deviceChecks,\n /* @conditional-compile-remove(unsupported-browser) */\n props.onEnvironmentInfoTroubleshootingClick,\n /* @conditional-compile-remove(call-readiness) */\n props.onNetworkingTroubleShootingClick,\n /* @conditional-compile-remove(call-readiness) */\n props.onPermissionsTroubleshootingClick\n ]\n );\n\n return (\n <div ref={containerRef} className={mergeStyles(containerDivStyles)}>\n <Stack verticalFill grow styles={compositeOuterContainerStyles} id={compositeParentDivId}>\n <Stack horizontal grow>\n <Stack.Item\n grow\n styles={callCompositeContainerStyles(mobileView)}\n // Perf: Instead of removing the video gallery from DOM, we hide it to prevent re-renders.\n style={callCompositeContainerCSS}\n >\n <CallComposite\n {...props}\n formFactor={formFactor}\n options={callCompositeOptions}\n adapter={callAdapter}\n fluentTheme={fluentTheme}\n />\n </Stack.Item>\n {\n /* @conditional-compile-remove(video-background-effects) */\n <CallAdapterProvider adapter={callAdapter}>\n <VideoEffectsPane\n showVideoEffectsOptions={showVideoEffectsPane}\n setshowVideoEffectsOptions={setShowVideoEffectsPane}\n />\n </CallAdapterProvider>\n }\n {chatProps.adapter && callAdapter && hasJoinedCall && (\n <CallWithChatPane\n chatCompositeProps={chatProps}\n inviteLink={props.joinInvitationURL}\n onClose={closePane}\n chatAdapter={chatProps.adapter}\n callAdapter={callAdapter}\n onFetchAvatarPersonaData={props.onFetchAvatarPersonaData}\n onFetchParticipantMenuItems={props.onFetchParticipantMenuItems}\n onChatButtonClicked={showShowChatTabHeaderButton(props.callControls) ? selectChat : undefined}\n onPeopleButtonClicked={showShowPeopleTabHeaderButton(props.callControls) ? selectPeople : undefined}\n modalLayerHostId={modalLayerHostId}\n mobileView={mobileView}\n activePane={activePane}\n /* @conditional-compile-remove(file-sharing) */\n fileSharing={props.fileSharing}\n rtl={props.rtl}\n callControls={typeof props.callControls !== 'boolean' ? props.callControls : undefined}\n />\n )}\n </Stack>\n {showControlBar && !isMobileWithActivePane && (\n <ChatAdapterProvider adapter={chatProps.adapter}>\n <Stack.Item styles={controlBarContainerStyles}>\n <CommonCallControlBar\n callAdapter={callAdapter}\n chatAdapter={chatProps.adapter}\n chatButtonChecked={activePane === 'chat'}\n onChatButtonClicked={toggleChat}\n peopleButtonChecked={activePane === 'people'}\n onPeopleButtonClicked={togglePeople}\n onMoreButtonClicked={onMoreButtonClicked}\n mobileView={mobileView}\n disableButtonsForLobbyPage={isInLobbyOrConnecting}\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n disableButtonsForHoldScreen={isInLocalHold}\n callControls={props.callControls}\n containerHeight={containerHeight}\n containerWidth={containerWidth}\n /* @conditional-compile-remove(PSTN-calls) */\n onClickShowDialpad={alternateCallerId ? onClickShowDialpad : undefined}\n /* @conditional-compile-remove(close-captions) */\n isCaptionsSupported={isTeamsCall && hasJoinedCall}\n /* @conditional-compile-remove(video-background-effects) */\n onShowVideoEffectsPicker={setShowVideoEffectsPane}\n rtl={props.rtl}\n />\n </Stack.Item>\n </ChatAdapterProvider>\n )}\n {showControlBar && showDrawer && (\n <ChatAdapterProvider adapter={chatProps.adapter}>\n <CallAdapterProvider adapter={callAdapter}>\n <Stack styles={drawerContainerStyles()}>\n <PreparedMoreDrawer\n callControls={props.callControls}\n onLightDismiss={closeDrawer}\n onPeopleButtonClicked={onMoreDrawerPeopleClicked}\n /* @conditional-compile-remove(PSTN-calls) */\n onClickShowDialpad={alternateCallerId ? onClickShowDialpad : undefined}\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n disableButtonsForHoldScreen={isInLocalHold}\n /* @conditional-compile-remove(close-captions) */\n isCaptionsSupported={isTeamsCall && hasJoinedCall}\n />\n </Stack>\n </CallAdapterProvider>\n </ChatAdapterProvider>\n )}\n\n {\n /* @conditional-compile-remove(PSTN-calls) */\n showControlBar && showDtmfDialpad && (\n <ChatAdapterProvider adapter={chatProps.adapter}>\n <CallAdapterProvider adapter={callAdapter}>\n <Stack styles={drawerContainerStyles()}>\n <SendDtmfDialpad\n isMobile={mobileView}\n strings={dialpadStrings}\n showDialpad={showDtmfDialpad}\n onDismissDialpad={onDismissDtmfDialpad}\n />\n </Stack>\n </CallAdapterProvider>\n </ChatAdapterProvider>\n )\n }\n {\n // This layer host is for ModalLocalAndRemotePIP in CallWithChatPane. This LayerHost cannot be inside the CallWithChatPane\n // because when the CallWithChatPane is hidden, ie. style property display is 'none', it takes up no space. This causes problems when dragging\n // the Modal because the draggable bounds thinks it has no space and will always return to its initial position after dragging.\n mobileView && <LayerHost id={modalLayerHostId} className={mergeStyles(modalLayerHostStyle)} />\n }\n </Stack>\n </div>\n );\n};\n\n/**\n * CallWithChatComposite brings together key components to provide a full call with chat experience out of the box.\n *\n * @public\n */\nexport const CallWithChatComposite = (props: CallWithChatCompositeProps): JSX.Element => {\n const { adapter, fluentTheme, rtl, formFactor, joinInvitationURL, options } = props;\n return (\n <BaseProvider fluentTheme={fluentTheme} rtl={rtl} locale={props.locale} icons={props.icons}>\n <CallWithChatScreen\n {...props}\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks={options?.deviceChecks}\n callWithChatAdapter={adapter}\n formFactor={formFactor}\n callControls={options?.callControls}\n joinInvitationURL={joinInvitationURL}\n fluentTheme={fluentTheme}\n /* @conditional-compile-remove(file-sharing) */\n fileSharing={options?.fileSharing}\n />\n </BaseProvider>\n );\n};\n\nconst hasJoinedCallFn = (page: CallCompositePage, callStatus: CallState): boolean => {\n /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(one-to-n-calling) */\n return (\n (page === 'call' &&\n (callStatus === 'Connected' || callStatus === 'RemoteHold' || callStatus === 'Disconnecting')) ||\n (page === 'hold' && (callStatus === 'LocalHold' || callStatus === 'Disconnecting'))\n );\n return page === 'call' && (callStatus === 'Connected' || callStatus === 'Disconnecting');\n};\n\nconst showShowChatTabHeaderButton = (callControls?: boolean | CallWithChatControlOptions): boolean => {\n if (callControls === undefined || callControls === true) {\n return true;\n }\n if (callControls === false) {\n return false;\n }\n return callControls.chatButton !== false;\n};\n\nconst showShowPeopleTabHeaderButton = (callControls?: boolean | CallWithChatControlOptions): boolean => {\n if (callControls === undefined || callControls === true) {\n return true;\n }\n if (callControls === false) {\n return false;\n }\n return callControls.peopleButton !== false;\n};\n\"../../../../react-components/src\""]}
1
+ {"version":3,"file":"CallWithChatComposite.js","sourceRoot":"","sources":["../../../../../../../react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,WAAW,EAAgB,KAAK,EAAS,MAAM,iBAAiB,CAAC;AAG1E,OAAO,EAAE,4BAA4B,EAAE,6BAA6B,EAAE,MAAM,sCAAsC,CAAC;AAEnH,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AACxF,OAAO,EAAE,6BAA6B,EAAE,MAAM,yCAAyC,CAAC;AAExF,OAAO,EAAE,aAAa,EAAsB,MAAM,kBAAkB,CAAC;AACrE,OAAO,EAAE,YAAY,EAAsB,MAAM,yBAAyB,CAAC;AAI3E,OAAO,EAIL,QAAQ,EACT,yCAAmC;AACpC,OAAO,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAG9C,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAAE,+BAA+B,EAAE,MAAM,yCAAyC,CAAC;AAC1F,OAAO,EAAE,kBAAkB,EAAwB,MAAM,gCAAgC,CAAC;AAQ1F,OAAO,EAAE,iCAAiC,EAAE,MAAM,gDAAgD,CAAC;AACnG,OAAO,EAAE,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,UAAqB,EAAW,EAAE;IAClF,mDAAmD,CAAC,mDAAmD;IACvG,OAAO,CACL,CAAC,IAAI,KAAK,MAAM;QACd,CAAC,UAAU,KAAK,WAAW,IAAI,UAAU,KAAK,YAAY,IAAI,UAAU,KAAK,eAAe,CAAC,CAAC;QAChG,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,UAAU,KAAK,WAAW,IAAI,UAAU,KAAK,eAAe,CAAC,CAAC,CACpF,CAAC;IACF,OAAO,IAAI,KAAK,MAAM,IAAI,CAAC,UAAU,KAAK,WAAW,IAAI,UAAU,KAAK,eAAe,CAAC,CAAC;AAC3F,CAAC,CAAC;AAEF,MAAM,mBAAmB,GAAG,CAAC,YAAmD,EAAW,EAAE;IAC3F,IAAI,YAAY,KAAK,SAAS,IAAI,YAAY,KAAK,IAAI,EAAE;QACvD,OAAO,IAAI,CAAC;KACb;IACD,IAAI,YAAY,KAAK,KAAK,EAAE;QAC1B,OAAO,KAAK,CAAC;KACd;IACD,OAAO,YAAY,CAAC,UAAU,KAAK,KAAK,CAAC;AAC3C,CAAC,CAAC;AAEF,MAAM,yBAAyB,GAAG,CAAC,YAAmD,EAAW,EAAE;IACjG,OAAO,OAAO,YAAY,KAAK,QAAQ,IAAI,UAAU,CAAC,YAAY,aAAZ,YAAY,uBAAZ,YAAY,CAAE,UAAU,CAAC,CAAC;AAClF,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useCallback, useState, useMemo, useEffect, useRef } from 'react';\nimport { mergeStyles, PartialTheme, Stack, Theme } from '@fluentui/react';\nimport { CallCompositePage } from '../CallComposite';\nimport { CallState } from '@azure/communication-calling';\nimport { callCompositeContainerStyles, compositeOuterContainerStyles } from './styles/CallWithChatCompositeStyles';\nimport { CallWithChatAdapter } from './adapter/CallWithChatAdapter';\nimport { CallWithChatBackedCallAdapter } from './adapter/CallWithChatBackedCallAdapter';\nimport { CallWithChatBackedChatAdapter } from './adapter/CallWithChatBackedChatAdapter';\nimport { CallAdapter } from '../CallComposite';\nimport { ChatComposite, ChatCompositeProps } from '../ChatComposite';\nimport { BaseProvider, BaseCompositeProps } from '../common/BaseComposite';\nimport { CallWithChatCompositeIcons } from '../common/icons';\nimport { AvatarPersonaDataCallback } from '../common/AvatarPersona';\nimport { CallWithChatAdapterState } from './state/CallWithChatAdapterState';\nimport {\n ParticipantMenuItemsCallback,\n _useContainerHeight,\n _useContainerWidth,\n useTheme\n} from '@internal/react-components';\nimport { useId } from '@fluentui/react-hooks';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileSharingOptions } from '../ChatComposite';\nimport { containerDivStyles } from '../common/ContainerRectProps';\nimport { useCallWithChatCompositeStrings } from './hooks/useCallWithChatCompositeStrings';\nimport { CallCompositeInner, CallCompositeOptions } from '../CallComposite/CallComposite';\n/* @conditional-compile-remove(call-readiness) */\nimport { DeviceCheckOptions } from '../CallComposite/CallComposite';\nimport {\n CommonCallControlOptions,\n CustomCallControlButtonCallbackArgs,\n _CommonCallControlOptions\n} from '../common/types/CommonCallControlOptions';\nimport { ChatButtonWithUnreadMessagesBadge } from './ChatButton/ChatButtonWithUnreadMessagesBadge';\nimport { getDesktopCommonButtonStyles } from '../common/ControlBar/CommonCallControlBar';\nimport { InjectedSidePaneProps } from '../CallComposite/components/SidePane/SidePaneProvider';\nimport { isDisabled } from '../CallComposite/utils';\nimport { CustomCallControlButtonCallback } from '../common/ControlBar/CustomButton';\nimport { SidePaneHeader } from '../common/SidePaneHeader';\nimport { _CallControlOptions } from '../CallComposite/types/CallControlOptions';\n\n/**\n * Props required for the {@link CallWithChatComposite}\n *\n * @public\n */\nexport interface CallWithChatCompositeProps extends BaseCompositeProps<CallWithChatCompositeIcons> {\n adapter: CallWithChatAdapter;\n /**\n * Fluent theme for the composite.\n *\n * Defaults to a light theme if undefined.\n */\n fluentTheme?: PartialTheme | Theme;\n /**\n * Optimizes the composite form factor for either desktop or mobile.\n * @remarks `mobile` is currently only optimized for Portrait mode on mobile devices and does not support landscape.\n * @defaultValue 'desktop'\n */\n formFactor?: 'desktop' | 'mobile';\n /**\n * URL that can be used to copy a call-with-chat invite to the Users clipboard.\n */\n joinInvitationURL?: string;\n /**\n * Flags to enable/disable or customize UI elements of the {@link CallWithChatComposite}\n */\n options?: CallWithChatCompositeOptions;\n}\n\n/**\n * Customization options for the control bar in calling with chat experience.\n *\n * @public\n */\nexport interface CallWithChatControlOptions extends CommonCallControlOptions {\n /**\n * Show or hide the chat button in the call-with-chat composite control bar.\n * @defaultValue true\n */\n chatButton?: boolean | /* @conditional-compile-remove(PSTN-calls) */ { disabled: boolean };\n}\n\n/**\n * Optional features of the {@link CallWithChatComposite}.\n *\n * @public\n */\nexport type CallWithChatCompositeOptions = {\n /**\n * Call control options to change what buttons show on the call-with-chat composite control bar.\n * If using the boolean values, true will cause default behavior across the whole control bar. False hides the whole control bar.\n */\n callControls?: boolean | CallWithChatControlOptions;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Properties for configuring the File Sharing feature.\n * If undefined, file sharing feature will be disabled.\n * @beta\n */\n fileSharing?: FileSharingOptions;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Device permissions check options for your call.\n * Here you can choose what device permissions you prompt the user for,\n * as well as what device permissions must be accepted before starting a call.\n */\n deviceChecks?: DeviceCheckOptions;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Callback you may provide to supply users with further steps to troubleshoot why they have been\n * unable to grant your site the required permissions for the call.\n *\n * @example\n * ```ts\n * onPermissionsTroubleshootingClick: () =>\n * window.open('https://contoso.com/permissions-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a 'further troubleshooting' link.\n */\n onPermissionsTroubleshootingClick?: (permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n }) => void;\n /* @conditional-compile-remove(call-readiness) */\n /**\n * Optional callback to supply users with further troubleshooting steps for network issues\n * experienced when connecting to a call.\n *\n * @example\n * ```ts\n * onNetworkingTroubleShootingClick?: () =>\n * window.open('https://contoso.com/network-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a 'network troubleshooting' link.\n */\n onNetworkingTroubleShootingClick?: () => void;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * Callback you may provide to supply users with a provided page to showcase supported browsers by ACS.\n *\n * @example\n * ```ts\n * onBrowserTroubleShootingClick?: () =>\n * window.open('https://contoso.com/browser-troubleshooting', '_blank');\n * ```\n *\n * @remarks\n * if this is not supplied, the composite will not show a unsupported browser page.\n */\n onEnvironmentInfoTroubleshootingClick?: () => void;\n};\n\ntype CallWithChatScreenProps = {\n callWithChatAdapter: CallWithChatAdapter;\n fluentTheme?: PartialTheme | Theme;\n formFactor?: 'desktop' | 'mobile';\n joinInvitationURL?: string;\n callControls?: boolean | CallWithChatControlOptions;\n onFetchAvatarPersonaData?: AvatarPersonaDataCallback;\n onFetchParticipantMenuItems?: ParticipantMenuItemsCallback;\n /* @conditional-compile-remove(file-sharing) */\n fileSharing?: FileSharingOptions;\n rtl?: boolean;\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks?: DeviceCheckOptions;\n /* @conditional-compile-remove(call-readiness) */\n onPermissionsTroubleshootingClick?: (permissionsState: {\n camera: PermissionState;\n microphone: PermissionState;\n }) => void;\n /* @conditional-compile-remove(call-readiness) */\n onNetworkingTroubleShootingClick?: () => void;\n /* @conditional-compile-remove(unsupported-browser) */\n onEnvironmentInfoTroubleshootingClick?: () => void;\n};\n\nconst CallWithChatScreen = (props: CallWithChatScreenProps): JSX.Element => {\n const { callWithChatAdapter, fluentTheme, formFactor = 'desktop' } = props;\n const mobileView = formFactor === 'mobile';\n\n if (!callWithChatAdapter) {\n throw new Error('CallWithChatAdapter is undefined');\n }\n\n const callAdapter: CallAdapter = useMemo(\n () => new CallWithChatBackedCallAdapter(callWithChatAdapter),\n [callWithChatAdapter]\n );\n\n const [currentCallState, setCurrentCallState] = useState<CallState>();\n const [currentPage, setCurrentPage] = useState<CallCompositePage>();\n const [isChatOpen, setIsChatOpen] = useState(false);\n\n const containerRef = useRef<HTMLDivElement>(null);\n\n useEffect(() => {\n const updateCallWithChatPage = (newState: CallWithChatAdapterState): void => {\n setCurrentPage(newState.page);\n setCurrentCallState(newState.call?.state);\n };\n updateCallWithChatPage(callWithChatAdapter.getState());\n callWithChatAdapter.onStateChange(updateCallWithChatPage);\n return () => {\n callWithChatAdapter.offStateChange(updateCallWithChatPage);\n };\n }, [callWithChatAdapter]);\n\n const chatProps: ChatCompositeProps = useMemo(() => {\n return {\n adapter: new CallWithChatBackedChatAdapter(callWithChatAdapter)\n };\n }, [callWithChatAdapter]);\n\n /** Constant setting of id for the parent stack of the composite */\n const compositeParentDivId = useId('callWithChatCompositeParentDiv-internal');\n\n const closeChat = useCallback(() => {\n setIsChatOpen(false);\n }, []);\n const openChat = useCallback(() => {\n setIsChatOpen(true);\n // timeout is required to give the window time to render the sendbox so we have something to send focus to.\n // TODO: Selecting elements in the DOM via attributes is not stable. We should expose an API from ChatComposite to be able to focus on the sendbox.\n const chatFocusTimeout = setInterval(() => {\n const callWithChatCompositeRootDiv = document.querySelector(`[id=\"${compositeParentDivId}\"]`);\n const sendbox = callWithChatCompositeRootDiv?.querySelector(`[id=\"sendbox\"]`) as HTMLTextAreaElement;\n if (sendbox !== null) {\n sendbox.focus();\n clearInterval(chatFocusTimeout);\n }\n }, 3);\n setTimeout(() => {\n clearInterval(chatFocusTimeout);\n }, 300);\n }, [compositeParentDivId]);\n\n const hasJoinedCall = !!(currentPage && hasJoinedCallFn(currentPage, currentCallState ?? 'None'));\n const toggleChat = useCallback(() => {\n isChatOpen || !hasJoinedCall ? closeChat() : openChat();\n }, [closeChat, hasJoinedCall, isChatOpen, openChat]);\n\n const callWithChatStrings = useCallWithChatCompositeStrings();\n const chatButtonStrings = useMemo(\n () => ({\n label: callWithChatStrings.chatButtonLabel,\n tooltipOffContent: callWithChatStrings.chatButtonTooltipOpen,\n tooltipOnContent: callWithChatStrings.chatButtonTooltipClose\n }),\n [callWithChatStrings]\n );\n const theme = useTheme();\n const commonButtonStyles = useMemo(\n () => (!mobileView ? getDesktopCommonButtonStyles(theme) : undefined),\n [mobileView, theme]\n );\n\n const showChatButton = checkShowChatButton(props.callControls);\n const chatButtonDisabled = showChatButton && (checkChatButtonIsDisabled(props.callControls) || !hasJoinedCall);\n const chatTabHeaderProps = useMemo(\n () =>\n mobileView && showChatButton\n ? {\n onClick: toggleChat,\n disabled: chatButtonDisabled\n }\n : undefined,\n [chatButtonDisabled, mobileView, toggleChat, showChatButton]\n );\n\n const customChatButton: CustomCallControlButtonCallback = useCallback(\n (args: CustomCallControlButtonCallbackArgs) => ({\n placement: mobileView ? 'primary' : 'secondary',\n onRenderButton: () => (\n <ChatButtonWithUnreadMessagesBadge\n chatAdapter={chatProps.adapter}\n isChatPaneVisible={isChatOpen}\n checked={isChatOpen}\n showLabel={args.displayType !== 'compact'}\n onClick={toggleChat}\n disabled={chatButtonDisabled}\n strings={chatButtonStrings}\n styles={commonButtonStyles}\n newMessageLabel={callWithChatStrings.chatButtonNewMessageNotificationLabel}\n />\n )\n }),\n [\n callWithChatStrings.chatButtonNewMessageNotificationLabel,\n chatButtonStrings,\n chatProps.adapter,\n commonButtonStyles,\n isChatOpen,\n chatButtonDisabled,\n mobileView,\n toggleChat\n ]\n );\n\n const callControlOptionsFromProps = useMemo(\n () => ({\n ...(typeof props.callControls === 'object' ? props.callControls : {})\n }),\n [props.callControls]\n );\n\n const injectedCustomButtonsFromProps = useMemo(() => {\n /* @conditional-compile-remove(control-bar-button-injection) */\n return [...(callControlOptionsFromProps.onFetchCustomButtonProps ?? [])];\n return [];\n }, [callControlOptionsFromProps]);\n\n const callCompositeOptions: CallCompositeOptions = useMemo(\n () => ({\n callControls:\n props.callControls === false\n ? false\n : ({\n ...callControlOptionsFromProps,\n onFetchCustomButtonProps: [\n ...(showChatButton ? [customChatButton] : []),\n /* @conditional-compile-remove(control-bar-button-injection) */\n ...injectedCustomButtonsFromProps\n ],\n legacyControlBarExperience: false\n } as _CallControlOptions),\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks: props.deviceChecks,\n /* @conditional-compile-remove(call-readiness) */\n onNetworkingTroubleShootingClick: props.onNetworkingTroubleShootingClick,\n /* @conditional-compile-remove(call-readiness) */\n onPermissionsTroubleshootingClick: props.onPermissionsTroubleshootingClick,\n /* @conditional-compile-remove(unsupported-browser) */\n onEnvironmentInfoTroubleshootingClick: props.onEnvironmentInfoTroubleshootingClick\n }),\n [\n props.callControls,\n callControlOptionsFromProps,\n showChatButton,\n customChatButton,\n injectedCustomButtonsFromProps,\n /* @conditional-compile-remove(call-readiness) */\n props.deviceChecks,\n /* @conditional-compile-remove(unsupported-browser) */\n props.onEnvironmentInfoTroubleshootingClick,\n /* @conditional-compile-remove(call-readiness) */\n props.onNetworkingTroubleShootingClick,\n /* @conditional-compile-remove(call-readiness) */\n props.onPermissionsTroubleshootingClick\n ]\n );\n\n const onRenderChatContent = useCallback(\n (): JSX.Element => (\n <ChatComposite\n {...chatProps}\n fluentTheme={theme}\n options={{\n topic: false,\n /* @conditional-compile-remove(chat-composite-participant-pane) */\n participantPane: false,\n /* @conditional-compile-remove(file-sharing) */\n fileSharing: props.fileSharing\n }}\n onFetchAvatarPersonaData={props.onFetchAvatarPersonaData}\n />\n ),\n [\n chatProps,\n /* @conditional-compile-remove(file-sharing) */ props.fileSharing,\n props.onFetchAvatarPersonaData,\n theme\n ]\n );\n\n const sidePaneHeaderRenderer = useCallback(\n () => (\n <SidePaneHeader\n headingText={callWithChatStrings.chatPaneTitle}\n onClose={closeChat}\n dismissSidePaneButtonAriaLabel={callWithChatStrings.dismissSidePaneButtonLabel ?? ''}\n mobileView={mobileView}\n />\n ),\n [callWithChatStrings.chatPaneTitle, callWithChatStrings.dismissSidePaneButtonLabel, closeChat, mobileView]\n );\n\n const sidePaneContentRenderer = useMemo(\n () => (hasJoinedCall ? onRenderChatContent : undefined),\n [hasJoinedCall, onRenderChatContent]\n );\n\n const sidePaneRenderer = useMemo(\n () => ({\n contentRenderer: sidePaneContentRenderer,\n headerRenderer: sidePaneHeaderRenderer,\n id: 'chat'\n }),\n [sidePaneContentRenderer, sidePaneHeaderRenderer]\n );\n\n const overrideSidePaneProps: InjectedSidePaneProps = useMemo(\n () => ({\n renderer: sidePaneRenderer,\n isActive: isChatOpen,\n persistRenderingWhenClosed: true\n }),\n [isChatOpen, sidePaneRenderer]\n );\n\n const onSidePaneIdChange = useCallback(\n (sidePaneId) => {\n // If the pane is switched to something other than chat, removing rendering chat.\n if (sidePaneId && sidePaneId !== 'chat') {\n closeChat();\n }\n },\n [closeChat]\n );\n\n return (\n <div ref={containerRef} className={mergeStyles(containerDivStyles)}>\n <Stack verticalFill grow styles={compositeOuterContainerStyles} id={compositeParentDivId}>\n <Stack horizontal grow>\n <Stack.Item grow styles={callCompositeContainerStyles(mobileView)}>\n <CallCompositeInner\n {...props}\n formFactor={formFactor}\n options={callCompositeOptions}\n adapter={callAdapter}\n fluentTheme={fluentTheme}\n callInvitationUrl={props.joinInvitationURL}\n overrideSidePane={overrideSidePaneProps}\n onSidePaneIdChange={onSidePaneIdChange}\n mobileChatTabHeader={chatTabHeaderProps}\n />\n </Stack.Item>\n </Stack>\n </Stack>\n </div>\n );\n};\n\n/**\n * CallWithChatComposite brings together key components to provide a full call with chat experience out of the box.\n *\n * @public\n */\nexport const CallWithChatComposite = (props: CallWithChatCompositeProps): JSX.Element => {\n const { adapter, fluentTheme, rtl, formFactor, joinInvitationURL, options } = props;\n return (\n <BaseProvider fluentTheme={fluentTheme} rtl={rtl} locale={props.locale} icons={props.icons}>\n <CallWithChatScreen\n {...props}\n /* @conditional-compile-remove(call-readiness) */\n deviceChecks={options?.deviceChecks}\n callWithChatAdapter={adapter}\n formFactor={formFactor}\n callControls={options?.callControls}\n joinInvitationURL={joinInvitationURL}\n fluentTheme={fluentTheme}\n /* @conditional-compile-remove(file-sharing) */\n fileSharing={options?.fileSharing}\n />\n </BaseProvider>\n );\n};\n\nconst hasJoinedCallFn = (page: CallCompositePage, callStatus: CallState): boolean => {\n /* @conditional-compile-remove(one-to-n-calling) */ /* @conditional-compile-remove(one-to-n-calling) */\n return (\n (page === 'call' &&\n (callStatus === 'Connected' || callStatus === 'RemoteHold' || callStatus === 'Disconnecting')) ||\n (page === 'hold' && (callStatus === 'LocalHold' || callStatus === 'Disconnecting'))\n );\n return page === 'call' && (callStatus === 'Connected' || callStatus === 'Disconnecting');\n};\n\nconst checkShowChatButton = (callControls?: boolean | CallWithChatControlOptions): boolean => {\n if (callControls === undefined || callControls === true) {\n return true;\n }\n if (callControls === false) {\n return false;\n }\n return callControls.chatButton !== false;\n};\n\nconst checkChatButtonIsDisabled = (callControls?: boolean | CallWithChatControlOptions): boolean => {\n return typeof callControls === 'object' && isDisabled(callControls?.chatButton);\n};\n\"../../../../react-components/src\""]}
@@ -1,5 +1,5 @@
1
1
  /// <reference types="react" />
2
- import { ControlBarButtonProps } from "../../../../react-components/src";
2
+ import { ControlBarButtonProps } from "../../../../../react-components/src";
3
3
  /**
4
4
  * @private
5
5
  */
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
3
  import React, { useMemo } from 'react';
4
- import { ControlBarButton, useTheme } from "../../../../react-components/src";
4
+ import { ControlBarButton, useTheme } from "../../../../../react-components/src";
5
5
  import { concatStyleSets } from '@fluentui/react';
6
6
  /**
7
7
  * @private
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatButton.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,EAAE,gBAAgB,EAAiD,QAAQ,EAAE,4CAAmC;AACvH,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAElD;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,KAA4B,EAAe,EAAE;IACtE,MAAM,OAAO,mBAAK,KAAK,EAAE,KAAK,CAAC,KAAK,IAAK,KAAK,CAAC,OAAO,CAAE,CAAC;IACzD,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,MAAM,GAA2B,OAAO,CAC5C,GAAG,EAAE;;QACH,OAAA,eAAe,CACb;YACE,WAAW,EAAE;gBACX,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY;aACvC;SACF,EACD,MAAA,KAAK,CAAC,MAAM,mCAAI,EAAE,CACnB,CAAA;KAAA,EACH,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAC3C,CAAC;IACF,OAAO,CACL,oBAAC,gBAAgB,oBACX,KAAK,IACT,QAAQ,EAAE,oBAAoB,EAC9B,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,MAAM,EAAE,MAAM,IACd,CACH,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useMemo } from 'react';\nimport { ControlBarButton, ControlBarButtonProps, ControlBarButtonStyles, useTheme } from '@internal/react-components';\nimport { concatStyleSets } from '@fluentui/react';\n\n/**\n * @private\n */\nexport const ChatButton = (props: ControlBarButtonProps): JSX.Element => {\n const strings = { label: props.label, ...props.strings };\n const theme = useTheme();\n const styles: ControlBarButtonStyles = useMemo(\n () =>\n concatStyleSets(\n {\n rootChecked: {\n background: theme.palette.neutralLight\n }\n },\n props.styles ?? {}\n ),\n [props.styles, theme.palette.neutralLight]\n );\n return (\n <ControlBarButton\n {...props}\n labelKey={'chatButtonLabelKey'}\n strings={strings}\n onClick={props.onClick}\n styles={styles}\n />\n );\n};\n\"../../../../../react-components/src\""]}
@@ -1,6 +1,6 @@
1
1
  /// <reference types="react" />
2
- import { ControlBarButtonProps } from "../../../../react-components/src";
3
- import { ChatAdapter } from '../ChatComposite';
2
+ import { ControlBarButtonProps } from "../../../../../react-components/src";
3
+ import { ChatAdapter } from '../../ChatComposite';
4
4
  /**
5
5
  * @private
6
6
  */
@@ -1,12 +1,12 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
3
  import { Stack } from '@fluentui/react';
4
- import { _formatString } from "../../../../acs-ui-common/src";
4
+ import { _formatString } from "../../../../../acs-ui-common/src";
5
5
  import React, { useCallback, useMemo, useState } from 'react';
6
6
  import { useEffect } from 'react';
7
- import { CallWithChatCompositeIcon } from '../common/icons';
7
+ import { CallWithChatCompositeIcon } from '../../common/icons';
8
8
  import { ChatButton } from './ChatButton';
9
- import { useCallWithChatCompositeStrings } from './hooks/useCallWithChatCompositeStrings';
9
+ import { useCallWithChatCompositeStrings } from '../hooks/useCallWithChatCompositeStrings';
10
10
  import { NotificationIcon } from './NotificationIcon';
11
11
  /**
12
12
  * Helper function to determine if the message in the event is a valid one from a user.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChatButtonWithUnreadMessagesBadge.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/ChatButton/ChatButtonWithUnreadMessagesBadge.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAgB,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,yCAAgC;AAExD,OAAO,KAAK,EAAE,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAC3F,OAA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AC,WAAW,EAAE,0BAA0B,EAAE,iBAAiB,EAAE,uBAAuB,CAAC,CAAC,CAAC;IAE1F,OAAO,CACL,oBAAC,UAAU,oBACL,KAAK,kBACE,sCAAsC,EACjD,eAAe,EAAE,kBAAkB,EACnC,cAAc,EAAE,cAAc,EAC9B,OAAO,EAAE,WAAW,IACpB,CACH,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,+BAA+B,GAAiB;IACpD,IAAI,EAAE;QACJ,OAAO,EAAE,QAAQ;QACjB,QAAQ,EAAE,UAAU;KACrB;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { ChatMessage } from '@azure/communication-chat';\nimport { IStackStyles, Stack } from '@fluentui/react';\nimport { _formatString } from '@internal/acs-ui-common';\nimport { ControlBarButtonProps } from '@internal/react-components';\nimport React, { useCallback, useMemo, useState } from 'react';\nimport { useEffect } from 'react';\nimport { ChatAdapter } from '../../ChatComposite';\nimport { CallWithChatCompositeIcon } from '../../common/icons';\nimport { ChatButton } from './ChatButton';\nimport { useCallWithChatCompositeStrings } from '../hooks/useCallWithChatCompositeStrings';\nimport { NotificationIcon } from './NotificationIcon';\n\n/**\n * @private\n */\nexport interface ChatButtonWithUnreadMessagesBadgeProps extends ControlBarButtonProps {\n chatAdapter: ChatAdapter;\n isChatPaneVisible: boolean;\n newMessageLabel?: string;\n}\n\n/**\n * Helper function to determine if the message in the event is a valid one from a user.\n * Display name is used since system messages will not have one.\n */\nconst validNewChatMessage = (message): boolean =>\n !!message.senderDisplayName && (message.type === 'text' || message.type === 'html');\n\nconst filledIcon = <CallWithChatCompositeIcon iconName={'ControlBarChatButtonActive'} />;\nconst regularIcon = <CallWithChatCompositeIcon iconName={'ControlBarChatButtonInactive'} />;\n\n/**\n * @private\n */\nexport const ChatButtonWithUnreadMessagesBadge = (props: ChatButtonWithUnreadMessagesBadgeProps): JSX.Element => {\n const { chatAdapter, isChatPaneVisible, newMessageLabel } = props;\n const [unreadChatMessagesCount, setUnreadChatMessagesCount] = useState<number>(0);\n\n const baseIcon = props.showLabel ? regularIcon : filledIcon;\n const callWithChatStrings = useCallWithChatCompositeStrings();\n\n const numberOfMsgToolTip =\n props.strings?.tooltipOffContent && unreadChatMessagesCount > 0\n ? _formatString(callWithChatStrings.chatButtonTooltipClosedWithMessageCount, {\n unreadMessagesCount: `${unreadChatMessagesCount}`\n })\n : undefined;\n\n const chatStrings = useMemo(\n () => ({\n label: props.strings?.label,\n tooltipOffContent: numberOfMsgToolTip ? numberOfMsgToolTip : props.strings?.tooltipOffContent,\n tooltipOnContent: props.strings?.tooltipOnContent\n }),\n [numberOfMsgToolTip, props.strings?.label, props.strings?.tooltipOffContent, props.strings?.tooltipOnContent]\n );\n const onRenderOnIcon = useCallback(() => baseIcon, [baseIcon]);\n const notificationOnIcon = useCallback((): JSX.Element => {\n return (\n <Stack styles={chatNotificationContainerStyles}>\n {unreadChatMessagesCount > 0 && (\n <NotificationIcon chatMessagesCount={unreadChatMessagesCount} label={newMessageLabel} />\n )}\n {baseIcon}\n </Stack>\n );\n }, [unreadChatMessagesCount, newMessageLabel, baseIcon]);\n\n useEffect(() => {\n if (isChatPaneVisible) {\n setUnreadChatMessagesCount(0);\n return;\n }\n const incrementUnreadChatMessagesCount = (event: { message: ChatMessage }): void => {\n if (!isChatPaneVisible && validNewChatMessage(event.message)) {\n setUnreadChatMessagesCount(unreadChatMessagesCount + 1);\n }\n };\n chatAdapter.on('messageReceived', incrementUnreadChatMessagesCount);\n\n return () => {\n chatAdapter.off('messageReceived', incrementUnreadChatMessagesCount);\n };\n }, [chatAdapter, setUnreadChatMessagesCount, isChatPaneVisible, unreadChatMessagesCount]);\n\n return (\n <ChatButton\n {...props}\n data-ui-id=\"call-with-chat-composite-chat-button\"\n onRenderOffIcon={notificationOnIcon}\n onRenderOnIcon={onRenderOnIcon}\n strings={chatStrings}\n />\n );\n};\n\nconst chatNotificationContainerStyles: IStackStyles = {\n root: {\n display: 'inline',\n position: 'relative'\n }\n};\n\"../../../../../acs-ui-common/src\"\"../../../../../react-components/src\""]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NotificationIcon.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/ChatButton/NotificationIcon.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAqC,eAAe,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAS5G;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,KAA4B,EAAe,EAAE;IAC5E,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,GAAG,KAAK,CAAC;IAC3C,MAAM,KAAK,GAAG,QAAQ,EAAE,CAAC;IACzB,MAAM,YAAY,GAAG,CAAC,gBAAgB,EAAe,EAAE;QACrD,IAAI,gBAAgB,GAAG,CAAC,EAAE;YACxB,OAAO,yCAAK,CAAC;SACd;aAAM;YACL,MAAM,oBAAoB,GAAG,gBAAgB,GAAG,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAI,CAAC;YAC5E,OAAO,CACL,oBAAC,IAAI,IAAC,IAAI,EAAE,QAAQ,gBAAc,oBAAoB,GAAG,KAAK,EAAE,MAAM,EAAE,sBAAsB,CAAC,KAAK,CAAC,IAClG,oBAAoB,CAChB,CACR,CAAC;SACH;IACH,CAAC,CAAC;IAEF,OAAO,CACL,oBAAC,KAAK,kBACO,kDAAkD,EAC7D,eAAe,EAAC,QAAQ,EACxB,aAAa,EAAC,QAAQ,EACtB,MAAM,EAAE,+BAA+B,CAAC,KAAK,CAAC;QAE9C,oBAAC,KAAK,QAAE,YAAY,CAAC,iBAAiB,CAAC,CAAS,CAC1C,CACT,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,0BAA0B,GAAG,KAAK,CAAC;AACzC,MAAM,mBAAmB,GAAG,CAAC,CAAC;AAE9B,MAAM,+BAA+B,GAAG,eAAe,CACrD,CAAC,KAAa,EAAe,EAAE,CAAC,CAAC;IAC/B,IAAI,EAAE;QACJ,YAAY,EAAE,GAAG,mBAAmB,KAAK;QACzC,MAAM,EAAE,GAAG,mBAAmB,KAAK;QACnC,QAAQ,EAAE,GAAG,mBAAmB,KAAK;QACrC,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY;QACtC,MAAM,EAAE,uBAAuB;QAC/B,OAAO,EAAE,GAAG,0BAA0B,KAAK;QAE3C,kEAAkE;QAClE,QAAQ,EAAE,UAAU;QACpB,GAAG,EAAE,IAAI,GAAG,GAAG,0BAA0B,GAAG,CAAC,KAAK;QAClD,IAAI,EAAE,GAAG,GAAG,GAAG,0BAA0B,GAAG,CAAC,KAAK;KACnD;CACF,CAAC,CACH,CAAC;AAEF,MAAM,sBAAsB,GAAG,eAAe,CAC5C,CAAC,KAAa,EAAgB,EAAE,CAAC,CAAC;IAChC,IAAI,EAAE;QACJ,KAAK,EAAE,OAAO;QACd,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ;KACtC;CACF,CAAC,CACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React from 'react';\nimport { IIconStyles, IStackStyles, ITheme, memoizeFunction, Stack, useTheme, Text } from '@fluentui/react';\n\n/**\n * @private\n */\nexport type NotificationIconProps = {\n chatMessagesCount: number;\n label?: string;\n};\n/**\n * @private\n */\nexport const NotificationIcon = (props: NotificationIconProps): JSX.Element => {\n const { chatMessagesCount, label } = props;\n const theme = useTheme();\n const renderNumber = (numberOfMessages): JSX.Element => {\n if (numberOfMessages < 1) {\n return <></>;\n } else {\n const textNumberOfMessages = numberOfMessages < 9 ? numberOfMessages : '9+';\n return (\n <Text role={'status'} aria-label={textNumberOfMessages + label} styles={notificationTextStyles(theme)}>\n {textNumberOfMessages}\n </Text>\n );\n }\n };\n\n return (\n <Stack\n data-ui-id=\"call-with-chat-composite-chat-button-unread-icon\"\n horizontalAlign=\"center\"\n verticalAlign=\"center\"\n styles={notificationIconContainerStyles(theme)}\n >\n <Stack>{renderNumber(chatMessagesCount)}</Stack>\n </Stack>\n );\n};\n\nconst notificationIconPaddingREM = 0.225;\nconst notificationSizeREM = 1;\n\nconst notificationIconContainerStyles = memoizeFunction(\n (theme: ITheme): IIconStyles => ({\n root: {\n borderRadius: `${notificationSizeREM}rem`, // Create a css circle. This should match the height.\n height: `${notificationSizeREM}rem`,\n minWidth: `${notificationSizeREM}rem`, // use min-width over width as we want to extend the width of the notification icon when contents is more than one character (e.g. 9+)\n background: theme.palette.themePrimary,\n border: `0.0625rem solid white`, // border should always be white\n padding: `${notificationIconPaddingREM}rem`,\n\n // positioning to place the badge within the button appropriately.\n position: 'absolute',\n top: `-${0.5 - notificationIconPaddingREM / 2}rem`,\n left: `${0.5 + notificationIconPaddingREM / 2}rem`\n }\n })\n);\n\nconst notificationTextStyles = memoizeFunction(\n (theme: ITheme): IStackStyles => ({\n root: {\n color: 'white',\n fontSize: theme.fonts.xSmall.fontSize\n }\n })\n);\n"]}
@@ -33,7 +33,7 @@ export const AddPeopleButton = (props) => {
33
33
  return (React.createElement(AddPeopleDropdown, { strings: strings, mobileView: mobileView, inviteLink: inviteLink, onAddParticipant: props.onAddParticipant, alternateCallerId: props.alternateCallerId }));
34
34
  }
35
35
  else {
36
- return (React.createElement(Stack, { tokens: peoplePaneContainerTokens },
36
+ return (React.createElement(Stack, { tokens: peoplePaneContainerTokens, "data-ui-id": "people-pane-content" },
37
37
  React.createElement(AddPeopleDropdown, { strings: strings, mobileView: mobileView, inviteLink: inviteLink, onAddParticipant: props.onAddParticipant, alternateCallerId: props.alternateCallerId }),
38
38
  participantList));
39
39
  }
@@ -46,7 +46,7 @@ export const AddPeopleButton = (props) => {
46
46
  }, styles: copyLinkButtonStylesThemed, onRenderIcon: () => React.createElement(CallWithChatCompositeIcon, { iconName: "Link", style: linkIconStyles }), text: strings.copyInviteLinkButtonLabel })))));
47
47
  }
48
48
  else {
49
- return (React.createElement(Stack, { tokens: peoplePaneContainerTokens },
49
+ return (React.createElement(Stack, { tokens: peoplePaneContainerTokens, "data-ui-id": "people-pane-content" },
50
50
  inviteLink && (React.createElement(Stack, { styles: copyLinkButtonStackStyles },
51
51
  React.createElement(Announcer, { announcementString: copyInviteLinkAnnouncerStrings, ariaLive: 'polite' }),
52
52
  React.createElement(DefaultButton, { text: strings.copyInviteLinkButtonLabel, onRenderIcon: () => React.createElement(CallWithChatCompositeIcon, { iconName: "Link", style: linkIconStyles }), onClick: () => {