@azure/communication-react 1.5.1-alpha-202303310013 → 1.5.1-alpha-202304020014

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 (118) hide show
  1. package/dist/communication-react.d.ts +131 -162
  2. package/dist/dist-cjs/communication-react/index.js +4354 -4178
  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/calling-component-bindings/src/handlers/createCommonHandlers.d.ts +2 -2
  7. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js +6 -4
  8. package/dist/dist-esm/calling-component-bindings/src/handlers/createCommonHandlers.js.map +1 -1
  9. package/dist/dist-esm/react-components/src/components/CameraButton.js +28 -25
  10. package/dist/dist-esm/react-components/src/components/CameraButton.js.map +1 -1
  11. package/dist/dist-esm/react-components/src/components/Caption.d.ts +21 -0
  12. package/dist/dist-esm/react-components/src/components/Caption.js +32 -0
  13. package/dist/dist-esm/react-components/src/components/Caption.js.map +1 -0
  14. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +31 -29
  15. package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
  16. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js +5 -7
  17. package/dist/dist-esm/react-components/src/components/VideoGallery/FloatingLocalVideoLayout.js.map +1 -1
  18. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.d.ts +0 -2
  19. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.js +3 -5
  20. package/dist/dist-esm/react-components/src/components/VideoGallery/styles/VideoGalleryResponsiveVerticalGallery.styles.js.map +1 -1
  21. package/dist/dist-esm/react-components/src/components/VideoGallery.js +1 -2
  22. package/dist/dist-esm/react-components/src/components/VideoGallery.js.map +1 -1
  23. package/dist/dist-esm/react-components/src/components/index.d.ts +1 -0
  24. package/dist/dist-esm/react-components/src/components/index.js +1 -0
  25. package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
  26. package/dist/dist-esm/react-components/src/components/styles/Captions.style.d.ts +21 -0
  27. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js +41 -0
  28. package/dist/dist-esm/react-components/src/components/styles/Captions.style.js.map +1 -0
  29. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +9 -3
  30. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +18 -6
  31. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
  32. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +10 -2
  33. package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
  34. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +79 -14
  35. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
  36. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.d.ts +1 -1
  37. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js.map +1 -1
  38. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.d.ts +9 -3
  39. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.js +3 -1
  40. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.js.map +1 -1
  41. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.d.ts +1 -1
  42. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js.map +1 -1
  43. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.d.ts +1 -1
  44. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.js.map +1 -1
  45. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.d.ts +1 -1
  46. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js.map +1 -1
  47. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Participants.d.ts +1 -1
  48. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Participants.js.map +1 -1
  49. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.d.ts +1 -1
  50. package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js.map +1 -1
  51. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js +4 -4
  52. package/dist/dist-esm/react-composites/src/composites/CallComposite/hooks/useHandlers.js.map +1 -1
  53. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +2 -2
  54. package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
  55. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CallControlOptions.d.ts +5 -87
  56. package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CallControlOptions.js.map +1 -1
  57. package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
  58. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +15 -75
  59. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +5 -5
  60. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
  61. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +4 -2
  62. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +11 -5
  63. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
  64. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +11 -2
  65. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
  66. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +4 -2
  67. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +11 -5
  68. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
  69. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/index.d.ts +1 -1
  70. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/index.js.map +1 -1
  71. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +3 -0
  72. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +6 -2
  73. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
  74. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.d.ts +1 -1
  75. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js +4 -3
  76. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.js.map +1 -1
  77. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.d.ts +30 -0
  78. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +253 -0
  79. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +1 -0
  80. package/dist/dist-esm/react-composites/src/composites/{CallWithChatComposite → common/ControlBar}/CustomButton.d.ts +19 -16
  81. package/dist/dist-esm/react-composites/src/composites/{CallWithChatComposite → common/ControlBar}/CustomButton.js +4 -4
  82. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.js.map +1 -0
  83. package/dist/dist-esm/react-composites/src/composites/{CallWithChatComposite/components → common/ControlBar}/DesktopMoreButton.d.ts +2 -2
  84. package/dist/dist-esm/react-composites/src/composites/{CallWithChatComposite/components → common/ControlBar}/DesktopMoreButton.js +3 -3
  85. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +1 -0
  86. package/dist/dist-esm/react-composites/src/composites/{CallWithChatComposite → common/ControlBar}/PeopleButton.d.ts +1 -1
  87. package/dist/dist-esm/react-composites/src/composites/{CallWithChatComposite → common/ControlBar}/PeopleButton.js +3 -3
  88. package/dist/dist-esm/react-composites/src/composites/common/ControlBar/PeopleButton.js.map +1 -0
  89. package/dist/dist-esm/react-composites/src/composites/{CallWithChatComposite/components → common/Drawer}/MoreDrawer.d.ts +2 -2
  90. package/dist/dist-esm/react-composites/src/composites/{CallWithChatComposite/components → common/Drawer}/MoreDrawer.js +4 -5
  91. package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +1 -0
  92. package/dist/dist-esm/react-composites/src/composites/{CallWithChatComposite → common/Drawer}/PreparedMoreDrawer.d.ts +2 -2
  93. package/dist/dist-esm/react-composites/src/composites/{CallWithChatComposite → common/Drawer}/PreparedMoreDrawer.js +5 -5
  94. package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.js.map +1 -0
  95. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +48 -21
  96. package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
  97. package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +2 -1
  98. package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
  99. package/dist/dist-esm/react-composites/src/composites/common/styles/Composite.styles.d.ts +7 -0
  100. package/dist/dist-esm/react-composites/src/composites/common/styles/Composite.styles.js +9 -0
  101. package/dist/dist-esm/react-composites/src/composites/common/styles/Composite.styles.js.map +1 -0
  102. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.d.ts +165 -0
  103. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.js +4 -0
  104. package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.js.map +1 -0
  105. package/dist/dist-esm/react-composites/src/composites/index.d.ts +3 -0
  106. package/dist/dist-esm/react-composites/src/composites/index.js.map +1 -1
  107. package/package.json +8 -8
  108. package/dist/dist-esm/react-components/src/components/styles/CaptionsBanner.style.d.ts +0 -13
  109. package/dist/dist-esm/react-components/src/components/styles/CaptionsBanner.style.js +0 -35
  110. package/dist/dist-esm/react-components/src/components/styles/CaptionsBanner.style.js.map +0 -1
  111. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.d.ts +0 -28
  112. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js +0 -194
  113. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js.map +0 -1
  114. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.js.map +0 -1
  115. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/PeopleButton.js.map +0 -1
  116. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/PreparedMoreDrawer.js.map +0 -1
  117. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/DesktopMoreButton.js.map +0 -1
  118. package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js.map +0 -1
@@ -2,6 +2,7 @@ import { CommunicationIdentifierKind } from '@azure/communication-common';
2
2
  import { CallState, DeviceManagerState } from "../../../../../calling-stateful-client/src";
3
3
  import { ChatThreadClientState } from "../../../../../chat-stateful-client/src";
4
4
  import { CallAdapter, CallAdapterState, CallCompositePage } from '../../CallComposite';
5
+ import { VideoBackgroundImage } from '../../CallComposite';
5
6
  import { ChatAdapter, ChatAdapterState } from '../../ChatComposite';
6
7
  import { FileUploadsUiState } from '../../ChatComposite';
7
8
  import { AdapterErrors } from '../../common/adapters';
@@ -67,6 +68,8 @@ export interface CallWithChatClientState {
67
68
  alternateCallerId?: string | undefined;
68
69
  /** Environment information for system adapter is made on */
69
70
  environmentInfo?: EnvironmentInfo;
71
+ /** Default set of background images for background replacement effect */
72
+ videoBackgroundImages?: VideoBackgroundImage[];
70
73
  }
71
74
  /**
72
75
  * CallWithChat State is a combination of Stateful Chat and Stateful Calling clients with some
@@ -22,7 +22,9 @@ export function callWithChatAdapterStateFromBackingStates(callAdapter, chatAdapt
22
22
  /* @conditional-compile-remove(PSTN-calls) */
23
23
  alternateCallerId: callAdapterState.alternateCallerId,
24
24
  /* @conditional-compile-remove(unsupported-browser) */
25
- environmentInfo: callAdapterState.environmentInfo
25
+ environmentInfo: callAdapterState.environmentInfo,
26
+ /* @conditional-compile-remove(video-background-effects) */
27
+ videoBackgroundImages: callAdapterState.videoBackgroundImages
26
28
  };
27
29
  }
28
30
  /**
@@ -37,6 +39,8 @@ export function mergeChatAdapterStateIntoCallWithChatAdapterState(existingCallWi
37
39
  * @private
38
40
  */
39
41
  export function mergeCallAdapterStateIntoCallWithChatAdapterState(existingCallWithChatAdapterState, callAdapterState) {
40
- return Object.assign(Object.assign({}, existingCallWithChatAdapterState), { userId: callAdapterState.userId, page: callAdapterState.page, displayName: callAdapterState.displayName, devices: callAdapterState.devices, call: callAdapterState.call, isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled, isTeamsCall: callAdapterState.isTeamsCall, latestCallErrors: callAdapterState.latestErrors });
42
+ return Object.assign(Object.assign({}, existingCallWithChatAdapterState), { userId: callAdapterState.userId, page: callAdapterState.page, displayName: callAdapterState.displayName, devices: callAdapterState.devices, call: callAdapterState.call, isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled, isTeamsCall: callAdapterState.isTeamsCall, latestCallErrors: callAdapterState.latestErrors,
43
+ /* @conditional-compile-remove(video-background-effects) */
44
+ videoBackgroundImages: callAdapterState.videoBackgroundImages });
41
45
  }
