@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.
Files changed (169) hide show
  1. package/lib/cjs/common/Constants.js +26 -8
  2. package/lib/cjs/common/utils.js +21 -2
  3. package/lib/cjs/components/callingcontainer/common/defaultProps/defaultCallingContainerControlProps.js +4 -1
  4. package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +7 -7
  5. package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlProps.js +26 -23
  6. package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlPropsRtl.js +20 -18
  7. package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +21 -8
  8. package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlProps.js +22 -19
  9. package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlPropsRtl.js +18 -16
  10. package/lib/cjs/components/chatbutton/ChatButton.js +28 -24
  11. package/lib/cjs/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +11 -5
  12. package/lib/cjs/components/chatbutton/common/defaultStyles/defaultChatButtonSubTitleStyles.js +3 -1
  13. package/lib/cjs/components/chatbutton/common/defaultStyles/defaultChatButtonTitleStyles.js +1 -0
  14. package/lib/cjs/components/common/commandbutton/CommandButton.js +37 -12
  15. package/lib/cjs/components/{header → common}/subcomponents/CloseButton.js +8 -7
  16. package/lib/cjs/components/confirmationpane/ConfirmationPane.js +9 -2
  17. package/lib/cjs/components/confirmationpane/common/defaultProps/defaultConfirmationPaneControlProps.js +10 -7
  18. package/lib/cjs/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneButtonGroupStyles.js +5 -1
  19. package/lib/cjs/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneGeneralStyles.js +7 -4
  20. package/lib/cjs/components/footer/Footer.js +7 -5
  21. package/lib/cjs/components/footer/common/defaultProps/customFooterControlProps.js +12 -10
  22. package/lib/cjs/components/footer/common/defaultProps/defaultFooterControlProps.js +18 -14
  23. package/lib/cjs/components/footer/common/defaultStyles/defaultFooterStyleProps.js +12 -6
  24. package/lib/cjs/components/footer/subcomponents/AudioNotificationButton.js +31 -14
  25. package/lib/cjs/components/footer/subcomponents/DownloadTranscriptButton.js +4 -4
  26. package/lib/cjs/components/footer/subcomponents/EmailTranscriptButton.js +4 -4
  27. package/lib/cjs/components/header/Header.js +7 -5
  28. package/lib/cjs/components/header/common/defaultProps/azureHeaderControlProps.js +8 -6
  29. package/lib/cjs/components/header/common/defaultProps/customHeaderControlProps.js +9 -7
  30. package/lib/cjs/components/header/common/defaultProps/defaultHeaderComponentOverrides.js +3 -1
  31. package/lib/cjs/components/header/common/defaultProps/defaultHeaderControlProps.js +13 -11
  32. package/lib/cjs/components/header/subcomponents/MinimizeButton.js +4 -4
  33. package/lib/cjs/components/inputvalidationpane/InputValidationPane.js +28 -28
  34. package/lib/cjs/components/inputvalidationpane/common/default/defaultProps/defaultInputValidationPaneControlProps.js +11 -11
  35. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -1
  36. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneGeneralStyles.js +1 -1
  37. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneInvalidInputErrorMessageStyles.js +1 -1
  38. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneSendButtonStyles.js +2 -1
  39. package/lib/cjs/components/inputvalidationpane/common/presetTwo/presetTwoProps/presetTwoInputValidationPaneControlProps.js +11 -11
  40. package/lib/cjs/components/loadingpane/LoadingPane.js +3 -2
  41. package/lib/cjs/components/loadingpane/common/defaultProps/defaultLoadingPaneControlProps.js +7 -4
  42. package/lib/cjs/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +3 -2
  43. package/lib/cjs/components/loadingpane/common/presetOneProps/presetOneLoadingPaneControlProps.js +1 -1
  44. package/lib/cjs/components/loadingpane/common/presetThreeProps/presetThreeLoadingPaneControlProps.js +1 -1
  45. package/lib/cjs/components/loadingpane/common/presetTwoProps/presetTwoLoadingPaneControlProps.js +1 -1
  46. package/lib/cjs/components/outofofficehourspane/OOOHPane.js +13 -6
  47. package/lib/cjs/components/outofofficehourspane/common/defaultProps/defaultOOOHPaneControlProps.js +7 -2
  48. package/lib/cjs/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.js +15 -0
  49. package/lib/cjs/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneProps.js +16 -0
  50. package/lib/cjs/components/outofofficehourspane/common/presetOneProps/presetOneOOOHPaneControlProps.js +1 -1
  51. package/lib/cjs/components/outofofficehourspane/common/presetTwoProps/presetTwoOOOHPaneControlProps.js +1 -1
  52. package/lib/cjs/components/postchatsurveypane/PostChatSurveyPane.js +2 -1
  53. package/lib/cjs/components/postchatsurveypane/common/defaultProps/defaultPostChatSurveyPaneControlProps.js +5 -2
  54. package/lib/cjs/components/postchatsurveypane/common/presetOneProps/presetOnePostChatSurveyPaneControlProps.js +1 -1
  55. package/lib/cjs/components/prechatsurveypane/PreChatSurveyPane.js +25 -11
  56. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultPreChatSurveyPaneControlProps.js +5 -1
  57. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +4 -1
  58. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.js +10 -0
  59. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneStyles.js +7 -1
  60. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.js +10 -0
  61. package/lib/cjs/components/prechatsurveypane/common/presetThreeProps/presetThreePreChatSurveyPaneControlProps.js +1 -1
  62. package/lib/cjs/components/prechatsurveypane/common/presetTwoProps/presetTwoPreChatSurveyPaneControlProps.js +1 -1
  63. package/lib/cjs/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.js +1 -0
  64. package/lib/cjs/components/proactivechatpane/ProactiveChatPane.js +36 -35
  65. package/lib/cjs/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +15 -8
  66. package/lib/cjs/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -13
  67. package/lib/cjs/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +15 -8
  68. package/lib/cjs/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +15 -8
  69. package/lib/cjs/components/proactivechatpane/common/presetTwo/presetTwoProps/presetTwoProactiveChatPaneControlProps.js +9 -6
  70. package/lib/cjs/components/reconnectchatpane/ReconnectChatPane.js +3 -3
  71. package/lib/cjs/components/reconnectchatpane/common/default/defaultProps/defaultReconnectChatPaneControlProps.js +12 -9
  72. package/lib/cjs/components/reconnectchatpane/common/presetThree/presetThreeProps/presetThreeReconnectChatPaneControlProps.js +11 -8
  73. package/lib/cjs/index.js +6 -0
  74. package/lib/cjs/services/BroadcastService.js +36 -8
  75. package/lib/esm/common/Constants.js +18 -6
  76. package/lib/esm/common/utils.js +16 -0
  77. package/lib/esm/components/callingcontainer/common/defaultProps/defaultCallingContainerControlProps.js +2 -1
  78. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +8 -8
  79. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlProps.js +24 -23
  80. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultProps/defaultCurrentCallControlPropsRtl.js +19 -18
  81. package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +22 -9
  82. package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlProps.js +20 -19
  83. package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/common/defaultProps/defaultIncomingCallControlPropsRtl.js +17 -16
  84. package/lib/esm/components/chatbutton/ChatButton.js +28 -24
  85. package/lib/esm/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +9 -5
  86. package/lib/esm/components/chatbutton/common/defaultStyles/defaultChatButtonSubTitleStyles.js +3 -1
  87. package/lib/esm/components/chatbutton/common/defaultStyles/defaultChatButtonTitleStyles.js +1 -0
  88. package/lib/esm/components/common/commandbutton/CommandButton.js +38 -13
  89. package/lib/esm/components/{header → common}/subcomponents/CloseButton.js +9 -8
  90. package/lib/esm/components/confirmationpane/ConfirmationPane.js +10 -3
  91. package/lib/esm/components/confirmationpane/common/defaultProps/defaultConfirmationPaneControlProps.js +8 -7
  92. package/lib/esm/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneButtonGroupStyles.js +5 -1
  93. package/lib/esm/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneGeneralStyles.js +7 -4
  94. package/lib/esm/components/footer/Footer.js +6 -5
  95. package/lib/esm/components/footer/common/defaultProps/customFooterControlProps.js +11 -10
  96. package/lib/esm/components/footer/common/defaultProps/defaultFooterControlProps.js +16 -14
  97. package/lib/esm/components/footer/common/defaultStyles/defaultFooterStyleProps.js +12 -6
  98. package/lib/esm/components/footer/subcomponents/AudioNotificationButton.js +32 -15
  99. package/lib/esm/components/footer/subcomponents/DownloadTranscriptButton.js +5 -5
  100. package/lib/esm/components/footer/subcomponents/EmailTranscriptButton.js +5 -5
  101. package/lib/esm/components/header/Header.js +6 -5
  102. package/lib/esm/components/header/common/defaultProps/azureHeaderControlProps.js +7 -6
  103. package/lib/esm/components/header/common/defaultProps/customHeaderControlProps.js +8 -7
  104. package/lib/esm/components/header/common/defaultProps/defaultHeaderComponentOverrides.js +2 -1
  105. package/lib/esm/components/header/common/defaultProps/defaultHeaderControlProps.js +12 -11
  106. package/lib/esm/components/header/subcomponents/MinimizeButton.js +5 -5
  107. package/lib/esm/components/inputvalidationpane/InputValidationPane.js +29 -29
  108. package/lib/esm/components/inputvalidationpane/common/default/defaultProps/defaultInputValidationPaneControlProps.js +12 -12
  109. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -1
  110. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneGeneralStyles.js +1 -1
  111. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneInvalidInputErrorMessageStyles.js +1 -1
  112. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneSendButtonStyles.js +2 -1
  113. package/lib/esm/components/inputvalidationpane/common/presetTwo/presetTwoProps/presetTwoInputValidationPaneControlProps.js +12 -12
  114. package/lib/esm/components/loadingpane/LoadingPane.js +3 -2
  115. package/lib/esm/components/loadingpane/common/defaultProps/defaultLoadingPaneControlProps.js +5 -4
  116. package/lib/esm/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +3 -2
  117. package/lib/esm/components/loadingpane/common/presetOneProps/presetOneLoadingPaneControlProps.js +1 -1
  118. package/lib/esm/components/loadingpane/common/presetThreeProps/presetThreeLoadingPaneControlProps.js +1 -1
  119. package/lib/esm/components/loadingpane/common/presetTwoProps/presetTwoLoadingPaneControlProps.js +1 -1
  120. package/lib/esm/components/outofofficehourspane/OOOHPane.js +13 -7
  121. package/lib/esm/components/outofofficehourspane/common/defaultProps/defaultOOOHPaneControlProps.js +5 -2
  122. package/lib/esm/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.js +6 -0
  123. package/lib/esm/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneProps.js +6 -0
  124. package/lib/esm/components/outofofficehourspane/common/presetOneProps/presetOneOOOHPaneControlProps.js +1 -1
  125. package/lib/esm/components/outofofficehourspane/common/presetTwoProps/presetTwoOOOHPaneControlProps.js +1 -1
  126. package/lib/esm/components/postchatsurveypane/PostChatSurveyPane.js +2 -1
  127. package/lib/esm/components/postchatsurveypane/common/defaultProps/defaultPostChatSurveyPaneControlProps.js +3 -2
  128. package/lib/esm/components/postchatsurveypane/common/presetOneProps/presetOnePostChatSurveyPaneControlProps.js +1 -1
  129. package/lib/esm/components/prechatsurveypane/PreChatSurveyPane.js +26 -12
  130. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultPreChatSurveyPaneControlProps.js +3 -1
  131. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +4 -1
  132. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.js +3 -0
  133. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneStyles.js +5 -1
  134. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.js +3 -0
  135. package/lib/esm/components/prechatsurveypane/common/presetThreeProps/presetThreePreChatSurveyPaneControlProps.js +1 -1
  136. package/lib/esm/components/prechatsurveypane/common/presetTwoProps/presetTwoPreChatSurveyPaneControlProps.js +1 -1
  137. package/lib/esm/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.js +1 -0
  138. package/lib/esm/components/proactivechatpane/ProactiveChatPane.js +33 -34
  139. package/lib/esm/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +13 -8
  140. package/lib/esm/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -11
  141. package/lib/esm/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +13 -8
  142. package/lib/esm/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +13 -8
  143. package/lib/esm/components/proactivechatpane/common/presetTwo/presetTwoProps/presetTwoProactiveChatPaneControlProps.js +7 -6
  144. package/lib/esm/components/reconnectchatpane/ReconnectChatPane.js +4 -4
  145. package/lib/esm/components/reconnectchatpane/common/default/defaultProps/defaultReconnectChatPaneControlProps.js +10 -9
  146. package/lib/esm/components/reconnectchatpane/common/presetThree/presetThreeProps/presetThreeReconnectChatPaneControlProps.js +9 -8
  147. package/lib/esm/index.js +1 -0
  148. package/lib/esm/services/BroadcastService.js +34 -8
  149. package/lib/types/common/Constants.d.ts +151 -2
  150. package/lib/types/common/utils.d.ts +1 -0
  151. package/lib/types/components/chatbutton/interfaces/IChatButtonControlProps.d.ts +3 -0
  152. package/lib/types/components/common/interfaces/ICommandButtonControlProps.d.ts +1 -0
  153. package/lib/types/components/common/interfaces/ICommandButtonProps.d.ts +1 -0
  154. package/lib/types/components/{header → common}/subcomponents/CloseButton.d.ts +1 -1
  155. package/lib/types/components/confirmationpane/interfaces/IConfirmationPaneControlProps.d.ts +0 -1
  156. package/lib/types/components/inputvalidationpane/interfaces/IInputValidationPaneControlProps.d.ts +0 -1
  157. package/lib/types/components/loadingpane/interfaces/ILoadingPaneProps.d.ts +2 -0
  158. package/lib/types/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.d.ts +2 -0
  159. package/lib/types/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneProps.d.ts +2 -0
  160. package/lib/types/components/outofofficehourspane/interfaces/IOOOHPaneControlProps.d.ts +1 -0
  161. package/lib/types/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.d.ts +2 -0
  162. package/lib/types/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.d.ts +2 -0
  163. package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneButtonStyles.d.ts +3 -0
  164. package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.d.ts +5 -0
  165. package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneStyleProps.d.ts +5 -0
  166. package/lib/types/components/proactivechatpane/interfaces/IProactiveChatPaneControlProps.d.ts +2 -1
  167. package/lib/types/index.d.ts +1 -0
  168. package/lib/types/services/BroadcastService.d.ts +1 -0
  169. 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: "currentCall-container",
