@microsoft/omnichannel-chat-components 0.1.0-main.fc27009 → 1.0.0

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 (109) hide show
  1. package/lib/cjs/common/Constants.js +11 -6
  2. package/lib/cjs/common/utils.js +21 -2
  3. package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +1 -1
  4. package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +15 -2
  5. package/lib/cjs/components/chatbutton/ChatButton.js +27 -23
  6. package/lib/cjs/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +5 -2
  7. package/lib/cjs/components/chatbutton/common/defaultStyles/defaultChatButtonSubTitleStyles.js +3 -1
  8. package/lib/cjs/components/chatbutton/common/defaultStyles/defaultChatButtonTitleStyles.js +1 -0
  9. package/lib/cjs/components/common/commandbutton/CommandButton.js +34 -9
  10. package/lib/cjs/components/{header → common}/subcomponents/CloseButton.js +4 -3
  11. package/lib/cjs/components/confirmationpane/ConfirmationPane.js +7 -0
  12. package/lib/cjs/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneButtonGroupStyles.js +5 -1
  13. package/lib/cjs/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneGeneralStyles.js +7 -4
  14. package/lib/cjs/components/footer/Footer.js +2 -2
  15. package/lib/cjs/components/footer/common/defaultProps/defaultFooterControlProps.js +1 -0
  16. package/lib/cjs/components/footer/common/defaultStyles/defaultFooterStyleProps.js +12 -6
  17. package/lib/cjs/components/footer/subcomponents/AudioNotificationButton.js +29 -12
  18. package/lib/cjs/components/header/Header.js +2 -2
  19. package/lib/cjs/components/inputvalidationpane/InputValidationPane.js +28 -28
  20. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -1
  21. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneGeneralStyles.js +1 -1
  22. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneInvalidInputErrorMessageStyles.js +1 -1
  23. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneSendButtonStyles.js +2 -1
  24. package/lib/cjs/components/loadingpane/LoadingPane.js +2 -1
  25. package/lib/cjs/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +3 -2
  26. package/lib/cjs/components/outofofficehourspane/OOOHPane.js +13 -6
  27. package/lib/cjs/components/outofofficehourspane/common/defaultProps/defaultOOOHPaneControlProps.js +3 -1
  28. package/lib/cjs/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.js +15 -0
  29. package/lib/cjs/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneProps.js +16 -0
  30. package/lib/cjs/components/postchatsurveypane/PostChatSurveyPane.js +2 -1
  31. package/lib/cjs/components/prechatsurveypane/PreChatSurveyPane.js +23 -9
  32. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultPreChatSurveyPaneControlProps.js +1 -0
  33. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +4 -1
  34. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.js +10 -0
  35. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneStyles.js +7 -1
  36. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.js +10 -0
  37. package/lib/cjs/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.js +1 -0
  38. package/lib/cjs/components/proactivechatpane/ProactiveChatPane.js +36 -35
  39. package/lib/cjs/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +5 -1
  40. package/lib/cjs/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -13
  41. package/lib/cjs/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +5 -1
  42. package/lib/cjs/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +5 -1
  43. package/lib/cjs/index.js +6 -0
  44. package/lib/cjs/services/BroadcastService.js +36 -8
  45. package/lib/esm/common/Constants.js +9 -4
  46. package/lib/esm/common/utils.js +16 -0
  47. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +1 -1
  48. package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +15 -2
  49. package/lib/esm/components/chatbutton/ChatButton.js +27 -23
  50. package/lib/esm/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +5 -2
  51. package/lib/esm/components/chatbutton/common/defaultStyles/defaultChatButtonSubTitleStyles.js +3 -1
  52. package/lib/esm/components/chatbutton/common/defaultStyles/defaultChatButtonTitleStyles.js +1 -0
  53. package/lib/esm/components/common/commandbutton/CommandButton.js +34 -9
  54. package/lib/esm/components/{header → common}/subcomponents/CloseButton.js +4 -3
  55. package/lib/esm/components/confirmationpane/ConfirmationPane.js +8 -1
  56. package/lib/esm/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneButtonGroupStyles.js +5 -1
  57. package/lib/esm/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneGeneralStyles.js +7 -4
  58. package/lib/esm/components/footer/Footer.js +2 -2
  59. package/lib/esm/components/footer/common/defaultProps/defaultFooterControlProps.js +1 -0
  60. package/lib/esm/components/footer/common/defaultStyles/defaultFooterStyleProps.js +12 -6
  61. package/lib/esm/components/footer/subcomponents/AudioNotificationButton.js +29 -12
  62. package/lib/esm/components/header/Header.js +2 -2
  63. package/lib/esm/components/inputvalidationpane/InputValidationPane.js +29 -29
  64. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -1
  65. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneGeneralStyles.js +1 -1
  66. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneInvalidInputErrorMessageStyles.js +1 -1
  67. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneSendButtonStyles.js +2 -1
  68. package/lib/esm/components/loadingpane/LoadingPane.js +2 -1
  69. package/lib/esm/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +3 -2
  70. package/lib/esm/components/outofofficehourspane/OOOHPane.js +13 -7
  71. package/lib/esm/components/outofofficehourspane/common/defaultProps/defaultOOOHPaneControlProps.js +3 -1
  72. package/lib/esm/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.js +6 -0
  73. package/lib/esm/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneProps.js +6 -0
  74. package/lib/esm/components/postchatsurveypane/PostChatSurveyPane.js +2 -1
  75. package/lib/esm/components/prechatsurveypane/PreChatSurveyPane.js +23 -9
  76. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultPreChatSurveyPaneControlProps.js +1 -0
  77. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +4 -1
  78. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.js +3 -0
  79. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneStyles.js +5 -1
  80. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.js +3 -0
  81. package/lib/esm/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.js +1 -0
  82. package/lib/esm/components/proactivechatpane/ProactiveChatPane.js +33 -34
  83. package/lib/esm/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +5 -1
  84. package/lib/esm/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -11
  85. package/lib/esm/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +5 -1
  86. package/lib/esm/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +5 -1
  87. package/lib/esm/index.js +1 -0
  88. package/lib/esm/services/BroadcastService.js +34 -8
  89. package/lib/types/common/Constants.d.ts +3 -2
  90. package/lib/types/common/utils.d.ts +1 -0
  91. package/lib/types/components/chatbutton/interfaces/IChatButtonControlProps.d.ts +3 -0
  92. package/lib/types/components/common/interfaces/ICommandButtonControlProps.d.ts +1 -0
  93. package/lib/types/components/common/interfaces/ICommandButtonProps.d.ts +1 -0
  94. package/lib/types/components/{header → common}/subcomponents/CloseButton.d.ts +1 -1
  95. package/lib/types/components/confirmationpane/interfaces/IConfirmationPaneControlProps.d.ts +0 -1
  96. package/lib/types/components/inputvalidationpane/interfaces/IInputValidationPaneControlProps.d.ts +0 -1
  97. package/lib/types/components/loadingpane/interfaces/ILoadingPaneProps.d.ts +2 -0
  98. package/lib/types/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.d.ts +2 -0
  99. package/lib/types/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneProps.d.ts +2 -0
  100. package/lib/types/components/outofofficehourspane/interfaces/IOOOHPaneControlProps.d.ts +1 -0
  101. package/lib/types/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.d.ts +2 -0
  102. package/lib/types/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.d.ts +2 -0
  103. package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneButtonStyles.d.ts +3 -0
  104. package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.d.ts +5 -0
  105. package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneStyleProps.d.ts +5 -0
  106. package/lib/types/components/proactivechatpane/interfaces/IProactiveChatPaneControlProps.d.ts +2 -1
  107. package/lib/types/index.d.ts +1 -0
  108. package/lib/types/services/BroadcastService.d.ts +1 -0
  109. package/package.json +2 -2
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Regex = exports.KeyCodes = exports.ElementType = exports.BROADCAST_CHANNEL_NAME = exports.AccessibilityBrightnessRatio = void 0;
6
+ exports.Regex = exports.KeyCodes = exports.HiddenTextStyles = exports.ElementType = exports.AccessibilityBrightnessRatio = void 0;
7
7
 
