@microsoft/omnichannel-chat-components 0.1.0-main.ae27766 → 0.1.0-main.bff9c0d

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 (89) hide show
  1. package/lib/cjs/common/Constants.js +12 -7
  2. package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +31 -1
  3. package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/common/defaultStyles/customizedCurrentCallStyleProps.js +0 -12
  4. package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/common/defaultStyles/defaultCurrentCallStyleProps.js +0 -12
  5. package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +45 -2
  6. package/lib/cjs/components/chatbutton/ChatButton.js +37 -26
  7. package/lib/cjs/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +4 -1
  8. package/lib/cjs/components/common/commandbutton/CommandButton.js +36 -10
  9. package/lib/cjs/components/{header → common}/subcomponents/CloseButton.js +4 -3
  10. package/lib/cjs/components/confirmationpane/ConfirmationPane.js +19 -10
  11. package/lib/cjs/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneButtonGroupStyles.js +5 -1
  12. package/lib/cjs/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneGeneralStyles.js +7 -4
  13. package/lib/cjs/components/footer/Footer.js +2 -2
  14. package/lib/cjs/components/footer/common/defaultProps/defaultFooterControlProps.js +1 -0
  15. package/lib/cjs/components/footer/common/defaultStyles/defaultFooterStyleProps.js +12 -6
  16. package/lib/cjs/components/footer/subcomponents/AudioNotificationButton.js +30 -11
  17. package/lib/cjs/components/header/Header.js +2 -2
  18. package/lib/cjs/components/inputvalidationpane/InputValidationPane.js +76 -46
  19. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -1
  20. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneInvalidInputErrorMessageStyles.js +1 -1
  21. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneSendButtonStyles.js +2 -1
  22. package/lib/cjs/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +1 -1
  23. package/lib/cjs/components/postchatsurveypane/PostChatSurveyPane.js +2 -1
  24. package/lib/cjs/components/prechatsurveypane/PreChatSurveyPane.js +22 -8
  25. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +4 -1
  26. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.js +10 -0
  27. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneStyles.js +7 -1
  28. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.js +10 -0
  29. package/lib/cjs/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.js +1 -0
  30. package/lib/cjs/components/proactivechatpane/ProactiveChatPane.js +33 -30
  31. package/lib/cjs/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +5 -1
  32. package/lib/cjs/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -13
  33. package/lib/cjs/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +5 -1
  34. package/lib/cjs/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +5 -1
  35. package/lib/cjs/components/reconnectchatpane/ReconnectChatPane.js +14 -12
  36. package/lib/cjs/index.js +6 -0
  37. package/lib/cjs/services/BroadcastService.js +36 -8
  38. package/lib/esm/common/Constants.js +10 -5
  39. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +33 -3
  40. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultStyles/customizedCurrentCallStyleProps.js +0 -12
  41. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultStyles/defaultCurrentCallStyleProps.js +0 -12
  42. package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +47 -4
  43. package/lib/esm/components/chatbutton/ChatButton.js +37 -26
  44. package/lib/esm/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +4 -1
  45. package/lib/esm/components/common/commandbutton/CommandButton.js +36 -10
  46. package/lib/esm/components/{header → common}/subcomponents/CloseButton.js +4 -3
  47. package/lib/esm/components/confirmationpane/ConfirmationPane.js +20 -11
  48. package/lib/esm/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneButtonGroupStyles.js +5 -1
  49. package/lib/esm/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneGeneralStyles.js +7 -4
  50. package/lib/esm/components/footer/Footer.js +2 -2
  51. package/lib/esm/components/footer/common/defaultProps/defaultFooterControlProps.js +1 -0
  52. package/lib/esm/components/footer/common/defaultStyles/defaultFooterStyleProps.js +12 -6
  53. package/lib/esm/components/footer/subcomponents/AudioNotificationButton.js +30 -11
  54. package/lib/esm/components/header/Header.js +2 -2
  55. package/lib/esm/components/inputvalidationpane/InputValidationPane.js +77 -47
  56. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -1
  57. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneInvalidInputErrorMessageStyles.js +1 -1
  58. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneSendButtonStyles.js +2 -1
  59. package/lib/esm/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +1 -1
  60. package/lib/esm/components/postchatsurveypane/PostChatSurveyPane.js +2 -1
  61. package/lib/esm/components/prechatsurveypane/PreChatSurveyPane.js +22 -8
  62. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +4 -1
  63. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.js +3 -0
  64. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneStyles.js +5 -1
  65. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.js +3 -0
  66. package/lib/esm/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.js +1 -0
  67. package/lib/esm/components/proactivechatpane/ProactiveChatPane.js +30 -29
  68. package/lib/esm/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +5 -1
  69. package/lib/esm/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -11
  70. package/lib/esm/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +5 -1
  71. package/lib/esm/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +5 -1
  72. package/lib/esm/components/reconnectchatpane/ReconnectChatPane.js +14 -12
  73. package/lib/esm/index.js +1 -0
  74. package/lib/esm/services/BroadcastService.js +34 -8
  75. package/lib/types/common/Constants.d.ts +8 -2
  76. package/lib/types/components/callingcontainer/subcomponents/CurrentCall/interfaces/ICurrentCallStyleProps.d.ts +0 -4
  77. package/lib/types/components/chatbutton/interfaces/IChatButtonControlProps.d.ts +3 -0
  78. package/lib/types/components/common/interfaces/ICommandButtonControlProps.d.ts +1 -0
  79. package/lib/types/components/common/interfaces/ICommandButtonProps.d.ts +1 -0
  80. package/lib/types/components/{header → common}/subcomponents/CloseButton.d.ts +1 -1
  81. package/lib/types/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.d.ts +2 -0
  82. package/lib/types/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.d.ts +2 -0
  83. package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneButtonStyles.d.ts +3 -0
  84. package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.d.ts +5 -0
  85. package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneStyleProps.d.ts +5 -0
  86. package/lib/types/components/proactivechatpane/interfaces/IProactiveChatPaneControlProps.d.ts +2 -1
  87. package/lib/types/index.d.ts +1 -0
  88. package/lib/types/services/BroadcastService.d.ts +1 -0
  89. package/package.json +2 -2
@@ -13,6 +13,8 @@ var _BroadcastService = require("../../services/BroadcastService");
13
13
 
14
14
  var _Button = require("@fluentui/react/lib/Button");
15
15
 
16
+ var _CloseButton = _interopRequireDefault(require("../common/subcomponents/CloseButton"));
17
+
16
18
  var _Constants = require("../../common/Constants");
17
19
 
18
20
  var _decodeComponentString = require("../../common/decodeComponentString");