42
46
  //# sourceMappingURL=CallWithChatAdapterState.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CallWithChatAdapterState.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAyFlC;;GAEG;AACH,MAAM,UAAU,yCAAyC,CACvD,WAAwB,EACxB,WAAwB;IAExB,MAAM,gBAAgB,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;IAChD,MAAM,gBAAgB,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;IAEhD,OAAO;QACL,IAAI,EAAE,gBAAgB,CAAC,IAAI;QAC3B,IAAI,EAAE,gBAAgB,CAAC,MAAM;QAC7B,MAAM,EAAE,gBAAgB,CAAC,MAAM;QAC/B,IAAI,EAAE,gBAAgB,CAAC,IAAI;QAC3B,WAAW,EAAE,gBAAgB,CAAC,WAAW;QACzC,OAAO,EAAE,gBAAgB,CAAC,OAAO;QACjC,+BAA+B,EAAE,gBAAgB,CAAC,+BAA+B;QACjF,WAAW,EAAE,gBAAgB,CAAC,WAAW;QACzC,gBAAgB,EAAE,gBAAgB,CAAC,YAAY;QAC/C,gBAAgB,EAAE,gBAAgB,CAAC,YAAY;QAC/C,+CAA+C;QAC/C,WAAW,EAAE,gBAAgB,CAAC,WAAW;QACzC,6CAA6C;QAC7C,iBAAiB,EAAE,gBAAgB,CAAC,iBAAiB;QACrD,sDAAsD;QACtD,eAAe,EAAE,gBAAgB,CAAC,eAAe;KAClD,CAAC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iDAAiD,CAC/D,gCAA0D,EAC1D,gBAAkC;IAElC,uCACK,gCAAgC,KACnC,IAAI,EAAE,gBAAgB,CAAC,MAAM,EAC7B,gBAAgB,EAAE,gBAAgB,CAAC,YAAY;QAC/C,+CAA+C;QAC/C,WAAW,EAAE,gBAAgB,CAAC,WAAW,IACzC;AACJ,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,iDAAiD,CAC/D,gCAA0D,EAC1D,gBAAkC;IAElC,uCACK,gCAAgC,KACnC,MAAM,EAAE,gBAAgB,CAAC,MAAM,EAC/B,IAAI,EAAE,gBAAgB,CAAC,IAAI,EAC3B,WAAW,EAAE,gBAAgB,CAAC,WAAW,EACzC,OAAO,EAAE,gBAAgB,CAAC,OAAO,EACjC,IAAI,EAAE,gBAAgB,CAAC,IAAI,EAC3B,+BAA+B,EAAE,gBAAgB,CAAC,+BAA+B,EACjF,WAAW,EAAE,gBAAgB,CAAC,WAAW,EACzC,gBAAgB,EAAE,gBAAgB,CAAC,YAAY,IAC/C;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CommunicationIdentifierKind } from '@azure/communication-common';\nimport { CallState, DeviceManagerState } from '@internal/calling-stateful-client';\nimport { ChatThreadClientState } from '@internal/chat-stateful-client';\nimport { CallAdapter, CallAdapterState, CallCompositePage } from '../../CallComposite';\nimport { ChatAdapter, ChatAdapterState } from '../../ChatComposite';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileUploadsUiState } from '../../ChatComposite';\nimport { AdapterErrors } from '../../common/adapters';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\n\n/**\n * UI state pertaining to the {@link CallWithChatComposite}.\n *\n * @public\n */\nexport interface CallWithChatAdapterUiState {\n /**\n * Microphone state before a call has joined.\n *\n * @public\n */\n isLocalPreviewMicrophoneEnabled: boolean;\n /**\n * Current page of the Composite.\n *\n * @public\n */\n page: CallCompositePage;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Files being uploaded by a user in the current thread.\n * Should be set to null once the upload is complete.\n * Array of type {@link FileUploadsUiState}\n *\n * @beta\n */\n fileUploads?: FileUploadsUiState;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * State to track whether the end user has opted in to using a\n * out of date version of a supported browser. Allows the user\n * to start a call in this state.\n *\n * @beta\n */\n unsupportedBrowserVersionsAllowed?: boolean;\n}\n\n/**\n * State from the backend services that drives {@link CallWithChatComposite}.\n *\n * @public\n */\nexport interface CallWithChatClientState {\n /** ID of the call participant using this CallWithChatAdapter. */\n userId: CommunicationIdentifierKind;\n /** Display name of the participant using this CallWithChatAdapter. */\n displayName: string | undefined;\n /** State of the current call. */\n call?: CallState;\n /** State of the current chat. */\n chat?: ChatThreadClientState;\n /** Latest call error encountered for each operation performed via the adapter. */\n latestCallErrors: AdapterErrors;\n /** Latest chat error encountered for each operation performed via the adapter. */\n latestChatErrors: AdapterErrors;\n /** State of available and currently selected devices */\n devices: DeviceManagerState;\n /** State of whether the active call is a Teams interop call */\n isTeamsCall: boolean;\n /* @conditional-compile-remove(PSTN-calls) */\n /** alternateCallerId for PSTN call */\n alternateCallerId?: string | undefined;\n /* @conditional-compile-remove(unsupported-browser) */\n /** Environment information for system adapter is made on */\n environmentInfo?: EnvironmentInfo;\n}\n\n/**\n * CallWithChat State is a combination of Stateful Chat and Stateful Calling clients with some\n * state specific to the CallWithChat Composite only.\n *\n * @public\n */\nexport interface CallWithChatAdapterState extends CallWithChatAdapterUiState, CallWithChatClientState {}\n\n/**\n * @private\n */\nexport function callWithChatAdapterStateFromBackingStates(\n callAdapter: CallAdapter,\n chatAdapter: ChatAdapter\n): CallWithChatAdapterState {\n const callAdapterState = callAdapter.getState();\n const chatAdapterState = chatAdapter.getState();\n\n return {\n call: callAdapterState.call,\n chat: chatAdapterState.thread,\n userId: callAdapterState.userId,\n page: callAdapterState.page,\n displayName: callAdapterState.displayName,\n devices: callAdapterState.devices,\n isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled,\n isTeamsCall: callAdapterState.isTeamsCall,\n latestCallErrors: callAdapterState.latestErrors,\n latestChatErrors: chatAdapterState.latestErrors,\n /* @conditional-compile-remove(file-sharing) */\n fileUploads: chatAdapterState.fileUploads,\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId: callAdapterState.alternateCallerId,\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo: callAdapterState.environmentInfo\n };\n}\n\n/**\n * @private\n */\nexport function mergeChatAdapterStateIntoCallWithChatAdapterState(\n existingCallWithChatAdapterState: CallWithChatAdapterState,\n chatAdapterState: ChatAdapterState\n): CallWithChatAdapterState {\n return {\n ...existingCallWithChatAdapterState,\n chat: chatAdapterState.thread,\n latestChatErrors: chatAdapterState.latestErrors,\n /* @conditional-compile-remove(file-sharing) */\n fileUploads: chatAdapterState.fileUploads\n };\n}\n\n/**\n * @private\n */\nexport function mergeCallAdapterStateIntoCallWithChatAdapterState(\n existingCallWithChatAdapterState: CallWithChatAdapterState,\n callAdapterState: CallAdapterState\n): CallWithChatAdapterState {\n return {\n ...existingCallWithChatAdapterState,\n userId: callAdapterState.userId,\n page: callAdapterState.page,\n displayName: callAdapterState.displayName,\n devices: callAdapterState.devices,\n call: callAdapterState.call,\n isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled,\n isTeamsCall: callAdapterState.isTeamsCall,\n latestCallErrors: callAdapterState.latestErrors\n };\n}\n\"../../../../../calling-stateful-client/src\"\"../../../../../chat-stateful-client/src\""]}