8
8
  var _class, _class2;
9
9
 
@@ -11,11 +11,16 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
11
11
 
12
12
  /* CSS Constants */
13
13
  const AccessibilityBrightnessRatio = 1.2;
14
- /* App constants*/
15
-
16
14
  exports.AccessibilityBrightnessRatio = AccessibilityBrightnessRatio;
17
- const BROADCAST_CHANNEL_NAME = "omnichannel_broadcast_channel";
18
- exports.BROADCAST_CHANNEL_NAME = BROADCAST_CHANNEL_NAME;
15
+ const HiddenTextStyles = {
16
+ position: "absolute",
17
+ height: "1px",
18
+ width: "1px",
19
+ overflow: "hidden",
20
+ clip: "rect(1px, 1px, 1px, 1px)",
21
+ whiteSpace: "nowrap"
22
+ };
23
+ exports.HiddenTextStyles = HiddenTextStyles;
19
24
  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);
20
25
  exports.KeyCodes = KeyCodes;
21
26
  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);
@@ -25,7 +30,7 @@ exports.ElementType = ElementType;
25
30
 
26
31
  (function (ElementType) {
27
32
  ElementType["ChatButton"] = "ChatButton";
28
- ElementType["HeaderCloseButton"] = "HeaderCloseButton";
33
+ ElementType["CloseButton"] = "CloseButton";
29
34
  ElementType["HeaderMinimizeButton"] = "HeaderMinimizeButton";
30
35
  ElementType["FooterDownloadTranscriptButton"] = "FooterDownloadTranscriptButton";
31
36
  ElementType["FooterEmailTranscriptButton"] = "FooterEmailTranscriptButton";
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.uuidv4 = exports.processCustomComponents = exports.getValidatedURL = exports.getSeconds = exports.getMinutes = exports.getInputValuesFromAdaptiveCard = exports.getHours = exports.generateEventName = exports.broadcastError = exports.addNoreferrerNoopenerTag = void 0;
6
+ exports.uuidv4 = exports.replaceURLWithAnchor = exports.processCustomComponents = exports.getValidatedURL = exports.getSeconds = exports.getMinutes = exports.getInputValuesFromAdaptiveCard = exports.getHours = exports.generateEventName = exports.broadcastError = exports.addNoreferrerNoopenerTag = void 0;
7
7
 
8
8
  var _Constants = require("./Constants");
9
9
 
@@ -133,4 +133,23 @@ const addNoreferrerNoopenerTag = htmlNode => {
133
133
  }
134
134
  };
135
135
 
136
- exports.addNoreferrerNoopenerTag = addNoreferrerNoopenerTag;
136
+ exports.addNoreferrerNoopenerTag = addNoreferrerNoopenerTag;
137
+
138
+ const replaceURLWithAnchor = (text, openInNewTab) => {
139
+ if (text) {
140
+ const modifiedText = text.replace(_Constants.Regex.URLRegex, function (url) {
141
+ if (openInNewTab) {
142
+ // eslint-disable-next-line quotes
143
+ return '<a href="' + url + '" rel="noreferrer noopener" target="_blank">' + url + '</a>';
144
+ } // eslint-disable-next-line quotes
145
+
146
+
147
+ return '<a href="' + url + '">' + url + '</a>';
148
+ });
149
+ return modifiedText;
150
+ }
151
+
152
+ return text;
153
+ };
154
+
155
+ exports.replaceURLWithAnchor = replaceURLWithAnchor;
@@ -29,7 +29,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
29
29
 
30
30
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
31
31
 
32
- 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); }
32
+ 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); }
33
33
 
