@microsoft/omnichannel-chat-components 0.1.0-main.f0b0a93 → 0.1.0-main.fb5f930
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/README.md +1 -0
- package/lib/cjs/assets/Icons.js +48 -0
- package/lib/cjs/common/Constants.js +12 -7
- package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +31 -1
- package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlPropsRtl.js +6 -16
- package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/common/defaultStyles/customizedCurrentCallStyleProps.js +0 -12
- package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/common/defaultStyles/defaultCurrentCallStyleProps.js +4 -16
- package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +45 -2
- package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/componentOverrideProps.js +2 -4
- package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlPropsRtl.js +4 -10
- package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/common/defaultStyles/defaultIncomingCallStyleProps.js +8 -8
- package/lib/cjs/components/chatbutton/ChatButton.js +47 -33
- package/lib/cjs/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +5 -2
- package/lib/cjs/components/chatbutton/common/defaultStyles/defaultChatButtonIconContainerStyles.js +2 -4
- package/lib/cjs/components/common/commandbutton/CommandButton.js +36 -10
- package/lib/cjs/components/{header → common}/subcomponents/CloseButton.js +4 -3
- package/lib/cjs/components/confirmationpane/ConfirmationPane.js +19 -10
- 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 +2 -2
- package/lib/cjs/components/footer/common/defaultProps/customFooterControlProps.js +5 -13
- package/lib/cjs/components/footer/common/defaultProps/defaultFooterControlProps.js +1 -0
- package/lib/cjs/components/footer/common/defaultStyles/defaultFooterStyleProps.js +12 -6
- package/lib/cjs/components/footer/subcomponents/AudioNotificationButton.js +29 -11
- package/lib/cjs/components/header/Header.js +2 -2
- package/lib/cjs/components/header/common/defaultProps/azureHeaderControlProps.js +2 -4
- package/lib/cjs/components/header/common/defaultProps/customHeaderControlProps.js +4 -10
- package/lib/cjs/components/header/common/defaultProps/defaultHeaderControlProps.js +2 -4
- package/lib/cjs/components/inputvalidationpane/InputValidationPane.js +76 -46
- package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -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/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconImageProps.js +2 -4
- package/lib/cjs/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +1 -1
- package/lib/cjs/components/loadingpane/common/presetThreeProps/presetThreeStyles/presetThreeLoadingPaneIconImageProps.js +2 -4
- package/lib/cjs/components/loadingpane/common/presetTwoProps/presetTwoStyles/presetTwoLoadingPaneGeneralStyles.js +2 -4
- package/lib/cjs/components/outofofficehourspane/common/presetTwoProps/presetTwoStyles/presetTwoOOOHPaneGeneralStyles.js +2 -4
- package/lib/cjs/components/postchatsurveypane/PostChatSurveyPane.js +3 -2
- package/lib/cjs/components/prechatsurveypane/PreChatSurveyPane.js +22 -8
- 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/{assets/assets.d.js → components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.js} +0 -0
- package/lib/cjs/components/proactivechatpane/ProactiveChatPane.js +33 -30
- package/lib/cjs/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +5 -1
- package/lib/cjs/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -15
- package/lib/cjs/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneHeaderContainerStyles.js +2 -4
- package/lib/cjs/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +5 -1
- package/lib/cjs/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +5 -1
- package/lib/cjs/components/reconnectchatpane/ReconnectChatPane.js +14 -12
- package/lib/cjs/components/reconnectchatpane/common/default/defaultStyles/defaultReconnectChatPaneIconStyles.js +2 -4
- package/lib/cjs/index.js +134 -0
- package/lib/cjs/services/BroadcastService.js +36 -8
- package/lib/esm/assets/Icons.js +21 -0
- package/lib/esm/common/Constants.js +10 -5
- package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +33 -3
- package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlPropsRtl.js +6 -10
- package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultStyles/customizedCurrentCallStyleProps.js +0 -12
- package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultStyles/defaultCurrentCallStyleProps.js +4 -16
- package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +47 -4
- package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/componentOverrideProps.js +2 -2
- package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlPropsRtl.js +4 -6
- package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/common/defaultStyles/defaultIncomingCallStyleProps.js +8 -8
- package/lib/esm/components/chatbutton/ChatButton.js +47 -33
- package/lib/esm/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +5 -2
- package/lib/esm/components/chatbutton/common/defaultStyles/defaultChatButtonIconContainerStyles.js +2 -2
- package/lib/esm/components/common/commandbutton/CommandButton.js +36 -10
- package/lib/esm/components/{header → common}/subcomponents/CloseButton.js +4 -3
- package/lib/esm/components/confirmationpane/ConfirmationPane.js +20 -11
- 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 +2 -2
- package/lib/esm/components/footer/common/defaultProps/customFooterControlProps.js +5 -8
- package/lib/esm/components/footer/common/defaultProps/defaultFooterControlProps.js +1 -0
- package/lib/esm/components/footer/common/defaultStyles/defaultFooterStyleProps.js +12 -6
- package/lib/esm/components/footer/subcomponents/AudioNotificationButton.js +29 -11
- package/lib/esm/components/header/Header.js +2 -2
- package/lib/esm/components/header/common/defaultProps/azureHeaderControlProps.js +2 -2
- package/lib/esm/components/header/common/defaultProps/customHeaderControlProps.js +4 -6
- package/lib/esm/components/header/common/defaultProps/defaultHeaderControlProps.js +2 -2
- package/lib/esm/components/inputvalidationpane/InputValidationPane.js +77 -47
- package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -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/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconImageProps.js +2 -2
- package/lib/esm/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +1 -1
- package/lib/esm/components/loadingpane/common/presetThreeProps/presetThreeStyles/presetThreeLoadingPaneIconImageProps.js +2 -2
- package/lib/esm/components/loadingpane/common/presetTwoProps/presetTwoStyles/presetTwoLoadingPaneGeneralStyles.js +2 -2
- package/lib/esm/components/outofofficehourspane/common/presetTwoProps/presetTwoStyles/presetTwoOOOHPaneGeneralStyles.js +2 -2
- package/lib/esm/components/postchatsurveypane/PostChatSurveyPane.js +3 -2
- package/lib/esm/components/prechatsurveypane/PreChatSurveyPane.js +22 -8
- 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/interfaces/IPreChatSurveyPaneElementStyles.js +1 -0
- package/lib/esm/components/proactivechatpane/ProactiveChatPane.js +30 -29
- package/lib/esm/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +5 -1
- package/lib/esm/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -11
- package/lib/esm/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneHeaderContainerStyles.js +2 -2
- package/lib/esm/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +5 -1
- package/lib/esm/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +5 -1
- package/lib/esm/components/reconnectchatpane/ReconnectChatPane.js +14 -12
- package/lib/esm/components/reconnectchatpane/common/default/defaultStyles/defaultReconnectChatPaneIconStyles.js +2 -2
- package/lib/esm/index.js +3 -1
- package/lib/esm/services/BroadcastService.js +34 -8
- package/lib/types/assets/Icons.d.ts +21 -0
- package/lib/types/common/Constants.d.ts +9 -2
- package/lib/types/components/callingcontainer/subcomponents/CurrentCall/interfaces/ICurrentCallStyleProps.d.ts +0 -4
- 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/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 +2 -0
- package/lib/types/services/BroadcastService.d.ts +1 -0
- package/package.json +5 -10
- package/lib/cjs/assets/imgs/ChatBubble.svg +0 -28
- package/lib/cjs/assets/imgs/ChatReconnectPopupIcon.png +0 -0
- package/lib/cjs/assets/imgs/Proactive_banner.png +0 -0
- package/lib/cjs/assets/imgs/agent.png +0 -0
- package/lib/cjs/assets/imgs/callacceptbutton.svg +0 -3
- package/lib/cjs/assets/imgs/callrejectbutton.svg +0 -3
- package/lib/cjs/assets/imgs/chat.svg +0 -47
- package/lib/cjs/assets/imgs/chatIcon.svg +0 -16
- package/lib/cjs/assets/imgs/closeButton.svg +0 -3
- package/lib/cjs/assets/imgs/closeChatButton.svg +0 -3
- package/lib/cjs/assets/imgs/error.svg +0 -3
- package/lib/cjs/assets/imgs/lcwAudioOff.svg +0 -3
- package/lib/cjs/assets/imgs/lcwAudioOn.svg +0 -3
- package/lib/cjs/assets/imgs/loading.gif +0 -0
- package/lib/cjs/assets/imgs/minimizeChatButton.svg +0 -3
- package/lib/cjs/assets/imgs/transcriptDownloadIcon.svg +0 -4
- package/lib/cjs/assets/imgs/transcriptEmailIcon.svg +0 -5
- package/lib/cjs/assets/imgs/videocallacceptbutton.svg +0 -3
- package/lib/cjs/assets/imgs/videooff.svg +0 -3
- package/lib/cjs/assets/imgs/videoon.svg +0 -3
- package/lib/cjs/assets/imgs/voiceoff.svg +0 -3
- package/lib/cjs/assets/imgs/voiceon.svg +0 -3
- package/lib/esm/assets/assets.d.js +0 -0
- package/lib/esm/assets/imgs/ChatBubble.svg +0 -28
- package/lib/esm/assets/imgs/ChatReconnectPopupIcon.png +0 -0
- package/lib/esm/assets/imgs/Proactive_banner.png +0 -0
- package/lib/esm/assets/imgs/agent.png +0 -0
- package/lib/esm/assets/imgs/callacceptbutton.svg +0 -3
- package/lib/esm/assets/imgs/callrejectbutton.svg +0 -3
- package/lib/esm/assets/imgs/chat.svg +0 -47
- package/lib/esm/assets/imgs/chatIcon.svg +0 -16
- package/lib/esm/assets/imgs/closeButton.svg +0 -3
- package/lib/esm/assets/imgs/closeChatButton.svg +0 -3
- package/lib/esm/assets/imgs/error.svg +0 -3
- package/lib/esm/assets/imgs/lcwAudioOff.svg +0 -3
- package/lib/esm/assets/imgs/lcwAudioOn.svg +0 -3
- package/lib/esm/assets/imgs/loading.gif +0 -0
- package/lib/esm/assets/imgs/minimizeChatButton.svg +0 -3
- package/lib/esm/assets/imgs/transcriptDownloadIcon.svg +0 -4
- package/lib/esm/assets/imgs/transcriptEmailIcon.svg +0 -5
- package/lib/esm/assets/imgs/videocallacceptbutton.svg +0 -3
- package/lib/esm/assets/imgs/videooff.svg +0 -3
- package/lib/esm/assets/imgs/videoon.svg +0 -3
- package/lib/esm/assets/imgs/voiceoff.svg +0 -3
- package/lib/esm/assets/imgs/voiceon.svg +0 -3
|
@@ -4,16 +4,21 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
4
4
|
|
|
5
5
|
/* CSS Constants */
|
|
6
6
|
export const AccessibilityBrightnessRatio = 1.2;
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
export const HiddenTextStyles = {
|
|
8
|
+
position: "absolute",
|
|
9
|
+
height: "1px",
|
|
10
|
+
width: "1px",
|
|
11
|
+
overflow: "hidden",
|
|
12
|
+
clip: "rect(1px, 1px, 1px, 1px)",
|
|
13
|
+
whiteSpace: "nowrap"
|
|
14
|
+
};
|
|
15
|
+
export const KeyCodes = (_class = class KeyCodes {}, _defineProperty(_class, "ENTER", "Enter"), _defineProperty(_class, "ESCAPE", "Escape"), _defineProperty(_class, "SPACE", "Space"), _defineProperty(_class, "DeclineCallHotKey", "D"), _defineProperty(_class, "AcceptAudioCallHotKey", "S"), _defineProperty(_class, "AcceptVideoCallHotKey", "A"), _defineProperty(_class, "ToggleMicHotKey", "M"), _defineProperty(_class, "ToggleCameraHotKey", "O"), _class);
|
|
11
16
|
export const Regex = (_class2 = class Regex {}, _defineProperty(_class2, "EmailRegex", "(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])"), _defineProperty(_class2, "URLRegex", /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi), _class2);
|
|
12
17
|
export let ElementType;
|
|
13
18
|
|
|
14
19
|
(function (ElementType) {
|
|
15
20
|
ElementType["ChatButton"] = "ChatButton";
|
|
16
|
-
ElementType["
|
|
21
|
+
ElementType["CloseButton"] = "CloseButton";
|
|
17
22
|
ElementType["HeaderMinimizeButton"] = "HeaderMinimizeButton";
|
|
18
23
|
ElementType["FooterDownloadTranscriptButton"] = "FooterDownloadTranscriptButton";
|
|
19
24
|
ElementType["FooterEmailTranscriptButton"] = "FooterEmailTranscriptButton";
|
|
@@ -1,15 +1,15 @@
|
|
|
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 { IconButton, Stack } from "@fluentui/react";
|
|
5
5
|
import { BroadcastService } from "../../../../services/BroadcastService";
|
|
6
6
|
import CommandButton from "../../../common/commandbutton/CommandButton";
|
|
7
|
-
import { ElementType } from "../../../../common/Constants";
|
|
7
|
+
import { ElementType, KeyCodes } from "../../../../common/Constants";
|
|
8
8
|
import Timer from "../Timer/Timer";
|
|
9
9
|
import { defaultCurrentCallProps } from "./common/defaultProps/defaultCurrentCallProps";
|
|
10
10
|
import { processCustomComponents } from "../../../../common/utils";
|
|
11
11
|
import { useBoolean } from "@fluentui/react-hooks";
|
|
12
|
-
import { useCallback } from "react";
|
|
12
|
+
import { useCallback, useEffect } from "react";
|
|
13
13
|
|
|
14
14
|
function CurrentCall(props) {
|
|
15
15
|
var _props$controlProps, _defaultCurrentCallPr, _props$controlProps2, _props$controlProps2$, _defaultCurrentCallPr2, _defaultCurrentCallPr3, _props$controlProps3, _props$controlProps3$, _defaultCurrentCallPr4, _defaultCurrentCallPr5, _props$controlProps4, _props$controlProps4$, _defaultCurrentCallPr6, _defaultCurrentCallPr7, _props$controlProps5, _props$controlProps5$, _defaultCurrentCallPr8, _defaultCurrentCallPr9, _props$controlProps6, _props$controlProps6$, _defaultCurrentCallPr10, _defaultCurrentCallPr11, _props$controlProps7, _props$controlProps7$, _defaultCurrentCallPr12, _defaultCurrentCallPr13, _props$controlProps8, _props$controlProps8$, _defaultCurrentCallPr14, _defaultCurrentCallPr15, _props$controlProps9, _props$controlProps10, _defaultCurrentCallPr16, _defaultCurrentCallPr17, _props$styleProps, _props$controlProps11, _props$controlProps12, _defaultCurrentCallPr18, _defaultCurrentCallPr19, _props$controlProps13, _props$controlProps14, _defaultCurrentCallPr20, _defaultCurrentCallPr21, _props$controlProps15, _props$controlProps16, _defaultCurrentCallPr22, _defaultCurrentCallPr23, _props$controlProps17, _props$controlProps18, _props$controlProps19, _props$controlProps20, _defaultCurrentCallPr24, _defaultCurrentCallPr25, _props$controlProps21, _props$controlProps22, _defaultCurrentCallPr26, _defaultCurrentCallPr27, _props$controlProps23, _props$controlProps24, _defaultCurrentCallPr28, _defaultCurrentCallPr29, _props$controlProps25, _props$controlProps26, _defaultCurrentCallPr30, _defaultCurrentCallPr31, _props$controlProps27, _props$controlProps28, _props$controlProps29, _props$controlProps30, _defaultCurrentCallPr32, _defaultCurrentCallPr33, _props$controlProps31, _props$controlProps32, _defaultCurrentCallPr34, _defaultCurrentCallPr35, _props$controlProps33, _props$controlProps34, _defaultCurrentCallPr36, _defaultCurrentCallPr37, _props$controlProps35, _props$controlProps36, _defaultCurrentCallPr38, _defaultCurrentCallPr39, _props$controlProps37, _defaultCurrentCallPr40, _props$controlProps38, _defaultCurrentCallPr41, _props$controlProps39, _defaultCurrentCallPr42, _props$controlProps40, _props$controlProps41, _props$controlProps42, _props$controlProps43, _defaultCurrentCallPr43, _defaultCurrentCallPr44, _props$controlProps44, _props$controlProps45, _defaultCurrentCallPr45, _defaultCurrentCallPr46, _props$controlProps46, _props$controlProps47, _defaultCurrentCallPr47, _defaultCurrentCallPr48, _props$controlProps48, _props$controlProps49, _defaultCurrentCallPr49, _defaultCurrentCallPr50, _props$controlProps50, _props$controlProps51, _props$controlProps52, _props$controlProps53, _defaultCurrentCallPr51, _defaultCurrentCallPr52, _props$controlProps54, _props$controlProps55, _defaultCurrentCallPr53, _defaultCurrentCallPr54, _props$controlProps56, _props$controlProps57, _defaultCurrentCallPr55, _defaultCurrentCallPr56, _props$controlProps58, _props$controlProps59, _defaultCurrentCallPr57, _defaultCurrentCallPr58, _defaultCurrentCallPr59, _props$controlProps60, _defaultCurrentCallPr60, _props$controlProps61, _defaultCurrentCallPr61, _props$styleProps2, _defaultCurrentCallPr62, _props$styleProps3, _defaultCurrentCallPr63, _props$styleProps4, _defaultCurrentCallPr67, _props$styleProps8, _defaultCurrentCallPr68, _props$styleProps9, _defaultCurrentCallPr69, _props$styleProps10, _defaultCurrentCallPr70, _props$styleProps11, _defaultCurrentCallPr71, _props$styleProps12, _props$controlProps68, _defaultCurrentCallPr72, _props$styleProps13, _props$styleProps13$c, _props$styleProps14, _props$styleProps14$c, _props$styleProps15, _props$styleProps15$c, _props$styleProps16, _props$styleProps16$c, _props$styleProps17, _props$styleProps17$c, _props$controlProps69, _props$controlProps70, _props$controlProps71, _props$controlProps72, _props$controlProps73, _props$controlProps74, _props$controlProps75, _props$controlProps76, _props$controlProps77, _defaultCurrentCallPr73, _defaultCurrentCallPr74, _props$controlProps78, _props$controlProps79, _defaultCurrentCallPr75, _defaultCurrentCallPr76, _props$controlProps80, _props$controlProps81, _props$controlProps82, _props$controlProps83, _defaultCurrentCallPr77, _defaultCurrentCallPr78, _props$controlProps84, _props$controlProps85, _defaultCurrentCallPr79, _defaultCurrentCallPr80, _props$controlProps86, _props$controlProps87, _props$controlProps88, _props$controlProps89, _props$controlProps90, _defaultCurrentCallPr81, _defaultCurrentCallPr82, _props$controlProps91, _props$controlProps92, _defaultCurrentCallPr83, _defaultCurrentCallPr84, _props$controlProps93, _props$controlProps94, _props$controlProps95, _props$controlProps96, _defaultCurrentCallPr85, _defaultCurrentCallPr86, _props$controlProps97, _props$controlProps98, _defaultCurrentCallPr87, _defaultCurrentCallPr88, _props$controlProps99, _props$controlProps100, _props$controlProps101;
|
|
@@ -189,6 +189,36 @@ function CurrentCall(props) {
|
|
|
189
189
|
}
|
|
190
190
|
}, []);
|
|
191
191
|
const hideCallTimer = ((_props$controlProps68 = props.controlProps) === null || _props$controlProps68 === void 0 ? void 0 : _props$controlProps68.hideCallTimer) ?? ((_defaultCurrentCallPr72 = defaultCurrentCallProps.controlProps) === null || _defaultCurrentCallPr72 === void 0 ? void 0 : _defaultCurrentCallPr72.hideCallTimer);
|
|
192
|
+
useEffect(() => {
|
|
193
|
+
const endCallShortcut = e => e.key === KeyCodes.ENTER;
|
|
194
|
+
|
|
195
|
+
const toggleMicShortcut = e => e.ctrlKey && e.shiftKey && e.key === KeyCodes.ToggleMicHotKey;
|
|
196
|
+
|
|
197
|
+
const toggleVideoShortcut = e => e.ctrlKey && e.shiftKey && e.key === KeyCodes.ToggleCameraHotKey;
|
|
198
|
+
|
|
199
|
+
const shortcutKeysHandler = e => {
|
|
200
|
+
if (endCallShortcut(e)) {
|
|
201
|
+
handleEndCallClick();
|
|
202
|
+
} else if (toggleMicShortcut(e)) {
|
|
203
|
+
handleMicClick();
|
|
204
|
+
} else if (toggleVideoShortcut(e)) {
|
|
205
|
+
handleVideoOffClick();
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
const ignoreDefault = e => {
|
|
210
|
+
if (endCallShortcut(e) || toggleMicShortcut(e) || toggleVideoShortcut(e)) {
|
|
211
|
+
e.preventDefault();
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
window.addEventListener("keyup", shortcutKeysHandler);
|
|
216
|
+
window.addEventListener("keydown", ignoreDefault);
|
|
217
|
+
return () => {
|
|
218
|
+
window.removeEventListener("keyup", shortcutKeysHandler);
|
|
219
|
+
window.removeEventListener("keydown", ignoreDefault);
|
|
220
|
+
};
|
|
221
|
+
}, []);
|
|
192
222
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
193
223
|
className: (_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : (_props$styleProps13$c = _props$styleProps13.classNames) === null || _props$styleProps13$c === void 0 ? void 0 : _props$styleProps13$c.currentCallComponentClassName,
|
|
194
224
|
horizontalAlign: "space-between",
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import videoon from "../../../../../../assets/imgs/videoon.svg";
|
|
3
|
-
import videooff from "../../../../../../assets/imgs/videooff.svg";
|
|
4
|
-
import voiceoff from "../../../../../../assets/imgs/voiceoff.svg";
|
|
5
|
-
import voiceon from "../../../../../../assets/imgs/voiceon.svg";
|
|
1
|
+
import { CallRejectButtonBase64, VideoOffIconBase64, VideoOnIconBase64, VoiceOffIconBase64, VoiceOnIconBase64 } from "../../../../../../assets/Icons";
|
|
6
2
|
export const defaultCurrentCallControlPropsRtl = {
|
|
7
3
|
id: "currentCall-container",
|
|
8
4
|
nonActionIds: {
|
|
@@ -45,7 +41,7 @@ export const defaultCurrentCallControlPropsRtl = {
|
|
|
45
41
|
type: "icon",
|
|
46
42
|
ariaLabel: "End Call",
|
|
47
43
|
imageIconProps: {
|
|
48
|
-
src:
|
|
44
|
+
src: CallRejectButtonBase64,
|
|
49
45
|
styles: {
|
|
50
46
|
image: {
|
|
51
47
|
height: "18px",
|
|
@@ -60,7 +56,7 @@ export const defaultCurrentCallControlPropsRtl = {
|
|
|
60
56
|
ariaLabel: "Mute",
|
|
61
57
|
toggleAriaLabel: "Unmute",
|
|
62
58
|
imageIconProps: {
|
|
63
|
-
src:
|
|
59
|
+
src: VoiceOnIconBase64,
|
|
64
60
|
styles: {
|
|
65
61
|
image: {
|
|
66
62
|
height: "16px",
|
|
@@ -69,7 +65,7 @@ export const defaultCurrentCallControlPropsRtl = {
|
|
|
69
65
|
}
|
|
70
66
|
},
|
|
71
67
|
imageToggleIconProps: {
|
|
72
|
-
src:
|
|
68
|
+
src: VoiceOffIconBase64,
|
|
73
69
|
styles: {
|
|
74
70
|
image: {
|
|
75
71
|
height: "16px",
|
|
@@ -85,7 +81,7 @@ export const defaultCurrentCallControlPropsRtl = {
|
|
|
85
81
|
ariaLabel: "Turn camera on",
|
|
86
82
|
toggleAriaLabel: "Turn camera off",
|
|
87
83
|
imageIconProps: {
|
|
88
|
-
src:
|
|
84
|
+
src: VideoOnIconBase64,
|
|
89
85
|
styles: {
|
|
90
86
|
image: {
|
|
91
87
|
height: "16px",
|
|
@@ -94,7 +90,7 @@ export const defaultCurrentCallControlPropsRtl = {
|
|
|
94
90
|
}
|
|
95
91
|
},
|
|
96
92
|
imageToggleIconProps: {
|
|
97
|
-
src:
|
|
93
|
+
src: VideoOffIconBase64,
|
|
98
94
|
styles: {
|
|
99
95
|
image: {
|
|
100
96
|
height: "16px",
|
|
@@ -47,18 +47,6 @@ export const customizedCurrentCallStyleProps = {
|
|
|
47
47
|
width: "50px",
|
|
48
48
|
margin: "1px"
|
|
49
49
|
},
|
|
50
|
-
currentCallTimerStyleProps: {
|
|
51
|
-
borderRadius: "2px",
|
|
52
|
-
margin: "1px",
|
|
53
|
-
color: "white",
|
|
54
|
-
paddingTop: "18px",
|
|
55
|
-
fontSize: 12,
|
|
56
|
-
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
57
|
-
backgroundColor: "transparent",
|
|
58
|
-
height: "50px",
|
|
59
|
-
width: "55px",
|
|
60
|
-
textAlign: "center"
|
|
61
|
-
},
|
|
62
50
|
videoTileStyleProps: {
|
|
63
51
|
minHeight: "180px",
|
|
64
52
|
height: "300px",
|
|
@@ -7,7 +7,7 @@ export const defaultCurrentCallStyleProps = {
|
|
|
7
7
|
},
|
|
8
8
|
micButtonStyleProps: {
|
|
9
9
|
borderRadius: "2px",
|
|
10
|
-
color: "
|
|
10
|
+
color: "#FFFFFF",
|
|
11
11
|
backgroundColor: "#3d3c3c",
|
|
12
12
|
height: "45px",
|
|
13
13
|
width: "50px",
|
|
@@ -18,7 +18,7 @@ export const defaultCurrentCallStyleProps = {
|
|
|
18
18
|
},
|
|
19
19
|
videoOffButtonStyleProps: {
|
|
20
20
|
borderRadius: "2px",
|
|
21
|
-
color: "
|
|
21
|
+
color: "#FFFFFF",
|
|
22
22
|
backgroundColor: "#3d3c3c",
|
|
23
23
|
height: "45px",
|
|
24
24
|
width: "50px",
|
|
@@ -32,25 +32,13 @@ export const defaultCurrentCallStyleProps = {
|
|
|
32
32
|
},
|
|
33
33
|
endCallButtonStyleProps: {
|
|
34
34
|
borderRadius: "2px",
|
|
35
|
-
color: "
|
|
36
|
-
backgroundColor: "
|
|
35
|
+
color: "#FFFFFF",
|
|
36
|
+
backgroundColor: "#DC0000",
|
|
37
37
|
lineHeight: "50px",
|
|
38
38
|
height: "45px",
|
|
39
39
|
width: "50px",
|
|
40
40
|
fontSize: "18px"
|
|
41
41
|
},
|
|
42
|
-
currentCallTimerStyleProps: {
|
|
43
|
-
borderRadius: "2px",
|
|
44
|
-
margin: "1px",
|
|
45
|
-
color: "white",
|
|
46
|
-
paddingTop: "18px",
|
|
47
|
-
fontSize: 12,
|
|
48
|
-
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
49
|
-
backgroundColor: "darkgrey",
|
|
50
|
-
height: "45px",
|
|
51
|
-
width: "50px",
|
|
52
|
-
textAlign: "center"
|
|
53
|
-
},
|
|
54
42
|
videoTileStyleProps: {
|
|
55
43
|
width: "100%",
|
|
56
44
|
marginLeft: "auto",
|
|
@@ -1,13 +1,13 @@
|
|
|
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 } from "../../../../common/Constants";
|
|
6
|
+
import { ElementType, 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";
|
|
10
|
-
import { useCallback } from "react";
|
|
10
|
+
import { useCallback, useEffect } from "react";
|
|
11
11
|
|
|
12
12
|
function IncomingCall(props) {
|
|
13
13
|
var _props$controlProps, _defaultIncomingCallP, _props$controlProps2, _props$controlProps2$, _defaultIncomingCallP2, _defaultIncomingCallP3, _props$controlProps3, _props$controlProps3$, _defaultIncomingCallP4, _defaultIncomingCallP5, _props$controlProps4, _props$controlProps4$, _defaultIncomingCallP6, _defaultIncomingCallP7, _defaultIncomingCallP8, _props$styleProps, _props$controlProps5, _props$controlProps5$, _defaultIncomingCallP9, _defaultIncomingCallP10, _props$controlProps6, _props$controlProps6$, _defaultIncomingCallP11, _defaultIncomingCallP12, _props$controlProps7, _props$controlProps7$, _defaultIncomingCallP13, _defaultIncomingCallP14, _defaultIncomingCallP15, _props$controlProps8, _defaultIncomingCallP16, _props$controlProps9, _defaultIncomingCallP17, _props$controlProps10, _defaultIncomingCallP18, _props$controlProps11, _defaultIncomingCallP19, _props$styleProps2, _defaultIncomingCallP20, _props$styleProps3, _defaultIncomingCallP21, _props$styleProps4, _defaultIncomingCallP22, _props$styleProps5, _defaultIncomingCallP23, _props$styleProps6, _defaultIncomingCallP24, _props$styleProps7, _defaultIncomingCallP25, _props$styleProps8, _defaultIncomingCallP26, _props$styleProps9, _props$styleProps10, _props$controlProps18, _defaultIncomingCallP27, _props$controlProps19, _props$componentOverr, _props$controlProps20, _props$controlProps21, _props$controlProps22, _props$controlProps23, _props$controlProps24, _props$controlProps25, _props$controlProps26, _props$controlProps27, _props$controlProps28;
|
|
@@ -84,12 +84,55 @@ function IncomingCall(props) {
|
|
|
84
84
|
(_props$controlProps17 = props.controlProps) === null || _props$controlProps17 === void 0 ? void 0 : _props$controlProps17.onAudioCallClick();
|
|
85
85
|
}
|
|
86
86
|
}, []);
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
const declineCallShortcut = e => e.ctrlKey && e.shiftKey && e.key === KeyCodes.DeclineCallHotKey;
|
|
89
|
+
|
|
90
|
+
const acceptAudioCallShortcut = e => e.ctrlKey && e.shiftKey && e.key === KeyCodes.AcceptAudioCallHotKey;
|
|
91
|
+
|
|
92
|
+
const acceptVideoCallShortcut = e => e.ctrlKey && e.shiftKey && e.key === KeyCodes.AcceptVideoCallHotKey;
|
|
93
|
+
|
|
94
|
+
const shortcutKeysHandler = e => {
|
|
95
|
+
if (declineCallShortcut(e)) {
|
|
96
|
+
handleDeclineCallClick();
|
|
97
|
+
} else if (acceptAudioCallShortcut(e)) {
|
|
98
|
+
handleAudioCallClick();
|
|
99
|
+
} else if (acceptVideoCallShortcut(e)) {
|
|
100
|
+
handleVideoCallClick();
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const ignoreDefault = e => {
|
|
105
|
+
if (declineCallShortcut(e) || acceptAudioCallShortcut(e) || acceptVideoCallShortcut(e)) {
|
|
106
|
+
e.preventDefault();
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
window.addEventListener("keyup", shortcutKeysHandler);
|
|
111
|
+
window.addEventListener("keydown", ignoreDefault);
|
|
112
|
+
return () => {
|
|
113
|
+
window.removeEventListener("keyup", shortcutKeysHandler);
|
|
114
|
+
window.removeEventListener("keydown", ignoreDefault);
|
|
115
|
+
};
|
|
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
|
+
}, []);
|
|
87
128
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
88
129
|
horizontal: true,
|
|
89
130
|
className: (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.className,
|
|
90
131
|
horizontalAlign: "space-between",
|
|
91
132
|
styles: stackStyles,
|
|
92
|
-
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
|
|
93
136
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
94
137
|
horizontal: true,
|
|
95
138
|
id: "incomingCallLeftGroup",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Image, Label, Stack } from "@fluentui/react";
|
|
3
|
-
import
|
|
3
|
+
import { AgentIconBase64 } from "../../../../../../assets/Icons";
|
|
4
4
|
const agentImageStyles = {
|
|
5
5
|
root: {
|
|
6
6
|
height: "50px",
|
|
@@ -35,7 +35,7 @@ export const componentOverrideProps = {
|
|
|
35
35
|
incomingCallTitle: /*#__PURE__*/React.createElement(Stack, {
|
|
36
36
|
horizontal: true
|
|
37
37
|
}, /*#__PURE__*/React.createElement(Image, {
|
|
38
|
-
src:
|
|
38
|
+
src: AgentIconBase64,
|
|
39
39
|
styles: agentImageStyles
|
|
40
40
|
}), /*#__PURE__*/React.createElement(Stack, {
|
|
41
41
|
verticalAlign: "center",
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import callacceptbutton from "../../../../../../assets/imgs/callacceptbutton.svg";
|
|
3
|
-
import videocallacceptbutton from "../../../../../../assets/imgs/videocallacceptbutton.svg";
|
|
1
|
+
import { CallAcceptButtonBase64, CallRejectButtonBase64, VideoCallAcceptButtonIconBase64 } from "../../../../../../assets/Icons";
|
|
4
2
|
export const defaultIncomingCallControlPropsRtl = {
|
|
5
3
|
id: "incomingCallPopup",
|
|
6
4
|
ariaLabel: "Incoming call area",
|
|
@@ -35,7 +33,7 @@ export const defaultIncomingCallControlPropsRtl = {
|
|
|
35
33
|
type: "icon",
|
|
36
34
|
ariaLabel: "Decline Call",
|
|
37
35
|
imageIconProps: {
|
|
38
|
-
src:
|
|
36
|
+
src: CallRejectButtonBase64,
|
|
39
37
|
styles: {
|
|
40
38
|
image: {
|
|
41
39
|
height: "18px",
|
|
@@ -50,7 +48,7 @@ export const defaultIncomingCallControlPropsRtl = {
|
|
|
50
48
|
type: "icon",
|
|
51
49
|
ariaLabel: "Audio Call",
|
|
52
50
|
imageIconProps: {
|
|
53
|
-
src:
|
|
51
|
+
src: CallAcceptButtonBase64,
|
|
54
52
|
styles: {
|
|
55
53
|
image: {
|
|
56
54
|
height: "18px",
|
|
@@ -65,7 +63,7 @@ export const defaultIncomingCallControlPropsRtl = {
|
|
|
65
63
|
type: "icon",
|
|
66
64
|
ariaLabel: "Video Call",
|
|
67
65
|
imageIconProps: {
|
|
68
|
-
src:
|
|
66
|
+
src: VideoCallAcceptButtonIconBase64,
|
|
69
67
|
styles: {
|
|
70
68
|
image: {
|
|
71
69
|
height: "18px",
|
|
@@ -6,8 +6,8 @@ export const defaultIncomingCallStyleProps = {
|
|
|
6
6
|
},
|
|
7
7
|
audioCallButtonStyleProps: {
|
|
8
8
|
borderRadius: "50%",
|
|
9
|
-
color: "
|
|
10
|
-
backgroundColor: "
|
|
9
|
+
color: "#FFFFFF",
|
|
10
|
+
backgroundColor: "#008000",
|
|
11
11
|
lineHeight: "40px",
|
|
12
12
|
height: "40px",
|
|
13
13
|
width: "40px",
|
|
@@ -18,8 +18,8 @@ export const defaultIncomingCallStyleProps = {
|
|
|
18
18
|
},
|
|
19
19
|
videoCallButtonStyleProps: {
|
|
20
20
|
borderRadius: "50%",
|
|
21
|
-
color: "
|
|
22
|
-
backgroundColor: "
|
|
21
|
+
color: "#FFFFFF",
|
|
22
|
+
backgroundColor: "#008000",
|
|
23
23
|
lineHeight: "40px",
|
|
24
24
|
height: "40px",
|
|
25
25
|
width: "40px",
|
|
@@ -34,8 +34,8 @@ export const defaultIncomingCallStyleProps = {
|
|
|
34
34
|
},
|
|
35
35
|
declineCallButtonStyleProps: {
|
|
36
36
|
borderRadius: "50%",
|
|
37
|
-
color: "
|
|
38
|
-
backgroundColor: "
|
|
37
|
+
color: "#FFFFFF",
|
|
38
|
+
backgroundColor: "#DC0000",
|
|
39
39
|
lineHeight: "40px",
|
|
40
40
|
height: "40px",
|
|
41
41
|
width: "40px",
|
|
@@ -44,11 +44,11 @@ export const defaultIncomingCallStyleProps = {
|
|
|
44
44
|
},
|
|
45
45
|
incomingCallTitleStyleProps: {
|
|
46
46
|
margin: "0 5px",
|
|
47
|
-
color: "
|
|
47
|
+
color: "#FFFFFF",
|
|
48
48
|
fontSize: 12,
|
|
49
49
|
fontFamily: "Segoe UI, Arial, sans-serif"
|
|
50
50
|
},
|
|
51
51
|
itemFocusStyleProps: {
|
|
52
|
-
outline: "2px solid
|
|
52
|
+
outline: "2px solid #FFFFFF"
|
|
53
53
|
}
|
|
54
54
|
};
|
|
@@ -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 } from "../../common/Constants";
|
|
4
|
+
import { ElementType, HiddenTextStyles, 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";
|
|
@@ -12,18 +12,28 @@ import { defaultChatButtonTextContainerStyles } from "./common/defaultStyles/def
|
|
|
12
12
|
import { defaultChatButtonTitleStyles } from "./common/defaultStyles/defaultChatButtonTitleStyles";
|
|
13
13
|
|
|
14
14
|
function NotificationBubble(props, parentId) {
|
|
15
|
-
var _props$styleProps, _props$controlProps
|
|
15
|
+
var _props$styleProps, _props$controlProps;
|
|
16
16
|
|
|
17
17
|
const notificationBubbleStyles = {
|
|
18
18
|
root: Object.assign({}, defaultChatButtonNotificationBubbleStyles, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.notificationBubbleStyleProps)
|
|
19
19
|
};
|
|
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
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
|
|
22
|
+
if (unreadMessageCount !== "0") {
|
|
23
|
+
var _props$componentOverr, _props$controlProps2, _props$controlProps3, _props$styleProps2, _props$styleProps2$cl, _props$controlProps4, _props$controlProps5;
|
|
24
|
+
|
|
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",
|
|
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,
|
|
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,
|
|
30
|
+
id: parentId + "-notification-bubble"
|
|
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));
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return null;
|
|
27
37
|
}
|
|
28
38
|
|
|
29
39
|
function IconContainer(props, parentId) {
|
|
@@ -35,13 +45,12 @@ function IconContainer(props, parentId) {
|
|
|
35
45
|
return decodeComponentString((_props$componentOverr2 = props.componentOverrides) === null || _props$componentOverr2 === void 0 ? void 0 : _props$componentOverr2.iconContainer) || /*#__PURE__*/React.createElement(Icon, {
|
|
36
46
|
className: (_props$styleProps4 = props.styleProps) === null || _props$styleProps4 === void 0 ? void 0 : (_props$styleProps4$cl = _props$styleProps4.classNames) === null || _props$styleProps4$cl === void 0 ? void 0 : _props$styleProps4$cl.iconContainerClassName,
|
|
37
47
|
styles: iconContainerStyles,
|
|
38
|
-
tabIndex: -1,
|
|
39
48
|
id: parentId + "-icon-container"
|
|
40
49
|
});
|
|
41
50
|
}
|
|
42
51
|
|
|
43
52
|
function TextContainer(props, parentId) {
|
|
44
|
-
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;
|
|
45
54
|
|
|
46
55
|
const textContainerStyles = {
|
|
47
56
|
root: Object.assign({}, defaultChatButtonTextContainerStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.textContainerStyleProps)
|
|
@@ -52,27 +61,24 @@ function TextContainer(props, parentId) {
|
|
|
52
61
|
const subtitleStyles = {
|
|
53
62
|
root: Object.assign({}, defaultChatButtonSubTitleStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.subtitleStyleProps)
|
|
54
63
|
};
|
|
55
|
-
const hideChatTitle = ((_props$
|
|
56
|
-
const hideChatSubtitle = ((_props$
|
|
57
|
-
const titleDir = ((_props$
|
|
58
|
-
const titleText = ((_props$
|
|
59
|
-
const subtitleDir = ((_props$
|
|
60
|
-
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);
|
|
61
70
|
return decodeComponentString((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.textContainer) || /*#__PURE__*/React.createElement(Stack, {
|
|
62
71
|
styles: textContainerStyles,
|
|
63
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,
|
|
64
|
-
id: parentId + "-text-container"
|
|
65
|
-
tabIndex: -1
|
|
73
|
+
id: parentId + "-text-container"
|
|
66
74
|
}, !hideChatTitle && (decodeComponentString((_props$componentOverr4 = props.componentOverrides) === null || _props$componentOverr4 === void 0 ? void 0 : _props$componentOverr4.title) || /*#__PURE__*/React.createElement(Label, {
|
|
67
75
|
styles: titleStyles,
|
|
68
|
-
tabIndex: -1,
|
|
69
76
|
dir: titleDir,
|
|
70
77
|
className: (_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 ? void 0 : (_props$styleProps9$cl = _props$styleProps9.classNames) === null || _props$styleProps9$cl === void 0 ? void 0 : _props$styleProps9$cl.titleClassName,
|
|
71
78
|
id: parentId + "-title",
|
|
72
79
|
title: titleText
|
|
73
80
|
}, titleText)), !hideChatSubtitle && (decodeComponentString((_props$componentOverr5 = props.componentOverrides) === null || _props$componentOverr5 === void 0 ? void 0 : _props$componentOverr5.subtitle) || /*#__PURE__*/React.createElement(Label, {
|
|
74
81
|
styles: subtitleStyles,
|
|
75
|
-
tabIndex: -1,
|
|
76
82
|
dir: subtitleDir,
|
|
77
83
|
className: (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : (_props$styleProps10$c = _props$styleProps10.classNames) === null || _props$styleProps10$c === void 0 ? void 0 : _props$styleProps10$c.subtitleClassName,
|
|
78
84
|
id: parentId + "-subtitle",
|
|
@@ -81,23 +87,23 @@ function TextContainer(props, parentId) {
|
|
|
81
87
|
}
|
|
82
88
|
|
|
83
89
|
function ChatButton(props) {
|
|
84
|
-
var _props$
|
|
90
|
+
var _props$controlProps12, _props$controlProps13, _props$controlProps14, _props$controlProps15, _props$controlProps16, _props$controlProps17, _props$controlProps18, _props$controlProps19, _props$styleProps11;
|
|
85
91
|
|
|
86
|
-
const elementId = ((_props$
|
|
87
|
-
const defaultAriaLabel = ((_props$
|
|
88
|
-
const defaultRole = ((_props$
|
|
89
|
-
const containersDir = ((_props$
|
|
90
|
-
const hideChatButton = ((_props$
|
|
91
|
-
const hideChatIcon = ((_props$
|
|
92
|
-
const hideChatTextContainer = ((_props$
|
|
93
|
-
const hideNotificationBubble = ((_props$
|
|
92
|
+
const elementId = ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.id) ?? "lcw-components-chat-button";
|
|
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);
|
|
94
100
|
const chatButtonGroupStyles = {
|
|
95
101
|
root: Object.assign({}, defaultChatButtonGeneralStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.generalStyleProps)
|
|
96
102
|
};
|
|
97
103
|
const handleInitiateChatClick = useCallback(() => {
|
|
98
|
-
var _props$
|
|
104
|
+
var _props$controlProps20;
|
|
99
105
|
|
|
100
|
-
if ((_props$
|
|
106
|
+
if ((_props$controlProps20 = props.controlProps) !== null && _props$controlProps20 !== void 0 && _props$controlProps20.onClick) {
|
|
101
107
|
const customEvent = {
|
|
102
108
|
elementType: ElementType.ChatButton,
|
|
103
109
|
elementId: elementId,
|
|
@@ -106,7 +112,14 @@ function ChatButton(props) {
|
|
|
106
112
|
BroadcastService.postMessage(customEvent);
|
|
107
113
|
props.controlProps.onClick();
|
|
108
114
|
}
|
|
109
|
-
}, []);
|
|
115
|
+
}, []); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
116
|
+
|
|
117
|
+
const handleInputKeyDown = e => {
|
|
118
|
+
if (e.code === KeyCodes.ENTER || e.code === KeyCodes.SPACE) {
|
|
119
|
+
handleInitiateChatClick();
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
110
123
|
return /*#__PURE__*/React.createElement(React.Fragment, null, !hideChatButton && /*#__PURE__*/React.createElement(Stack, {
|
|
111
124
|
horizontal: true,
|
|
112
125
|
id: elementId,
|
|
@@ -115,8 +128,9 @@ function ChatButton(props) {
|
|
|
115
128
|
tabIndex: 0,
|
|
116
129
|
role: defaultRole,
|
|
117
130
|
onClick: handleInitiateChatClick,
|
|
131
|
+
onKeyDown: handleInputKeyDown,
|
|
118
132
|
"aria-label": defaultAriaLabel
|
|
119
|
-
}, !hideChatIcon && IconContainer(props, elementId), !
|
|
133
|
+
}, !hideChatIcon && IconContainer(props, elementId), !hideNotificationBubble && NotificationBubble(props, elementId), !hideChatTextContainer && TextContainer(props, elementId)));
|
|
120
134
|
}
|
|
121
135
|
|
|
122
136
|
export default ChatButton;
|
|
@@ -2,7 +2,7 @@ export const defaultChatButtonControlProps = {
|
|
|
2
2
|
id: "lcw-components-chat-button",
|
|
3
3
|
dir: "ltr",
|
|
4
4
|
role: "button",
|
|
5
|
-
ariaLabel: "
|
|
5
|
+
ariaLabel: "Let's chat We are online",
|
|
6
6
|
unreadMessageCount: "0",
|
|
7
7
|
titleText: "Let's Chat!",
|
|
8
8
|
subtitleText: "We're online.",
|
|
@@ -14,5 +14,8 @@ export const defaultChatButtonControlProps = {
|
|
|
14
14
|
hideChatTextContainer: false,
|
|
15
15
|
hideChatSubtitle: false,
|
|
16
16
|
hideChatTitle: false,
|
|
17
|
-
hideNotificationBubble: true
|
|
17
|
+
hideNotificationBubble: true,
|
|
18
|
+
unreadMessageString: "new messages",
|
|
19
|
+
largeUnreadMessageString: "99+",
|
|
20
|
+
ariaLabelUnreadMessageString: "you have new messages"
|
|
18
21
|
};
|
package/lib/esm/components/chatbutton/common/defaultStyles/defaultChatButtonIconContainerStyles.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ModernChatIconBase64 } from "../../../../assets/Icons";
|
|
2
2
|
export const defaultChatButtonIconContainerStyles = {
|
|
3
3
|
align: "center",
|
|
4
4
|
backgroundColor: "#315FA2",
|
|
5
|
-
backgroundImage: `url(${
|
|
5
|
+
backgroundImage: `url(${ModernChatIconBase64})`,
|
|
6
6
|
backgroundPosition: "center",
|
|
7
7
|
backgroundRepeat: "no-repeat",
|
|
8
8
|
backgroundSize: "65% 65%",
|