1
+ {"version":3,"file":"CallWithChatAdapterState.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA8FlC;;GAEG;AACH,MAAM,UAAU,yCAAyC,CACvD,WAAwB,EACxB,WAAwB;IAExB,MAAM,gBAAgB,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;IAChD,MAAM,gBAAgB,GAAG,WAAW,CAAC,QAAQ,EAAE,CAAC;IAEhD,OAAO;QACL,IAAI,EAAE,gBAAgB,CAAC,IAAI;QAC3B,IAAI,EAAE,gBAAgB,CAAC,MAAM;QAC7B,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;QAC3D,qBAAqB,EAAE,gBAAgB,CAAC,qBAAqB,IAC7D;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { CommunicationIdentifierKind } from '@azure/communication-common';\nimport { CallState, DeviceManagerState } from '@internal/calling-stateful-client';\nimport { ChatThreadClientState } from '@internal/chat-stateful-client';\nimport { CallAdapter, CallAdapterState, CallCompositePage } from '../../CallComposite';\n/* @conditional-compile-remove(video-background-effects) */\nimport { VideoBackgroundImage } from '../../CallComposite';\nimport { ChatAdapter, ChatAdapterState } from '../../ChatComposite';\n/* @conditional-compile-remove(file-sharing) */\nimport { FileUploadsUiState } from '../../ChatComposite';\nimport { AdapterErrors } from '../../common/adapters';\n/* @conditional-compile-remove(unsupported-browser) */\nimport { EnvironmentInfo } from '@azure/communication-calling';\n\n/**\n * UI state pertaining to the {@link CallWithChatComposite}.\n *\n * @public\n */\nexport interface CallWithChatAdapterUiState {\n /**\n * Microphone state before a call has joined.\n *\n * @public\n */\n isLocalPreviewMicrophoneEnabled: boolean;\n /**\n * Current page of the Composite.\n *\n * @public\n */\n page: CallCompositePage;\n /* @conditional-compile-remove(file-sharing) */\n /**\n * Files being uploaded by a user in the current thread.\n * Should be set to null once the upload is complete.\n * Array of type {@link FileUploadsUiState}\n *\n * @beta\n */\n fileUploads?: FileUploadsUiState;\n /* @conditional-compile-remove(unsupported-browser) */\n /**\n * State to track whether the end user has opted in to using a\n * out of date version of a supported browser. Allows the user\n * to start a call in this state.\n *\n * @beta\n */\n unsupportedBrowserVersionsAllowed?: boolean;\n}\n\n/**\n * State from the backend services that drives {@link CallWithChatComposite}.\n *\n * @public\n */\nexport interface CallWithChatClientState {\n /** ID of the call participant using this CallWithChatAdapter. */\n userId: CommunicationIdentifierKind;\n /** Display name of the participant using this CallWithChatAdapter. */\n displayName: string | undefined;\n /** State of the current call. */\n call?: CallState;\n /** State of the current chat. */\n chat?: ChatThreadClientState;\n /** Latest call error encountered for each operation performed via the adapter. */\n latestCallErrors: AdapterErrors;\n /** Latest chat error encountered for each operation performed via the adapter. */\n latestChatErrors: AdapterErrors;\n /** State of available and currently selected devices */\n devices: DeviceManagerState;\n /** State of whether the active call is a Teams interop call */\n isTeamsCall: boolean;\n /* @conditional-compile-remove(PSTN-calls) */\n /** alternateCallerId for PSTN call */\n alternateCallerId?: string | undefined;\n /* @conditional-compile-remove(unsupported-browser) */\n /** Environment information for system adapter is made on */\n environmentInfo?: EnvironmentInfo;\n /* @conditional-compile-remove(video-background-effects) */\n /** Default set of background images for background replacement effect */\n videoBackgroundImages?: VideoBackgroundImage[];\n}\n\n/**\n * CallWithChat State is a combination of Stateful Chat and Stateful Calling clients with some\n * state specific to the CallWithChat Composite only.\n *\n * @public\n */\nexport interface CallWithChatAdapterState extends CallWithChatAdapterUiState, CallWithChatClientState {}\n\n/**\n * @private\n */\nexport function callWithChatAdapterStateFromBackingStates(\n callAdapter: CallAdapter,\n chatAdapter: ChatAdapter\n): CallWithChatAdapterState {\n const callAdapterState = callAdapter.getState();\n const chatAdapterState = chatAdapter.getState();\n\n return {\n call: callAdapterState.call,\n chat: chatAdapterState.thread,\n userId: callAdapterState.userId,\n page: callAdapterState.page,\n displayName: callAdapterState.displayName,\n devices: callAdapterState.devices,\n isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled,\n isTeamsCall: callAdapterState.isTeamsCall,\n latestCallErrors: callAdapterState.latestErrors,\n latestChatErrors: chatAdapterState.latestErrors,\n /* @conditional-compile-remove(file-sharing) */\n fileUploads: chatAdapterState.fileUploads,\n /* @conditional-compile-remove(PSTN-calls) */\n alternateCallerId: callAdapterState.alternateCallerId,\n /* @conditional-compile-remove(unsupported-browser) */\n environmentInfo: callAdapterState.environmentInfo,\n /* @conditional-compile-remove(video-background-effects) */\n videoBackgroundImages: callAdapterState.videoBackgroundImages\n };\n}\n\n/**\n * @private\n */\nexport function mergeChatAdapterStateIntoCallWithChatAdapterState(\n existingCallWithChatAdapterState: CallWithChatAdapterState,\n chatAdapterState: ChatAdapterState\n): CallWithChatAdapterState {\n return {\n ...existingCallWithChatAdapterState,\n chat: chatAdapterState.thread,\n latestChatErrors: chatAdapterState.latestErrors,\n /* @conditional-compile-remove(file-sharing) */\n fileUploads: chatAdapterState.fileUploads\n };\n}\n\n/**\n * @private\n */\nexport function mergeCallAdapterStateIntoCallWithChatAdapterState(\n existingCallWithChatAdapterState: CallWithChatAdapterState,\n callAdapterState: CallAdapterState\n): CallWithChatAdapterState {\n return {\n ...existingCallWithChatAdapterState,\n userId: callAdapterState.userId,\n page: callAdapterState.page,\n displayName: callAdapterState.displayName,\n devices: callAdapterState.devices,\n call: callAdapterState.call,\n isLocalPreviewMicrophoneEnabled: callAdapterState.isLocalPreviewMicrophoneEnabled,\n isTeamsCall: callAdapterState.isTeamsCall,\n latestCallErrors: callAdapterState.latestErrors,\n /* @conditional-compile-remove(video-background-effects) */\n videoBackgroundImages: callAdapterState.videoBackgroundImages\n };\n}\n\"../../../../../calling-stateful-client/src\"\"../../../../../chat-stateful-client/src\""]}
@@ -4,7 +4,7 @@ import { IStackStyles } from '@fluentui/react';
4
4
  */
5
5
  export declare const compositeOuterContainerStyles: IStackStyles;
6
6
  /** @private */
7
- export declare const callCompositeContainerStyles: IStackStyles;
7
+ export declare const callCompositeContainerStyles: (isMobile: boolean) => IStackStyles;
8
8
  /** @private */
9
9
  export declare const controlBarContainerStyles: IStackStyles;
10
10
  /**
@@ -1,5 +1,6 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT license.
3
+ import { compositeMinWidthRem } from '../../common/styles/Composite.styles';
3
4
  /**
4
5
  * @private
5
6
  */
@@ -11,15 +12,15 @@ export const compositeOuterContainerStyles = {
11
12
  }
12
13
  };
13
14
  /** @private */
14
- export const callCompositeContainerStyles = {
15
+ export const callCompositeContainerStyles = (isMobile) => ({
15
16
  root: {
16
17
  // Start a new stacking context so that any `position:absolute` elements
17
18
  // inside the call composite do not compete with its siblings.
18
19
  position: 'relative',
19
20
  width: '100%',
20
- minWidth: 0
21
+ minWidth: isMobile ? 'unset' : `${compositeMinWidthRem}rem`
21
22
  }
22
- };
23
+ });
23
24
  /** @private */