34
34
  function CurrentCall(props) {
35
35
  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;
@@ -25,7 +25,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
25
25
 
26
26
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
27
 
28
- 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); }
28
+ 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); }
29
29
 
30
30
  function IncomingCall(props) {
31
31
  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;
@@ -132,12 +132,25 @@ function IncomingCall(props) {
132
132
  window.removeEventListener("keydown", ignoreDefault);
133
133
  };
134
134
  }, []);
135
+ (0, React.useEffect)(() => {
136
+ // Setting focus to decline call button when incoming call alert appears
137
+ if (declineCallButtonId) {
138
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
139
+ const declineCallButton = document.getElementById(declineCallButtonId);
140
+
141
+ if (declineCallButton) {
142
+ declineCallButton.focus();
143
+ }
144
+ }
145
+ }, []);
135
146
  return /*#__PURE__*/React.createElement(_react2.Stack, {
136
147
  horizontal: true,
137
148
  className: (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.className,
138
149
  horizontalAlign: "space-between",
139
150
  styles: stackStyles,
140
- dir: ((_props$controlProps18 = props.controlProps) === null || _props$controlProps18 === void 0 ? void 0 : _props$controlProps18.dir) ?? ((_defaultIncomingCallP27 = _defaultIncomingCallProps.defaultIncomingCallProps.controlProps) === null || _defaultIncomingCallP27 === void 0 ? void 0 : _defaultIncomingCallP27.dir)
151
+ dir: ((_props$controlProps18 = props.controlProps) === null || _props$controlProps18 === void 0 ? void 0 : _props$controlProps18.dir) ?? ((_defaultIncomingCallP27 = _defaultIncomingCallProps.defaultIncomingCallProps.controlProps) === null || _defaultIncomingCallP27 === void 0 ? void 0 : _defaultIncomingCallP27.dir),
152
+ role: "alert",
153
+ "aria-label": incomingCallTitleProps === null || incomingCallTitleProps === void 0 ? void 0 : incomingCallTitleProps.text
141
154
  }, /*#__PURE__*/React.createElement(_react2.Stack, {
142
155
  horizontal: true,
143
156
  id: "incomingCallLeftGroup",
@@ -42,13 +42,17 @@ function NotificationBubble(props, parentId) {
42
42
  const unreadMessageCount = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.unreadMessageCount) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.unreadMessageCount);
43
43
 
44
44
  if (unreadMessageCount !== "0") {
45
- var _props$componentOverr, _props$styleProps2, _props$styleProps2$cl;
45
+ var _props$componentOverr, _props$controlProps2, _props$controlProps3, _props$styleProps2, _props$styleProps2$cl, _props$controlProps4, _props$controlProps5;
46
46
 
47
- return (0, _decodeComponentString.decodeComponentString)((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.notificationBubble) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
47
+ return (0, _decodeComponentString.decodeComponentString)((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.notificationBubble) || /*#__PURE__*/_react2.default.createElement(_react.Stack, {
48
+ "aria-live": "polite",
48
49
  styles: notificationBubbleStyles,
50
+ "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.defaultChatButtonControlProps.ariaLabelUnreadMessageString,
49
51
  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,
50
52
  id: parentId + "-notification-bubble"
51
- }, unreadMessageCount);
53
+ }, unreadMessageCount, /*#__PURE__*/_react2.default.createElement("span", {
54
+ style: _Constants.HiddenTextStyles
55
+ }, (_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.defaultChatButtonControlProps.unreadMessageString));
52
56
  }
53
57
 
54
58
  return null;
@@ -68,7 +72,7 @@ function IconContainer(props, parentId) {
68
72
  }
69
73
 
70
74
  function TextContainer(props, parentId) {
71
- 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;
75
+ 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;
72
76
 
73
77
  const textContainerStyles = {
74
78
  root: Object.assign({}, _defaultChatButtonTextContainerStyles.defaultChatButtonTextContainerStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.textContainerStyleProps)
@@ -79,12 +83,12 @@ function TextContainer(props, parentId) {
79
83
  const subtitleStyles = {
80
84
  root: Object.assign({}, _defaultChatButtonSubTitleStyles.defaultChatButtonSubTitleStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.subtitleStyleProps)
81
85
  };
82
- const hideChatTitle = ((_props$controlProps2 = props.controlProps) === null || _props$controlProps2 === void 0 ? void 0 : _props$controlProps2.hideChatTitle) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.hideChatTitle);
83
- const hideChatSubtitle = ((_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.hideChatSubtitle) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.hideChatSubtitle);
84
- const titleDir = ((_props$controlProps4 = props.controlProps) === null || _props$controlProps4 === void 0 ? void 0 : _props$controlProps4.dir) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.dir);
85
- const titleText = ((_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.titleText) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.titleText);
86
- const subtitleDir = ((_props$controlProps6 = props.controlProps) === null || _props$controlProps6 === void 0 ? void 0 : _props$controlProps6.dir) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.dir);
87
- const subtitleText = ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.subtitleText) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.subtitleText);
86
+ const hideChatTitle = ((_props$controlProps6 = props.controlProps) === null || _props$controlProps6 === void 0 ? void 0 : _props$controlProps6.hideChatTitle) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.hideChatTitle);
87
+ const hideChatSubtitle = ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.hideChatSubtitle) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.hideChatSubtitle);
88
+ const titleDir = ((_props$controlProps8 = props.controlProps) === null || _props$controlProps8 === void 0 ? void 0 : _props$controlProps8.dir) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.dir);
89
+ const titleText = ((_props$controlProps9 = props.controlProps) === null || _props$controlProps9 === void 0 ? void 0 : _props$controlProps9.titleText) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.titleText);
90
+ const subtitleDir = ((_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.dir) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.dir);
91
+ const subtitleText = ((_props$controlProps11 = props.controlProps) === null || _props$controlProps11 === void 0 ? void 0 : _props$controlProps11.subtitleText) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.subtitleText);
88
92
  return (0, _decodeComponentString.decodeComponentString)((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.textContainer) || /*#__PURE__*/_react2.default.createElement(_react.Stack, {
89
93
  styles: textContainerStyles,
90
94
  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,
@@ -105,23 +109,23 @@ function TextContainer(props, parentId) {
105
109
  }
106
110
 
107
111
  function ChatButton(props) {
108
- var _props$controlProps8, _props$controlProps9, _props$controlProps10, _props$controlProps11, _props$controlProps12, _props$controlProps13, _props$controlProps14, _props$controlProps15, _props$styleProps11;
109
-
110
- const elementId = ((_props$controlProps8 = props.controlProps) === null || _props$controlProps8 === void 0 ? void 0 : _props$controlProps8.id) ?? "lcw-components-chat-button";
111
- const defaultAriaLabel = ((_props$controlProps9 = props.controlProps) === null || _props$controlProps9 === void 0 ? void 0 : _props$controlProps9.ariaLabel) ?? "live chat button";
112
- const defaultRole = ((_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.role) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.role);
113
- const containersDir = ((_props$controlProps11 = props.controlProps) === null || _props$controlProps11 === void 0 ? void 0 : _props$controlProps11.dir) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.dir);
114
- const hideChatButton = ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.hideChatButton) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.hideChatButton);
115
- const hideChatIcon = ((_props$controlProps13 = props.controlProps) === null || _props$controlProps13 === void 0 ? void 0 : _props$controlProps13.hideChatIcon) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.hideChatIcon);
116
- const hideChatTextContainer = ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.hideChatTextContainer) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.hideChatTextContainer);
117
- const hideNotificationBubble = ((_props$controlProps15 = props.controlProps) === null || _props$controlProps15 === void 0 ? void 0 : _props$controlProps15.hideNotificationBubble) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.hideNotificationBubble);
112
+ var _props$controlProps12, _props$controlProps13, _props$controlProps14, _props$controlProps15, _props$controlProps16, _props$controlProps17, _props$controlProps18, _props$controlProps19, _props$styleProps11;
113
+
114
+ const elementId = ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.id) ?? "lcw-components-chat-button";
115
+ const defaultAriaLabel = ((_props$controlProps13 = props.controlProps) === null || _props$controlProps13 === void 0 ? void 0 : _props$controlProps13.ariaLabel) ?? _defaultChatButtonControlProps.defaultChatButtonControlProps.ariaLabel;
116
+ const defaultRole = ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.role) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.role);
117
+ const containersDir = ((_props$controlProps15 = props.controlProps) === null || _props$controlProps15 === void 0 ? void 0 : _props$controlProps15.dir) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.dir);
118
+ const hideChatButton = ((_props$controlProps16 = props.controlProps) === null || _props$controlProps16 === void 0 ? void 0 : _props$controlProps16.hideChatButton) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.hideChatButton);
119
+ const hideChatIcon = ((_props$controlProps17 = props.controlProps) === null || _props$controlProps17 === void 0 ? void 0 : _props$controlProps17.hideChatIcon) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.hideChatIcon);
120
+ const hideChatTextContainer = ((_props$controlProps18 = props.controlProps) === null || _props$controlProps18 === void 0 ? void 0 : _props$controlProps18.hideChatTextContainer) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.hideChatTextContainer);
121
+ const hideNotificationBubble = ((_props$controlProps19 = props.controlProps) === null || _props$controlProps19 === void 0 ? void 0 : _props$controlProps19.hideNotificationBubble) ?? (_defaultChatButtonControlProps.defaultChatButtonControlProps === null || _defaultChatButtonControlProps.defaultChatButtonControlProps === void 0 ? void 0 : _defaultChatButtonControlProps.defaultChatButtonControlProps.hideNotificationBubble);
118
122
  const chatButtonGroupStyles = {
119
123
  root: Object.assign({}, _defaultChatButtonGeneralStyles.defaultChatButtonGeneralStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.generalStyleProps)
120
124
  };