@@ -21,10 +23,6 @@ var _defaultProactiveChatPaneBodyContainerStyles = require("./common/default/def
21
23
 
22
24
  var _defaultProactiveChatPaneBodyTitleStyles = require("./common/default/defaultStyles/defaultProactiveChatPaneBodyTitleStyles");
23
25
 
24
- var _defaultProactiveChatPaneCloseButtonHoveredStyles = require("./common/default/defaultStyles/defaultProactiveChatPaneCloseButtonHoveredStyles");
25
-
26
- var _defaultProactiveChatPaneCloseButtonStyles = require("./common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles");
27
-
28
26
  var _defaultProactiveChatPaneControlProps = require("./common/default/defaultProps/defaultProactiveChatPaneControlProps");
29
27
 
30
28
  var _defaultProactiveChatPaneGeneralStyles = require("./common/default/defaultStyles/defaultProactiveChatPaneGeneralStyles");
@@ -43,12 +41,18 @@ var _defaultProactiveChatPaneTitleStyles = require("./common/default/defaultStyl
43
41
 
44
42
  var _utils = require("../../common/utils");
45
43
 
44
+ var _defaultProactiveChatPaneProps = require("./common/default/defaultProps/defaultProactiveChatPaneProps");
45
+
46
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
47
+
46
48
  function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
47
49
 
48
50
  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; }
49
51
 
52
+ 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); }
53
+
50
54
  function ProactiveChatPane(props) {
51
- var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$styleProps8, _props$styleProps9, _props$styleProps10, _props$styleProps11, _props$controlProps6, _props$styleProps12, _props$styleProps12$c, _props$controlProps7, _props$controlProps8, _props$styleProps13, _props$styleProps13$c, _props$styleProps14, _props$styleProps14$c, _props$controlProps9, _props$componentOverr, _props$styleProps15, _props$styleProps15$c, _props$controlProps10, _props$controlProps11, _props$componentOverr2, _props$styleProps16, _props$styleProps16$c, _props$controlProps12, _props$controlProps13, _props$componentOverr3, _props$styleProps17, _props$styleProps17$c, _props$controlProps14, _props$controlProps15, _props$styleProps18, _props$styleProps18$c, _props$controlProps16, _props$componentOverr4, _props$styleProps19, _props$styleProps19$c, _props$controlProps17, _props$controlProps18, _props$componentOverr5, _props$styleProps20, _props$styleProps20$c, _props$controlProps19, _props$controlProps20;
55
+ var _props$controlProps, _defaultProactiveChat, _props$controlProps6, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$styleProps5, _defaultProactiveChat2, _props$styleProps6, _defaultProactiveChat3, _props$styleProps7, _props$styleProps8, _props$styleProps9, _props$styleProps10, _props$styleProps11, _props$styleProps12, _props$controlProps7, _props$styleProps13, _props$styleProps13$c, _props$controlProps8, _props$controlProps9, _props$styleProps14, _props$styleProps14$c, _props$styleProps15, _props$styleProps15$c, _props$controlProps10, _props$componentOverr, _props$styleProps16, _props$styleProps16$c, _props$controlProps11, _props$controlProps12, _props$componentOverr2, _props$styleProps17, _props$styleProps17$c, _props$controlProps13, _props$controlProps14, _props$componentOverr3, _props$styleProps18, _props$styleProps18$c, _props$controlProps15, _props$styleProps19, _props$styleProps19$c, _props$controlProps16, _props$componentOverr4, _props$styleProps20, _props$styleProps20$c, _props$controlProps17, _props$controlProps18, _props$componentOverr5, _props$styleProps21, _props$styleProps21$c, _props$controlProps19, _props$controlProps20;
52
56
 
53
57
  const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.id;
54
58
 
@@ -100,6 +104,7 @@ function ProactiveChatPane(props) {
100
104
  (_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.onStart();
101
105
  }
102
106
  }, []);
107
+ const closeButtonProps = Object.assign({}, (_defaultProactiveChat = _defaultProactiveChatPaneProps.defaultProactiveChatPaneProps.controlProps) === null || _defaultProactiveChat === void 0 ? void 0 : _defaultProactiveChat.closeButtonProps, (_props$controlProps6 = props.controlProps) === null || _props$controlProps6 === void 0 ? void 0 : _props$controlProps6.closeButtonProps);
103
108
  const containerStyles = {
104
109
  root: Object.assign({}, _defaultProactiveChatPaneGeneralStyles.defaultProactiveChatPaneGeneralStyles, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps)
105
110
  };