24
25
  export const controlBarContainerStyles = {
25
26
  root: {
@@ -1 +1 @@
1
- {"version":3,"file":"CallWithChatCompositeStyles.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAiB;IACzD,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QAEb,iFAAiF;QACjF,QAAQ,EAAE,UAAU;KACrB;CACF,CAAC;AAEF,eAAe;AACf,MAAM,CAAC,MAAM,4BAA4B,GAAiB;IACxD,IAAI,EAAE;QACJ,wEAAwE;QACxE,8DAA8D;QAC9D,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,CAAC;KACZ;CACF,CAAC;AAEF,eAAe;AACf,MAAM,CAAC,MAAM,yBAAyB,GAAiB;IACrD,IAAI,EAAE;QACJ,wEAAwE;QACxE,2DAA2D;QAC3D,QAAQ,EAAE,UAAU;KACrB;CACF,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAiB;IACrD,IAAI,EAAE;QACJ,QAAQ,EAAE,UAAU;KACrB;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { IStackStyles } from '@fluentui/react';\n\n/**\n * @private\n */\nexport const compositeOuterContainerStyles: IStackStyles = {\n root: {\n width: '100%',\n\n // Create a new stacking context so that DrawerMenu can be positioned absolutely.\n position: 'relative'\n }\n};\n\n/** @private */\nexport const callCompositeContainerStyles: IStackStyles = {\n root: {\n // Start a new stacking context so that any `position:absolute` elements\n // inside the call composite do not compete with its siblings.\n position: 'relative',\n width: '100%',\n minWidth: 0\n }\n};\n\n/** @private */\nexport const controlBarContainerStyles: IStackStyles = {\n root: {\n // Start a new stacking context so that any `position:absolute` elements\n // inside the control bar do not compete with its siblings.\n position: 'relative'\n }\n};\n\n/**\n * Chat button might have a optional notification icon attached that must be positioned absolute inside the chat button.\n * this requires the parent to have `position relative`\n * @private\n */\nexport const ChatButtonContainerStyles: IStackStyles = {\n root: {\n position: 'relative'\n }\n};\n"]}
1
+ {"version":3,"file":"CallWithChatCompositeStyles.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/CallWithChatComposite/styles/CallWithChatCompositeStyles.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAE5E;;GAEG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAiB;IACzD,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM;QAEb,iFAAiF;QACjF,QAAQ,EAAE,UAAU;KACrB;CACF,CAAC;AAEF,eAAe;AACf,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,QAAiB,EAAgB,EAAE,CAAC,CAAC;IAChF,IAAI,EAAE;QACJ,wEAAwE;QACxE,8DAA8D;QAC9D,QAAQ,EAAE,UAAU;QACpB,KAAK,EAAE,MAAM;QACb,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,oBAAoB,KAAK;KAC5D;CACF,CAAC,CAAC;AAEH,eAAe;AACf,MAAM,CAAC,MAAM,yBAAyB,GAAiB;IACrD,IAAI,EAAE;QACJ,wEAAwE;QACxE,2DAA2D;QAC3D,QAAQ,EAAE,UAAU;KACrB;CACF,CAAC;AAEF;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAiB;IACrD,IAAI,EAAE;QACJ,QAAQ,EAAE,UAAU;KACrB;CACF,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { IStackStyles } from '@fluentui/react';\nimport { compositeMinWidthRem } from '../../common/styles/Composite.styles';\n\n/**\n * @private\n */\nexport const compositeOuterContainerStyles: IStackStyles = {\n root: {\n width: '100%',\n\n // Create a new stacking context so that DrawerMenu can be positioned absolutely.\n position: 'relative'\n }\n};\n\n/** @private */\nexport const callCompositeContainerStyles = (isMobile: boolean): IStackStyles => ({\n root: {\n // Start a new stacking context so that any `position:absolute` elements\n // inside the call composite do not compete with its siblings.\n position: 'relative',\n width: '100%',\n minWidth: isMobile ? 'unset' : `${compositeMinWidthRem}rem`\n }\n});\n\n/** @private */\nexport const controlBarContainerStyles: IStackStyles = {\n root: {\n // Start a new stacking context so that any `position:absolute` elements\n // inside the control bar do not compete with its siblings.\n position: 'relative'\n }\n};\n\n/**\n * Chat button might have a optional notification icon attached that must be positioned absolute inside the chat button.\n * this requires the parent to have `position relative`\n * @private\n */\nexport const ChatButtonContainerStyles: IStackStyles = {\n root: {\n position: 'relative'\n }\n};\n"]}
@@ -0,0 +1,30 @@
1
+ /// <reference types="react" />
2
+ import { CallAdapter } from '../../CallComposite';
3
+ import { ChatAdapter } from '../../ChatComposite';
4
+ import { ContainerRectProps } from '../ContainerRectProps';
5
+ import { CallWithChatControlOptions } from '../../CallWithChatComposite';
6
+ import { CommonCallControlOptions } from '../types/CommonCallControlOptions';
7
+ /**
8
+ * @private
9
+ */
10
+ export interface CommonCallControlBarProps {
11
+ callAdapter: CallAdapter;
12
+ chatButtonChecked?: boolean;
13
+ peopleButtonChecked: boolean;
14
+ onChatButtonClicked?: () => void;
15
+ onPeopleButtonClicked: () => void;
16
+ onMoreButtonClicked?: () => void;
17
+ mobileView: boolean;
18
+ disableButtonsForLobbyPage: boolean;
19
+ callControls?: boolean | CommonCallControlOptions | CallWithChatControlOptions;
20
+ chatAdapter?: ChatAdapter;
21
+ disableButtonsForHoldScreen?: boolean;
22
+ onClickShowDialpad?: () => void;
23
+ onShowVideoEffectsPicker?: (showVideoEffectsOptions: boolean) => void;
24
+ rtl?: boolean;
25
+ }
26
+ /**
27
+ * @private
28
+ */
29
+ export declare const CommonCallControlBar: (props: CommonCallControlBarProps & ContainerRectProps) => JSX.Element;
30
+ //# sourceMappingURL=CommonCallControlBar.d.ts.map
@@ -0,0 +1,253 @@
1
+ // Copyright (c) Microsoft Corporation.
2
+ // Licensed under the MIT license.
3
+ import React, { useMemo, useRef, useEffect, useState, useCallback } from 'react';
4
+ import { CallAdapterProvider } from '../../CallComposite/adapter/CallAdapterProvider';
5
+ import { PeopleButton } from './PeopleButton';
6
+ import { concatStyleSets, mergeStyles, mergeStyleSets, Stack, useTheme } from '@fluentui/react';
7
+ import { controlBarContainerStyles } from '../../CallComposite/styles/CallControls.styles';
8
+ import { callControlsContainerStyles } from '../../CallComposite/styles/CallPage.styles';
9
+ import { useCallWithChatCompositeStrings } from '../../CallWithChatComposite/hooks/useCallWithChatCompositeStrings';
10
+ import { ChatButtonWithUnreadMessagesBadge } from '../../CallWithChatComposite/ChatButtonWithUnreadMessagesBadge';
11
+ import { ControlBar } from "../../../../../react-components/src";
12
+ import { Microphone } from '../../CallComposite/components/buttons/Microphone';
13
+ import { Camera } from '../../CallComposite/components/buttons/Camera';
14
+ import { ScreenShare } from '../../CallComposite/components/buttons/ScreenShare';
15
+ import { EndCall } from '../../CallComposite/components/buttons/EndCall';
16
+ import { MoreButton } from '../MoreButton';
17
+ /* @conditional-compile-remove(control-bar-button-injection) */
18
+ import { CUSTOM_BUTTON_OPTIONS, generateCustomCallControlBarButton, onFetchCustomButtonPropsTrampoline } from './CustomButton';
19
+ /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
20
+ import { DesktopMoreButton } from './DesktopMoreButton';
21
+ import { isDisabled } from '../../CallComposite/utils';
22
+ import { HiddenFocusStartPoint } from '../HiddenFocusStartPoint';
23
+ const inferCommonCallControlOptions = (mobileView, commonCallControlOptions) => {
24
+ if (commonCallControlOptions === false) {
25
+ return false;
26
+ }
27
+ const options = commonCallControlOptions === true || commonCallControlOptions === undefined ? {} : commonCallControlOptions;
28
+ if (mobileView) {
29
+ // Set to compressed mode when composite is optimized for mobile
30
+ options.displayType = 'compact';
31
+ // Do not show screen share button when composite is optimized for mobile unless the developer
32
+ // has explicitly opted in.
33
+ if (options.screenShareButton !== true) {
34
+ options.screenShareButton = false;
35
+ }
36
+ }
37
+ return options;
38
+ };
39
+ /**
40
+ * @private
41
+ */
42
+ export const CommonCallControlBar = (props) => {
43
+ var _a, _b, _c;
44
+ const theme = useTheme();
45
+ const controlBarContainerRef = useRef(null);
46
+ const sidepaneControlsRef = useRef(null);
47
+ const controlBarSizeRef = useRef(null);
48
+ const [controlBarButtonsWidth, setControlBarButtonsWidth] = useState(0);
49
+ const [panelsButtonsWidth, setPanelsButtonsWidth] = useState(0);
50
+ const [controlBarContainerWidth, setControlBarContainerWidth] = useState(0);
51
+ const [totalButtonsWidth, setTotalButtonsWidth] = useState(0);
52
+ const [isOutOfSpace, setIsOutOfSpace] = useState(false);
53
+ const callWithChatStrings = useCallWithChatCompositeStrings();
54
+ const options = inferCommonCallControlOptions(props.mobileView, props.callControls);
55
+ const handleResize = useCallback(() => {
56
+ setControlBarButtonsWidth(controlBarContainerRef.current ? controlBarContainerRef.current.offsetWidth : 0);
57
+ setPanelsButtonsWidth(sidepaneControlsRef.current ? sidepaneControlsRef.current.offsetWidth : 0);
58
+ setControlBarContainerWidth(controlBarSizeRef.current ? controlBarSizeRef.current.offsetWidth : 0);
59
+ }, []);
60
+ // on load set inital width
61
+ useEffect(() => {
62
+ setControlBarButtonsWidth(controlBarContainerRef.current ? controlBarContainerRef.current.offsetWidth : 0);
63
+ setPanelsButtonsWidth(sidepaneControlsRef.current ? sidepaneControlsRef.current.offsetWidth : 0);
64
+ setControlBarContainerWidth(controlBarSizeRef.current ? controlBarSizeRef.current.offsetWidth : 0);
65
+ }, []);
66
+ // get the current width of control bar buttons and panel control buttons when browser size change
67
+ useEffect(() => {
68
+ window.addEventListener('resize', handleResize);
69
+ return () => window.removeEventListener('resize', handleResize);
70
+ }, [handleResize]);
71
+ /* when size change, reset total buttons width and compare with the control bar container width
72
+ if the total width of those buttons exceed container width, do not center the control bar buttons based on parent container width
73
+ Instead let them take up the remaining white space on the left */
74
+ useEffect(() => {
75
+ // white space on the left when control bar buttons are centered based on container width + control bar buttons width + panel control buttons width
76
+ setTotalButtonsWidth((controlBarContainerWidth - controlBarButtonsWidth) / 2 + controlBarButtonsWidth + panelsButtonsWidth);
77
+ }, [controlBarButtonsWidth, panelsButtonsWidth, controlBarContainerWidth]);
78
+ useEffect(() => {
79
+ setIsOutOfSpace(totalButtonsWidth > controlBarContainerWidth);
80
+ }, [totalButtonsWidth, controlBarContainerWidth]);
81
+ const chatButtonStrings = useMemo(() => ({
82
+ label: callWithChatStrings.chatButtonLabel,
83
+ tooltipOffContent: callWithChatStrings.chatButtonTooltipOpen,
84
+ tooltipOnContent: callWithChatStrings.chatButtonTooltipClose
85
+ }), [callWithChatStrings]);
86
+ const peopleButtonStrings = useMemo(() => ({
87
+ label: callWithChatStrings.peopleButtonLabel,
88
+ tooltipOffContent: callWithChatStrings.peopleButtonTooltipOpen,
89
+ tooltipOnContent: callWithChatStrings.peopleButtonTooltipClose
90
+ }), [callWithChatStrings]);
91
+ const moreButtonStrings = useMemo(() => ({
92
+ label: callWithChatStrings.moreDrawerButtonLabel,
93
+ tooltipContent: callWithChatStrings.moreDrawerButtonTooltip
94
+ }), [callWithChatStrings]);
95
+ const centerContainerStyles = useMemo(() => {
96
+ const styles = !props.mobileView ? desktopControlBarStyles : {};
97
+ return mergeStyleSets(styles, {
98
+ root: {
99
+ // Enforce a background color on control bar to ensure it matches the composite background color.
100
+ background: theme.semanticColors.bodyBackground
101
+ }
102
+ });
103
+ }, [props.mobileView, theme.semanticColors.bodyBackground]);
104
+ const screenShareButtonStyles = useMemo(() => (!props.mobileView ? getDesktopScreenShareButtonStyles(theme) : undefined), [props.mobileView, theme]);
105
+ const commonButtonStyles = useMemo(() => (!props.mobileView ? getDesktopCommonButtonStyles(theme) : undefined), [props.mobileView, theme]);
106
+ const endCallButtonStyles = useMemo(() => (!props.mobileView ? getDesktopEndCallButtonStyles(theme) : undefined), [props.mobileView, theme]);
107
+ const controlBarWrapperDesktopStyles = useMemo(
108
+ // only center control bar buttons based on parent container if there are enough space on the screen and not mobile
109
+ () => (!props.mobileView && !isOutOfSpace ? (props.rtl ? wrapperDesktopRtlStyles : wrapperDesktopStyles) : {}), [props.mobileView, props.rtl, isOutOfSpace]);
110
+ // only center control bar buttons based on parent container if there are enough space on the screen and not mobile
111
+ const controlBarDesktopContainerStyles = useMemo(() => (!props.mobileView && !isOutOfSpace ? { position: 'relative' } : {}), [props.mobileView, isOutOfSpace]);
112
+ /* @conditional-compile-remove(control-bar-button-injection) */
113
+ const customButtons = useMemo(() => generateCustomCallControlBarButton(onFetchCustomButtonPropsTrampoline(options !== false ? options : undefined), options !== false ? options === null || options === void 0 ? void 0 : options.displayType : undefined), [options]);
114
+ // when options is false then we want to hide the whole control bar.
115
+ if (options === false) {
116
+ return React.createElement(React.Fragment, null);
117
+ }
118
+ const chatButton = props.chatAdapter ? (React.createElement(ChatButtonWithUnreadMessagesBadge, { chatAdapter: props.chatAdapter, checked: props.chatButtonChecked, showLabel: options.displayType !== 'compact', isChatPaneVisible: (_a = props.chatButtonChecked) !== null && _a !== void 0 ? _a : false, onClick: props.onChatButtonClicked, disabled: props.disableButtonsForLobbyPage || isDisabled(options.chatButton), strings: chatButtonStrings, styles: commonButtonStyles, newMessageLabel: callWithChatStrings.chatButtonNewMessageNotificationLabel })) : (React.createElement(React.Fragment, null));
119
+ return (React.createElement("div", { ref: controlBarSizeRef },
120
+ React.createElement(Stack, { horizontal: true, reversed: !props.mobileView && !isOutOfSpace, horizontalAlign: "space-between", className: mergeStyles(callControlsContainerStyles, controlBarContainerStyles, controlBarDesktopContainerStyles) },
121
+ React.createElement(Stack.Item, { grow: true, className: mergeStyles(controlBarWrapperDesktopStyles) },
122
+ React.createElement(CallAdapterProvider, { adapter: props.callAdapter },
123
+ React.createElement(Stack, { horizontalAlign: "center" },
124
+ React.createElement(HiddenFocusStartPoint, null),
125
+ React.createElement(Stack.Item, null,
126
+ React.createElement("div", { ref: controlBarContainerRef },
127
+ React.createElement(ControlBar, { layout: "horizontal", styles: centerContainerStyles },
128
+ isEnabled(options.microphoneButton) && (React.createElement(Microphone, { displayType: options.displayType, styles: commonButtonStyles, splitButtonsForDeviceSelection: !props.mobileView,
129
+ /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
130
+ disabled: props.disableButtonsForHoldScreen || isDisabled(options.microphoneButton) })),
131
+ isEnabled(options.cameraButton) && (React.createElement(Camera, { displayType: options.displayType, styles: commonButtonStyles, splitButtonsForDeviceSelection: !props.mobileView,
132
+ /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
133
+ disabled: props.disableButtonsForHoldScreen || isDisabled(options.cameraButton),
134
+ /* @conditional-compile-remove(video-background-effects) */
135
+ onShowVideoEffectsPicker: props.onShowVideoEffectsPicker })),
136
+ props.mobileView && isEnabled(options === null || options === void 0 ? void 0 : options.chatButton) && chatButton,
137
+ isEnabled(options.screenShareButton) && (React.createElement(ScreenShare, { option: options.screenShareButton, displayType: options.displayType, styles: screenShareButtonStyles,
138
+ /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */
139
+ disabled: props.disableButtonsForHoldScreen || isDisabled(options.screenShareButton) })),
140
+ /* @conditional-compile-remove(control-bar-button-injection) */
141
+ (_b = customButtons['primary']) === null || _b === void 0 ? void 0 :
142
+ _b.slice(0, props.mobileView
143
+ ? CUSTOM_BUTTON_OPTIONS.MAX_PRIMARY_MOBILE_CUSTOM_BUTTONS
144
+ : CUSTOM_BUTTON_OPTIONS.MAX_PRIMARY_DESKTOP_CUSTOM_BUTTONS).map((CustomButton, i) => {
145
+ return (React.createElement(CustomButton, { key: `primary-custom-button-${i}`, styles: commonButtonStyles, showLabel: options.displayType !== 'compact' }));
146
+ }),
147
+ props.mobileView && (React.createElement(MoreButton, { "data-ui-id": "call-with-chat-composite-more-button", strings: moreButtonStrings, onClick: props.onMoreButtonClicked, disabled: props.disableButtonsForLobbyPage })),
148
+ /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ isEnabled(options === null || options === void 0 ? void 0 : options.moreButton) &&
149
+ /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ isEnabled(options === null || options === void 0 ? void 0 : options.holdButton) &&
150
+ !props.mobileView && (React.createElement(DesktopMoreButton, { disableButtonsForHoldScreen: props.disableButtonsForHoldScreen, styles: commonButtonStyles, onClickShowDialpad: props.onClickShowDialpad,
151
+ /* @conditional-compile-remove(control-bar-button-injection) */
152
+ callControls: props.callControls })),
153
+ React.createElement(EndCall, { displayType: "compact", styles: endCallButtonStyles }))))))),
154
+ !props.mobileView && (React.createElement(Stack.Item, null,
155
+ React.createElement("div", { ref: sidepaneControlsRef },
156
+ React.createElement(Stack, { horizontal: true, className: !props.mobileView ? mergeStyles(desktopButtonContainerStyle) : undefined },
157
+ /* @conditional-compile-remove(control-bar-button-injection) */
158
+ (_c = customButtons['secondary']) === null || _c === void 0 ? void 0 :
159
+ _c.slice(0, CUSTOM_BUTTON_OPTIONS.MAX_SECONDARY_DESKTOP_CUSTOM_BUTTONS).map((CustomButton, i) => {
160
+ return (React.createElement(CustomButton, { key: `secondary-custom-button-${i}`, styles: commonButtonStyles, showLabel: options.displayType !== 'compact' }));
161
+ }),
162
+ isEnabled(options === null || options === void 0 ? void 0 : options.peopleButton) && (React.createElement(PeopleButton, { checked: props.peopleButtonChecked, ariaLabel: peopleButtonStrings === null || peopleButtonStrings === void 0 ? void 0 : peopleButtonStrings.label, showLabel: options.displayType !== 'compact', onClick: props.onPeopleButtonClicked, "data-ui-id": "call-with-chat-composite-people-button", disabled: props.disableButtonsForLobbyPage || isDisabled(options.peopleButton), strings: peopleButtonStrings, styles: commonButtonStyles })),
163
+ isEnabled(options === null || options === void 0 ? void 0 : options.chatButton) && chatButton)))))));
164
+ };
165
+ const desktopButtonContainerStyle = {
166
+ padding: '0.75rem',
167
+ columnGap: '0.5rem'
168
+ };
169
+ const desktopControlBarStyles = {
170
+ root: desktopButtonContainerStyle
171
+ };
172
+ {
173
+ /*
174
+ Styling here to ensure the control bar buttons stay in the center of the parent component (control Container) regardless of its siblings
175
+ Need to add 'reversed' to parent container because the styling here reverse the position of the two stack items
176
+ */
177
+ }
178
+ const wrapperDesktopStyles = {
179
+ position: 'absolute',
180
+ left: '50%',
181
+ transform: 'translate(-50%, 0)'
182
+ };
183
+ const wrapperDesktopRtlStyles = {
184
+ position: 'absolute',
185
+ right: '50%',
186
+ transform: 'translate(-50%, 0)'
187
+ };
188
+ const getDesktopCommonButtonStyles = (theme) => ({
189
+ root: {
190
+ border: `solid 1px ${theme.palette.neutralQuaternaryAlt}`,
191
+ borderRadius: theme.effects.roundedCorner4,
192
+ minHeight: '2.5rem',
193
+ maxWidth: '12rem' // allot extra space than the regular ControlBarButton. This is to give extra room to have the icon beside the text.
194
+ },
195
+ flexContainer: {
196
+ display: 'flex',
197
+ flexFlow: 'row nowrap'
198
+ },
199
+ textContainer: {
200
+ // Override the default so that label doesn't introduce a new block.
201
+ display: 'inline',
202
+ // Ensure width is set to permit child to show ellipsis when there is a label that is too long
203
+ maxWidth: '100%'
204
+ },
205
+ label: {
206
+ fontSize: theme.fonts.medium.fontSize,
207
+ // Ensure there is enough space between the icon and text to allow for the unread messages badge in the chat button
208
+ marginLeft: '0.625rem',
209
+ // Ensure letters that go above and below the standard text line like 'g', 'y', 'j' are not clipped
210
+ lineHeight: '1.5rem',
211
+ // Do not allow very long button texts to ruin the control bar experience, instead ensure long text is truncated and shows ellipsis
212
+ display: 'block',
213
+ textOverflow: 'ellipsis',
214
+ whiteSpace: 'nowrap',
215
+ overflow: 'hidden'
216
+ },
217
+ splitButtonMenuButton: {
218
+ border: `solid 1px ${theme.palette.neutralQuaternaryAlt}`,
219
+ borderTopRightRadius: theme.effects.roundedCorner4,
220
+ borderBottomRightRadius: theme.effects.roundedCorner4,
221
+ borderTopLeftRadius: '0',
222
+ borderBottomLeftRadius: '0'
223
+ },
224
+ splitButtonMenuButtonChecked: {
225
+ // Default colors the menu half similarly for :hover and when button is checked.
226
+ // To align with how the left-half is styled, override the checked style.
227
+ background: 'none'
228
+ }
229
+ });
230
+ const getDesktopScreenShareButtonStyles = (theme) => {
231
+ const overrideStyles = {
232
+ border: 'none',
233
+ background: theme.palette.themePrimary,
234
+ color: theme.palette.white,
235
+ '* > svg': { fill: theme.palette.white }
236
+ };
237
+ const overrides = {
238
+ rootChecked: overrideStyles,
239
+ rootCheckedHovered: overrideStyles
240
+ };
241
+ return concatStyleSets(getDesktopCommonButtonStyles(theme), overrides);
242
+ };
243
+ const getDesktopEndCallButtonStyles = (theme) => {
244
+ const overrides = {
245
+ root: {
246
+ // Suppress border around the dark-red button.
247
+ border: 'none'
248
+ }
249
+ };
250
+ return concatStyleSets(getDesktopCommonButtonStyles(theme), overrides);
251
+ };
252
+ const isEnabled = (option) => option !== false;
253
+ //# sourceMappingURL=CommonCallControlBar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CommonCallControlBar.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/common/ControlBar/CommonCallControlBar.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACjF,OAAO,EAAE,mBAAmB,EAAE,MAAM,iDAAiD,CAAC;AAEtF,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAkB,WAAW,EAAE,cAAc,EAAE,KAAK,EAAE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K,CAAC,OAAO,CAAC,cAAc;QACrD,mBAAmB,EAAE,GAAG;QACxB,sBAAsB,EAAE,GAAG;KAC5B;IACD,4BAA4B,EAAE;QAC5B,gFAAgF;QAChF,yEAAyE;QACzE,UAAU,EAAE,MAAM;KACnB;CACF,CAAC,CAAC;AAEH,MAAM,iCAAiC,GAAG,CAAC,KAAa,EAA0B,EAAE;IAClF,MAAM,cAAc,GAAG;QACrB,MAAM,EAAE,MAAM;QACd,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,YAAY;QACtC,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK;QAC1B,SAAS,EAAE,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE;KACzC,CAAC;IACF,MAAM,SAAS,GAA2B;QACxC,WAAW,EAAE,cAAc;QAC3B,kBAAkB,EAAE,cAAc;KACnC,CAAC;IACF,OAAO,eAAe,CAAC,4BAA4B,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;AACzE,CAAC,CAAC;AAEF,MAAM,6BAA6B,GAAG,CAAC,KAAa,EAA0B,EAAE;IAC9E,MAAM,SAAS,GAA2B;QACxC,IAAI,EAAE;YACJ,8CAA8C;YAC9C,MAAM,EAAE,MAAM;SACf;KACF,CAAC;IACF,OAAO,eAAe,CAAC,4BAA4B,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,CAAC;AACzE,CAAC,CAAC;AAEF,MAAM,SAAS,GAAG,CAAC,MAAe,EAAW,EAAE,CAAC,MAAM,KAAK,KAAK,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport React, { useMemo, useRef, useEffect, useState, useCallback } from 'react';\nimport { CallAdapterProvider } from '../../CallComposite/adapter/CallAdapterProvider';\nimport { CallAdapter } from '../../CallComposite';\nimport { PeopleButton } from './PeopleButton';\nimport { concatStyleSets, IStyle, ITheme, mergeStyles, mergeStyleSets, Stack, useTheme } from '@fluentui/react';\nimport { controlBarContainerStyles } from '../../CallComposite/styles/CallControls.styles';\nimport { callControlsContainerStyles } from '../../CallComposite/styles/CallPage.styles';\nimport { useCallWithChatCompositeStrings } from '../../CallWithChatComposite/hooks/useCallWithChatCompositeStrings';\nimport { ChatAdapter } from '../../ChatComposite';\nimport { ChatButtonWithUnreadMessagesBadge } from '../../CallWithChatComposite/ChatButtonWithUnreadMessagesBadge';\nimport { BaseCustomStyles, ControlBarButtonStyles } from '@internal/react-components';\nimport { ControlBar } from '@internal/react-components';\nimport { Microphone } from '../../CallComposite/components/buttons/Microphone';\nimport { Camera } from '../../CallComposite/components/buttons/Camera';\nimport { ScreenShare } from '../../CallComposite/components/buttons/ScreenShare';\nimport { EndCall } from '../../CallComposite/components/buttons/EndCall';\nimport { MoreButton } from '../MoreButton';\nimport { ContainerRectProps } from '../ContainerRectProps';\n/* @conditional-compile-remove(control-bar-button-injection) */\nimport {\n CUSTOM_BUTTON_OPTIONS,\n generateCustomCallControlBarButton,\n onFetchCustomButtonPropsTrampoline\n} from './CustomButton';\n/*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\nimport { DesktopMoreButton } from './DesktopMoreButton';\nimport { isDisabled } from '../../CallComposite/utils';\nimport { HiddenFocusStartPoint } from '../HiddenFocusStartPoint';\nimport { CallWithChatControlOptions } from '../../CallWithChatComposite';\nimport { CommonCallControlOptions } from '../types/CommonCallControlOptions';\n\n/**\n * @private\n */\nexport interface CommonCallControlBarProps {\n callAdapter: CallAdapter;\n chatButtonChecked?: boolean;\n peopleButtonChecked: boolean;\n onChatButtonClicked?: () => void;\n onPeopleButtonClicked: () => void;\n onMoreButtonClicked?: () => void;\n mobileView: boolean;\n disableButtonsForLobbyPage: boolean;\n callControls?: boolean | CommonCallControlOptions | CallWithChatControlOptions;\n chatAdapter?: ChatAdapter;\n disableButtonsForHoldScreen?: boolean;\n /* @conditional-compile-remove(PSTN-calls) */\n onClickShowDialpad?: () => void;\n /* @conditional-compile-remove(video-background-effects) */\n onShowVideoEffectsPicker?: (showVideoEffectsOptions: boolean) => void;\n rtl?: boolean;\n}\n\nconst inferCommonCallControlOptions = (\n mobileView: boolean,\n commonCallControlOptions?: boolean | CallWithChatControlOptions\n): CallWithChatControlOptions | false => {\n if (commonCallControlOptions === false) {\n return false;\n }\n\n const options =\n commonCallControlOptions === true || commonCallControlOptions === undefined ? {} : commonCallControlOptions;\n if (mobileView) {\n // Set to compressed mode when composite is optimized for mobile\n options.displayType = 'compact';\n // Do not show screen share button when composite is optimized for mobile unless the developer\n // has explicitly opted in.\n if (options.screenShareButton !== true) {\n options.screenShareButton = false;\n }\n }\n return options;\n};\n\n/**\n * @private\n */\nexport const CommonCallControlBar = (props: CommonCallControlBarProps & ContainerRectProps): JSX.Element => {\n const theme = useTheme();\n\n const controlBarContainerRef = useRef<HTMLHeadingElement>(null);\n const sidepaneControlsRef = useRef<HTMLHeadingElement>(null);\n const controlBarSizeRef = useRef<HTMLHeadingElement>(null);\n\n const [controlBarButtonsWidth, setControlBarButtonsWidth] = useState(0);\n const [panelsButtonsWidth, setPanelsButtonsWidth] = useState(0);\n const [controlBarContainerWidth, setControlBarContainerWidth] = useState(0);\n\n const [totalButtonsWidth, setTotalButtonsWidth] = useState(0);\n const [isOutOfSpace, setIsOutOfSpace] = useState(false);\n\n const callWithChatStrings = useCallWithChatCompositeStrings();\n const options = inferCommonCallControlOptions(props.mobileView, props.callControls);\n\n const handleResize = useCallback((): void => {\n setControlBarButtonsWidth(controlBarContainerRef.current ? controlBarContainerRef.current.offsetWidth : 0);\n setPanelsButtonsWidth(sidepaneControlsRef.current ? sidepaneControlsRef.current.offsetWidth : 0);\n setControlBarContainerWidth(controlBarSizeRef.current ? controlBarSizeRef.current.offsetWidth : 0);\n }, []);\n\n // on load set inital width\n useEffect(() => {\n setControlBarButtonsWidth(controlBarContainerRef.current ? controlBarContainerRef.current.offsetWidth : 0);\n setPanelsButtonsWidth(sidepaneControlsRef.current ? sidepaneControlsRef.current.offsetWidth : 0);\n setControlBarContainerWidth(controlBarSizeRef.current ? controlBarSizeRef.current.offsetWidth : 0);\n }, []);\n\n // get the current width of control bar buttons and panel control buttons when browser size change\n useEffect(() => {\n window.addEventListener('resize', handleResize);\n return () => window.removeEventListener('resize', handleResize);\n }, [handleResize]);\n\n /* when size change, reset total buttons width and compare with the control bar container width\n if the total width of those buttons exceed container width, do not center the control bar buttons based on parent container width\n Instead let them take up the remaining white space on the left */\n useEffect(() => {\n // white space on the left when control bar buttons are centered based on container width + control bar buttons width + panel control buttons width\n setTotalButtonsWidth(\n (controlBarContainerWidth - controlBarButtonsWidth) / 2 + controlBarButtonsWidth + panelsButtonsWidth\n );\n }, [controlBarButtonsWidth, panelsButtonsWidth, controlBarContainerWidth]);\n\n useEffect(() => {\n setIsOutOfSpace(totalButtonsWidth > controlBarContainerWidth);\n }, [totalButtonsWidth, controlBarContainerWidth]);\n\n const chatButtonStrings = useMemo(\n () => ({\n label: callWithChatStrings.chatButtonLabel,\n tooltipOffContent: callWithChatStrings.chatButtonTooltipOpen,\n tooltipOnContent: callWithChatStrings.chatButtonTooltipClose\n }),\n [callWithChatStrings]\n );\n const peopleButtonStrings = useMemo(\n () => ({\n label: callWithChatStrings.peopleButtonLabel,\n tooltipOffContent: callWithChatStrings.peopleButtonTooltipOpen,\n tooltipOnContent: callWithChatStrings.peopleButtonTooltipClose\n }),\n [callWithChatStrings]\n );\n const moreButtonStrings = useMemo(\n () => ({\n label: callWithChatStrings.moreDrawerButtonLabel,\n tooltipContent: callWithChatStrings.moreDrawerButtonTooltip\n }),\n [callWithChatStrings]\n );\n\n const centerContainerStyles = useMemo(() => {\n const styles: BaseCustomStyles = !props.mobileView ? desktopControlBarStyles : {};\n return mergeStyleSets(styles, {\n root: {\n // Enforce a background color on control bar to ensure it matches the composite background color.\n background: theme.semanticColors.bodyBackground\n }\n });\n }, [props.mobileView, theme.semanticColors.bodyBackground]);\n const screenShareButtonStyles = useMemo(\n () => (!props.mobileView ? getDesktopScreenShareButtonStyles(theme) : undefined),\n [props.mobileView, theme]\n );\n const commonButtonStyles = useMemo(\n () => (!props.mobileView ? getDesktopCommonButtonStyles(theme) : undefined),\n [props.mobileView, theme]\n );\n const endCallButtonStyles = useMemo(\n () => (!props.mobileView ? getDesktopEndCallButtonStyles(theme) : undefined),\n [props.mobileView, theme]\n );\n\n const controlBarWrapperDesktopStyles: IStyle = useMemo(\n // only center control bar buttons based on parent container if there are enough space on the screen and not mobile\n () => (!props.mobileView && !isOutOfSpace ? (props.rtl ? wrapperDesktopRtlStyles : wrapperDesktopStyles) : {}),\n [props.mobileView, props.rtl, isOutOfSpace]\n );\n\n // only center control bar buttons based on parent container if there are enough space on the screen and not mobile\n const controlBarDesktopContainerStyles: IStyle = useMemo(\n () => (!props.mobileView && !isOutOfSpace ? { position: 'relative' } : {}),\n [props.mobileView, isOutOfSpace]\n );\n\n /* @conditional-compile-remove(control-bar-button-injection) */\n const customButtons = useMemo(\n () =>\n generateCustomCallControlBarButton(\n onFetchCustomButtonPropsTrampoline(options !== false ? options : undefined),\n options !== false ? options?.displayType : undefined\n ),\n [options]\n );\n\n // when options is false then we want to hide the whole control bar.\n if (options === false) {\n return <></>;\n }\n\n const chatButton = props.chatAdapter ? (\n <ChatButtonWithUnreadMessagesBadge\n chatAdapter={props.chatAdapter}\n checked={props.chatButtonChecked}\n showLabel={options.displayType !== 'compact'}\n isChatPaneVisible={props.chatButtonChecked ?? false}\n onClick={props.onChatButtonClicked}\n disabled={props.disableButtonsForLobbyPage || isDisabled(options.chatButton)}\n strings={chatButtonStrings}\n styles={commonButtonStyles}\n newMessageLabel={callWithChatStrings.chatButtonNewMessageNotificationLabel}\n />\n ) : (\n <></>\n );\n\n return (\n <div ref={controlBarSizeRef}>\n <Stack\n horizontal\n reversed={!props.mobileView && !isOutOfSpace}\n horizontalAlign=\"space-between\"\n className={mergeStyles(\n callControlsContainerStyles,\n controlBarContainerStyles,\n controlBarDesktopContainerStyles\n )}\n >\n <Stack.Item grow className={mergeStyles(controlBarWrapperDesktopStyles)}>\n <CallAdapterProvider adapter={props.callAdapter}>\n <Stack horizontalAlign=\"center\">\n {/*\n HiddenFocusStartPoint is a util component used when we can't ensure the initial element for first\n tab focus is at the top of dom tree. It moves the first-tab focus to the next interact-able element\n immediately after it in the dom tree.\n */}\n <HiddenFocusStartPoint />\n <Stack.Item>\n {/*\n Note: We use the layout=\"horizontal\" instead of dockedBottom because of how we position the\n control bar. The control bar exists in a Stack below the MediaGallery. The MediaGallery is\n set to grow and fill the remaining space not taken up by the ControlBar. If we were to use\n dockedBottom it has position absolute and would therefore float on top of the media gallery,\n occluding some of its content.\n */}\n <div ref={controlBarContainerRef}>\n <ControlBar layout=\"horizontal\" styles={centerContainerStyles}>\n {isEnabled(options.microphoneButton) && (\n <Microphone\n displayType={options.displayType}\n styles={commonButtonStyles}\n splitButtonsForDeviceSelection={!props.mobileView}\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n disabled={props.disableButtonsForHoldScreen || isDisabled(options.microphoneButton)}\n />\n )}\n {isEnabled(options.cameraButton) && (\n <Camera\n displayType={options.displayType}\n styles={commonButtonStyles}\n splitButtonsForDeviceSelection={!props.mobileView}\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n disabled={props.disableButtonsForHoldScreen || isDisabled(options.cameraButton)}\n /* @conditional-compile-remove(video-background-effects) */\n onShowVideoEffectsPicker={props.onShowVideoEffectsPicker}\n />\n )}\n {props.mobileView && isEnabled(options?.chatButton) && chatButton}\n {isEnabled(options.screenShareButton) && (\n <ScreenShare\n option={options.screenShareButton}\n displayType={options.displayType}\n styles={screenShareButtonStyles}\n /* @conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */\n disabled={props.disableButtonsForHoldScreen || isDisabled(options.screenShareButton)}\n />\n )}\n {\n /* @conditional-compile-remove(control-bar-button-injection) */\n customButtons['primary']\n ?.slice(\n 0,\n props.mobileView\n ? CUSTOM_BUTTON_OPTIONS.MAX_PRIMARY_MOBILE_CUSTOM_BUTTONS\n : CUSTOM_BUTTON_OPTIONS.MAX_PRIMARY_DESKTOP_CUSTOM_BUTTONS\n )\n .map((CustomButton, i) => {\n return (\n <CustomButton\n key={`primary-custom-button-${i}`}\n styles={commonButtonStyles}\n showLabel={options.displayType !== 'compact'}\n />\n );\n })\n }\n {props.mobileView && (\n <MoreButton\n data-ui-id=\"call-with-chat-composite-more-button\"\n strings={moreButtonStrings}\n onClick={props.onMoreButtonClicked}\n disabled={props.disableButtonsForLobbyPage}\n />\n )}\n {\n /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ isEnabled(\n options?.moreButton\n ) &&\n /*@conditional-compile-remove(PSTN-calls) */ /* @conditional-compile-remove(one-to-n-calling) */ isEnabled(\n options?.holdButton\n ) &&\n !props.mobileView && (\n <DesktopMoreButton\n disableButtonsForHoldScreen={props.disableButtonsForHoldScreen}\n styles={commonButtonStyles}\n onClickShowDialpad={props.onClickShowDialpad}\n /* @conditional-compile-remove(control-bar-button-injection) */\n callControls={props.callControls}\n />\n )\n }\n <EndCall displayType=\"compact\" styles={endCallButtonStyles} />\n </ControlBar>\n </div>\n </Stack.Item>\n </Stack>\n </CallAdapterProvider>\n </Stack.Item>\n {!props.mobileView && (\n <Stack.Item>\n <div ref={sidepaneControlsRef}>\n <Stack horizontal className={!props.mobileView ? mergeStyles(desktopButtonContainerStyle) : undefined}>\n {\n /* @conditional-compile-remove(control-bar-button-injection) */\n customButtons['secondary']\n ?.slice(0, CUSTOM_BUTTON_OPTIONS.MAX_SECONDARY_DESKTOP_CUSTOM_BUTTONS)\n .map((CustomButton, i) => {\n return (\n <CustomButton\n key={`secondary-custom-button-${i}`}\n styles={commonButtonStyles}\n showLabel={options.displayType !== 'compact'}\n />\n );\n })\n }\n {isEnabled(options?.peopleButton) && (\n <PeopleButton\n checked={props.peopleButtonChecked}\n ariaLabel={peopleButtonStrings?.label}\n showLabel={options.displayType !== 'compact'}\n onClick={props.onPeopleButtonClicked}\n data-ui-id=\"call-with-chat-composite-people-button\"\n disabled={props.disableButtonsForLobbyPage || isDisabled(options.peopleButton)}\n strings={peopleButtonStrings}\n styles={commonButtonStyles}\n />\n )}\n {isEnabled(options?.chatButton) && chatButton}\n </Stack>\n </div>\n </Stack.Item>\n )}\n </Stack>\n </div>\n );\n};\n\nconst desktopButtonContainerStyle: IStyle = {\n padding: '0.75rem',\n columnGap: '0.5rem'\n};\n\nconst desktopControlBarStyles: BaseCustomStyles = {\n root: desktopButtonContainerStyle\n};\n\n{\n /*\n Styling here to ensure the control bar buttons stay in the center of the parent component (control Container) regardless of its siblings\n Need to add 'reversed' to parent container because the styling here reverse the position of the two stack items \n */\n}\nconst wrapperDesktopStyles: IStyle = {\n position: 'absolute',\n left: '50%',\n transform: 'translate(-50%, 0)'\n};\n\nconst wrapperDesktopRtlStyles: IStyle = {\n position: 'absolute',\n right: '50%',\n transform: 'translate(-50%, 0)'\n};\n\nconst getDesktopCommonButtonStyles = (theme: ITheme): ControlBarButtonStyles => ({\n root: {\n border: `solid 1px ${theme.palette.neutralQuaternaryAlt}`,\n borderRadius: theme.effects.roundedCorner4,\n minHeight: '2.5rem',\n maxWidth: '12rem' // allot extra space than the regular ControlBarButton. This is to give extra room to have the icon beside the text.\n },\n flexContainer: {\n display: 'flex',\n flexFlow: 'row nowrap'\n },\n textContainer: {\n // Override the default so that label doesn't introduce a new block.\n display: 'inline',\n\n // Ensure width is set to permit child to show ellipsis when there is a label that is too long\n maxWidth: '100%'\n },\n label: {\n fontSize: theme.fonts.medium.fontSize,\n\n // Ensure there is enough space between the icon and text to allow for the unread messages badge in the chat button\n marginLeft: '0.625rem',\n\n // Ensure letters that go above and below the standard text line like 'g', 'y', 'j' are not clipped\n lineHeight: '1.5rem',\n\n // Do not allow very long button texts to ruin the control bar experience, instead ensure long text is truncated and shows ellipsis\n display: 'block',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap',\n overflow: 'hidden'\n },\n splitButtonMenuButton: {\n border: `solid 1px ${theme.palette.neutralQuaternaryAlt}`,\n borderTopRightRadius: theme.effects.roundedCorner4,\n borderBottomRightRadius: theme.effects.roundedCorner4,\n borderTopLeftRadius: '0',\n borderBottomLeftRadius: '0'\n },\n splitButtonMenuButtonChecked: {\n // Default colors the menu half similarly for :hover and when button is checked.\n // To align with how the left-half is styled, override the checked style.\n background: 'none'\n }\n});\n\nconst getDesktopScreenShareButtonStyles = (theme: ITheme): ControlBarButtonStyles => {\n const overrideStyles = {\n border: 'none',\n background: theme.palette.themePrimary,\n color: theme.palette.white,\n '* > svg': { fill: theme.palette.white }\n };\n const overrides: ControlBarButtonStyles = {\n rootChecked: overrideStyles,\n rootCheckedHovered: overrideStyles\n };\n return concatStyleSets(getDesktopCommonButtonStyles(theme), overrides);\n};\n\nconst getDesktopEndCallButtonStyles = (theme: ITheme): ControlBarButtonStyles => {\n const overrides: ControlBarButtonStyles = {\n root: {\n // Suppress border around the dark-red button.\n border: 'none'\n }\n };\n return concatStyleSets(getDesktopCommonButtonStyles(theme), overrides);\n};\n\nconst isEnabled = (option: unknown): boolean => option !== false;\n\"../../../../../react-components/src\""]}
@@ -1,7 +1,8 @@
1
1
  import { IContextualMenuItem } from '@fluentui/react';