121
125
  const handleInitiateChatClick = (0, _react2.useCallback)(() => {
122
- var _props$controlProps16;
126
+ var _props$controlProps20;
123
127
 
124
- if ((_props$controlProps16 = props.controlProps) !== null && _props$controlProps16 !== void 0 && _props$controlProps16.onClick) {
128
+ if ((_props$controlProps20 = props.controlProps) !== null && _props$controlProps20 !== void 0 && _props$controlProps20.onClick) {
125
129
  const customEvent = {
126
130
  elementType: _Constants.ElementType.ChatButton,
127
131
  elementId: elementId,
@@ -150,7 +154,7 @@ function ChatButton(props) {
150
154
  onClick: handleInitiateChatClick,
151
155
  onKeyDown: handleInputKeyDown,
152
156
  "aria-label": defaultAriaLabel
153
- }, !hideChatIcon && IconContainer(props, elementId), !hideChatTextContainer && TextContainer(props, elementId), !hideNotificationBubble && NotificationBubble(props, elementId)));
157
+ }, !hideChatIcon && IconContainer(props, elementId), !hideNotificationBubble && NotificationBubble(props, elementId), !hideChatTextContainer && TextContainer(props, elementId)));
154
158
  }
155
159
 
156
160
  var _default = ChatButton;