@@ -115,10 +120,8 @@ function ProactiveChatPane(props) {
115
120
  const subtitleStyles = {
116
121
  root: Object.assign({}, _defaultProactiveChatPaneSubtitleStyles.defaultProactiveChatPaneSubtitleStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.subtitleStyleProps)
117
122
  };
118
- const closeButtonStyles = {
119
- root: Object.assign({}, _defaultProactiveChatPaneCloseButtonStyles.defaultProactiveChatPaneCloseButtonStyles, (_props$styleProps6 = props.styleProps) === null || _props$styleProps6 === void 0 ? void 0 : _props$styleProps6.closeButtonStyleProps),
120
- rootHovered: Object.assign({}, _defaultProactiveChatPaneCloseButtonHoveredStyles.defaultProactiveChatPaneCloseButtonHoveredStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.closeButtonHoveredStyleProps)
121
- };
123
+ const closeButtonStyles = Object.assign({}, (_defaultProactiveChat2 = _defaultProactiveChatPaneProps.defaultProactiveChatPaneProps.styleProps) === null || _defaultProactiveChat2 === void 0 ? void 0 : _defaultProactiveChat2.closeButtonStyleProps, (_props$styleProps6 = props.styleProps) === null || _props$styleProps6 === void 0 ? void 0 : _props$styleProps6.closeButtonStyleProps);
124
+ const closeButtonHoverStyles = Object.assign({}, (_defaultProactiveChat3 = _defaultProactiveChatPaneProps.defaultProactiveChatPaneProps.styleProps) === null || _defaultProactiveChat3 === void 0 ? void 0 : _defaultProactiveChat3.closeButtonHoveredStyleProps, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.closeButtonHoveredStyleProps);
122
125
  const bodyContainerStyles = {
123
126
  root: Object.assign({}, _defaultProactiveChatPaneBodyContainerStyles.defaultProactiveChatPaneBodyContainerStyles, (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : _props$styleProps8.bodyContainerStyleProps)
124
127
  };
@@ -127,57 +130,57 @@ function ProactiveChatPane(props) {
127
130
  };
128
131
  const startButtonStyles = {
129
132
  root: Object.assign({}, _defaultProactiveChatPaneStartButtonStyles.defaultProactiveChatPaneStartButtonStyles, (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.startButtonStyleProps),
130
- rootHovered: Object.assign({}, _defaultProactiveChatPaneStartButtonHoveredStyles.defaultProactiveChatPaneStartButtonHoveredStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.startButtonHoveredStyleProps)
133
+ rootHovered: Object.assign({}, _defaultProactiveChatPaneStartButtonHoveredStyles.defaultProactiveChatPaneStartButtonHoveredStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.startButtonHoveredStyleProps),
134
+ rootPressed: Object.assign({}, _defaultProactiveChatPaneStartButtonHoveredStyles.defaultProactiveChatPaneStartButtonHoveredStyles, (_props$styleProps12 = props.styleProps) === null || _props$styleProps12 === void 0 ? void 0 : _props$styleProps12.startButtonHoveredStyleProps)
131
135
  };
132
- return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, !((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.hideProactiveChatPane) && /*#__PURE__*/_react2.default.createElement(_react.Stack, {
133
- className: (_props$styleProps12 = props.styleProps) === null || _props$styleProps12 === void 0 ? void 0 : (_props$styleProps12$c = _props$styleProps12.classNames) === null || _props$styleProps12$c === void 0 ? void 0 : _props$styleProps12$c.containerClassName,
136
+ return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, !((_props$controlProps7 = props.controlProps) !== null && _props$controlProps7 !== void 0 && _props$controlProps7.hideProactiveChatPane) && /*#__PURE__*/_react2.default.createElement(_react.Stack, {
137
+ className: (_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : (_props$styleProps13$c = _props$styleProps13.classNames) === null || _props$styleProps13$c === void 0 ? void 0 : _props$styleProps13$c.containerClassName,
134
138
  id: elementId,
135
139
  tabIndex: -1,
136
140
  onKeyDown: handleEscKeyDown,
137
- dir: ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.dir) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.dir,
138
- "aria-label": ((_props$controlProps8 = props.controlProps) === null || _props$controlProps8 === void 0 ? void 0 : _props$controlProps8.proactiveChatPaneAriaLabel) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.proactiveChatPaneAriaLabel,
141
+ dir: ((_props$controlProps8 = props.controlProps) === null || _props$controlProps8 === void 0 ? void 0 : _props$controlProps8.dir) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.dir,
142
+ "aria-label": ((_props$controlProps9 = props.controlProps) === null || _props$controlProps9 === void 0 ? void 0 : _props$controlProps9.proactiveChatPaneAriaLabel) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.proactiveChatPaneAriaLabel,
139
143
  styles: containerStyles
140
144
  }, /*#__PURE__*/_react2.default.createElement(_react.Stack, {
141
145
  horizontal: true,
142
- className: (_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : (_props$styleProps13$c = _props$styleProps13.classNames) === null || _props$styleProps13$c === void 0 ? void 0 : _props$styleProps13$c.headerContainerClassName,
146
+ className: (_props$styleProps14 = props.styleProps) === null || _props$styleProps14 === void 0 ? void 0 : (_props$styleProps14$c = _props$styleProps14.classNames) === null || _props$styleProps14$c === void 0 ? void 0 : _props$styleProps14$c.headerContainerClassName,
143
147
  styles: headerContainerStyles,
144
148
  tabIndex: -1,
145
149
  id: elementId + "-headercontainer"
146
150
  }, /*#__PURE__*/_react2.default.createElement(_react.Stack, {
147
- className: (_props$styleProps14 = props.styleProps) === null || _props$styleProps14 === void 0 ? void 0 : (_props$styleProps14$c = _props$styleProps14.classNames) === null || _props$styleProps14$c === void 0 ? void 0 : _props$styleProps14$c.textContainerClassName,
151
+ className: (_props$styleProps15 = props.styleProps) === null || _props$styleProps15 === void 0 ? void 0 : (_props$styleProps15$c = _props$styleProps15.classNames) === null || _props$styleProps15$c === void 0 ? void 0 : _props$styleProps15$c.textContainerClassName,
148
152
  styles: textContainerStyles,
149
153
  tabIndex: -1,
150
154
  id: elementId + "-textcontainer"
151
- }, !((_props$controlProps9 = props.controlProps) !== null && _props$controlProps9 !== void 0 && _props$controlProps9.hideTitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.title) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
152
- className: (_props$styleProps15 = props.styleProps) === null || _props$styleProps15 === void 0 ? void 0 : (_props$styleProps15$c = _props$styleProps15.classNames) === null || _props$styleProps15$c === void 0 ? void 0 : _props$styleProps15$c.titleClassName,
155
+ }, !((_props$controlProps10 = props.controlProps) !== null && _props$controlProps10 !== void 0 && _props$controlProps10.hideTitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.title) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
156
+ className: (_props$styleProps16 = props.styleProps) === null || _props$styleProps16 === void 0 ? void 0 : (_props$styleProps16$c = _props$styleProps16.classNames) === null || _props$styleProps16$c === void 0 ? void 0 : _props$styleProps16$c.titleClassName,
153
157
  styles: titleStyles,
154
158
  tabIndex: -1,
155
159
  id: elementId + "-title"
156
- }, ((_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.titleText) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.titleText)), !((_props$controlProps11 = props.controlProps) !== null && _props$controlProps11 !== void 0 && _props$controlProps11.hideSubtitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr2 = props.componentOverrides) === null || _props$componentOverr2 === void 0 ? void 0 : _props$componentOverr2.subtitle) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
157
- className: (_props$styleProps16 = props.styleProps) === null || _props$styleProps16 === void 0 ? void 0 : (_props$styleProps16$c = _props$styleProps16.classNames) === null || _props$styleProps16$c === void 0 ? void 0 : _props$styleProps16$c.subtitleClassName,
160
+ }, ((_props$controlProps11 = props.controlProps) === null || _props$controlProps11 === void 0 ? void 0 : _props$controlProps11.titleText) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.titleText)), !((_props$controlProps12 = props.controlProps) !== null && _props$controlProps12 !== void 0 && _props$controlProps12.hideSubtitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr2 = props.componentOverrides) === null || _props$componentOverr2 === void 0 ? void 0 : _props$componentOverr2.subtitle) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
161
+ className: (_props$styleProps17 = props.styleProps) === null || _props$styleProps17 === void 0 ? void 0 : (_props$styleProps17$c = _props$styleProps17.classNames) === null || _props$styleProps17$c === void 0 ? void 0 : _props$styleProps17$c.subtitleClassName,
158
162
  styles: subtitleStyles,
159
163
  tabIndex: -1,
160
164
  id: elementId + "-subtitle"
161
- }, ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.subtitleText) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.subtitleText))), !((_props$controlProps13 = props.controlProps) !== null && _props$controlProps13 !== void 0 && _props$controlProps13.hideCloseButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.closeButton) || /*#__PURE__*/_react2.default.createElement(_react.IconButton, {
162
- className: (_props$styleProps17 = props.styleProps) === null || _props$styleProps17 === void 0 ? void 0 : (_props$styleProps17$c = _props$styleProps17.classNames) === null || _props$styleProps17$c === void 0 ? void 0 : _props$styleProps17$c.closeButtonClassName,
163
- styles: closeButtonStyles,
164
- tabIndex: 0,
165
+ }, ((_props$controlProps13 = props.controlProps) === null || _props$controlProps13 === void 0 ? void 0 : _props$controlProps13.subtitleText) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.subtitleText))), !((_props$controlProps14 = props.controlProps) !== null && _props$controlProps14 !== void 0 && _props$controlProps14.hideCloseButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.closeButton) || /*#__PURE__*/_react2.default.createElement(_CloseButton.default, _extends({}, closeButtonProps, {
166
+ className: (_props$styleProps18 = props.styleProps) === null || _props$styleProps18 === void 0 ? void 0 : (_props$styleProps18$c = _props$styleProps18.classNames) === null || _props$styleProps18$c === void 0 ? void 0 : _props$styleProps18$c.closeButtonClassName,
165
167
  onClick: handleCloseClick,
166
- id: elementId + "-closebutton",
167
- "aria-label": ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.closeButtonAriaLabel) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.closeButtonAriaLabel
168
- }))), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
168
+ styles: closeButtonStyles,
169
+ hoverStyles: closeButtonHoverStyles,
170
+ id: elementId + "-closebutton"
171
+ })))), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
169
172
  horizontal: ((_props$controlProps15 = props.controlProps) === null || _props$controlProps15 === void 0 ? void 0 : _props$controlProps15.isBodyContainerHorizantal) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.isBodyContainerHorizantal,