2
- import { ControlBarButton, _DrawerMenuItemProps } from "../../../../react-components/src";
3
- import { CallControlDisplayType, CustomCallControlButtonCallbackArgs, CustomControlButtonProps } from '../CallComposite/types/CallControlOptions';
4
- import { CallWithChatControlOptions } from './CallWithChatComposite';
2
+ import { ControlBarButton, _DrawerMenuItemProps } from "../../../../../react-components/src";
3
+ import { CustomCallControlButtonCallbackArgs, CustomControlButtonProps } from '../types/CommonCallControlOptions';
4
+ import { CallControlDisplayType } from '../types/CommonCallControlOptions';
5
+ import { CommonCallControlOptions } from '../types/CommonCallControlOptions';
5
6
  /**
6
7
  * Max number of Custom Buttons in primary and secondary ControlBar
7
8
  * Does not include existing buttons in the controlBar.
@@ -15,22 +16,22 @@ export declare const CUSTOM_BUTTON_OPTIONS: {
15
16
  };
16
17
  /** @private */
17
18
  export declare type CustomButtons = {
18
- [key in CustomCallWithChatControlButtonPlacement]: typeof ControlBarButton[] | undefined;
19
+ [key in CustomCallControlButtonPlacement]: typeof ControlBarButton[] | undefined;
19
20
  };