@@ -8,7 +8,7 @@ const defaultChatButtonControlProps = {
8
8
  id: "lcw-components-chat-button",
9
9
  dir: "ltr",
10
10
  role: "button",
11
- ariaLabel: "live chat button",
11
+ ariaLabel: "Let's chat We are online",
12
12
  unreadMessageCount: "0",
13
13
  titleText: "Let's Chat!",
14
14
  subtitleText: "We're online.",
@@ -20,6 +20,9 @@ const defaultChatButtonControlProps = {
20
20
  hideChatTextContainer: false,
21
21
  hideChatSubtitle: false,
22
22
  hideChatTitle: false,
23
- hideNotificationBubble: true
23
+ hideNotificationBubble: true,
24
+ unreadMessageString: "new messages",
25
+ largeUnreadMessageString: "99+",
26
+ ariaLabelUnreadMessageString: "you have new messages"
24
27
  };
25
28
  exports.defaultChatButtonControlProps = defaultChatButtonControlProps;
@@ -14,7 +14,9 @@ const defaultChatButtonSubTitleStyles = {
14
14
  fontWeight: "200",
15
15
  margin: "0px 14px 0px 14px",
16
16
  overflow: "hidden",
17
+ padding: "0px",
17
18
  textOverflow: "ellipsis !important",
18
- width: "max-content"
19
+ whiteSpace: "nowrap",
20
+ width: "90px"
19
21
  };
20
22
  exports.defaultChatButtonSubTitleStyles = defaultChatButtonSubTitleStyles;
@@ -15,6 +15,7 @@ const defaultChatButtonTitleStyles = {
15
15
  height: "22px",
16
16
  margin: "0px 14px 0px 14px",
17
17
  overflow: "hidden",
18
+ padding: "0px",
18
19
  textOverflow: "ellipsis !important",
19
20
  whiteSpace: "nowrap",
20
21
  width: "90px"
@@ -18,17 +18,42 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
18
18
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
19
19
 
20
20
  function CommandButton(props) {
21
+ var _props$hoverStyles, _props$hoverStyles2, _props$focusStyles;
22
+
21
23
  //imageIconProps > iconName
22
24
  const iconProp = props.imageIconProps ? {
23
25
  imageProps: props.imageIconProps
24
26
  } : {
25
- iconName: props.iconName,
26
- styles: {
27
- root: props.styles
28
- }
27
+ iconName: props.iconName
29
28
  };
30
- const iconButtonStyles = {
31
- root: props.styles,
29
+ let iconStyles = {};
30
+
31
+ if (props.type === "icon") {
32
+ var _props$styles;
33
+
34
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
+ iconStyles = { ...(props === null || props === void 0 ? void 0 : (_props$styles = props.styles) === null || _props$styles === void 0 ? void 0 : _props$styles.icon)
36
+ };
37
+ }
38
+
39
+ const buttonStyles = {
40
+ icon: { ...iconStyles
41
+ },
42
+ root: {
43
+ selectors: {
44
+ ":hover .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
45
+ ...(props === null || props === void 0 ? void 0 : (_props$hoverStyles = props.hoverStyles) === null || _props$hoverStyles === void 0 ? void 0 : _props$hoverStyles.icon)
46
+ },
47
+ ":active .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
48
+ ...(props === null || props === void 0 ? void 0 : (_props$hoverStyles2 = props.hoverStyles) === null || _props$hoverStyles2 === void 0 ? void 0 : _props$hoverStyles2.icon)
49
+ },
50
+ ":focus .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
51
+ ...(props === null || props === void 0 ? void 0 : (_props$focusStyles = props.focusStyles) === null || _props$focusStyles === void 0 ? void 0 : _props$focusStyles.icon)
52
+ }
53
+ },
54
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
55
+ ...(props === null || props === void 0 ? void 0 : props.styles)
56
+ },
32
57
  rootHovered: props.hoverStyles,
33
58
  rootFocused: props.focusStyles,
34
59
  rootPressed: props.hoverStyles
@@ -53,14 +78,14 @@ function CommandButton(props) {
53
78
  onClick: handleOnClick,
54
79
  disabled: props.disabled,
55
80
  className: props.className,
56
- styles: iconButtonStyles
81
+ styles: buttonStyles
57
82
  }), props.type === "icon" && /*#__PURE__*/_react2.default.createElement(_react.IconButton, {
58
83
  id: props.id,
59
84
  iconProps: iconProp,
60
- title: props.ariaLabel,
85
+ title: props.hideButtonTitle ? undefined : props.ariaLabel,
61
86
  ariaLabel: props.ariaLabel,
62
87
  disabled: props.disabled,
63
- styles: iconButtonStyles,
88
+ styles: buttonStyles,
64
89
  onClick: handleOnClick,
65
90
  className: props.className
66
91
  }));
