@azure/communication-react 1.5.1-alpha-202304040013 → 1.5.1-beta.2
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.
- package/CHANGELOG.beta.md +76 -1
- package/CHANGELOG.json +621 -0
- package/dist/communication-react.d.ts +160 -192
- package/dist/dist-cjs/communication-react/index.js +1615 -2195
- package/dist/dist-cjs/communication-react/index.js.map +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js +1 -1
- package/dist/dist-esm/acs-ui-common/src/telemetryVersion.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js +2 -29
- package/dist/dist-esm/chat-component-bindings/src/messageThreadSelector.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/utils/constants.d.ts +0 -4
- package/dist/dist-esm/chat-component-bindings/src/utils/constants.js +0 -4
- package/dist/dist-esm/chat-component-bindings/src/utils/constants.js.map +1 -1
- package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js +26 -32
- package/dist/dist-esm/chat-component-bindings/src/utils/updateMessagesWithAttached.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/convertChatMessage.js +1 -6
- package/dist/dist-esm/chat-stateful-client/src/convertChatMessage.js.map +1 -1
- package/dist/dist-esm/chat-stateful-client/src/types/ChatMessageWithStatus.d.ts +0 -1
- package/dist/dist-esm/chat-stateful-client/src/types/ChatMessageWithStatus.js.map +1 -1
- package/dist/dist-esm/communication-react/src/index.d.ts +0 -2
- package/dist/dist-esm/communication-react/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js +29 -31
- package/dist/dist-esm/react-components/src/components/CaptionsBanner.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.d.ts +1 -2
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js +13 -11
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.d.ts +1 -2
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js +20 -34
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageComponentAsMessageBubble.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.d.ts +2 -11
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js +9 -47
- package/dist/dist-esm/react-components/src/components/ChatMessage/ChatMessageContent.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.d.ts +0 -7
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.js +1 -5
- package/dist/dist-esm/react-components/src/components/FileDownloadCards.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/MessageThread.d.ts +3 -10
- package/dist/dist-esm/react-components/src/components/MessageThread.js +36 -57
- package/dist/dist-esm/react-components/src/components/MessageThread.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/index.d.ts +0 -1
- package/dist/dist-esm/react-components/src/components/index.js +0 -1
- package/dist/dist-esm/react-components/src/components/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/styles/CaptionsBanner.style.d.ts +13 -0
- package/dist/dist-esm/react-components/src/components/styles/CaptionsBanner.style.js +35 -0
- package/dist/dist-esm/react-components/src/components/styles/CaptionsBanner.style.js.map +1 -0
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.d.ts +0 -5
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js +0 -28
- package/dist/dist-esm/react-components/src/components/styles/MessageThread.styles.js.map +1 -1
- package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.d.ts +4 -6
- package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.js +1 -1
- package/dist/dist-esm/react-components/src/components/utils/getParticipantsWhoHaveReadMessage.js.map +1 -1
- package/dist/dist-esm/react-components/src/index.d.ts +0 -1
- package/dist/dist-esm/react-components/src/index.js.map +1 -1
- package/dist/dist-esm/react-components/src/localization/locales/de-DE/strings.json +116 -11
- package/dist/dist-esm/react-components/src/localization/locales/en-GB/strings.json +115 -10
- package/dist/dist-esm/react-components/src/localization/locales/en-US/strings.json +1 -3
- package/dist/dist-esm/react-components/src/localization/locales/es-ES/strings.json +115 -10
- package/dist/dist-esm/react-components/src/localization/locales/fr-FR/strings.json +116 -11
- package/dist/dist-esm/react-components/src/localization/locales/it-IT/strings.json +115 -10
- package/dist/dist-esm/react-components/src/localization/locales/ja-JP/strings.json +115 -10
- package/dist/dist-esm/react-components/src/localization/locales/ko-KR/strings.json +115 -10
- package/dist/dist-esm/react-components/src/localization/locales/nl-NL/strings.json +115 -10
- package/dist/dist-esm/react-components/src/localization/locales/pt-BR/strings.json +116 -11
- package/dist/dist-esm/react-components/src/localization/locales/ru-RU/strings.json +115 -10
- package/dist/dist-esm/react-components/src/localization/locales/tr-TR/strings.json +116 -11
- package/dist/dist-esm/react-components/src/localization/locales/zh-CN/strings.json +115 -10
- package/dist/dist-esm/react-components/src/localization/locales/zh-TW/strings.json +115 -10
- package/dist/dist-esm/react-components/src/theming/icons.d.ts +0 -1
- package/dist/dist-esm/react-components/src/theming/icons.js +0 -8
- package/dist/dist-esm/react-components/src/theming/icons.js.map +1 -1
- package/dist/dist-esm/react-components/src/types/ChatMessage.d.ts +1 -20
- package/dist/dist-esm/react-components/src/types/ChatMessage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.d.ts +0 -20
- package/dist/dist-esm/react-composites/src/composites/CallComposite/Strings.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.d.ts +1 -7
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js +2 -14
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/AzureCommunicationCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.d.ts +0 -8
- package/dist/dist-esm/react-composites/src/composites/CallComposite/adapter/CallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js +20 -93
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/CallArrangement.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Camera.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.d.ts +3 -9
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.js +1 -3
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Custom.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Devices.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/EndCall.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Microphone.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Participants.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/Participants.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/components/buttons/ScreenShare.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/CallComposite/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js +1 -19
- package/dist/dist-esm/react-composites/src/composites/CallComposite/pages/ConfigurationPage.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.d.ts +1 -5
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js +0 -20
- package/dist/dist-esm/react-composites/src/composites/CallComposite/styles/CallConfiguration.styles.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CallControlOptions.d.ts +87 -5
- package/dist/dist-esm/react-composites/src/composites/CallComposite/types/CallControlOptions.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallComposite/utils/Utils.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.d.ts +75 -15
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js +5 -7
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatComposite.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.d.ts +28 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js +194 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CallWithChatControlBar.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/{common/ControlBar → CallWithChatComposite}/CustomButton.d.ts +16 -19
- package/dist/dist-esm/react-composites/src/composites/{common/ControlBar → CallWithChatComposite}/CustomButton.js +4 -4
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/CustomButton.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/{common/ControlBar → CallWithChatComposite}/PeopleButton.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/{common/ControlBar → CallWithChatComposite}/PeopleButton.js +3 -3
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/PeopleButton.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/{common/Drawer → CallWithChatComposite}/PreparedMoreDrawer.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/{common/Drawer → CallWithChatComposite}/PreparedMoreDrawer.js +5 -5
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/PreparedMoreDrawer.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.d.ts +0 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js +1 -7
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/AzureCommunicationCallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.d.ts +0 -10
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.d.ts +0 -2
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js +1 -7
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/adapter/CallWithChatBackedCallAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/{common/ControlBar → CallWithChatComposite/components}/DesktopMoreButton.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/{common/ControlBar → CallWithChatComposite/components}/DesktopMoreButton.js +3 -3
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/DesktopMoreButton.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/{common/Drawer → CallWithChatComposite/components}/MoreDrawer.d.ts +2 -2
- package/dist/dist-esm/react-composites/src/composites/{common/Drawer → CallWithChatComposite/components}/MoreDrawer.js +5 -4
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/components/MoreDrawer.js.map +1 -0
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/index.d.ts +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.d.ts +0 -3
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js +2 -6
- package/dist/dist-esm/react-composites/src/composites/CallWithChatComposite/state/CallWithChatAdapterState.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.d.ts +0 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js +0 -11
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationChatAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.d.ts +1 -4
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js +1 -29
- package/dist/dist-esm/react-composites/src/composites/ChatComposite/adapter/AzureCommunicationFileUploadAdapter.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.d.ts +0 -2
- package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js +3 -88
- package/dist/dist-esm/react-composites/src/composites/common/VideoEffectsPane.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/common/icons.d.ts +1 -7
- package/dist/dist-esm/react-composites/src/composites/common/icons.js +1 -7
- package/dist/dist-esm/react-composites/src/composites/common/icons.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/index.d.ts +0 -3
- package/dist/dist-esm/react-composites/src/composites/index.js.map +1 -1
- package/dist/dist-esm/react-composites/src/composites/localization/locales/de-DE/strings.json +17 -3
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-GB/strings.json +17 -3
- package/dist/dist-esm/react-composites/src/composites/localization/locales/en-US/strings.json +0 -5
- package/dist/dist-esm/react-composites/src/composites/localization/locales/es-ES/strings.json +17 -3
- package/dist/dist-esm/react-composites/src/composites/localization/locales/fr-FR/strings.json +17 -3
- package/dist/dist-esm/react-composites/src/composites/localization/locales/it-IT/strings.json +17 -3
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ja-JP/strings.json +17 -3
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ko-KR/strings.json +17 -3
- package/dist/dist-esm/react-composites/src/composites/localization/locales/nl-NL/strings.json +17 -3
- package/dist/dist-esm/react-composites/src/composites/localization/locales/pt-BR/strings.json +17 -3
- package/dist/dist-esm/react-composites/src/composites/localization/locales/ru-RU/strings.json +17 -3
- package/dist/dist-esm/react-composites/src/composites/localization/locales/tr-TR/strings.json +17 -3
- package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-CN/strings.json +17 -3
- package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json +17 -3
- package/package.json +10 -10
- package/dist/dist-esm/react-components/src/components/Caption.d.ts +0 -21
- package/dist/dist-esm/react-components/src/components/Caption.js +0 -32
- package/dist/dist-esm/react-components/src/components/Caption.js.map +0 -1
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.d.ts +0 -21
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.js +0 -41
- package/dist/dist-esm/react-components/src/components/styles/Captions.style.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.d.ts +0 -30
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js +0 -253
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CustomButton.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/DesktopMoreButton.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/ControlBar/PeopleButton.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/MoreDrawer.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/Drawer/PreparedMoreDrawer.js.map +0 -1
- package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.d.ts +0 -165
- package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.js +0 -4
- package/dist/dist-esm/react-composites/src/composites/common/types/CommonCallControlOptions.js.map +0 -1
package/dist/dist-esm/react-composites/src/composites/localization/locales/zh-TW/strings.json
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"call": {
|
3
3
|
"cameraLabel": "相機",
|
4
|
+
"noCamerasLabel": "找不到相機",
|
4
5
|
"cameraPermissionDenied": "您的瀏覽器禁止存取您的相機",
|
5
6
|
"cameraTurnedOff": "您的相機已關閉",
|
6
7
|
"chatButtonLabel": "聊天",
|
@@ -53,6 +54,8 @@
|
|
53
54
|
"roomNotFoundDetails": "提供的會議室識別碼無效。",
|
54
55
|
"roomNotFoundTitle": "找不到會議室",
|
55
56
|
"soundLabel": "音效",
|
57
|
+
"noMicrophonesLabel": "找不到麥克風",
|
58
|
+
"noSpeakersLabel": "找不到喇叭",
|
56
59
|
"startCallButtonLabel": "開始通話",
|
57
60
|
"openDialpadButtonLabel": "撥打電話號碼",
|
58
61
|
"peoplePaneAddPeopleButtonLabel": "新增人員",
|
@@ -67,8 +70,19 @@
|
|
67
70
|
"resumingCallButtonAriaLabel": "繼續通話",
|
68
71
|
"holdScreenLabel": "您的通話已保留",
|
69
72
|
"openDtmfDialpadLabel": "顯示撥號盤",
|
70
|
-
"
|
71
|
-
"outboundCallingNoticeString": "撥號中..."
|
73
|
+
"dtmfDialpadPlaceholderText": "輸入號碼",
|
74
|
+
"outboundCallingNoticeString": "撥號中...",
|
75
|
+
"participantJoinedNoticeString": "{displayName} 已加入",
|
76
|
+
"twoParticipantJoinedNoticeString": "{displayName1} 和 {displayName2} 已加入",
|
77
|
+
"threeParticipantJoinedNoticeString": "{displayName1}、{displayName2} 和 {displayName3} 已加入",
|
78
|
+
"participantLeftNoticeString": "{displayName} 已離開",
|
79
|
+
"twoParticipantLeftNoticeString": "{displayName1} 和 {displayName2} 已離開",
|
80
|
+
"threeParticipantLeftNoticeString": "{displayName1}、{displayName2} 和 {displayName3} 已離開",
|
81
|
+
"unnamedParticipantString": "未命名的參與者",
|
82
|
+
"manyUnnamedParticipantsJoined": "未命名的參與者和 {numOfParticipants} 個其他參與者已加入",
|
83
|
+
"manyUnnamedParticipantsLeft": "未命名的參與者和 {numOfParticipants} 個其他參與者已離開",
|
84
|
+
"manyParticipantsJoined": "{displayName1}、{displayName2}、{displayName3}和其他{numOfParticipants}位參與者已加入",
|
85
|
+
"manyParticipantsLeft": "{displayName1}、{displayName2}、{displayName3}和其他{numOfParticipants}位參與者"
|
72
86
|
},
|
73
87
|
"chat": {
|
74
88
|
"chatListHeader": "在此聊天中",
|
@@ -105,6 +119,6 @@
|
|
105
119
|
"dialpadModalAriaLabel": "撥號鍵台",
|
106
120
|
"dialpadCloseModalButtonAriaLabel": "關閉撥號鍵台",
|
107
121
|
"openDtmfDialpadLabel": "顯示撥號盤",
|
108
|
-
"
|
122
|
+
"dtmfDialpadPlaceholderText": "輸入號碼"
|
109
123
|
}
|
110
124
|
}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@azure/communication-react",
|
3
|
-
"version": "1.5.1-
|
3
|
+
"version": "1.5.1-beta.2",
|
4
4
|
"sideEffects": false,
|
5
5
|
"description": "React library for building modern communication user experiences utilizing Azure Communication Services",
|
6
6
|
"keywords": [
|
@@ -47,7 +47,7 @@
|
|
47
47
|
"uuid": "^8.1.0"
|
48
48
|
},
|
49
49
|
"peerDependencies": {
|
50
|
-
"@azure/communication-calling": "1.12.0-beta.2
|
50
|
+
"@azure/communication-calling": "1.12.0-beta.2",
|
51
51
|
"@azure/communication-calling-effects": "1.0.0-beta.2",
|
52
52
|
"@azure/communication-chat": ">=1.2.0",
|
53
53
|
"@types/react": ">=16.8.0 <18.0.0",
|
@@ -83,19 +83,19 @@
|
|
83
83
|
"_by-flavor": "rushx _current-flavor && env-cmd -f ../../common/config/env/.env --use-shell"
|
84
84
|
},
|
85
85
|
"devDependencies": {
|
86
|
-
"@azure/communication-calling": "1.12.0-beta.2
|
86
|
+
"@azure/communication-calling": "1.12.0-beta.2",
|
87
87
|
"@azure/communication-calling-effects": "1.0.0-beta.2",
|
88
88
|
"@azure/communication-chat": ">=1.2.0",
|
89
89
|
"@azure/core-auth": "1.3.2",
|
90
90
|
"@babel/cli": "~7.16.0",
|
91
91
|
"@babel/core": "~7.16.0",
|
92
|
-
"@internal/calling-component-bindings": "1.5.1-
|
93
|
-
"@internal/calling-stateful-client": "1.5.1-
|
94
|
-
"@internal/chat-component-bindings": "1.5.1-
|
95
|
-
"@internal/chat-stateful-client": "1.5.1-
|
96
|
-
"@internal/fake-backends": "1.5.1-
|
97
|
-
"@internal/react-components": "1.5.1-
|
98
|
-
"@internal/react-composites": "1.5.1-
|
92
|
+
"@internal/calling-component-bindings": "1.5.1-beta.2",
|
93
|
+
"@internal/calling-stateful-client": "1.5.1-beta.2",
|
94
|
+
"@internal/chat-component-bindings": "1.5.1-beta.2",
|
95
|
+
"@internal/chat-stateful-client": "1.5.1-beta.2",
|
96
|
+
"@internal/fake-backends": "1.5.1-beta.2",
|
97
|
+
"@internal/react-components": "1.5.1-beta.2",
|
98
|
+
"@internal/react-composites": "1.5.1-beta.2",
|
99
99
|
"@microsoft/api-documenter": "~7.12.11",
|
100
100
|
"@microsoft/api-extractor": "~7.18.0",
|
101
101
|
"@rollup/plugin-json": "~4.1.0",
|
@@ -1,21 +0,0 @@
|
|
1
|
-
/// <reference types="react" />
|
2
|
-
import { OnRenderAvatarCallback } from '../types';
|
3
|
-
import { _CaptionsInfo } from './CaptionsBanner';
|
4
|
-
/**
|
5
|
-
* @internal
|
6
|
-
* Props for a single line of caption.
|
7
|
-
*/
|
8
|
-
export interface _CaptionProps extends _CaptionsInfo {
|
9
|
-
/**
|
10
|
-
* Optional callback to override render of the avatar.
|
11
|
-
*
|
12
|
-
* @param userId - user Id
|
13
|
-
*/
|
14
|
-
onRenderAvatar?: OnRenderAvatarCallback;
|
15
|
-
}
|
16
|
-
/**
|
17
|
-
* @internal
|
18
|
-
* A component for displaying a single line of caption
|
19
|
-
*/
|
20
|
-
export declare const _Caption: (props: _CaptionProps) => JSX.Element;
|
21
|
-
//# sourceMappingURL=Caption.d.ts.map
|
@@ -1,32 +0,0 @@
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
2
|
-
// Licensed under the MIT license.
|
3
|
-
import { Persona, Stack, PersonaSize, Text } from '@fluentui/react';
|
4
|
-
import React from 'react';
|
5
|
-
import { captionClassName, displayNameClassName, iconClassName } from './styles/Captions.style';
|
6
|
-
/**
|
7
|
-
* @internal
|
8
|
-
* A component for displaying a single line of caption
|
9
|
-
*/
|
10
|
-
export const _Caption = (props) => {
|
11
|
-
const { displayName, userId, captionText, onRenderAvatar } = props;
|
12
|
-
const personaOptions = {
|
13
|
-
hidePersonaDetails: true,
|
14
|
-
size: PersonaSize.size32,
|
15
|
-
text: displayName,
|
16
|
-
showOverflowTooltip: false,
|
17
|
-
styles: {
|
18
|
-
root: {
|
19
|
-
margin: '0.25rem'
|
20
|
-
}
|
21
|
-
}
|
22
|
-
};
|
23
|
-
const userIcon = onRenderAvatar ? onRenderAvatar(userId !== null && userId !== void 0 ? userId : '', personaOptions) : React.createElement(Persona, Object.assign({}, personaOptions));
|
24
|
-
return (React.createElement(Stack, { horizontal: true, verticalAlign: "start", horizontalAlign: "start" },
|
25
|
-
React.createElement(Stack.Item, { className: iconClassName }, userIcon),
|
26
|
-
React.createElement(Stack, { verticalAlign: "start" },
|
27
|
-
React.createElement(Stack.Item, null,
|
28
|
-
React.createElement(Text, { className: displayNameClassName }, displayName)),
|
29
|
-
React.createElement(Stack.Item, null,
|
30
|
-
React.createElement(Text, { className: captionClassName }, captionText)))));
|
31
|
-
};
|
32
|
-
//# sourceMappingURL=Caption.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file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C,SAAS,EAAE,gBAAgB,IAAG,WAAW,CAAQ,CAC5C,CACP,CACF,CACT,CAAC;AACJ,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\nimport { IPersona, Persona, Stack, PersonaSize, Text } from '@fluentui/react';\nimport React from 'react';\nimport { _FileUploadCardsStrings } from './FileUploadCards';\nimport { OnRenderAvatarCallback } from '../types';\nimport { captionClassName, displayNameClassName, iconClassName } from './styles/Captions.style';\nimport { _CaptionsInfo } from './CaptionsBanner';\n\n/**\n * @internal\n * Props for a single line of caption.\n */\nexport interface _CaptionProps extends _CaptionsInfo {\n /**\n * Optional callback to override render of the avatar.\n *\n * @param userId - user Id\n */\n onRenderAvatar?: OnRenderAvatarCallback;\n}\n\n/**\n * @internal\n * A component for displaying a single line of caption\n */\nexport const _Caption = (props: _CaptionProps): JSX.Element => {\n const { displayName, userId, captionText, onRenderAvatar } = props;\n\n const personaOptions: IPersona = {\n hidePersonaDetails: true,\n size: PersonaSize.size32,\n text: displayName,\n showOverflowTooltip: false,\n styles: {\n root: {\n margin: '0.25rem'\n }\n }\n };\n\n const userIcon = onRenderAvatar ? onRenderAvatar(userId ?? '', personaOptions) : <Persona {...personaOptions} />;\n\n return (\n <Stack horizontal verticalAlign=\"start\" horizontalAlign=\"start\">\n <Stack.Item className={iconClassName}>{userIcon}</Stack.Item>\n\n <Stack verticalAlign=\"start\">\n <Stack.Item>\n <Text className={displayNameClassName}>{displayName}</Text>\n </Stack.Item>\n <Stack.Item>\n <Text className={captionClassName}>{captionText}</Text>\n </Stack.Item>\n </Stack>\n </Stack>\n );\n};\n"]}
|
@@ -1,21 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @private
|
3
|
-
*/
|
4
|
-
export declare const iconClassName: string;
|
5
|
-
/**
|
6
|
-
* @private
|
7
|
-
*/
|
8
|
-
export declare const displayNameClassName: string;
|
9
|
-
/**
|
10
|
-
* @private
|
11
|
-
*/
|
12
|
-
export declare const captionClassName: string;
|
13
|
-
/**
|
14
|
-
* @private
|
15
|
-
*/
|
16
|
-
export declare const captionContainerClassName: string;
|
17
|
-
/**
|
18
|
-
* @private
|
19
|
-
*/
|
20
|
-
export declare const captionsBannerClassName: string;
|
21
|
-
//# sourceMappingURL=Captions.style.d.ts.map
|
@@ -1,41 +0,0 @@
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
2
|
-
// Licensed under the MIT license.
|
3
|
-
import { mergeStyles } from '@fluentui/react';
|
4
|
-
import { _pxToRem } from "../../../../acs-ui-common/src";
|
5
|
-
/**
|
6
|
-
* @private
|
7
|
-
*/
|
8
|
-
export const iconClassName = mergeStyles({
|
9
|
-
marginRight: _pxToRem(8)
|
10
|
-
});
|
11
|
-
/**
|
12
|
-
* @private
|
13
|
-
*/
|
14
|
-
export const displayNameClassName = mergeStyles({
|
15
|
-
fontWeight: 400,
|
16
|
-
fontSize: _pxToRem(12),
|
17
|
-
lineHeight: _pxToRem(16)
|
18
|
-
});
|
19
|
-
/**
|
20
|
-
* @private
|
21
|
-
*/
|
22
|
-
export const captionClassName = mergeStyles({
|
23
|
-
fontWeight: 400,
|
24
|
-
fontSize: _pxToRem(16),
|
25
|
-
lineHeight: _pxToRem(22)
|
26
|
-
});
|
27
|
-
/**
|
28
|
-
* @private
|
29
|
-
*/
|
30
|
-
export const captionContainerClassName = mergeStyles({
|
31
|
-
marginTop: _pxToRem(6),
|
32
|
-
marginBottom: _pxToRem(6)
|
33
|
-
});
|
34
|
-
/**
|
35
|
-
* @private
|
36
|
-
*/
|
37
|
-
export const captionsBannerClassName = mergeStyles({
|
38
|
-
height: _pxToRem(100),
|
39
|
-
overflow: 'scroll'
|
40
|
-
});
|
41
|
-
//# sourceMappingURL=Captions.style.js.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"Captions.style.js","sourceRoot":"","sources":["../../../../../../../react-components/src/components/styles/Captions.style.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,sCAAgC;AAEnD;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,WAAW,CAAC;IACvC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;CACzB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,WAAW,CAAC;IAC9C,UAAU,EAAE,GAAG;IACf,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC;IACtB,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC;CACzB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,WAAW,CAAC;IAC1C,UAAU,EAAE,GAAG;IACf,QAAQ,EAAE,QAAQ,CAAC,EAAE,CAAC;IACtB,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC;CACzB,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,WAAW,CAAC;IACnD,SAAS,EAAE,QAAQ,CAAC,CAAC,CAAC;IACtB,YAAY,EAAE,QAAQ,CAAC,CAAC,CAAC;CAC1B,CAAC,CAAC;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,WAAW,CAAC;IACjD,MAAM,EAAE,QAAQ,CAAC,GAAG,CAAC;IACrB,QAAQ,EAAE,QAAQ;CACnB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { mergeStyles } from '@fluentui/react';\nimport { _pxToRem } from '@internal/acs-ui-common';\n\n/**\n * @private\n */\nexport const iconClassName = mergeStyles({\n marginRight: _pxToRem(8)\n});\n\n/**\n * @private\n */\nexport const displayNameClassName = mergeStyles({\n fontWeight: 400,\n fontSize: _pxToRem(12),\n lineHeight: _pxToRem(16)\n});\n\n/**\n * @private\n */\nexport const captionClassName = mergeStyles({\n fontWeight: 400,\n fontSize: _pxToRem(16),\n lineHeight: _pxToRem(22)\n});\n\n/**\n * @private\n */\nexport const captionContainerClassName = mergeStyles({\n marginTop: _pxToRem(6),\n marginBottom: _pxToRem(6)\n});\n\n/**\n * @private\n */\nexport const captionsBannerClassName = mergeStyles({\n height: _pxToRem(100),\n overflow: 'scroll'\n});\n\"../../../../acs-ui-common/src\""]}
|
package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.d.ts
DELETED
@@ -1,30 +0,0 @@
|
|
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
|
package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js
DELETED
@@ -1,253 +0,0 @@
|
|
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
|
package/dist/dist-esm/react-composites/src/composites/common/ControlBar/CommonCallControlBar.js.map
DELETED
@@ -1 +0,0 @@
|
|
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,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChH,OAAO,EAAE,yBAAyB,EAAE,MAAM,g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AAG;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 +0,0 @@
|
|
1
|
-
{"version":3,"file":"CustomButton.js","sourceRoot":"","sources":["../../../../../../../../react-composites/src/composites/common/ControlBar/CustomButton.tsx"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,iDAAiD;AACjD,OAAO,EAAE,IAAI,EAAuB,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAC5E,OAAO,EAAE,gBAAgB,EAAwB,4CAAmC;AACpF,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC,kCAAkC,EAAE,CAAC;IACrC,iCAAiC,EAAE,CAAC;IACpC,oCAAoC,EAAE,CAAC;CACxC,CAAC;AAOF,eAAe;AACf,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAChD,wBAA4D,EAC5D,WAAoC,EACrB,EAAE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,CAAC,GAAG,CAAC,kCAAkC,CAAC;SACjE;QACH,CAAC,CAAC,SAAS,IACb,CAAC;AAmDH,+DAA+D;AAC/D,eAAe;AACf,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAChD,OAAkC,EACa,EAAE;IACjD,IAAI,QAAQ,GAAkD,SAAS,CAAC;IACxE,QAAQ,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,wBAAwB,CAAC;IAC7C,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n// eslint-disable-next-line no-restricted-imports\nimport { Icon, IContextualMenuItem, mergeStyleSets } from '@fluentui/react';\nimport { ControlBarButton, _DrawerMenuItemProps } from '@internal/react-components';\nimport React from 'react';\nimport { CustomCallControlButtonCallbackArgs, CustomControlButtonProps } from '../types/CommonCallControlOptions';\nimport { CallControlDisplayType } from '../types/CommonCallControlOptions';\n/* @conditional-compile-remove(control-bar-button-injection) */\nimport { CommonCallControlOptions } from '../types/CommonCallControlOptions';\n\n/**\n * Max number of Custom Buttons in primary and secondary ControlBar\n * Does not include existing buttons in the controlBar.\n *\n * @private\n */\nexport const CUSTOM_BUTTON_OPTIONS = {\n MAX_PRIMARY_DESKTOP_CUSTOM_BUTTONS: 3,\n MAX_PRIMARY_MOBILE_CUSTOM_BUTTONS: 1,\n MAX_SECONDARY_DESKTOP_CUSTOM_BUTTONS: 2\n};\n\n/** @private */\nexport type CustomButtons = {\n [key in CustomCallControlButtonPlacement]: typeof ControlBarButton[] | undefined;\n};\n\n/** @private */\nexport const generateCustomCallControlBarButton = (\n onFetchCustomButtonProps?: CustomCallControlButtonCallback[],\n displayType?: CallControlDisplayType\n): CustomButtons => {\n const allButtonProps = onFetchCustomButtonProps?.map((callback) => callback({ displayType }));\n\n return {\n primary: generateCustomControlBarButtons('primary', allButtonProps),\n secondary: generateCustomControlBarButtons('secondary', allButtonProps),\n overflow: generateCustomControlBarButtons('overflow', allButtonProps)\n };\n};\n\n/** @private */\nconst generateCustomControlBarButtons = (\n placement: CustomCallControlButtonPlacement,\n customButtons?: CustomCallControlButtonProps[]\n): typeof ControlBarButton[] =>\n customButtons\n ? customButtons\n .filter((buttonProps) => buttonProps.placement === placement)\n .map((buttonProps, i) => (internalProps) => (\n <ControlBarButton\n ariaDescription={buttonProps.ariaDescription ?? internalProps.ariaDescription}\n ariaLabel={buttonProps.ariaLabel ?? internalProps.ariaLabel}\n disabled={buttonProps.disabled ?? internalProps.disabled}\n id={buttonProps.id ?? internalProps.id}\n key={buttonProps.key ?? `${buttonProps.placement}_${i}`}\n onClick={buttonProps.onItemClick ?? internalProps.onClick}\n onRenderIcon={() => (\n <Icon iconName={buttonProps.iconName ?? internalProps.iconProps?.iconName ?? 'ControlButtonOptions'} />\n )}\n showLabel={buttonProps.showLabel ?? internalProps.showLabel}\n text={buttonProps.text ?? internalProps.text}\n styles={mergeStyleSets(internalProps.styles, buttonProps.styles)}\n />\n ))\n : [];\n\n/** @private */\nconst generateCustomDrawerButtons = (\n placement: CustomCallControlButtonPlacement,\n customButtons?: CustomCallControlButtonProps[]\n): _DrawerMenuItemProps[] =>\n customButtons\n ? customButtons\n .filter((buttonProps) => buttonProps.placement === placement)\n .map(\n (buttonProps, i): _DrawerMenuItemProps => ({\n ...buttonProps,\n disabled: buttonProps.disabled,\n iconProps: { iconName: buttonProps.iconName },\n id: buttonProps.id,\n itemKey: buttonProps.key ? '' + buttonProps.key : `${buttonProps.placement}_${i}`,\n onItemClick: buttonProps.onItemClick,\n text: buttonProps.text\n })\n )\n : [];\n\n/** @private */\nexport type CustomDrawerButtons = {\n [key in CustomCallControlButtonPlacement]: _DrawerMenuItemProps[];\n};\n\n/** @private */\nexport const generateCustomCallDrawerButtons = (\n onFetchCustomButtonProps?: CustomCallControlButtonCallback[],\n displayType?: CallControlDisplayType\n): CustomDrawerButtons => {\n const customButtons = onFetchCustomButtonProps?.map((callback) => callback({ displayType }));\n return {\n primary: generateCustomDrawerButtons('primary', customButtons),\n secondary: generateCustomDrawerButtons('secondary', customButtons),\n overflow: generateCustomDrawerButtons('overflow', customButtons)\n };\n};\n\n/** @private */\nexport type CustomDesktopOverflowButtons = {\n [key in CustomCallControlButtonPlacement]: IContextualMenuItem[];\n};\n\n/** @private */\nexport const generateCustomCallDesktopOverflowButtons = (\n onFetchCustomButtonProps?: CustomCallControlButtonCallback[],\n displayType?: CallControlDisplayType\n): CustomDesktopOverflowButtons => {\n const customButtons = onFetchCustomButtonProps?.map((callback) => callback({ displayType }));\n return {\n primary: generateCustomDrawerButtons('primary', customButtons).map(drawerMenuItemToContextualMenuItem),\n secondary: generateCustomDrawerButtons('secondary', customButtons).map(drawerMenuItemToContextualMenuItem),\n overflow: generateCustomDrawerButtons('overflow', customButtons).map(drawerMenuItemToContextualMenuItem)\n };\n};\n\n/** @private */\nexport const drawerMenuItemToContextualMenuItem = (item: _DrawerMenuItemProps): IContextualMenuItem => ({\n ...item,\n key: item.itemKey,\n onClick: item.onItemClick\n ? (ev) => {\n item.onItemClick?.(ev);\n }\n : undefined,\n subMenuProps: item.subMenuProps\n ? {\n items: item.subMenuProps.map(drawerMenuItemToContextualMenuItem)\n }\n : undefined\n});\n\n/**\n * A callback that returns the props to render a custom {@link ControlBarButton} and {@link DrawerMenuItem}.\n *\n * The response indicates where the custom button should be placed.\n *\n * Performance tip: This callback is only called when either the callback or its arguments change.\n * @beta\n */\nexport type CustomCallControlButtonCallback = (\n args: CustomCallControlButtonCallbackArgs\n) => CustomCallControlButtonProps;\n\n/**\n * Placement for a custom button injected in the {@link CommonCallControlBar}.\n *\n * 'primary': Place the button(s) on the right end of the center control bar but before the EndCallButton (left end in rtl mode).\n * 'overflow': Place the buttons(s) on the end of the overflow Menu.\n * 'secondary': Place the button(s) on the left end of the side control bar (right in rtl mode).\n *\n * Multiple buttons assigned the same placement are appended in order.\n * E.g., if two buttons are placed in 'secondary', they'll both appear on the left end (right end in rtl mode)\n * in the order provided.\n *\n * Only 'primary' placement works when legacy call control is enabled in call composite\n *\n * @beta\n */\nexport type CustomCallControlButtonPlacement = 'primary' | 'overflow' | 'secondary';\n\n/**\n * Response from {@link CustomCallControlButtonCallback}.\n *\n * Includes the icon and placement prop necessary to indicate where to place the\n * {@link ControlBarButton} and a {@link DrawerMenuItem}\n *\n * @beta\n */\nexport interface CustomCallControlButtonProps extends CustomControlButtonProps {\n /**\n * Where to place the custom button relative to other buttons.\n */\n placement: CustomCallControlButtonPlacement;\n /**\n * Icon to render. Icon is a non-default icon name that needs to be registered as a\n * custom icon using registerIcons through fluentui. Examples include icons from the fluentui library\n */\n iconName?: string;\n}\n\n/* @conditional-compile-remove(control-bar-button-injection) */\n/** @private */\nexport const onFetchCustomButtonPropsTrampoline = (\n options?: CommonCallControlOptions\n): CustomCallControlButtonCallback[] | undefined => {\n let response: CustomCallControlButtonCallback[] | undefined = undefined;\n response = options?.onFetchCustomButtonProps;\n return response;\n};\n\"../../../../../react-components/src\""]}
|