4
+ id: Ids.DefaultCurrentCallId,
4
5
  nonActionIds: {
5
- currentCallActionGroupId: "currentCall-actionicons",
6
- currentCallFooterId: "currentCall-footer",
7
- remoteVideoTileId: "remoteVideo",
8
- selfVideoTileId: "selfVideo",
9
- videoTileGroupId: "currentCall-body"
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: "callRejectButton",
41
- type: "icon",
42
- ariaLabel: "End Call",
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: "toggleAudio",
55
- type: "icon",
56
- ariaLabel: "Mute",
57
- toggleAriaLabel: "Unmute",
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: "toggleVideo",
80
- type: "icon",
81
- ariaLabel: "Turn camera on",
82
- toggleAriaLabel: "Turn camera off",
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: "oc-lcw-CurrentCall-timer"
105
+ id: Ids.CallTimerId
105
106
  }
106
107
  };
@@ -1,9 +1,9 @@
1
- function _extends() { _extends = Object.assign || 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); }
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: "incomingCallEnded"
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: "OnClick"
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: "OnClick"
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: "incomingCallLeftGroup",
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: "incomingCallMiddleGroup",
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: "incomingCallRightGroup",
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: "oc-lcw-incomingcall",
3
+ id: Ids.DefaultIncomingCallId,
3
4
  dir: "ltr",