170
- className: (_props$styleProps18 = props.styleProps) === null || _props$styleProps18 === void 0 ? void 0 : (_props$styleProps18$c = _props$styleProps18.classNames) === null || _props$styleProps18$c === void 0 ? void 0 : _props$styleProps18$c.bodyContainerClassName,
173
+ className: (_props$styleProps19 = props.styleProps) === null || _props$styleProps19 === void 0 ? void 0 : (_props$styleProps19$c = _props$styleProps19.classNames) === null || _props$styleProps19$c === void 0 ? void 0 : _props$styleProps19$c.bodyContainerClassName,
171
174
  styles: bodyContainerStyles,
172
175
  tabIndex: -1,
173
176
  id: elementId + "-bodycontainer"
174
177
  }, !((_props$controlProps16 = props.controlProps) !== null && _props$controlProps16 !== void 0 && _props$controlProps16.hideBodyTitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr4 = props.componentOverrides) === null || _props$componentOverr4 === void 0 ? void 0 : _props$componentOverr4.bodyTitle) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
175
- className: (_props$styleProps19 = props.styleProps) === null || _props$styleProps19 === void 0 ? void 0 : (_props$styleProps19$c = _props$styleProps19.classNames) === null || _props$styleProps19$c === void 0 ? void 0 : _props$styleProps19$c.bodyTitleClassName,
178
+ className: (_props$styleProps20 = props.styleProps) === null || _props$styleProps20 === void 0 ? void 0 : (_props$styleProps20$c = _props$styleProps20.classNames) === null || _props$styleProps20$c === void 0 ? void 0 : _props$styleProps20$c.bodyTitleClassName,
176
179
  styles: bodyTitleStyles,
177
180
  tabIndex: -1,
178
181
  id: elementId + "-bodytitle"