20
21
  /** @private */
21
- export declare const generateCustomCallWithChatControlBarButton: (onFetchCustomButtonProps?: CustomCallWithChatControlButtonCallback[] | undefined, displayType?: CallControlDisplayType | undefined) => CustomButtons;
22
+ export declare const generateCustomCallControlBarButton: (onFetchCustomButtonProps?: CustomCallControlButtonCallback[] | undefined, displayType?: CallControlDisplayType | undefined) => CustomButtons;
22
23
  /** @private */
23
24
  export declare type CustomDrawerButtons = {
24
- [key in CustomCallWithChatControlButtonPlacement]: _DrawerMenuItemProps[];
25
+ [key in CustomCallControlButtonPlacement]: _DrawerMenuItemProps[];
25
26
  };
26
27
  /** @private */
27
- export declare const generateCustomCallWithChatDrawerButtons: (onFetchCustomButtonProps?: CustomCallWithChatControlButtonCallback[] | undefined, displayType?: CallControlDisplayType | undefined) => CustomDrawerButtons;
28
+ export declare const generateCustomCallDrawerButtons: (onFetchCustomButtonProps?: CustomCallControlButtonCallback[] | undefined, displayType?: CallControlDisplayType | undefined) => CustomDrawerButtons;
28
29
  /** @private */