4
- ariaLabel: "Incoming call area",
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("download transcript clicked");
11
+ console.log("decline call clicked");
11
12
  },
12
13
  onAudioCallClick: function () {
13
- console.log("email transcript clicked");
14
+ console.log("audio call clicked");
14
15
  },
15
16
  onVideoCallClick: function () {
16
- console.log("audio notification clicked");
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: "callRejectButton",
32
- type: "icon",
33
- ariaLabel: "Reject call",
34
- iconName: "DeclineCall",
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: "callAcceptButton",
39
- type: "icon",
40
- ariaLabel: "Accept voice call",
41
- iconName: "IncomingCall",
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: "videoCallAcceptButton",
46
- type: "icon",
47
- ariaLabel: "Accept video Call",
48
- iconName: "Video",
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: "incomingCallMessage",
53
- text: "Incoming Call"
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: "incomingCallPopup",
4
- ariaLabel: "Incoming call area",
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("download transcript clicked");
11
+ console.log("decline call clicked");
11
12
  },
12
13
  onAudioCallClick: function () {
13
- console.log("email transcript clicked");
14
+ console.log("audio call clicked");
14
15
  },
15
16
  onVideoCallClick: function () {
16
- console.log("audio notification clicked");
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: "callRejectButton",
33
- type: "icon",
34
- ariaLabel: "Decline Call",
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: "callAcceptButton",
48
- type: "icon",
49
- ariaLabel: "Audio Call",
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: "videoCallAcceptButton",
63
- type: "icon",
64
- ariaLabel: "Video Call",
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: "incomingCallMessage",
78
- text: "Incoming Call"
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(Label, {
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$controlProps2, _props$controlProps3, _props$controlProps4, _props$controlProps5, _props$controlProps6, _props$controlProps7, _props$componentOverr3, _props$styleProps8, _props$styleProps8$cl, _props$componentOverr4, _props$styleProps9, _props$styleProps9$cl, _props$componentOverr5, _props$styleProps10, _props$styleProps10$c;
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$controlProps2 = props.controlProps) === null || _props$controlProps2 === void 0 ? void 0 : _props$controlProps2.hideChatTitle) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatTitle);
61
- const hideChatSubtitle = ((_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.hideChatSubtitle) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatSubtitle);
62
- const titleDir = ((_props$controlProps4 = props.controlProps) === null || _props$controlProps4 === void 0 ? void 0 : _props$controlProps4.dir) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.dir);
63
- const titleText = ((_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.titleText) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.titleText);
64
- const subtitleDir = ((_props$controlProps6 = props.controlProps) === null || _props$controlProps6 === void 0 ? void 0 : _props$controlProps6.dir) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.dir);
65
- const subtitleText = ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.subtitleText) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.subtitleText);
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$controlProps8, _props$controlProps9, _props$controlProps10, _props$controlProps11, _props$controlProps12, _props$controlProps13, _props$controlProps14, _props$controlProps15, _props$styleProps11;
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$controlProps8 = props.controlProps) === null || _props$controlProps8 === void 0 ? void 0 : _props$controlProps8.id) ?? "lcw-components-chat-button";
89
- const defaultAriaLabel = ((_props$controlProps9 = props.controlProps) === null || _props$controlProps9 === void 0 ? void 0 : _props$controlProps9.ariaLabel) ?? "live chat button";
90
- const defaultRole = ((_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.role) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.role);
91
- const containersDir = ((_props$controlProps11 = props.controlProps) === null || _props$controlProps11 === void 0 ? void 0 : _props$controlProps11.dir) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.dir);
92
- const hideChatButton = ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.hideChatButton) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatButton);
93
- const hideChatIcon = ((_props$controlProps13 = props.controlProps) === null || _props$controlProps13 === void 0 ? void 0 : _props$controlProps13.hideChatIcon) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatIcon);
94
- const hideChatTextContainer = ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.hideChatTextContainer) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatTextContainer);
95
- const hideNotificationBubble = ((_props$controlProps15 = props.controlProps) === null || _props$controlProps15 === void 0 ? void 0 : _props$controlProps15.hideNotificationBubble) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideNotificationBubble);
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$controlProps16;
104
+ var _props$controlProps20;
101
105
 