@@ -9,7 +9,7 @@ var _react = _interopRequireDefault(require("react"));
9
9
 
10
10
  var _Constants = require("../../../common/Constants");
11
11
 
12
- var _CommandButton = _interopRequireDefault(require("../../common/commandbutton/CommandButton"));
12
+ var _CommandButton = _interopRequireDefault(require("../commandbutton/CommandButton"));
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
@@ -18,7 +18,7 @@ function CloseButton(props) {
18
18
  type
19
19
  } = props;
20
20
  const customEvent = {
21
- elementType: _Constants.ElementType.HeaderCloseButton,
21
+ elementType: _Constants.ElementType.CloseButton,
22
22
  elementId: props === null || props === void 0 ? void 0 : props.id,
23
23
  eventName: "OnClick"
24
24
  };
@@ -34,7 +34,8 @@ function CloseButton(props) {
34
34
  onClick: props.onClick,
35
35
  ariaLabel: props.ariaLabel ?? "Close",
36
36
  className: props.className,
37
- customEvent: customEvent
37
+ customEvent: customEvent,
38
+ hideButtonTitle: props.hideButtonTitle
38
39
  });
39
40
  }
40
41
 
@@ -80,6 +80,12 @@ function ConfirmationPane(props) {
80
80
 
81
81
  (_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.onCancel();
82
82
  }
83
+ }, []); // eslint-disable-next-line @typescript-eslint/no-explicit-any
84
+
85
+ const handleEscKeyDown = (0, _react2.useCallback)(e => {
86
+ if (e.code === _Constants.KeyCodes.ESCAPE) {
87
+ handleCancelClick();
88
+ }
83
89
  }, []);