29
30
  export declare type CustomDesktopOverflowButtons = {
30
- [key in CustomCallWithChatControlButtonPlacement]: IContextualMenuItem[];
31
+ [key in CustomCallControlButtonPlacement]: IContextualMenuItem[];
31
32
  };
32
33
  /** @private */
33
- export declare const generateCustomCallWithChatDesktopOverflowButtons: (onFetchCustomButtonProps?: CustomCallWithChatControlButtonCallback[] | undefined, displayType?: CallControlDisplayType | undefined) => CustomDesktopOverflowButtons;
34
+ export declare const generateCustomCallDesktopOverflowButtons: (onFetchCustomButtonProps?: CustomCallControlButtonCallback[] | undefined, displayType?: CallControlDisplayType | undefined) => CustomDesktopOverflowButtons;
34
35
  /** @private */
35
36
  export declare const drawerMenuItemToContextualMenuItem: (item: _DrawerMenuItemProps) => IContextualMenuItem;
36
37
  /**
@@ -41,9 +42,9 @@ export declare const drawerMenuItemToContextualMenuItem: (item: _DrawerMenuItemP
41
42
  * Performance tip: This callback is only called when either the callback or its arguments change.
42
43
  * @beta
43
44
  */
44
- export declare type CustomCallWithChatControlButtonCallback = (args: CustomCallControlButtonCallbackArgs) => CustomCallWithChatControlButtonProps;
45
+ export declare type CustomCallControlButtonCallback = (args: CustomCallControlButtonCallbackArgs) => CustomCallControlButtonProps;
45
46
  /**
46
- * Placement for a custom button injected in the {@link CallWithChatControlBar}.
47
+ * Placement for a custom button injected in the {@link CommonCallControlBar}.
47
48
  *
48
49
  * 'primary': Place the button(s) on the right end of the center control bar but before the EndCallButton (left end in rtl mode).
49
50
  * 'overflow': Place the buttons(s) on the end of the overflow Menu.
@@ -53,22 +54,24 @@ export declare type CustomCallWithChatControlButtonCallback = (args: CustomCallC
53
54
  * E.g., if two buttons are placed in 'secondary', they'll both appear on the left end (right end in rtl mode)
54
55
  * in the order provided.
55
56
  *
57
+ * Only 'primary' placement works when legacy call control is enabled in call composite
58
+ *
56
59
  * @beta
57
60
  */