179
182
  }, ((_props$controlProps17 = props.controlProps) === null || _props$controlProps17 === void 0 ? void 0 : _props$controlProps17.bodyTitleText) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.bodyTitleText)), !((_props$controlProps18 = props.controlProps) !== null && _props$controlProps18 !== void 0 && _props$controlProps18.hideStartButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr5 = props.componentOverrides) === null || _props$componentOverr5 === void 0 ? void 0 : _props$componentOverr5.startButton) || /*#__PURE__*/_react2.default.createElement(_Button.DefaultButton, {
180
- className: (_props$styleProps20 = props.styleProps) === null || _props$styleProps20 === void 0 ? void 0 : (_props$styleProps20$c = _props$styleProps20.classNames) === null || _props$styleProps20$c === void 0 ? void 0 : _props$styleProps20$c.startButtonClassName,
183
+ className: (_props$styleProps21 = props.styleProps) === null || _props$styleProps21 === void 0 ? void 0 : (_props$styleProps21$c = _props$styleProps21.classNames) === null || _props$styleProps21$c === void 0 ? void 0 : _props$styleProps21$c.startButtonClassName,
181
184
  styles: startButtonStyles,
182
185
  tabIndex: 0,
183
186
  text: ((_props$controlProps19 = props.controlProps) === null || _props$controlProps19 === void 0 ? void 0 : _props$controlProps19.startButtonText) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.startButtonText,
@@ -14,7 +14,11 @@ const defaultProactiveChatPaneControlProps = {
14
14
  hideSubtitle: false,
15
15
  subtitleText: "Live chat support!",
16
16
  hideCloseButton: false,
17
- closeButtonAriaLabel: "Close Button",
17
+ closeButtonProps: {
18
+ type: "icon",
19
+ iconName: "ChromeClose",
20
+ hideButtonTitle: true
21
+ },
18
22
  isBodyContainerHorizantal: false,
19
23
  hideBodyTitle: false,
20
24
  bodyTitleText: "Hi! Have any questions? I am here to help.",
@@ -4,19 +4,8 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.defaultProactiveChatPaneCloseButtonStyles = void 0;
7
-
8
- var _Icons = require("../../../../../assets/Icons");
9
-
10
7
  const defaultProactiveChatPaneCloseButtonStyles = {
11
- backgroundImage: `url(${_Icons.CloseChatButtonIconBase64})`,
12
- backgroundPosition: "center",
13
- backgroundRepeat: "no-repeat",
14
- color: "#605e5c",
15
- cursor: "pointer",
16
- height: "14px",
17
- lineHeight: "14px",
18
- textAlign: "center",
19
- width: "14px",
20
- zIndex: "inherit"
8
+ color: "white",
9
+ fontSize: "12px"
21
10
  };
22
11
  exports.defaultProactiveChatPaneCloseButtonStyles = defaultProactiveChatPaneCloseButtonStyles;
@@ -14,7 +14,11 @@ const presetOneProactiveChatPaneControlProps = {
14
14
  hideSubtitle: false,
15
15
  subtitleText: "Live chat support!",
16
16
  hideCloseButton: false,
17
- closeButtonAriaLabel: "Close Button",
17
+ closeButtonProps: {
18
+ type: "icon",
19
+ iconName: "ChromeClose",
20
+ hideButtonTitle: true
21
+ },
18
22
  isBodyContainerHorizantal: true,
19
23
  hideBodyTitle: false,
20
24
  bodyTitleText: "Hi! Have any questions? I am here to help.",
@@ -14,7 +14,11 @@ const presetThreeProactiveChatPaneControlProps = {
14
14
  hideSubtitle: false,
15
15
  subtitleText: "Live chat support!",
16
16
  hideCloseButton: false,
17
- closeButtonAriaLabel: "Close Button",
17
+ closeButtonProps: {
18
+ type: "icon",
19
+ iconName: "ChromeClose",
20
+ hideButtonTitle: true
21
+ },
18
22
  isBodyContainerHorizantal: false,
19
23
  hideBodyTitle: false,
20
24
  bodyTitleText: "Hi! Have any questions? I am here to help.",
@@ -42,7 +42,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
42
42
  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; }
43
43
 
44
44
  function ReconnectChatPane(props) {
45
- var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$styleProps8, _props$styleProps9, _props$styleProps10, _props$controlProps8, _props$styleProps11, _props$styleProps11$c, _props$controlProps9, _props$controlProps10, _props$styleProps12, _props$styleProps12$c, _props$controlProps11, _props$componentOverr, _props$styleProps13, _props$styleProps13$c, _props$controlProps12, _props$controlProps13, _props$componentOverr2, _props$styleProps14, _props$styleProps14$c, _props$controlProps14, _props$controlProps15, _props$componentOverr3, _props$styleProps15, _props$styleProps15$c, _props$controlProps16, _props$controlProps17, _props$styleProps16, _props$styleProps16$c, _props$controlProps18, _props$componentOverr4, _props$styleProps17, _props$styleProps17$c, _props$controlProps19, _props$controlProps20, _props$controlProps21, _props$componentOverr5, _props$styleProps18, _props$styleProps18$c, _props$controlProps22, _props$controlProps23;
45
+ var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$styleProps8, _props$styleProps9, _props$styleProps10, _props$styleProps11, _props$styleProps12, _props$controlProps8, _props$styleProps13, _props$styleProps13$c, _props$controlProps9, _props$controlProps10, _props$styleProps14, _props$styleProps14$c, _props$controlProps11, _props$componentOverr, _props$styleProps15, _props$styleProps15$c, _props$controlProps12, _props$controlProps13, _props$componentOverr2, _props$styleProps16, _props$styleProps16$c, _props$controlProps14, _props$controlProps15, _props$componentOverr3, _props$styleProps17, _props$styleProps17$c, _props$controlProps16, _props$controlProps17, _props$styleProps18, _props$styleProps18$c, _props$controlProps18, _props$componentOverr4, _props$styleProps19, _props$styleProps19$c, _props$controlProps19, _props$controlProps20, _props$controlProps21, _props$componentOverr5, _props$styleProps20, _props$styleProps20$c, _props$controlProps22, _props$controlProps23;
46
46
 
47
47
  const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? _defaultReconnectChatPaneControlProps.defaultReconnectChatPaneControlProps.id;
48
48
  const handleContinueChatClick = (0, _react2.useCallback)(() => {
@@ -117,14 +117,16 @@ function ReconnectChatPane(props) {
117
117
  };
118
118
  const continueChatButtonStyles = {
119
119
  root: Object.assign({}, _defaultReconnectChatPaneContinueChatButtonStyles.defaultReconnectChatPaneContinueChatButtonStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.continueChatButtonStyleProps),
120
- rootHovered: Object.assign({}, _defaultReconnectChatPaneContinueChatButtonHoveredStyles.defaultReconnectChatPaneContinueChatButtonHoveredStyles, (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : _props$styleProps8.continueChatButtonHoveredStyleProps)
120
+ rootHovered: Object.assign({}, _defaultReconnectChatPaneContinueChatButtonHoveredStyles.defaultReconnectChatPaneContinueChatButtonHoveredStyles, (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : _props$styleProps8.continueChatButtonHoveredStyleProps),
121
+ rootPressed: Object.assign({}, _defaultReconnectChatPaneContinueChatButtonHoveredStyles.defaultReconnectChatPaneContinueChatButtonHoveredStyles, (_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 ? void 0 : _props$styleProps9.continueChatButtonHoveredStyleProps)
121
122
  };
122
123
  const startNewChatButtonStyles = {
123
- root: Object.assign({}, _defaultReconnectChatPaneStartNewChatButtonStyles.defaultReconnectChatPaneStartNewChatButtonStyles, (_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 ? void 0 : _props$styleProps9.startNewChatButtonStyleProps),
124
- rootHovered: Object.assign({}, _defaultReconnectChatPaneStartNewChatButtonHoveredStyles.defaultReconnectChatPaneStartNewChatButtonHoveredStyles, (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.startNewChatButtonHoveredStyleProps)
124
+ root: Object.assign({}, _defaultReconnectChatPaneStartNewChatButtonStyles.defaultReconnectChatPaneStartNewChatButtonStyles, (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.startNewChatButtonStyleProps),
125
+ rootHovered: Object.assign({}, _defaultReconnectChatPaneStartNewChatButtonHoveredStyles.defaultReconnectChatPaneStartNewChatButtonHoveredStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.startNewChatButtonHoveredStyleProps),
126
+ rootPressed: Object.assign({}, _defaultReconnectChatPaneStartNewChatButtonHoveredStyles.defaultReconnectChatPaneStartNewChatButtonHoveredStyles, (_props$styleProps12 = props.styleProps) === null || _props$styleProps12 === void 0 ? void 0 : _props$styleProps12.startNewChatButtonHoveredStyleProps)
125
127
  };
126
128
  return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, !((_props$controlProps8 = props.controlProps) !== null && _props$controlProps8 !== void 0 && _props$controlProps8.hideReconnectChatPane) && /*#__PURE__*/_react2.default.createElement(_react.Stack, {
127
- className: (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : (_props$styleProps11$c = _props$styleProps11.classNames) === null || _props$styleProps11$c === void 0 ? void 0 : _props$styleProps11$c.containerClassName,
129
+ className: (_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : (_props$styleProps13$c = _props$styleProps13.classNames) === null || _props$styleProps13$c === void 0 ? void 0 : _props$styleProps13$c.containerClassName,
128
130
  id: elementId,
129
131
  tabIndex: -1,
130
132
  onKeyDown: handleEscKeyDown,
@@ -132,22 +134,22 @@ function ReconnectChatPane(props) {
132
134
  "aria-label": ((_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.reconnectChatPaneAriaLabel) || _defaultReconnectChatPaneControlProps.defaultReconnectChatPaneControlProps.reconnectChatPaneAriaLabel,
133
135
  styles: containerStyles
134
136
  }, /*#__PURE__*/_react2.default.createElement(_react.Stack, {
135
- className: (_props$styleProps12 = props.styleProps) === null || _props$styleProps12 === void 0 ? void 0 : (_props$styleProps12$c = _props$styleProps12.classNames) === null || _props$styleProps12$c === void 0 ? void 0 : _props$styleProps12$c.wrapperClassName,
137
+ className: (_props$styleProps14 = props.styleProps) === null || _props$styleProps14 === void 0 ? void 0 : (_props$styleProps14$c = _props$styleProps14.classNames) === null || _props$styleProps14$c === void 0 ? void 0 : _props$styleProps14$c.wrapperClassName,
136
138
  styles: wrapperStyles,
137
139
  tabIndex: -1,
138
140
  id: elementId + "-wrapper"
139
141
  }, !((_props$controlProps11 = props.controlProps) !== null && _props$controlProps11 !== void 0 && _props$controlProps11.hideTitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.title) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
140
- className: (_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : (_props$styleProps13$c = _props$styleProps13.classNames) === null || _props$styleProps13$c === void 0 ? void 0 : _props$styleProps13$c.titleClassName,
142
+ className: (_props$styleProps15 = props.styleProps) === null || _props$styleProps15 === void 0 ? void 0 : (_props$styleProps15$c = _props$styleProps15.classNames) === null || _props$styleProps15$c === void 0 ? void 0 : _props$styleProps15$c.titleClassName,
141
143
  styles: titleStyles,
142
144
  tabIndex: -1,
143
145
  id: elementId + "-title"
144
146
  }, ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.titleText) || _defaultReconnectChatPaneControlProps.defaultReconnectChatPaneControlProps.titleText)), !((_props$controlProps13 = props.controlProps) !== null && _props$controlProps13 !== void 0 && _props$controlProps13.hideSubtitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr2 = props.componentOverrides) === null || _props$componentOverr2 === void 0 ? void 0 : _props$componentOverr2.subtitle) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
145
- className: (_props$styleProps14 = props.styleProps) === null || _props$styleProps14 === void 0 ? void 0 : (_props$styleProps14$c = _props$styleProps14.classNames) === null || _props$styleProps14$c === void 0 ? void 0 : _props$styleProps14$c.subtitleClassName,
147
+ className: (_props$styleProps16 = props.styleProps) === null || _props$styleProps16 === void 0 ? void 0 : (_props$styleProps16$c = _props$styleProps16.classNames) === null || _props$styleProps16$c === void 0 ? void 0 : _props$styleProps16$c.subtitleClassName,
146
148
  styles: subtitleStyles,
147
149
  tabIndex: -1,
148
150
  id: elementId + "-subtitle"
149
151
  }, ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.subtitleText) || _defaultReconnectChatPaneControlProps.defaultReconnectChatPaneControlProps.subtitleText)), !((_props$controlProps15 = props.controlProps) !== null && _props$controlProps15 !== void 0 && _props$controlProps15.hideIcon) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.icon) || /*#__PURE__*/_react2.default.createElement(_react.Icon, {
150
- className: (_props$styleProps15 = props.styleProps) === null || _props$styleProps15 === void 0 ? void 0 : (_props$styleProps15$c = _props$styleProps15.classNames) === null || _props$styleProps15$c === void 0 ? void 0 : _props$styleProps15$c.iconClassName,
152
+ className: (_props$styleProps17 = props.styleProps) === null || _props$styleProps17 === void 0 ? void 0 : (_props$styleProps17$c = _props$styleProps17.classNames) === null || _props$styleProps17$c === void 0 ? void 0 : _props$styleProps17$c.iconClassName,
151
153
  styles: iconStyles,
152
154
  tabIndex: -1,
153
155
  role: "img",
@@ -155,12 +157,12 @@ function ReconnectChatPane(props) {
155
157
  "aria-label": ((_props$controlProps16 = props.controlProps) === null || _props$controlProps16 === void 0 ? void 0 : _props$controlProps16.iconAriaLabel) || _defaultReconnectChatPaneControlProps.defaultReconnectChatPaneControlProps.iconAriaLabel
156
158
  })), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
157
159
  horizontal: ((_props$controlProps17 = props.controlProps) === null || _props$controlProps17 === void 0 ? void 0 : _props$controlProps17.isButtonGroupHorizontal) || _defaultReconnectChatPaneControlProps.defaultReconnectChatPaneControlProps.isButtonGroupHorizontal,
158
- className: (_props$styleProps16 = props.styleProps) === null || _props$styleProps16 === void 0 ? void 0 : (_props$styleProps16$c = _props$styleProps16.classNames) === null || _props$styleProps16$c === void 0 ? void 0 : _props$styleProps16$c.buttonGroupClassName,
160
+ className: (_props$styleProps18 = props.styleProps) === null || _props$styleProps18 === void 0 ? void 0 : (_props$styleProps18$c = _props$styleProps18.classNames) === null || _props$styleProps18$c === void 0 ? void 0 : _props$styleProps18$c.buttonGroupClassName,
159
161
  styles: buttonGroupStyles,
160
162
  tabIndex: -1,
161
163
  id: elementId + "-buttongroup"
162
164
  }, !((_props$controlProps18 = props.controlProps) !== null && _props$controlProps18 !== void 0 && _props$controlProps18.hideContinueChatButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr4 = props.componentOverrides) === null || _props$componentOverr4 === void 0 ? void 0 : _props$componentOverr4.continueChatButton) || /*#__PURE__*/_react2.default.createElement(_react.DefaultButton, {
163
- className: (_props$styleProps17 = props.styleProps) === null || _props$styleProps17 === void 0 ? void 0 : (_props$styleProps17$c = _props$styleProps17.classNames) === null || _props$styleProps17$c === void 0 ? void 0 : _props$styleProps17$c.continueChatButtonClassName,
165
+ className: (_props$styleProps19 = props.styleProps) === null || _props$styleProps19 === void 0 ? void 0 : (_props$styleProps19$c = _props$styleProps19.classNames) === null || _props$styleProps19$c === void 0 ? void 0 : _props$styleProps19$c.continueChatButtonClassName,
164
166
  styles: continueChatButtonStyles,
165
167
  tabIndex: 0,
166
168
  text: ((_props$controlProps19 = props.controlProps) === null || _props$controlProps19 === void 0 ? void 0 : _props$controlProps19.continueChatButtonText) || _defaultReconnectChatPaneControlProps.defaultReconnectChatPaneControlProps.continueChatButtonText,
@@ -168,7 +170,7 @@ function ReconnectChatPane(props) {
168
170
  id: elementId + "-continueconversationbutton",
169
171
  "aria-label": ((_props$controlProps20 = props.controlProps) === null || _props$controlProps20 === void 0 ? void 0 : _props$controlProps20.continueChatButtonAriaLabel) || _defaultReconnectChatPaneControlProps.defaultReconnectChatPaneControlProps.continueChatButtonAriaLabel
170
172
  })), !((_props$controlProps21 = props.controlProps) !== null && _props$controlProps21 !== void 0 && _props$controlProps21.hideStartNewChatButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr5 = props.componentOverrides) === null || _props$componentOverr5 === void 0 ? void 0 : _props$componentOverr5.startNewChatButton) || /*#__PURE__*/_react2.default.createElement(_react.DefaultButton, {
171
- className: (_props$styleProps18 = props.styleProps) === null || _props$styleProps18 === void 0 ? void 0 : (_props$styleProps18$c = _props$styleProps18.classNames) === null || _props$styleProps18$c === void 0 ? void 0 : _props$styleProps18$c.startNewChatButtonClassName,
173
+ className: (_props$styleProps20 = props.styleProps) === null || _props$styleProps20 === void 0 ? void 0 : (_props$styleProps20$c = _props$styleProps20.classNames) === null || _props$styleProps20$c === void 0 ? void 0 : _props$styleProps20$c.startNewChatButtonClassName,
172
174
  styles: startNewChatButtonStyles,
173
175
  tabIndex: 0,
174
176
  text: ((_props$controlProps22 = props.controlProps) === null || _props$controlProps22 === void 0 ? void 0 : _props$controlProps22.startNewChatButtonText) || _defaultReconnectChatPaneControlProps.defaultReconnectChatPaneControlProps.startNewChatButtonText,
package/lib/cjs/index.js CHANGED
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "BroadcastService", {
27
27
  return _BroadcastService.BroadcastService;
28
28
  }
29
29
  });
30
+ Object.defineProperty(exports, "BroadcastServiceInitialize", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _BroadcastService.BroadcastServiceInitialize;
34
+ }
35
+ });
30
36
  Object.defineProperty(exports, "CallAcceptButtonBase64", {
31
37
  enumerable: true,
32
38
  get: function () {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.BroadcastService = void 0;
6
+ exports.BroadcastServiceInitialize = exports.BroadcastService = void 0;
7
7
 
8
8
  var _rxjs = require("rxjs");
9
9
 
@@ -11,20 +11,48 @@ var _operators = require("rxjs/operators");
11
11
 
12
12
  var _broadcastChannel = require("broadcast-channel");
13
13
 
14
- var _Constants = require("../common/Constants");
14
+ const newMessage = new _rxjs.Subject(); // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
15
 
16
- const newMessage = new _rxjs.Subject();
17
- const pubChannel = new _broadcastChannel.BroadcastChannel(_Constants.BROADCAST_CHANNEL_NAME);
18
- const subChannel = new _broadcastChannel.BroadcastChannel(_Constants.BROADCAST_CHANNEL_NAME); // eslint-disable-next-line @typescript-eslint/no-explicit-any
16
+ const broadcastServicePubList = {}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
17
 
20
- subChannel.onmessage = message => {
21
- newMessage.next(message);
18
+ const broadcastServiceSubList = {}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
+
20
+ let pubChannel; // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
+
22
+ let subChannel;
23
+
24
+ const BroadcastServiceInitialize = channelName => {
25
+ if (broadcastServicePubList[channelName]) {
26
+ pubChannel = broadcastServicePubList[channelName];
27
+ } else {
28
+ const newPubChannel = new _broadcastChannel.BroadcastChannel(channelName);
29
+ broadcastServicePubList[channelName] = newPubChannel;
30
+ pubChannel = newPubChannel;
31
+ }
32
+
33
+ if (broadcastServiceSubList[channelName]) {
34
+ subChannel = broadcastServiceSubList[channelName];
35
+ } else {
36
+ const newSubChannel = new _broadcastChannel.BroadcastChannel(channelName);
37
+ broadcastServiceSubList[channelName] = newSubChannel;
38
+ subChannel = newSubChannel;
39
+ } // eslint-disable-next-line @typescript-eslint/no-explicit-any
40
+
41
+
42
+ subChannel.onmessage = message => {
43
+ newMessage.next(message);
44
+ };
22
45
  };
23
46
 
47
+ exports.BroadcastServiceInitialize = BroadcastServiceInitialize;
24
48
  const BroadcastService = {
25
49
  //broadcast a message
26
50
  postMessage: message => {
27
- pubChannel.postMessage(message);
51
+ /**
52
+ * Omit copying methods to prevent 'DataCloneError' in older browsers when passing an object with functions
53
+ * This exception occurs when an object can't be clone with the 'structured clone algorithm' (used by postMessage)
54
+ */
55
+ pubChannel.postMessage(JSON.parse(JSON.stringify(message)));
28
56
  },
29
57
  getMessage: message => {
30
58
  return newMessage.pipe((0, _operators.filter)(msg => msg.elementId == message.elementId && msg.elementType == message.elementType && msg.eventName == message.eventName));
@@ -4,16 +4,21 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
4
4
 
5
5
  /* CSS Constants */
6
6
  export const AccessibilityBrightnessRatio = 1.2;
7
- /* App constants*/
8
-
9
- export const BROADCAST_CHANNEL_NAME = "omnichannel_broadcast_channel";
10
- export const KeyCodes = (_class = class KeyCodes {}, _defineProperty(_class, "ENTER", "Enter"), _defineProperty(_class, "ESCAPE", "Escape"), _defineProperty(_class, "SPACE", "Space"), _class);
7
+ export const HiddenTextStyles = {
8
+ position: "absolute",
9
+ height: "1px",
10
+ width: "1px",
11
+ overflow: "hidden",
12
+ clip: "rect(1px, 1px, 1px, 1px)",
13
+ whiteSpace: "nowrap"
14
+ };
15
+ export const KeyCodes = (_class = class KeyCodes {}, _defineProperty(_class, "ENTER", "Enter"), _defineProperty(_class, "ESCAPE", "Escape"), _defineProperty(_class, "SPACE", "Space"), _defineProperty(_class, "DeclineCallHotKey", "D"), _defineProperty(_class, "AcceptAudioCallHotKey", "S"), _defineProperty(_class, "AcceptVideoCallHotKey", "A"), _defineProperty(_class, "ToggleMicHotKey", "M"), _defineProperty(_class, "ToggleCameraHotKey", "O"), _class);
11
16
  export const Regex = (_class2 = class Regex {}, _defineProperty(_class2, "EmailRegex", "(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])"), _defineProperty(_class2, "URLRegex", /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi), _class2);
12
17
  export let ElementType;
13
18
 
14
19
  (function (ElementType) {
15
20
  ElementType["ChatButton"] = "ChatButton";
16
- ElementType["HeaderCloseButton"] = "HeaderCloseButton";
21
+ ElementType["CloseButton"] = "CloseButton";
17
22
  ElementType["HeaderMinimizeButton"] = "HeaderMinimizeButton";
18
23
  ElementType["FooterDownloadTranscriptButton"] = "FooterDownloadTranscriptButton";
19
24
  ElementType["FooterEmailTranscriptButton"] = "FooterEmailTranscriptButton";
@@ -1,15 +1,15 @@
1
- function _extends() { _extends = Object.assign || 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 { IconButton, Stack } from "@fluentui/react";
5
5
  import { BroadcastService } from "../../../../services/BroadcastService";
6
6
  import CommandButton from "../../../common/commandbutton/CommandButton";
7
- import { ElementType } from "../../../../common/Constants";
7
+ import { ElementType, KeyCodes } from "../../../../common/Constants";
8
8
  import Timer from "../Timer/Timer";
9
9
  import { defaultCurrentCallProps } from "./common/defaultProps/defaultCurrentCallProps";
10
10
  import { processCustomComponents } from "../../../../common/utils";
11
11
  import { useBoolean } from "@fluentui/react-hooks";
12
- import { useCallback } from "react";
12
+ import { useCallback, useEffect } from "react";
13
13
 
14
14
  function CurrentCall(props) {
15
15
  var _props$controlProps, _defaultCurrentCallPr, _props$controlProps2, _props$controlProps2$, _defaultCurrentCallPr2, _defaultCurrentCallPr3, _props$controlProps3, _props$controlProps3$, _defaultCurrentCallPr4, _defaultCurrentCallPr5, _props$controlProps4, _props$controlProps4$, _defaultCurrentCallPr6, _defaultCurrentCallPr7, _props$controlProps5, _props$controlProps5$, _defaultCurrentCallPr8, _defaultCurrentCallPr9, _props$controlProps6, _props$controlProps6$, _defaultCurrentCallPr10, _defaultCurrentCallPr11, _props$controlProps7, _props$controlProps7$, _defaultCurrentCallPr12, _defaultCurrentCallPr13, _props$controlProps8, _props$controlProps8$, _defaultCurrentCallPr14, _defaultCurrentCallPr15, _props$controlProps9, _props$controlProps10, _defaultCurrentCallPr16, _defaultCurrentCallPr17, _props$styleProps, _props$controlProps11, _props$controlProps12, _defaultCurrentCallPr18, _defaultCurrentCallPr19, _props$controlProps13, _props$controlProps14, _defaultCurrentCallPr20, _defaultCurrentCallPr21, _props$controlProps15, _props$controlProps16, _defaultCurrentCallPr22, _defaultCurrentCallPr23, _props$controlProps17, _props$controlProps18, _props$controlProps19, _props$controlProps20, _defaultCurrentCallPr24, _defaultCurrentCallPr25, _props$controlProps21, _props$controlProps22, _defaultCurrentCallPr26, _defaultCurrentCallPr27, _props$controlProps23, _props$controlProps24, _defaultCurrentCallPr28, _defaultCurrentCallPr29, _props$controlProps25, _props$controlProps26, _defaultCurrentCallPr30, _defaultCurrentCallPr31, _props$controlProps27, _props$controlProps28, _props$controlProps29, _props$controlProps30, _defaultCurrentCallPr32, _defaultCurrentCallPr33, _props$controlProps31, _props$controlProps32, _defaultCurrentCallPr34, _defaultCurrentCallPr35, _props$controlProps33, _props$controlProps34, _defaultCurrentCallPr36, _defaultCurrentCallPr37, _props$controlProps35, _props$controlProps36, _defaultCurrentCallPr38, _defaultCurrentCallPr39, _props$controlProps37, _defaultCurrentCallPr40, _props$controlProps38, _defaultCurrentCallPr41, _props$controlProps39, _defaultCurrentCallPr42, _props$controlProps40, _props$controlProps41, _props$controlProps42, _props$controlProps43, _defaultCurrentCallPr43, _defaultCurrentCallPr44, _props$controlProps44, _props$controlProps45, _defaultCurrentCallPr45, _defaultCurrentCallPr46, _props$controlProps46, _props$controlProps47, _defaultCurrentCallPr47, _defaultCurrentCallPr48, _props$controlProps48, _props$controlProps49, _defaultCurrentCallPr49, _defaultCurrentCallPr50, _props$controlProps50, _props$controlProps51, _props$controlProps52, _props$controlProps53, _defaultCurrentCallPr51, _defaultCurrentCallPr52, _props$controlProps54, _props$controlProps55, _defaultCurrentCallPr53, _defaultCurrentCallPr54, _props$controlProps56, _props$controlProps57, _defaultCurrentCallPr55, _defaultCurrentCallPr56, _props$controlProps58, _props$controlProps59, _defaultCurrentCallPr57, _defaultCurrentCallPr58, _defaultCurrentCallPr59, _props$controlProps60, _defaultCurrentCallPr60, _props$controlProps61, _defaultCurrentCallPr61, _props$styleProps2, _defaultCurrentCallPr62, _props$styleProps3, _defaultCurrentCallPr63, _props$styleProps4, _defaultCurrentCallPr67, _props$styleProps8, _defaultCurrentCallPr68, _props$styleProps9, _defaultCurrentCallPr69, _props$styleProps10, _defaultCurrentCallPr70, _props$styleProps11, _defaultCurrentCallPr71, _props$styleProps12, _props$controlProps68, _defaultCurrentCallPr72, _props$styleProps13, _props$styleProps13$c, _props$styleProps14, _props$styleProps14$c, _props$styleProps15, _props$styleProps15$c, _props$styleProps16, _props$styleProps16$c, _props$styleProps17, _props$styleProps17$c, _props$controlProps69, _props$controlProps70, _props$controlProps71, _props$controlProps72, _props$controlProps73, _props$controlProps74, _props$controlProps75, _props$controlProps76, _props$controlProps77, _defaultCurrentCallPr73, _defaultCurrentCallPr74, _props$controlProps78, _props$controlProps79, _defaultCurrentCallPr75, _defaultCurrentCallPr76, _props$controlProps80, _props$controlProps81, _props$controlProps82, _props$controlProps83, _defaultCurrentCallPr77, _defaultCurrentCallPr78, _props$controlProps84, _props$controlProps85, _defaultCurrentCallPr79, _defaultCurrentCallPr80, _props$controlProps86, _props$controlProps87, _props$controlProps88, _props$controlProps89, _props$controlProps90, _defaultCurrentCallPr81, _defaultCurrentCallPr82, _props$controlProps91, _props$controlProps92, _defaultCurrentCallPr83, _defaultCurrentCallPr84, _props$controlProps93, _props$controlProps94, _props$controlProps95, _props$controlProps96, _defaultCurrentCallPr85, _defaultCurrentCallPr86, _props$controlProps97, _props$controlProps98, _defaultCurrentCallPr87, _defaultCurrentCallPr88, _props$controlProps99, _props$controlProps100, _props$controlProps101;
@@ -189,6 +189,36 @@ function CurrentCall(props) {
189
189
  }
190
190
  }, []);
191
191
  const hideCallTimer = ((_props$controlProps68 = props.controlProps) === null || _props$controlProps68 === void 0 ? void 0 : _props$controlProps68.hideCallTimer) ?? ((_defaultCurrentCallPr72 = defaultCurrentCallProps.controlProps) === null || _defaultCurrentCallPr72 === void 0 ? void 0 : _defaultCurrentCallPr72.hideCallTimer);
192
+ useEffect(() => {
193
+ const endCallShortcut = e => e.key === KeyCodes.ENTER;
194
+
195
+ const toggleMicShortcut = e => e.ctrlKey && e.shiftKey && e.key === KeyCodes.ToggleMicHotKey;
196
+
197
+ const toggleVideoShortcut = e => e.ctrlKey && e.shiftKey && e.key === KeyCodes.ToggleCameraHotKey;
198
+
199
+ const shortcutKeysHandler = e => {
200
+ if (endCallShortcut(e)) {
201
+ handleEndCallClick();
202
+ } else if (toggleMicShortcut(e)) {
203
+ handleMicClick();
204
+ } else if (toggleVideoShortcut(e)) {
205
+ handleVideoOffClick();
206
+ }
207
+ };
208
+
209
+ const ignoreDefault = e => {
210
+ if (endCallShortcut(e) || toggleMicShortcut(e) || toggleVideoShortcut(e)) {
211
+ e.preventDefault();
212
+ }
213
+ };
214
+
215
+ window.addEventListener("keyup", shortcutKeysHandler);
216
+ window.addEventListener("keydown", ignoreDefault);
217
+ return () => {
218
+ window.removeEventListener("keyup", shortcutKeysHandler);
219
+ window.removeEventListener("keydown", ignoreDefault);
220
+ };
221
+ }, []);
192
222
  return /*#__PURE__*/React.createElement(Stack, {
193
223
  className: (_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : (_props$styleProps13$c = _props$styleProps13.classNames) === null || _props$styleProps13$c === void 0 ? void 0 : _props$styleProps13$c.currentCallComponentClassName,
194
224
  horizontalAlign: "space-between",
@@ -47,18 +47,6 @@ export const customizedCurrentCallStyleProps = {
47
47
  width: "50px",
48
48
  margin: "1px"
49
49
  },
50
- currentCallTimerStyleProps: {
51
- borderRadius: "2px",
52
- margin: "1px",
53
- color: "white",
54
- paddingTop: "18px",
55
- fontSize: 12,
56
- fontFamily: "Segoe UI, Arial, sans-serif",
57
- backgroundColor: "transparent",
58
- height: "50px",
59
- width: "55px",
60
- textAlign: "center"
61
- },
62
50
  videoTileStyleProps: {
63
51
  minHeight: "180px",
64
52
  height: "300px",
@@ -39,18 +39,6 @@ export const defaultCurrentCallStyleProps = {
39
39
  width: "50px",
40
40
  fontSize: "18px"
41
41
  },
42
- currentCallTimerStyleProps: {
43
- borderRadius: "2px",
44
- margin: "1px",
45
- color: "#FFFFFF",
46
- paddingTop: "18px",
47
- fontSize: 12,
48
- fontFamily: "Segoe UI, Arial, sans-serif",
49
- backgroundColor: "darkgrey",
50
- height: "45px",
51
- width: "50px",
52
- textAlign: "center"
53
- },
54
42
  videoTileStyleProps: {
55
43
  width: "100%",
56
44
  marginLeft: "auto",