84
90
  const containerStyles = {
85
91
  root: Object.assign({}, _defaultConfirmationPaneGeneralStyles.defaultConfirmationPaneGeneralStyles, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps)
@@ -107,6 +113,7 @@ function ConfirmationPane(props) {
107
113
  };
108
114
  return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, !((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.hideConfirmationPane) && /*#__PURE__*/_react2.default.createElement(_react.Stack, {
109
115
  id: elementId,
116
+ onKeyDown: handleEscKeyDown,
110
117
  tabIndex: -1,
111
118
  dir: ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.dir) || _defaultConfirmationPaneControlProps.defaultConfirmationPaneControlProps.dir,
112
119
  styles: containerStyles,
@@ -6,9 +6,13 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.defaultConfirmationPaneButtonGroupStyles = void 0;
7
7
  const defaultConfirmationPaneButtonGroupStyles = {
8
8
  display: "flex",
9
+ width: "auto",
10
+ height: "auto",
11
+ boxSizing: "border-box",
9
12
  flexFlow: "row",
10
13
  justifyContent: "center",
11
14
  alignItems: "center",
12
- gap: "10px"
15
+ gap: "10px",
16
+ marginBottom: "10px"
13
17
  };
14
18
  exports.defaultConfirmationPaneButtonGroupStyles = defaultConfirmationPaneButtonGroupStyles;
@@ -5,19 +5,22 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.defaultConfirmationPaneGeneralStyles = void 0;
7
7
  const defaultConfirmationPaneGeneralStyles = {
8
+ display: "flex",
9
+ minHeight: "160px",
10
+ maxHeight: "300px",
11
+ boxSizing: "border-box",
8
12
  backgroundColor: "white",
9
13
  borderRadius: "2px",
10
14
  color: "black",
11
15
  fontFamily: "Segoe UI, Arial, sans-serif",
12
16
  fontSize: "14px",
13
- height: "160px",
14
17
  padding: "10px 20px",
15
- width: "262px",
16
18
  position: "absolute",
17
19
  justifyContent: "center",
18
20
  alignItems: "center",
19
- display: "flex",
20
21
  flexFlow: "column",
21
- zIndex: "9999"
22
+ zIndex: "9999",
23
+ left: "26px",
24
+ right: "26px"
22
25
  };
23
26
  exports.defaultConfirmationPaneGeneralStyles = defaultConfirmationPaneGeneralStyles;
@@ -27,7 +27,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
27
27
 
28
28
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
29
29
 
30
- 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); }
30
+ 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); }
31
31
 
32
32
  (0, _react2.initializeIcons)();
33
33
 