58
- export declare type CustomCallWithChatControlButtonPlacement = 'primary' | 'overflow' | 'secondary';
61
+ export declare type CustomCallControlButtonPlacement = 'primary' | 'overflow' | 'secondary';
59
62
  /**
60
- * Response from {@link CustomCallWithChatControlButtonCallback}.
63
+ * Response from {@link CustomCallControlButtonCallback}.
61
64
  *
62
65
  * Includes the icon and placement prop necessary to indicate where to place the
63
66
  * {@link ControlBarButton} and a {@link DrawerMenuItem}
64
67
  *
65
68
  * @beta
66
69
  */
67
- export interface CustomCallWithChatControlButtonProps extends CustomControlButtonProps {
70
+ export interface CustomCallControlButtonProps extends CustomControlButtonProps {
68
71
  /**
69
72
  * Where to place the custom button relative to other buttons.
70
73
  */
71
- placement: CustomCallWithChatControlButtonPlacement;
74
+ placement: CustomCallControlButtonPlacement;
72
75
  /**
73
76
  * Icon to render. Icon is a non-default icon name that needs to be registered as a
74
77
  * custom icon using registerIcons through fluentui. Examples include icons from the fluentui library
@@ -76,5 +79,5 @@ export interface CustomCallWithChatControlButtonProps extends CustomControlButto
76
79
  iconName?: string;
77
80
  }
78
81
  /** @private */
79
- export declare const onFetchCustomButtonPropsTrampoline: (options?: CallWithChatControlOptions | undefined) => CustomCallWithChatControlButtonCallback[] | undefined;
82
+ export declare const onFetchCustomButtonPropsTrampoline: (options?: CommonCallControlOptions | undefined) => CustomCallControlButtonCallback[] | undefined;
80
83
  //# sourceMappingURL=CustomButton.d.ts.map