@microsoft/omnichannel-chat-components 0.1.0-main.fc27009 → 1.0.1-main.57b83f8
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/lib/cjs/common/Constants.js +26 -8
- package/lib/cjs/common/utils.js +21 -2
- package/lib/cjs/components/callingcontainer/common/defaultProps/defaultCallingContainerControlProps.js +4 -1
- package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +7 -7
- package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlProps.js +26 -23
- package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlPropsRtl.js +20 -18
- package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +21 -8
- package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlProps.js +22 -19
- package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlPropsRtl.js +18 -16
- package/lib/cjs/components/chatbutton/ChatButton.js +28 -24
- package/lib/cjs/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +11 -5
- package/lib/cjs/components/chatbutton/common/defaultStyles/defaultChatButtonSubTitleStyles.js +3 -1
- package/lib/cjs/components/chatbutton/common/defaultStyles/defaultChatButtonTitleStyles.js +1 -0
- package/lib/cjs/components/common/commandbutton/CommandButton.js +37 -12
- package/lib/cjs/components/{header → common}/subcomponents/CloseButton.js +8 -7
- package/lib/cjs/components/confirmationpane/ConfirmationPane.js +9 -2
- package/lib/cjs/components/confirmationpane/common/defaultProps/defaultConfirmationPaneControlProps.js +10 -7
- package/lib/cjs/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneButtonGroupStyles.js +5 -1
- package/lib/cjs/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneGeneralStyles.js +7 -4
- package/lib/cjs/components/footer/Footer.js +7 -5
- package/lib/cjs/components/footer/common/defaultProps/customFooterControlProps.js +12 -10
- package/lib/cjs/components/footer/common/defaultProps/defaultFooterControlProps.js +18 -14
- package/lib/cjs/components/footer/common/defaultStyles/defaultFooterStyleProps.js +12 -6
- package/lib/cjs/components/footer/subcomponents/AudioNotificationButton.js +31 -14
- package/lib/cjs/components/footer/subcomponents/DownloadTranscriptButton.js +4 -4
- package/lib/cjs/components/footer/subcomponents/EmailTranscriptButton.js +4 -4
- package/lib/cjs/components/header/Header.js +7 -5
- package/lib/cjs/components/header/common/defaultProps/azureHeaderControlProps.js +8 -6
- package/lib/cjs/components/header/common/defaultProps/customHeaderControlProps.js +9 -7
- package/lib/cjs/components/header/common/defaultProps/defaultHeaderComponentOverrides.js +3 -1
- package/lib/cjs/components/header/common/defaultProps/defaultHeaderControlProps.js +13 -11
- package/lib/cjs/components/header/subcomponents/MinimizeButton.js +4 -4
- package/lib/cjs/components/inputvalidationpane/InputValidationPane.js +28 -28
- package/lib/cjs/components/inputvalidationpane/common/default/defaultProps/defaultInputValidationPaneControlProps.js +11 -11
- package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -1
- package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneGeneralStyles.js +1 -1
- package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneInvalidInputErrorMessageStyles.js +1 -1
- package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneSendButtonStyles.js +2 -1
- package/lib/cjs/components/inputvalidationpane/common/presetTwo/presetTwoProps/presetTwoInputValidationPaneControlProps.js +11 -11
- package/lib/cjs/components/loadingpane/LoadingPane.js +3 -2
- package/lib/cjs/components/loadingpane/common/defaultProps/defaultLoadingPaneControlProps.js +7 -4
- package/lib/cjs/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +3 -2
- package/lib/cjs/components/loadingpane/common/presetOneProps/presetOneLoadingPaneControlProps.js +1 -1
- package/lib/cjs/components/loadingpane/common/presetThreeProps/presetThreeLoadingPaneControlProps.js +1 -1
- package/lib/cjs/components/loadingpane/common/presetTwoProps/presetTwoLoadingPaneControlProps.js +1 -1
- package/lib/cjs/components/outofofficehourspane/OOOHPane.js +13 -6
- package/lib/cjs/components/outofofficehourspane/common/defaultProps/defaultOOOHPaneControlProps.js +7 -2
- package/lib/cjs/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.js +15 -0
- package/lib/cjs/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneProps.js +16 -0
- package/lib/cjs/components/outofofficehourspane/common/presetOneProps/presetOneOOOHPaneControlProps.js +1 -1
- package/lib/cjs/components/outofofficehourspane/common/presetTwoProps/presetTwoOOOHPaneControlProps.js +1 -1
- package/lib/cjs/components/postchatsurveypane/PostChatSurveyPane.js +2 -1
- package/lib/cjs/components/postchatsurveypane/common/defaultProps/defaultPostChatSurveyPaneControlProps.js +5 -2
- package/lib/cjs/components/postchatsurveypane/common/presetOneProps/presetOnePostChatSurveyPaneControlProps.js +1 -1
- package/lib/cjs/components/prechatsurveypane/PreChatSurveyPane.js +25 -11
- package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultPreChatSurveyPaneControlProps.js +5 -1
- package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +4 -1
- package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.js +10 -0
- package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneStyles.js +7 -1
- package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.js +10 -0
- package/lib/cjs/components/prechatsurveypane/common/presetThreeProps/presetThreePreChatSurveyPaneControlProps.js +1 -1
- package/lib/cjs/components/prechatsurveypane/common/presetTwoProps/presetTwoPreChatSurveyPaneControlProps.js +1 -1
- package/lib/cjs/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.js +1 -0
- package/lib/cjs/components/proactivechatpane/ProactiveChatPane.js +36 -35
- package/lib/cjs/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +15 -8
- package/lib/cjs/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -13
- package/lib/cjs/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +15 -8
- package/lib/cjs/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +15 -8
- package/lib/cjs/components/proactivechatpane/common/presetTwo/presetTwoProps/presetTwoProactiveChatPaneControlProps.js +9 -6
- package/lib/cjs/components/reconnectchatpane/ReconnectChatPane.js +3 -3
- package/lib/cjs/components/reconnectchatpane/common/default/defaultProps/defaultReconnectChatPaneControlProps.js +12 -9
- package/lib/cjs/components/reconnectchatpane/common/presetThree/presetThreeProps/presetThreeReconnectChatPaneControlProps.js +11 -8
- package/lib/cjs/index.js +6 -0
- package/lib/cjs/services/BroadcastService.js +36 -8
- package/lib/esm/common/Constants.js +18 -6
- package/lib/esm/common/utils.js +16 -0
- package/lib/esm/components/callingcontainer/common/defaultProps/defaultCallingContainerControlProps.js +2 -1
- package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +8 -8
- package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlProps.js +24 -23
- package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlPropsRtl.js +19 -18
- package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +22 -9
- package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlProps.js +20 -19
- package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlPropsRtl.js +17 -16
- package/lib/esm/components/chatbutton/ChatButton.js +28 -24
- package/lib/esm/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +9 -5
- package/lib/esm/components/chatbutton/common/defaultStyles/defaultChatButtonSubTitleStyles.js +3 -1
- package/lib/esm/components/chatbutton/common/defaultStyles/defaultChatButtonTitleStyles.js +1 -0
- package/lib/esm/components/common/commandbutton/CommandButton.js +38 -13
- package/lib/esm/components/{header → common}/subcomponents/CloseButton.js +9 -8
- package/lib/esm/components/confirmationpane/ConfirmationPane.js +10 -3
- package/lib/esm/components/confirmationpane/common/defaultProps/defaultConfirmationPaneControlProps.js +8 -7
- package/lib/esm/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneButtonGroupStyles.js +5 -1
- package/lib/esm/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneGeneralStyles.js +7 -4
- package/lib/esm/components/footer/Footer.js +6 -5
- package/lib/esm/components/footer/common/defaultProps/customFooterControlProps.js +11 -10
- package/lib/esm/components/footer/common/defaultProps/defaultFooterControlProps.js +16 -14
- package/lib/esm/components/footer/common/defaultStyles/defaultFooterStyleProps.js +12 -6
- package/lib/esm/components/footer/subcomponents/AudioNotificationButton.js +32 -15
- package/lib/esm/components/footer/subcomponents/DownloadTranscriptButton.js +5 -5
- package/lib/esm/components/footer/subcomponents/EmailTranscriptButton.js +5 -5
- package/lib/esm/components/header/Header.js +6 -5
- package/lib/esm/components/header/common/defaultProps/azureHeaderControlProps.js +7 -6
- package/lib/esm/components/header/common/defaultProps/customHeaderControlProps.js +8 -7
- package/lib/esm/components/header/common/defaultProps/defaultHeaderComponentOverrides.js +2 -1
- package/lib/esm/components/header/common/defaultProps/defaultHeaderControlProps.js +12 -11
- package/lib/esm/components/header/subcomponents/MinimizeButton.js +5 -5
- package/lib/esm/components/inputvalidationpane/InputValidationPane.js +29 -29
- package/lib/esm/components/inputvalidationpane/common/default/defaultProps/defaultInputValidationPaneControlProps.js +12 -12
- package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -1
- package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneGeneralStyles.js +1 -1
- package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneInvalidInputErrorMessageStyles.js +1 -1
- package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneSendButtonStyles.js +2 -1
- package/lib/esm/components/inputvalidationpane/common/presetTwo/presetTwoProps/presetTwoInputValidationPaneControlProps.js +12 -12
- package/lib/esm/components/loadingpane/LoadingPane.js +3 -2
- package/lib/esm/components/loadingpane/common/defaultProps/defaultLoadingPaneControlProps.js +5 -4
- package/lib/esm/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +3 -2
- package/lib/esm/components/loadingpane/common/presetOneProps/presetOneLoadingPaneControlProps.js +1 -1
- package/lib/esm/components/loadingpane/common/presetThreeProps/presetThreeLoadingPaneControlProps.js +1 -1
- package/lib/esm/components/loadingpane/common/presetTwoProps/presetTwoLoadingPaneControlProps.js +1 -1
- package/lib/esm/components/outofofficehourspane/OOOHPane.js +13 -7
- package/lib/esm/components/outofofficehourspane/common/defaultProps/defaultOOOHPaneControlProps.js +5 -2
- package/lib/esm/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.js +6 -0
- package/lib/esm/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneProps.js +6 -0
- package/lib/esm/components/outofofficehourspane/common/presetOneProps/presetOneOOOHPaneControlProps.js +1 -1
- package/lib/esm/components/outofofficehourspane/common/presetTwoProps/presetTwoOOOHPaneControlProps.js +1 -1
- package/lib/esm/components/postchatsurveypane/PostChatSurveyPane.js +2 -1
- package/lib/esm/components/postchatsurveypane/common/defaultProps/defaultPostChatSurveyPaneControlProps.js +3 -2
- package/lib/esm/components/postchatsurveypane/common/presetOneProps/presetOnePostChatSurveyPaneControlProps.js +1 -1
- package/lib/esm/components/prechatsurveypane/PreChatSurveyPane.js +26 -12
- package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultPreChatSurveyPaneControlProps.js +3 -1
- package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +4 -1
- package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.js +3 -0
- package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneStyles.js +5 -1
- package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.js +3 -0
- package/lib/esm/components/prechatsurveypane/common/presetThreeProps/presetThreePreChatSurveyPaneControlProps.js +1 -1
- package/lib/esm/components/prechatsurveypane/common/presetTwoProps/presetTwoPreChatSurveyPaneControlProps.js +1 -1
- package/lib/esm/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.js +1 -0
- package/lib/esm/components/proactivechatpane/ProactiveChatPane.js +33 -34
- package/lib/esm/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +13 -8
- package/lib/esm/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -11
- package/lib/esm/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +13 -8
- package/lib/esm/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +13 -8
- package/lib/esm/components/proactivechatpane/common/presetTwo/presetTwoProps/presetTwoProactiveChatPaneControlProps.js +7 -6
- package/lib/esm/components/reconnectchatpane/ReconnectChatPane.js +4 -4
- package/lib/esm/components/reconnectchatpane/common/default/defaultProps/defaultReconnectChatPaneControlProps.js +10 -9
- package/lib/esm/components/reconnectchatpane/common/presetThree/presetThreeProps/presetThreeReconnectChatPaneControlProps.js +9 -8
- package/lib/esm/index.js +1 -0
- package/lib/esm/services/BroadcastService.js +34 -8
- package/lib/types/common/Constants.d.ts +151 -2
- package/lib/types/common/utils.d.ts +1 -0
- package/lib/types/components/chatbutton/interfaces/IChatButtonControlProps.d.ts +3 -0
- package/lib/types/components/common/interfaces/ICommandButtonControlProps.d.ts +1 -0
- package/lib/types/components/common/interfaces/ICommandButtonProps.d.ts +1 -0
- package/lib/types/components/{header → common}/subcomponents/CloseButton.d.ts +1 -1
- package/lib/types/components/confirmationpane/interfaces/IConfirmationPaneControlProps.d.ts +0 -1
- package/lib/types/components/inputvalidationpane/interfaces/IInputValidationPaneControlProps.d.ts +0 -1
- package/lib/types/components/loadingpane/interfaces/ILoadingPaneProps.d.ts +2 -0
- package/lib/types/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.d.ts +2 -0
- package/lib/types/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneProps.d.ts +2 -0
- package/lib/types/components/outofofficehourspane/interfaces/IOOOHPaneControlProps.d.ts +1 -0
- package/lib/types/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.d.ts +2 -0
- package/lib/types/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.d.ts +2 -0
- package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneButtonStyles.d.ts +3 -0
- package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.d.ts +5 -0
- package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneStyleProps.d.ts +5 -0
- package/lib/types/components/proactivechatpane/interfaces/IProactiveChatPaneControlProps.d.ts +2 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/services/BroadcastService.d.ts +1 -0
- package/package.json +2 -2
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { CallRejectButtonBase64, VideoOffIconBase64, VideoOnIconBase64, VoiceOffIconBase64, VoiceOnIconBase64 } from "../../../../../../assets/Icons";
|
|
2
|
+
import { AriaLabels, ButtonTypes, Ids } from "../../../../../../common/Constants";
|
|
2
3
|
export const defaultCurrentCallControlPropsRtl = {
|
|
3
|
-
id:
|
|
4
|
+
id: Ids.DefaultCurrentCallId,
|
|
4
5
|
nonActionIds: {
|
|
5
|
-
currentCallActionGroupId:
|
|
6
|
-
currentCallFooterId:
|
|
7
|
-
remoteVideoTileId:
|
|
8
|
-
selfVideoTileId:
|
|
9
|
-
videoTileGroupId:
|
|
6
|
+
currentCallActionGroupId: Ids.CurrentCallActionGroupId,
|
|
7
|
+
currentCallFooterId: Ids.CurrentCallFooterId,
|
|
8
|
+
remoteVideoTileId: Ids.RemoteVideoTileId,
|
|
9
|
+
selfVideoTileId: Ids.SelfVideoTileId,
|
|
10
|
+
videoTileGroupId: Ids.VideoTileGroupId
|
|
10
11
|
},
|
|
11
12
|
hideMicButton: false,
|
|
12
13
|
hideVideoButton: false,
|
|
@@ -37,9 +38,9 @@ export const defaultCurrentCallControlPropsRtl = {
|
|
|
37
38
|
},
|
|
38
39
|
dir: "rtl",
|
|
39
40
|
endCallButtonProps: {
|
|
40
|
-
id:
|
|
41
|
-
type:
|
|
42
|
-
ariaLabel:
|
|
41
|
+
id: Ids.EndCallButtonId,
|
|
42
|
+
type: ButtonTypes.Icon,
|
|
43
|
+
ariaLabel: AriaLabels.EndCall,
|
|
43
44
|
imageIconProps: {
|
|
44
45
|
src: CallRejectButtonBase64,
|
|
45
46
|
styles: {
|
|
@@ -51,10 +52,10 @@ export const defaultCurrentCallControlPropsRtl = {
|
|
|
51
52
|
}
|
|
52
53
|
},
|
|
53
54
|
micButtonProps: {
|
|
54
|
-
id:
|
|
55
|
-
type:
|
|
56
|
-
ariaLabel:
|
|
57
|
-
toggleAriaLabel:
|
|
55
|
+
id: Ids.MicButtonId,
|
|
56
|
+
type: ButtonTypes.Icon,
|
|
57
|
+
ariaLabel: AriaLabels.MicMute,
|
|
58
|
+
toggleAriaLabel: AriaLabels.MicUnmute,
|
|
58
59
|
imageIconProps: {
|
|
59
60
|
src: VoiceOnIconBase64,
|
|
60
61
|
styles: {
|
|
@@ -76,10 +77,10 @@ export const defaultCurrentCallControlPropsRtl = {
|
|
|
76
77
|
iconSize: 18
|
|
77
78
|
},
|
|
78
79
|
videoButtonProps: {
|
|
79
|
-
id:
|
|
80
|
-
type:
|
|
81
|
-
ariaLabel:
|
|
82
|
-
toggleAriaLabel:
|
|
80
|
+
id: Ids.VideoButtonId,
|
|
81
|
+
type: ButtonTypes.Icon,
|
|
82
|
+
ariaLabel: AriaLabels.VideoTurnCameraOn,
|
|
83
|
+
toggleAriaLabel: AriaLabels.VideoTurnCameraOff,
|
|
83
84
|
imageIconProps: {
|
|
84
85
|
src: VideoOnIconBase64,
|
|
85
86
|
styles: {
|
|
@@ -101,6 +102,6 @@ export const defaultCurrentCallControlPropsRtl = {
|
|
|
101
102
|
iconSize: 18
|
|
102
103
|
},
|
|
103
104
|
callTimerProps: {
|
|
104
|
-
id:
|
|
105
|
+
id: Ids.CallTimerId
|
|
105
106
|
}
|
|
106
107
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Label, Stack } from "@fluentui/react";
|
|
5
5
|
import CommandButton from "../../../common/commandbutton/CommandButton";
|
|
6
|
-
import { ElementType, KeyCodes } from "../../../../common/Constants";
|
|
6
|
+
import { ElementType, EventNames, Ids, KeyCodes } from "../../../../common/Constants";
|
|
7
7
|
import { decodeComponentString } from "../../../../common/decodeComponentString";
|
|
8
8
|
import { defaultIncomingCallProps } from "./common/defaultProps/defaultIncomingCallProps";
|
|
9
9
|
import { processCustomComponents } from "../../../../common/utils";
|
|
@@ -45,7 +45,7 @@ function IncomingCall(props) {
|
|
|
45
45
|
const declineCustomEvent = {
|
|
46
46
|
elementType: ElementType.IncomingCallDeclineCallButton,
|
|
47
47
|
elementId: declineCallButtonId,
|
|
48
|
-
eventName:
|
|
48
|
+
eventName: EventNames.IncomingCallEnded
|
|
49
49
|
};
|
|
50
50
|
const handleDeclineCallClick = useCallback(() => {
|
|
51
51
|
var _props$controlProps12;
|
|
@@ -59,7 +59,7 @@ function IncomingCall(props) {
|
|
|
59
59
|
const videoCustomEvent = {
|
|
60
60
|
elementType: ElementType.IncomingCallVideoCallButton,
|
|
61
61
|
elementId: videoCallButtonId,
|
|
62
|
-
eventName:
|
|
62
|
+
eventName: EventNames.OnClick
|
|
63
63
|
};
|
|
64
64
|
const handleVideoCallClick = useCallback(() => {
|
|
65
65
|
var _props$controlProps14;
|
|
@@ -73,7 +73,7 @@ function IncomingCall(props) {
|
|
|
73
73
|
const audioCustomEvent = {
|
|
74
74
|
elementType: ElementType.IncomingCallAudioCallButton,
|
|
75
75
|
elementId: audioCallButtonId,
|
|
76
|
-
eventName:
|
|
76
|
+
eventName: EventNames.OnClick
|
|
77
77
|
};
|
|
78
78
|
const handleAudioCallClick = useCallback(() => {
|
|
79
79
|
var _props$controlProps16;
|
|
@@ -114,15 +114,28 @@ function IncomingCall(props) {
|
|
|
114
114
|
window.removeEventListener("keydown", ignoreDefault);
|
|
115
115
|
};
|
|
116
116
|
}, []);
|
|
117
|
+
useEffect(() => {
|
|
118
|
+
// Setting focus to decline call button when incoming call alert appears
|
|
119
|
+
if (declineCallButtonId) {
|
|
120
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
121
|
+
const declineCallButton = document.getElementById(declineCallButtonId);
|
|
122
|
+
|
|
123
|
+
if (declineCallButton) {
|
|
124
|
+
declineCallButton.focus();
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}, []);
|
|
117
128
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
118
129
|
horizontal: true,
|
|
119
130
|
className: (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.className,
|
|
120
131
|
horizontalAlign: "space-between",
|
|
121
132
|
styles: stackStyles,
|
|
122
|
-
dir: ((_props$controlProps18 = props.controlProps) === null || _props$controlProps18 === void 0 ? void 0 : _props$controlProps18.dir) ?? ((_defaultIncomingCallP27 = defaultIncomingCallProps.controlProps) === null || _defaultIncomingCallP27 === void 0 ? void 0 : _defaultIncomingCallP27.dir)
|
|
133
|
+
dir: ((_props$controlProps18 = props.controlProps) === null || _props$controlProps18 === void 0 ? void 0 : _props$controlProps18.dir) ?? ((_defaultIncomingCallP27 = defaultIncomingCallProps.controlProps) === null || _defaultIncomingCallP27 === void 0 ? void 0 : _defaultIncomingCallP27.dir),
|
|
134
|
+
role: "alert",
|
|
135
|
+
"aria-label": incomingCallTitleProps === null || incomingCallTitleProps === void 0 ? void 0 : incomingCallTitleProps.text
|
|
123
136
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
124
137
|
horizontal: true,
|
|
125
|
-
id:
|
|
138
|
+
id: Ids.IncomingCallLeftGroupId,
|
|
126
139
|
verticalAlign: "center",
|
|
127
140
|
tokens: leftGroupStackTokens
|
|
128
141
|
}, !((_props$controlProps19 = props.controlProps) !== null && _props$controlProps19 !== void 0 && _props$controlProps19.hideIncomingCallTitle) && (decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.incomingCallTitle) || /*#__PURE__*/React.createElement(Label, _extends({}, incomingCallTitleProps, {
|
|
@@ -131,12 +144,12 @@ function IncomingCall(props) {
|
|
|
131
144
|
styles: incomingCallTitleStyles
|
|
132
145
|
}), incomingCallTitleProps === null || incomingCallTitleProps === void 0 ? void 0 : incomingCallTitleProps.text)), processCustomComponents((_props$controlProps20 = props.controlProps) === null || _props$controlProps20 === void 0 ? void 0 : (_props$controlProps21 = _props$controlProps20.leftGroup) === null || _props$controlProps21 === void 0 ? void 0 : _props$controlProps21.children)), /*#__PURE__*/React.createElement(Stack, {
|
|
133
146
|
horizontal: true,
|
|
134
|
-
id:
|
|
147
|
+
id: Ids.IncomingCallMiddleGroupId,
|
|
135
148
|
verticalAlign: "center",
|
|
136
149
|
tokens: middleGroupStackTokens
|
|
137
150
|
}, processCustomComponents((_props$controlProps22 = props.controlProps) === null || _props$controlProps22 === void 0 ? void 0 : (_props$controlProps23 = _props$controlProps22.middleGroup) === null || _props$controlProps23 === void 0 ? void 0 : _props$controlProps23.children)), /*#__PURE__*/React.createElement(Stack, {
|
|
138
151
|
horizontal: true,
|
|
139
|
-
id:
|
|
152
|
+
id: Ids.IncomingCallRightGroupId,
|
|
140
153
|
verticalAlign: "center",
|
|
141
154
|
tokens: rightGroupStackTokens
|
|
142
155
|
}, processCustomComponents((_props$controlProps24 = props.controlProps) === null || _props$controlProps24 === void 0 ? void 0 : (_props$controlProps25 = _props$controlProps24.rightGroup) === null || _props$controlProps25 === void 0 ? void 0 : _props$controlProps25.children), !((_props$controlProps26 = props.controlProps) !== null && _props$controlProps26 !== void 0 && _props$controlProps26.hideDeclineCall) && /*#__PURE__*/React.createElement(CommandButton, _extends({}, declineCallButtonProps, {
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
+
import { AriaLabels, IconNames, ButtonTypes, Ids, Texts } from "../../../../../../common/Constants";
|
|
1
2
|
export const defaultIncomingCallControlProps = {
|
|
2
|
-
id:
|
|
3
|
+
id: Ids.DefaultIncomingCallId,
|
|
3
4
|
dir: "ltr",
|
|
4
|
-
ariaLabel:
|
|
5
|
+
ariaLabel: AriaLabels.IncomingCallArea,
|
|
5
6
|
hideAudioCall: false,
|
|
6
7
|
hideVideoCall: false,
|
|
7
8
|
hideDeclineCall: false,
|
|
8
9
|
hideIncomingCallTitle: false,
|
|
9
10
|
onDeclineCallClick: function () {
|
|
10
|
-
console.log("
|
|
11
|
+
console.log("decline call clicked");
|
|
11
12
|
},
|
|
12
13
|
onAudioCallClick: function () {
|
|
13
|
-
console.log("
|
|
14
|
+
console.log("audio call clicked");
|
|
14
15
|
},
|
|
15
16
|
onVideoCallClick: function () {
|
|
16
|
-
console.log("
|
|
17
|
+
console.log("video call clicked");
|
|
17
18
|
},
|
|
18
19
|
middleGroup: {
|
|
19
20
|
gap: 5,
|
|
@@ -28,28 +29,28 @@ export const defaultIncomingCallControlProps = {
|
|
|
28
29
|
children: []
|
|
29
30
|
},
|
|
30
31
|
declineCallButtonProps: {
|
|
31
|
-
id:
|
|
32
|
-
type:
|
|
33
|
-
ariaLabel:
|
|
34
|
-
iconName:
|
|
32
|
+
id: Ids.DeclineCallButtonId,
|
|
33
|
+
type: ButtonTypes.Icon,
|
|
34
|
+
ariaLabel: AriaLabels.RejectCall,
|
|
35
|
+
iconName: IconNames.DeclineCall,
|
|
35
36
|
iconSize: 20
|
|
36
37
|
},
|
|
37
38
|
audioCallButtonProps: {
|
|
38
|
-
id:
|
|
39
|
-
type:
|
|
40
|
-
ariaLabel:
|
|
41
|
-
iconName:
|
|
39
|
+
id: Ids.AudioCallButtonId,
|
|
40
|
+
type: ButtonTypes.Icon,
|
|
41
|
+
ariaLabel: AriaLabels.AcceptVoiceCall,
|
|
42
|
+
iconName: IconNames.IncomingCall,
|
|
42
43
|
iconSize: 20
|
|
43
44
|
},
|
|
44
45
|
videoCallButtonProps: {
|
|
45
|
-
id:
|
|
46
|
-
type:
|
|
47
|
-
ariaLabel:
|
|
48
|
-
iconName:
|
|
46
|
+
id: Ids.VideoCallButtonId,
|
|
47
|
+
type: ButtonTypes.Icon,
|
|
48
|
+
ariaLabel: AriaLabels.AcceptVideoCall,
|
|
49
|
+
iconName: IconNames.Video,
|
|
49
50
|
iconSize: 20
|
|
50
51
|
},
|
|
51
52
|
incomingCallTitle: {
|
|
52
|
-
id:
|
|
53
|
-
text:
|
|
53
|
+
id: Ids.IncomingCallTitleId,
|
|
54
|
+
text: Texts.IncomingCallTitle
|
|
54
55
|
}
|
|
55
56
|
};
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { CallAcceptButtonBase64, CallRejectButtonBase64, VideoCallAcceptButtonIconBase64 } from "../../../../../../assets/Icons";
|
|
2
|
+
import { AriaLabels, ButtonTypes, Ids, Texts } from "../../../../../../common/Constants";
|
|
2
3
|
export const defaultIncomingCallControlPropsRtl = {
|
|
3
|
-
id:
|
|
4
|
-
ariaLabel:
|
|
4
|
+
id: Ids.DefaultIncomingCallPopupId,
|
|
5
|
+
ariaLabel: AriaLabels.IncomingCallArea,
|
|
5
6
|
hideAudioCall: false,
|
|
6
7
|
hideVideoCall: false,
|
|
7
8
|
hideDeclineCall: false,
|
|
8
9
|
hideIncomingCallTitle: false,
|
|
9
10
|
onDeclineCallClick: function () {
|
|
10
|
-
console.log("
|
|
11
|
+
console.log("decline call clicked");
|
|
11
12
|
},
|
|
12
13
|
onAudioCallClick: function () {
|
|
13
|
-
console.log("
|
|
14
|
+
console.log("audio call clicked");
|
|
14
15
|
},
|
|
15
16
|
onVideoCallClick: function () {
|
|
16
|
-
console.log("
|
|
17
|
+
console.log("video call clicked");
|
|
17
18
|
},
|
|
18
19
|
middleGroup: {
|
|
19
20
|
gap: 5,
|
|
@@ -29,9 +30,9 @@ export const defaultIncomingCallControlPropsRtl = {
|
|
|
29
30
|
},
|
|
30
31
|
dir: "rtl",
|
|
31
32
|
declineCallButtonProps: {
|
|
32
|
-
id:
|
|
33
|
-
type:
|
|
34
|
-
ariaLabel:
|
|
33
|
+
id: Ids.DeclineCallButtonId,
|
|
34
|
+
type: ButtonTypes.Icon,
|
|
35
|
+
ariaLabel: AriaLabels.DeclineCall,
|
|
35
36
|
imageIconProps: {
|
|
36
37
|
src: CallRejectButtonBase64,
|
|
37
38
|
styles: {
|
|
@@ -44,9 +45,9 @@ export const defaultIncomingCallControlPropsRtl = {
|
|
|
44
45
|
iconSize: 20
|
|
45
46
|
},
|
|
46
47
|
audioCallButtonProps: {
|
|
47
|
-
id:
|
|
48
|
-
type:
|
|
49
|
-
ariaLabel:
|
|
48
|
+
id: Ids.AudioCallButtonId,
|
|
49
|
+
type: ButtonTypes.Icon,
|
|
50
|
+
ariaLabel: AriaLabels.AudioCall,
|
|
50
51
|
imageIconProps: {
|
|
51
52
|
src: CallAcceptButtonBase64,
|
|
52
53
|
styles: {
|
|
@@ -59,9 +60,9 @@ export const defaultIncomingCallControlPropsRtl = {
|
|
|
59
60
|
iconSize: 20
|
|
60
61
|
},
|
|
61
62
|
videoCallButtonProps: {
|
|
62
|
-
id:
|
|
63
|
-
type:
|
|
64
|
-
ariaLabel:
|
|
63
|
+
id: Ids.VideoCallButtonId,
|
|
64
|
+
type: ButtonTypes.Icon,
|
|
65
|
+
ariaLabel: AriaLabels.VideoCall,
|
|
65
66
|
imageIconProps: {
|
|
66
67
|
src: VideoCallAcceptButtonIconBase64,
|
|
67
68
|
styles: {
|
|
@@ -74,7 +75,7 @@ export const defaultIncomingCallControlPropsRtl = {
|
|
|
74
75
|
iconSize: 20
|
|
75
76
|
},
|
|
76
77
|
incomingCallTitle: {
|
|
77
|
-
id:
|
|
78
|
-
text:
|
|
78
|
+
id: Ids.IncomingCallTitleId,
|
|
79
|
+
text: Texts.IncomingCallTitle
|
|
79
80
|
}
|
|
80
81
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Icon, Label, Stack } from "@fluentui/react";
|
|
2
2
|
import React, { useCallback } from "react";
|
|
3
3
|
import { BroadcastService } from "../../services/BroadcastService";
|
|
4
|
-
import { ElementType, KeyCodes } from "../../common/Constants";
|
|
4
|
+
import { ElementType, EventNames, HiddenTextStyles, Ids, KeyCodes } from "../../common/Constants";
|
|
5
5
|
import { decodeComponentString } from "../../common/decodeComponentString";
|
|
6
6
|
import { defaultChatButtonControlProps } from "./common/defaultProps/defaultChatButtonControlProps";
|
|
7
7
|
import { defaultChatButtonGeneralStyles } from "./common/defaultStyles/defaultChatButtonGeneralStyles";
|
|
@@ -20,13 +20,17 @@ function NotificationBubble(props, parentId) {
|
|
|
20
20
|
const unreadMessageCount = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.unreadMessageCount) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.unreadMessageCount);
|
|
21
21
|
|
|
22
22
|
if (unreadMessageCount !== "0") {
|
|
23
|
-
var _props$componentOverr, _props$styleProps2, _props$styleProps2$cl;
|
|
23
|
+
var _props$componentOverr, _props$controlProps2, _props$controlProps3, _props$styleProps2, _props$styleProps2$cl, _props$controlProps4, _props$controlProps5;
|
|
24
24
|
|
|
25
|
-
return decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.notificationBubble) || /*#__PURE__*/React.createElement(
|
|
25
|
+
return decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.notificationBubble) || /*#__PURE__*/React.createElement(Stack, {
|
|
26
|
+
"aria-live": "polite",
|
|
26
27
|
styles: notificationBubbleStyles,
|
|
28
|
+
"aria-label": (_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.ariaLabelUnreadMessageString ? (_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.ariaLabelUnreadMessageString : defaultChatButtonControlProps.ariaLabelUnreadMessageString,
|
|
27
29
|
className: (_props$styleProps2 = props.styleProps) === null || _props$styleProps2 === void 0 ? void 0 : (_props$styleProps2$cl = _props$styleProps2.classNames) === null || _props$styleProps2$cl === void 0 ? void 0 : _props$styleProps2$cl.notificationBubbleClassName,
|
|
28
30
|
id: parentId + "-notification-bubble"
|
|
29
|
-
}, unreadMessageCount
|
|
31
|
+
}, unreadMessageCount, /*#__PURE__*/React.createElement("span", {
|
|
32
|
+
style: HiddenTextStyles
|
|
33
|
+
}, (_props$controlProps4 = props.controlProps) !== null && _props$controlProps4 !== void 0 && _props$controlProps4.unreadMessageString ? (_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.unreadMessageString : defaultChatButtonControlProps.unreadMessageString));
|
|
30
34
|
}
|
|
31
35
|
|
|
32
36
|
return null;
|
|
@@ -46,7 +50,7 @@ function IconContainer(props, parentId) {
|
|
|
46
50
|
}
|
|
47
51
|
|
|
48
52
|
function TextContainer(props, parentId) {
|
|
49
|
-
var _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$
|
|
53
|
+
var _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$controlProps6, _props$controlProps7, _props$controlProps8, _props$controlProps9, _props$controlProps10, _props$controlProps11, _props$componentOverr3, _props$styleProps8, _props$styleProps8$cl, _props$componentOverr4, _props$styleProps9, _props$styleProps9$cl, _props$componentOverr5, _props$styleProps10, _props$styleProps10$c;
|
|
50
54
|
|
|
51
55
|
const textContainerStyles = {
|
|
52
56
|
root: Object.assign({}, defaultChatButtonTextContainerStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.textContainerStyleProps)
|
|
@@ -57,12 +61,12 @@ function TextContainer(props, parentId) {
|
|
|
57
61
|
const subtitleStyles = {
|
|
58
62
|
root: Object.assign({}, defaultChatButtonSubTitleStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.subtitleStyleProps)
|
|
59
63
|
};
|
|
60
|
-
const hideChatTitle = ((_props$
|
|
61
|
-
const hideChatSubtitle = ((_props$
|
|
62
|
-
const titleDir = ((_props$
|
|
63
|
-
const titleText = ((_props$
|
|
64
|
-
const subtitleDir = ((_props$
|
|
65
|
-
const subtitleText = ((_props$
|
|
64
|
+
const hideChatTitle = ((_props$controlProps6 = props.controlProps) === null || _props$controlProps6 === void 0 ? void 0 : _props$controlProps6.hideChatTitle) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatTitle);
|
|
65
|
+
const hideChatSubtitle = ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.hideChatSubtitle) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatSubtitle);
|
|
66
|
+
const titleDir = ((_props$controlProps8 = props.controlProps) === null || _props$controlProps8 === void 0 ? void 0 : _props$controlProps8.dir) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.dir);
|
|
67
|
+
const titleText = ((_props$controlProps9 = props.controlProps) === null || _props$controlProps9 === void 0 ? void 0 : _props$controlProps9.titleText) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.titleText);
|
|
68
|
+
const subtitleDir = ((_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.dir) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.dir);
|
|
69
|
+
const subtitleText = ((_props$controlProps11 = props.controlProps) === null || _props$controlProps11 === void 0 ? void 0 : _props$controlProps11.subtitleText) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.subtitleText);
|
|
66
70
|
return decodeComponentString((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.textContainer) || /*#__PURE__*/React.createElement(Stack, {
|
|
67
71
|
styles: textContainerStyles,
|
|
68
72
|
className: (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : (_props$styleProps8$cl = _props$styleProps8.classNames) === null || _props$styleProps8$cl === void 0 ? void 0 : _props$styleProps8$cl.textContainerClassName,
|
|
@@ -83,27 +87,27 @@ function TextContainer(props, parentId) {
|
|
|
83
87
|
}
|
|
84
88
|
|
|
85
89
|
function ChatButton(props) {
|
|
86
|
-
var _props$
|
|
90
|
+
var _props$controlProps12, _props$controlProps13, _props$controlProps14, _props$controlProps15, _props$controlProps16, _props$controlProps17, _props$controlProps18, _props$controlProps19, _props$styleProps11;
|
|
87
91
|
|
|
88
|
-
const elementId = ((_props$
|
|
89
|
-
const defaultAriaLabel = ((_props$
|
|
90
|
-
const defaultRole = ((_props$
|
|
91
|
-
const containersDir = ((_props$
|
|
92
|
-
const hideChatButton = ((_props$
|
|
93
|
-
const hideChatIcon = ((_props$
|
|
94
|
-
const hideChatTextContainer = ((_props$
|
|
95
|
-
const hideNotificationBubble = ((_props$
|
|
92
|
+
const elementId = ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.id) ?? Ids.DefaultChatButtonId;
|
|
93
|
+
const defaultAriaLabel = ((_props$controlProps13 = props.controlProps) === null || _props$controlProps13 === void 0 ? void 0 : _props$controlProps13.ariaLabel) ?? defaultChatButtonControlProps.ariaLabel;
|
|
94
|
+
const defaultRole = ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.role) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.role);
|
|
95
|
+
const containersDir = ((_props$controlProps15 = props.controlProps) === null || _props$controlProps15 === void 0 ? void 0 : _props$controlProps15.dir) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.dir);
|
|
96
|
+
const hideChatButton = ((_props$controlProps16 = props.controlProps) === null || _props$controlProps16 === void 0 ? void 0 : _props$controlProps16.hideChatButton) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatButton);
|
|
97
|
+
const hideChatIcon = ((_props$controlProps17 = props.controlProps) === null || _props$controlProps17 === void 0 ? void 0 : _props$controlProps17.hideChatIcon) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatIcon);
|
|
98
|
+
const hideChatTextContainer = ((_props$controlProps18 = props.controlProps) === null || _props$controlProps18 === void 0 ? void 0 : _props$controlProps18.hideChatTextContainer) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatTextContainer);
|
|
99
|
+
const hideNotificationBubble = ((_props$controlProps19 = props.controlProps) === null || _props$controlProps19 === void 0 ? void 0 : _props$controlProps19.hideNotificationBubble) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideNotificationBubble);
|
|
96
100
|
const chatButtonGroupStyles = {
|
|
97
101
|
root: Object.assign({}, defaultChatButtonGeneralStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.generalStyleProps)
|
|
98
102
|
};
|
|
99
103
|
const handleInitiateChatClick = useCallback(() => {
|
|
100
|
-
var _props$
|
|
104
|
+
var _props$controlProps20;
|
|
101
105
|
|
|
102
|
-
if ((_props$
|
|
106
|
+
if ((_props$controlProps20 = props.controlProps) !== null && _props$controlProps20 !== void 0 && _props$controlProps20.onClick) {
|
|
103
107
|
const customEvent = {
|
|
104
108
|
elementType: ElementType.ChatButton,
|
|
105
109
|
elementId: elementId,
|
|
106
|
-
eventName:
|
|
110
|
+
eventName: EventNames.OnClick
|
|
107
111
|
};
|
|
108
112
|
BroadcastService.postMessage(customEvent);
|
|
109
113
|
props.controlProps.onClick();
|
|
@@ -126,7 +130,7 @@ function ChatButton(props) {
|
|
|
126
130
|
onClick: handleInitiateChatClick,
|
|
127
131
|
onKeyDown: handleInputKeyDown,
|
|
128
132
|
"aria-label": defaultAriaLabel
|
|
129
|
-
}, !hideChatIcon && IconContainer(props, elementId), !
|
|
133
|
+
}, !hideChatIcon && IconContainer(props, elementId), !hideNotificationBubble && NotificationBubble(props, elementId), !hideChatTextContainer && TextContainer(props, elementId)));
|
|
130
134
|
}
|
|
131
135
|
|
|
132
136
|
export default ChatButton;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
+
import { AriaLabels, Ids, Texts } from "../../../../common/Constants";
|
|
1
2
|
export const defaultChatButtonControlProps = {
|
|
2
|
-
id:
|
|
3
|
+
id: Ids.DefaultChatButtonId,
|
|
3
4
|
dir: "ltr",
|
|
4
5
|
role: "button",
|
|
5
|
-
ariaLabel:
|
|
6
|
+
ariaLabel: AriaLabels.LetsChatWeAreOnline,
|
|
6
7
|
unreadMessageCount: "0",
|
|
7
|
-
titleText:
|
|
8
|
-
subtitleText:
|
|
8
|
+
titleText: Texts.ChatButtonTitle,
|
|
9
|
+
subtitleText: Texts.ChatButtonSubtitle,
|
|
9
10
|
onClick: function () {
|
|
10
11
|
console.log("initiate chat");
|
|
11
12
|
},
|
|
@@ -14,5 +15,8 @@ export const defaultChatButtonControlProps = {
|
|
|
14
15
|
hideChatTextContainer: false,
|
|
15
16
|
hideChatSubtitle: false,
|
|
16
17
|
hideChatTitle: false,
|
|
17
|
-
hideNotificationBubble: true
|
|
18
|
+
hideNotificationBubble: true,
|
|
19
|
+
unreadMessageString: Texts.ChatButtonUnreadMessageString,
|
|
20
|
+
largeUnreadMessageString: Texts.ChatButtonLargeUnreadMessageString,
|
|
21
|
+
ariaLabelUnreadMessageString: AriaLabels.UnreadMessageString
|
|
18
22
|
};
|
|
@@ -1,20 +1,45 @@
|
|
|
1
1
|
import { DefaultButton, IconButton } from "@fluentui/react";
|
|
2
2
|
import React, { useCallback } from "react";
|
|
3
3
|
import { BroadcastService } from "../../../services/BroadcastService";
|
|
4
|
-
import { ElementType } from "../../../common/Constants";
|
|
4
|
+
import { ElementType, EventNames, ButtonTypes } from "../../../common/Constants";
|
|
5
5
|
|
|
6
6
|
function CommandButton(props) {
|
|
7
|
+
var _props$hoverStyles, _props$hoverStyles2, _props$focusStyles;
|
|
8
|
+
|
|
7
9
|
//imageIconProps > iconName
|
|
8
10
|
const iconProp = props.imageIconProps ? {
|
|
9
11
|
imageProps: props.imageIconProps
|
|
10
12
|
} : {
|
|
11
|
-
iconName: props.iconName
|
|
12
|
-
styles: {
|
|
13
|
-
root: props.styles
|
|
14
|
-
}
|
|
13
|
+
iconName: props.iconName
|
|
15
14
|
};
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
let iconStyles = {};
|
|
16
|
+
|
|
17
|
+
if (props.type === ButtonTypes.Icon) {
|
|
18
|
+
var _props$styles;
|
|
19
|
+
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
iconStyles = { ...(props === null || props === void 0 ? void 0 : (_props$styles = props.styles) === null || _props$styles === void 0 ? void 0 : _props$styles.icon)
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const buttonStyles = {
|
|
26
|
+
icon: { ...iconStyles
|
|
27
|
+
},
|
|
28
|
+
root: {
|
|
29
|
+
selectors: {
|
|
30
|
+
":hover .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
|
+
...(props === null || props === void 0 ? void 0 : (_props$hoverStyles = props.hoverStyles) === null || _props$hoverStyles === void 0 ? void 0 : _props$hoverStyles.icon)
|
|
32
|
+
},
|
|
33
|
+
":active .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
+
...(props === null || props === void 0 ? void 0 : (_props$hoverStyles2 = props.hoverStyles) === null || _props$hoverStyles2 === void 0 ? void 0 : _props$hoverStyles2.icon)
|
|
35
|
+
},
|
|
36
|
+
":focus .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
|
+
...(props === null || props === void 0 ? void 0 : (_props$focusStyles = props.focusStyles) === null || _props$focusStyles === void 0 ? void 0 : _props$focusStyles.icon)
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
+
...(props === null || props === void 0 ? void 0 : props.styles)
|
|
42
|
+
},
|
|
18
43
|
rootHovered: props.hoverStyles,
|
|
19
44
|
rootFocused: props.focusStyles,
|
|
20
45
|
rootPressed: props.hoverStyles
|
|
@@ -22,7 +47,7 @@ function CommandButton(props) {
|
|
|
22
47
|
const handleOnClick = useCallback(() => {
|
|
23
48
|
if (props !== null && props !== void 0 && props.onClick) {
|
|
24
49
|
const customEvent = props.customEvent ?? {
|
|
25
|
-
eventName:
|
|
50
|
+
eventName: EventNames.OnClick,
|
|
26
51
|
elementType: ElementType.Custom,
|
|
27
52
|
elementId: props === null || props === void 0 ? void 0 : props.id
|
|
28
53
|
};
|
|
@@ -30,21 +55,21 @@ function CommandButton(props) {
|
|
|
30
55
|
props === null || props === void 0 ? void 0 : props.onClick();
|
|
31
56
|
}
|
|
32
57
|
}, []);
|
|
33
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, props.type ===
|
|
58
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, props.type === ButtonTypes.Text && /*#__PURE__*/React.createElement(DefaultButton, {
|
|
34
59
|
id: props.id,
|
|
35
60
|
text: props.text,
|
|
36
61
|
ariaLabel: props.ariaLabel,
|
|
37
62
|
onClick: handleOnClick,
|
|
38
63
|
disabled: props.disabled,
|
|
39
64
|
className: props.className,
|
|
40
|
-
styles:
|
|
41
|
-
}), props.type ===
|
|
65
|
+
styles: buttonStyles
|
|
66
|
+
}), props.type === ButtonTypes.Icon && /*#__PURE__*/React.createElement(IconButton, {
|
|
42
67
|
id: props.id,
|
|
43
68
|
iconProps: iconProp,
|
|
44
|
-
title: props.ariaLabel,
|
|
69
|
+
title: props.hideButtonTitle ? undefined : props.ariaLabel,
|
|
45
70
|
ariaLabel: props.ariaLabel,
|
|
46
71
|
disabled: props.disabled,
|
|
47
|
-
styles:
|
|
72
|
+
styles: buttonStyles,
|
|
48
73
|
onClick: handleOnClick,
|
|
49
74
|
className: props.className
|
|
50
75
|
}));
|
|
@@ -1,29 +1,30 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ElementType } from "../../../common/Constants";
|
|
3
|
-
import CommandButton from "
|
|
2
|
+
import { AriaLabels, ElementType, EventNames, IconNames, Texts } from "../../../common/Constants";
|
|
3
|
+
import CommandButton from "../commandbutton/CommandButton";
|
|
4
4
|
|
|
5
5
|
function CloseButton(props) {
|
|
6
6
|
const {
|
|
7
7
|
type
|
|
8
8
|
} = props;
|
|
9
9
|
const customEvent = {
|
|
10
|
-
elementType: ElementType.
|
|
10
|
+
elementType: ElementType.CloseButton,
|
|
11
11
|
elementId: props === null || props === void 0 ? void 0 : props.id,
|
|
12
|
-
eventName:
|
|
12
|
+
eventName: EventNames.OnClick
|
|
13
13
|
};
|
|
14
14
|
return /*#__PURE__*/React.createElement(CommandButton, {
|
|
15
15
|
id: props === null || props === void 0 ? void 0 : props.id,
|
|
16
16
|
type: type,
|
|
17
|
-
text: props.text ??
|
|
17
|
+
text: props.text ?? Texts.CloseButtonText,
|
|
18
18
|
styles: props.styles,
|
|
19
19
|
hoverStyles: props.hoverStyles,
|
|
20
20
|
focusStyles: props.focusStyles,
|
|
21
|
-
iconName: props.iconName ??
|
|
21
|
+
iconName: props.iconName ?? IconNames.ChromeClose,
|
|
22
22
|
imageIconProps: props.imageIconProps,
|
|
23
23
|
onClick: props.onClick,
|
|
24
|
-
ariaLabel: props.ariaLabel ??
|
|
24
|
+
ariaLabel: props.ariaLabel ?? AriaLabels.Close,
|
|
25
25
|
className: props.className,
|
|
26
|
-
customEvent: customEvent
|
|
26
|
+
customEvent: customEvent,
|
|
27
|
+
hideButtonTitle: props.hideButtonTitle
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
30
|
|
|
@@ -2,7 +2,7 @@ import { DefaultButton, PrimaryButton } from "@fluentui/react/lib/Button";
|
|
|
2
2
|
import { Label, Stack } from "@fluentui/react";
|
|
3
3
|
import React, { useCallback } from "react";
|
|
4
4
|
import { BroadcastService } from "../../services/BroadcastService";
|
|
5
|
-
import { ElementType } from "../../common/Constants";
|
|
5
|
+
import { ElementType, EventNames, KeyCodes } from "../../common/Constants";
|
|
6
6
|
import { decodeComponentString } from "../../common/decodeComponentString";
|
|
7
7
|
import { defaultConfirmationPaneButtonGroupStyles } from "./common/defaultStyles/defaultConfirmationPaneButtonGroupStyles";
|
|
8
8
|
import { defaultConfirmationPaneCancelButtonHoveredStyles } from "./common/defaultStyles/defaultConfirmationPaneCancelButtonHoveredStyles";
|
|
@@ -29,7 +29,7 @@ function ConfirmationPane(props) {
|
|
|
29
29
|
const customEvent = {
|
|
30
30
|
elementType: ElementType.ConfirmationPaneConfirmButton,
|
|
31
31
|
elementId: elementId + "-confirmbutton",
|
|
32
|
-
eventName:
|
|
32
|
+
eventName: EventNames.OnClick
|
|
33
33
|
};
|
|
34
34
|
BroadcastService.postMessage(customEvent);
|
|
35
35
|
(_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.onConfirm();
|
|
@@ -44,11 +44,17 @@ function ConfirmationPane(props) {
|
|
|
44
44
|
const customEvent = {
|
|
45
45
|
elementType: ElementType.ConfirmationPaneCancelButton,
|
|
46
46
|
elementId: elementId + "-cancelbutton",
|
|
47
|
-
eventName:
|
|
47
|
+
eventName: EventNames.OnClick
|
|
48
48
|
};
|
|
49
49
|
BroadcastService.postMessage(customEvent);
|
|
50
50
|
(_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.onCancel();
|
|
51
51
|
}
|
|
52
|
+
}, []); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
|
+
|
|
54
|
+
const handleEscKeyDown = useCallback(e => {
|
|
55
|
+
if (e.code === KeyCodes.ESCAPE) {
|
|
56
|
+
handleCancelClick();
|
|
57
|
+
}
|
|
52
58
|
}, []);
|
|
53
59
|
const containerStyles = {
|
|
54
60
|
root: Object.assign({}, defaultConfirmationPaneGeneralStyles, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps)
|
|
@@ -76,6 +82,7 @@ function ConfirmationPane(props) {
|
|
|
76
82
|
};
|
|
77
83
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.hideConfirmationPane) && /*#__PURE__*/React.createElement(Stack, {
|
|
78
84
|
id: elementId,
|
|
85
|
+
onKeyDown: handleEscKeyDown,
|
|
79
86
|
tabIndex: -1,
|
|
80
87
|
dir: ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.dir) || defaultConfirmationPaneControlProps.dir,
|
|
81
88
|
styles: containerStyles,
|