@@ -87,7 +87,7 @@ function Footer(props) {
87
87
  verticalAlign: "start"
88
88
  }, /*#__PURE__*/React.createElement(_react2.Stack, {
89
89
  horizontal: true,
90
- verticalAlign: "start"
90
+ verticalAlign: "center"
91
91
  }, (0, _utils.processCustomComponents)((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : (_props$controlProps15 = _props$controlProps14.rightGroup) === null || _props$controlProps15 === void 0 ? void 0 : _props$controlProps15.children), !((_props$controlProps16 = props.controlProps) !== null && _props$controlProps16 !== void 0 && _props$controlProps16.hideAudioNotificationButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.AudioNotificationButton) || /*#__PURE__*/React.createElement(_AudioNotificationButton.default, _extends({}, audioNotificationButtonProps, {
92
92
  onClick: (_props$controlProps17 = props.controlProps) === null || _props$controlProps17 === void 0 ? void 0 : _props$controlProps17.onAudioNotificationClick,
93
93
  styles: audioNotificationButtonStyles,
@@ -41,6 +41,7 @@ const defaultFooterControlProps = {
41
41
  },
42
42
  audioNotificationButtonProps: {
43
43
  id: "oc-lcw-footer-audionotification-button",
44
+ type: "icon",
44
45
  ariaLabel: "Turn sound off",
45
46
  toggleAriaLabel: "Turn sound on",
46
47
  iconName: "Volume3",
@@ -14,8 +14,10 @@ const defaultFooterStyleProps = {
14
14
  padding: "0 10px 5px 10px"
15
15
  },
16
16
  downloadTranscriptButtonStyleProps: {
17
- color: "blue",
18
- fontSize: 16,
17
+ icon: {
18
+ color: "blue",
19
+ fontSize: 16
20
+ },
19
21
  height: "25px",
20
22
  lineHeight: "25px",
21
23
  width: "25px"
@@ -25,8 +27,10 @@ const defaultFooterStyleProps = {
25
27
  backgroundColor: "#C8C8C8"
26
28
  },
27
29
  emailTranscriptButtonStyleProps: {
28
- color: "blue",
29
- fontSize: 16,
30
+ icon: {
31
+ color: "blue",
32
+ fontSize: 16
33
+ },
30
34
  height: "25px",
31
35
  lineHeight: "25px",
32
36
  width: "25px"
@@ -36,8 +40,10 @@ const defaultFooterStyleProps = {
36
40
  backgroundColor: "#C8C8C8"
37
41
  },
38
42
  audioNotificationButtonStyleProps: {
39
- color: "blue",
40
- fontSize: 16,
43
+ icon: {
44
+ color: "blue",
45
+ fontSize: 16
46
+ },
41
47
  height: "25px",
42
48
  lineHeight: "25px",
43
49
  width: "25px"
@@ -22,28 +22,45 @@ function AudioNotificationButton(props) {
22
22
  disabled
23
23
  } = props;
24
24
  const [muted, setMuted] = (0, _react2.useState)(props.isAudioMuted);
25
+ let iconStyles = {};
26
+
27
+ if (props.type === "icon") {
28
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
+ iconStyles = { ...(props === null || props === void 0 ? void 0 : props.styles).icon
30
+ };
31
+ }
32
+
25
33
  const iconButtonStyles = {
26
- root: props === null || props === void 0 ? void 0 : props.styles,
27
- rootHovered: props === null || props === void 0 ? void 0 : props.hoverStyles,
28
- rootFocused: props === null || props === void 0 ? void 0 : props.focusStyles,
29
- rootPressed: props === null || props === void 0 ? void 0 : props.hoverStyles
34
+ icon: iconStyles,
35
+ root: {
36
+ selectors: {
37
+ ":hover .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
38
+ ...(props === null || props === void 0 ? void 0 : props.hoverStyles).icon
39
+ },
40
+ ":active .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
+ ...(props === null || props === void 0 ? void 0 : props.hoverStyles).icon
42
+ },
43
+ ":focus .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
44
+ ...(props === null || props === void 0 ? void 0 : props.focusStyles).icon
45
+ }
46
+ },
47
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
48
+ ...(props === null || props === void 0 ? void 0 : props.styles)
49
+ },
50
+ rootHovered: props.hoverStyles,
51
+ rootFocused: props.focusStyles,
52
+ rootPressed: props.hoverStyles
30
53
  }; //imageIconProps > iconName
31
54
 
32
55
  const volume0Icon = props.imageToggleIconProps ? {
33
56
  imageProps: props === null || props === void 0 ? void 0 : props.imageToggleIconProps
34
57
  } : {
35
- iconName: (props === null || props === void 0 ? void 0 : props.toggleIconName) ?? "Volume0",
36
- styles: {
37
- root: props.styles
38
- }
58
+ iconName: (props === null || props === void 0 ? void 0 : props.toggleIconName) ?? "Volume0"
39
59
  };
40
60
  const volume3Icon = props.imageIconProps ? {
41
61
  imageProps: props === null || props === void 0 ? void 0 : props.imageIconProps
42
62
  } : {
43
- iconName: (props === null || props === void 0 ? void 0 : props.iconName) ?? "Volume3",
44
- styles: {
45
- root: props.styles
46
- }
63
+ iconName: (props === null || props === void 0 ? void 0 : props.iconName) ?? "Volume3"
47
64
  };
48
65
  const handleOnClick = (0, _react2.useCallback)(() => {
49
66
  setMuted(!muted);
@@ -9,7 +9,7 @@ var React = _interopRequireWildcard(require("react"));
9
9
 
10
10
  var _react2 = require("@fluentui/react");
11
11
 
12
- var _CloseButton = _interopRequireDefault(require("./subcomponents/CloseButton"));
12
+ var _CloseButton = _interopRequireDefault(require("../common/subcomponents/CloseButton"));
13
13
 
14
14
  var _MinimizeButton = _interopRequireDefault(require("./subcomponents/MinimizeButton"));
15
15
 
@@ -25,7 +25,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
25
25
 
26
26
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
27
27
 
28
- 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); }
28
+ 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); }
29
29
 
30
30
  (0, _react2.initializeIcons)();
31
31