102
- if ((_props$controlProps16 = props.controlProps) !== null && _props$controlProps16 !== void 0 && _props$controlProps16.onClick) {
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: "OnClick"
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), !hideChatTextContainer && TextContainer(props, elementId), !hideNotificationBubble && NotificationBubble(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: "lcw-components-chat-button",
3
+ id: Ids.DefaultChatButtonId,
3
4
  dir: "ltr",
4
5
  role: "button",
5
- ariaLabel: "live chat button",
6
+ ariaLabel: AriaLabels.LetsChatWeAreOnline,
6
7
  unreadMessageCount: "0",
7
- titleText: "Let's Chat!",
8
- subtitleText: "We're online.",
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
  };
@@ -8,6 +8,8 @@ export const defaultChatButtonSubTitleStyles = {
8
8
  fontWeight: "200",
9
9
  margin: "0px 14px 0px 14px",
10
10
  overflow: "hidden",
11
+ padding: "0px",
11
12
  textOverflow: "ellipsis !important",
12
- width: "max-content"
13
+ whiteSpace: "nowrap",
14
+ width: "90px"
13
15
  };
@@ -9,6 +9,7 @@ export const defaultChatButtonTitleStyles = {
9
9
  height: "22px",
10
10
  margin: "0px 14px 0px 14px",
11
11
  overflow: "hidden",
12
+ padding: "0px",
12
13
  textOverflow: "ellipsis !important",
13
14
  whiteSpace: "nowrap",
14
15
  width: "90px"
@@ -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
- const iconButtonStyles = {
17
- root: props.styles,
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: "onClick",
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 === "text" && /*#__PURE__*/React.createElement(DefaultButton, {
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: iconButtonStyles
41
- }), props.type === "icon" && /*#__PURE__*/React.createElement(IconButton, {
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: iconButtonStyles,
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 "../../common/commandbutton/CommandButton";
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.HeaderCloseButton,
10
+ elementType: ElementType.CloseButton,
11
11
  elementId: props === null || props === void 0 ? void 0 : props.id,
12
- eventName: "OnClick"
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 ?? "Close",
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 ?? "ChromeClose",
21
+ iconName: props.iconName ?? IconNames.ChromeClose,
22
22
  imageIconProps: props.imageIconProps,
23
23
  onClick: props.onClick,
24
- ariaLabel: props.ariaLabel ?? "Close",
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: "OnClick"
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: "OnClick"
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,