@microsoft/omnichannel-chat-components 0.1.0-main.5a87386 → 0.1.0-main.600e05c

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 (28) hide show
  1. package/lib/cjs/common/Constants.js +1 -1
  2. package/lib/cjs/components/common/commandbutton/CommandButton.js +27 -6
  3. package/lib/cjs/components/{header → common}/subcomponents/CloseButton.js +4 -3
  4. package/lib/cjs/components/footer/subcomponents/AudioNotificationButton.js +30 -12
  5. package/lib/cjs/components/header/Header.js +1 -1
  6. package/lib/cjs/components/proactivechatpane/ProactiveChatPane.js +36 -35
  7. package/lib/cjs/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +5 -1
  8. package/lib/cjs/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -13
  9. package/lib/cjs/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +5 -1
  10. package/lib/cjs/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +5 -1
  11. package/lib/cjs/services/BroadcastService.js +5 -1
  12. package/lib/esm/common/Constants.js +1 -1
  13. package/lib/esm/components/common/commandbutton/CommandButton.js +27 -6
  14. package/lib/esm/components/{header → common}/subcomponents/CloseButton.js +4 -3
  15. package/lib/esm/components/footer/subcomponents/AudioNotificationButton.js +30 -12
  16. package/lib/esm/components/header/Header.js +1 -1
  17. package/lib/esm/components/proactivechatpane/ProactiveChatPane.js +33 -34
  18. package/lib/esm/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +5 -1
  19. package/lib/esm/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -11
  20. package/lib/esm/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +5 -1
  21. package/lib/esm/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +5 -1
  22. package/lib/esm/services/BroadcastService.js +5 -1
  23. package/lib/types/common/Constants.d.ts +1 -1
  24. package/lib/types/components/common/interfaces/ICommandButtonControlProps.d.ts +1 -0
  25. package/lib/types/components/common/interfaces/ICommandButtonProps.d.ts +1 -0
  26. package/lib/types/components/{header → common}/subcomponents/CloseButton.d.ts +1 -1
  27. package/lib/types/components/proactivechatpane/interfaces/IProactiveChatPaneControlProps.d.ts +2 -1
  28. package/package.json +1 -1
@@ -30,7 +30,7 @@ exports.ElementType = ElementType;
30
30
 
31
31
  (function (ElementType) {
32
32
  ElementType["ChatButton"] = "ChatButton";
33
- ElementType["HeaderCloseButton"] = "HeaderCloseButton";
33
+ ElementType["CloseButton"] = "CloseButton";
34
34
  ElementType["HeaderMinimizeButton"] = "HeaderMinimizeButton";
35
35
  ElementType["FooterDownloadTranscriptButton"] = "FooterDownloadTranscriptButton";
36
36
  ElementType["FooterEmailTranscriptButton"] = "FooterEmailTranscriptButton";
@@ -18,17 +18,38 @@ 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$styles, _props$styles2, _props$styles3, _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
29
  const buttonStyles = {
31
- root: props.styles,
30
+ icon: props.styles,
31
+ root: {
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
+ width: props === null || props === void 0 ? void 0 : (_props$styles = props.styles) === null || _props$styles === void 0 ? void 0 : _props$styles.width,
34
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
+ height: props === null || props === void 0 ? void 0 : (_props$styles2 = props.styles) === null || _props$styles2 === void 0 ? void 0 : _props$styles2.height,
36
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
+ backgroundColor: props === null || props === void 0 ? void 0 : (_props$styles3 = props.styles) === null || _props$styles3 === void 0 ? void 0 : _props$styles3.backgroundColor,
38
+ selectors: {
39
+ ":hover .ms-Button-icon": {
40
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
+ color: props === null || props === void 0 ? void 0 : (_props$hoverStyles = props.hoverStyles) === null || _props$hoverStyles === void 0 ? void 0 : _props$hoverStyles.color
42
+ },
43
+ ":active .ms-Button-icon": {
44
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
45
+ color: props === null || props === void 0 ? void 0 : (_props$hoverStyles2 = props.hoverStyles) === null || _props$hoverStyles2 === void 0 ? void 0 : _props$hoverStyles2.color
46
+ },
47
+ ":focus .ms-Button-icon": {
48
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
49
+ color: props === null || props === void 0 ? void 0 : (_props$focusStyles = props.focusStyles) === null || _props$focusStyles === void 0 ? void 0 : _props$focusStyles.color
50
+ }
51
+ }
52
+ },
32
53
  rootHovered: props.hoverStyles,
33
54
  rootFocused: props.focusStyles,
34
55
  rootPressed: props.hoverStyles
@@ -57,7 +78,7 @@ function CommandButton(props) {
57
78
  }), props.type === "icon" && /*#__PURE__*/_react2.default.createElement(_react.IconButton, {
58
79
  id: props.id,
59
80
  iconProps: iconProp,
60
- title: props.ariaLabel,
81
+ title: props.hideButtonTitle ? undefined : props.ariaLabel,
61
82
  ariaLabel: props.ariaLabel,
62
83
  disabled: props.disabled,
63
84
  styles: buttonStyles,
@@ -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
 
@@ -18,32 +18,50 @@ 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 AudioNotificationButton(props) {
21
+ var _props$styles, _props$styles2, _props$styles3, _props$hoverStyles, _props$hoverStyles2, _props$focusStyles;
22
+
21
23
  const {
22
24
  disabled
23
25
  } = props;
24
26
  const [muted, setMuted] = (0, _react2.useState)(props.isAudioMuted);
25
27
  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
28
+ icon: props.styles,
29
+ root: {
30
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
+ width: props === null || props === void 0 ? void 0 : (_props$styles = props.styles) === null || _props$styles === void 0 ? void 0 : _props$styles.width,
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
+ height: props === null || props === void 0 ? void 0 : (_props$styles2 = props.styles) === null || _props$styles2 === void 0 ? void 0 : _props$styles2.height,
34
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
+ backgroundColor: props === null || props === void 0 ? void 0 : (_props$styles3 = props.styles) === null || _props$styles3 === void 0 ? void 0 : _props$styles3.backgroundColor,
36
+ selectors: {
37
+ ":hover .ms-Button-icon": {
38
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
39
+ color: props === null || props === void 0 ? void 0 : (_props$hoverStyles = props.hoverStyles) === null || _props$hoverStyles === void 0 ? void 0 : _props$hoverStyles.color
40
+ },
41
+ ":active .ms-Button-icon": {
42
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
43
+ color: props === null || props === void 0 ? void 0 : (_props$hoverStyles2 = props.hoverStyles) === null || _props$hoverStyles2 === void 0 ? void 0 : _props$hoverStyles2.color
44
+ },
45
+ ":focus .ms-Button-icon": {
46
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
47
+ color: props === null || props === void 0 ? void 0 : (_props$focusStyles = props.focusStyles) === null || _props$focusStyles === void 0 ? void 0 : _props$focusStyles.color
48
+ }
49
+ }
50
+ },
51
+ rootHovered: props.hoverStyles,
52
+ rootFocused: props.focusStyles,
53
+ rootPressed: props.hoverStyles
30
54
  }; //imageIconProps > iconName
31
55
 
32
56
  const volume0Icon = props.imageToggleIconProps ? {
33
57
  imageProps: props === null || props === void 0 ? void 0 : props.imageToggleIconProps
34
58
  } : {
35
- iconName: (props === null || props === void 0 ? void 0 : props.toggleIconName) ?? "Volume0",
36
- styles: {
37
- root: props.styles
38
- }
59
+ iconName: (props === null || props === void 0 ? void 0 : props.toggleIconName) ?? "Volume0"
39
60
  };
40
61
  const volume3Icon = props.imageIconProps ? {
41
62
  imageProps: props === null || props === void 0 ? void 0 : props.imageIconProps
42
63
  } : {
43
- iconName: (props === null || props === void 0 ? void 0 : props.iconName) ?? "Volume3",
44
- styles: {
45
- root: props.styles
46
- }
64
+ iconName: (props === null || props === void 0 ? void 0 : props.iconName) ?? "Volume3"
47
65
  };
48
66
  const handleOnClick = (0, _react2.useCallback)(() => {
49
67
  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
 
@@ -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$styleProps12, _props$styleProps13, _props$controlProps6, _props$styleProps14, _props$styleProps14$c, _props$controlProps7, _props$controlProps8, _props$styleProps15, _props$styleProps15$c, _props$styleProps16, _props$styleProps16$c, _props$controlProps9, _props$componentOverr, _props$styleProps17, _props$styleProps17$c, _props$controlProps10, _props$controlProps11, _props$componentOverr2, _props$styleProps18, _props$styleProps18$c, _props$controlProps12, _props$controlProps13, _props$componentOverr3, _props$styleProps19, _props$styleProps19$c, _props$controlProps14, _props$controlProps15, _props$styleProps20, _props$styleProps20$c, _props$controlProps16, _props$componentOverr4, _props$styleProps21, _props$styleProps21$c, _props$controlProps17, _props$controlProps18, _props$componentOverr5, _props$styleProps22, _props$styleProps22$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,71 +120,67 @@ 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
- rootPressed: Object.assign({}, _defaultProactiveChatPaneCloseButtonHoveredStyles.defaultProactiveChatPaneCloseButtonHoveredStyles, (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : _props$styleProps8.closeButtonHoveredStyleProps)
122
- };
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);
123
125
  const bodyContainerStyles = {
124
- root: Object.assign({}, _defaultProactiveChatPaneBodyContainerStyles.defaultProactiveChatPaneBodyContainerStyles, (_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 ? void 0 : _props$styleProps9.bodyContainerStyleProps)
126
+ root: Object.assign({}, _defaultProactiveChatPaneBodyContainerStyles.defaultProactiveChatPaneBodyContainerStyles, (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : _props$styleProps8.bodyContainerStyleProps)
125
127
  };
126
128
  const bodyTitleStyles = {
127
- root: Object.assign({}, _defaultProactiveChatPaneBodyTitleStyles.defaultProactiveChatPaneBodyTitleStyles, (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.bodyTitleStyleProps)
129
+ root: Object.assign({}, _defaultProactiveChatPaneBodyTitleStyles.defaultProactiveChatPaneBodyTitleStyles, (_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 ? void 0 : _props$styleProps9.bodyTitleStyleProps)
128
130
  };
129
131
  const startButtonStyles = {
130
- root: Object.assign({}, _defaultProactiveChatPaneStartButtonStyles.defaultProactiveChatPaneStartButtonStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.startButtonStyleProps),
131
- rootHovered: Object.assign({}, _defaultProactiveChatPaneStartButtonHoveredStyles.defaultProactiveChatPaneStartButtonHoveredStyles, (_props$styleProps12 = props.styleProps) === null || _props$styleProps12 === void 0 ? void 0 : _props$styleProps12.startButtonHoveredStyleProps),
132
- rootPressed: Object.assign({}, _defaultProactiveChatPaneStartButtonHoveredStyles.defaultProactiveChatPaneStartButtonHoveredStyles, (_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : _props$styleProps13.startButtonHoveredStyleProps)
132
+ root: Object.assign({}, _defaultProactiveChatPaneStartButtonStyles.defaultProactiveChatPaneStartButtonStyles, (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.startButtonStyleProps),
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)
133
135
  };
134
- 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, {
135
- 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.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,
136
138
  id: elementId,
137
139
  tabIndex: -1,
138
140
  onKeyDown: handleEscKeyDown,
139
- dir: ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.dir) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.dir,
140
- "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,
141
143
  styles: containerStyles
142
144
  }, /*#__PURE__*/_react2.default.createElement(_react.Stack, {
143
145
  horizontal: true,
144
- 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.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,
145
147
  styles: headerContainerStyles,
146
148
  tabIndex: -1,
147
149
  id: elementId + "-headercontainer"
148
150
  }, /*#__PURE__*/_react2.default.createElement(_react.Stack, {
149
- 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.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,
150
152
  styles: textContainerStyles,
151
153
  tabIndex: -1,
152
154
  id: elementId + "-textcontainer"
153
- }, !((_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, {
154
- 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.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,
155
157
  styles: titleStyles,
156
158
  tabIndex: -1,
157
159
  id: elementId + "-title"
158
- }, ((_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, {
159
- 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.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,
160
162
  styles: subtitleStyles,
161
163
  tabIndex: -1,
162
164
  id: elementId + "-subtitle"
163
- }, ((_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, {
164
- 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.closeButtonClassName,
165
- styles: closeButtonStyles,
166
- 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,
167
167
  onClick: handleCloseClick,
168
- id: elementId + "-closebutton",
169
- "aria-label": ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.closeButtonAriaLabel) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.closeButtonAriaLabel
170
- }))), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
168
+ styles: closeButtonStyles,
169
+ hoverStyles: closeButtonHoverStyles,
170
+ id: elementId + "-closebutton"
171
+ })))), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
171
172
  horizontal: ((_props$controlProps15 = props.controlProps) === null || _props$controlProps15 === void 0 ? void 0 : _props$controlProps15.isBodyContainerHorizantal) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.isBodyContainerHorizantal,
172
- 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.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,
173
174
  styles: bodyContainerStyles,
174
175
  tabIndex: -1,
175
176
  id: elementId + "-bodycontainer"
176
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, {
177
- 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.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,
178
179
  styles: bodyTitleStyles,
179
180
  tabIndex: -1,
180
181
  id: elementId + "-bodytitle"
181
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, {
182
- className: (_props$styleProps22 = props.styleProps) === null || _props$styleProps22 === void 0 ? void 0 : (_props$styleProps22$c = _props$styleProps22.classNames) === null || _props$styleProps22$c === void 0 ? void 0 : _props$styleProps22$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,
183
184
  styles: startButtonStyles,
184
185
  tabIndex: 0,
185
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.",
@@ -48,7 +48,11 @@ exports.BroadcastServiceInitialize = BroadcastServiceInitialize;
48
48
  const BroadcastService = {
49
49
  //broadcast a message
50
50
  postMessage: message => {
51
- 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)));
52
56
  },
53
57
  getMessage: message => {
54
58
  return newMessage.pipe((0, _operators.filter)(msg => msg.elementId == message.elementId && msg.elementType == message.elementType && msg.eventName == message.eventName));
@@ -18,7 +18,7 @@ export let ElementType;
18
18
 
19
19
  (function (ElementType) {
20
20
  ElementType["ChatButton"] = "ChatButton";
21
- ElementType["HeaderCloseButton"] = "HeaderCloseButton";
21
+ ElementType["CloseButton"] = "CloseButton";
22
22
  ElementType["HeaderMinimizeButton"] = "HeaderMinimizeButton";
23
23
  ElementType["FooterDownloadTranscriptButton"] = "FooterDownloadTranscriptButton";
24
24
  ElementType["FooterEmailTranscriptButton"] = "FooterEmailTranscriptButton";
@@ -4,17 +4,38 @@ import { BroadcastService } from "../../../services/BroadcastService";
4
4
  import { ElementType } from "../../../common/Constants";
5
5
 
6
6
  function CommandButton(props) {
7
+ var _props$styles, _props$styles2, _props$styles3, _props$hoverStyles, _props$hoverStyles2, _props$focusStyles;
8
+
7
9
  //imageIconProps > iconName
8
10
  const iconProp = props.imageIconProps ? {
9
11
  imageProps: props.imageIconProps
10
12
  } : {
11
- iconName: props.iconName,
12
- styles: {
13
- root: props.styles
14
- }
13
+ iconName: props.iconName
15
14
  };
16
15
  const buttonStyles = {
17
- root: props.styles,
16
+ icon: props.styles,
17
+ root: {
18
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
+ width: props === null || props === void 0 ? void 0 : (_props$styles = props.styles) === null || _props$styles === void 0 ? void 0 : _props$styles.width,
20
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
+ height: props === null || props === void 0 ? void 0 : (_props$styles2 = props.styles) === null || _props$styles2 === void 0 ? void 0 : _props$styles2.height,
22
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
23
+ backgroundColor: props === null || props === void 0 ? void 0 : (_props$styles3 = props.styles) === null || _props$styles3 === void 0 ? void 0 : _props$styles3.backgroundColor,
24
+ selectors: {
25
+ ":hover .ms-Button-icon": {
26
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
+ color: props === null || props === void 0 ? void 0 : (_props$hoverStyles = props.hoverStyles) === null || _props$hoverStyles === void 0 ? void 0 : _props$hoverStyles.color
28
+ },
29
+ ":active .ms-Button-icon": {
30
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
+ color: props === null || props === void 0 ? void 0 : (_props$hoverStyles2 = props.hoverStyles) === null || _props$hoverStyles2 === void 0 ? void 0 : _props$hoverStyles2.color
32
+ },
33
+ ":focus .ms-Button-icon": {
34
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
35
+ color: props === null || props === void 0 ? void 0 : (_props$focusStyles = props.focusStyles) === null || _props$focusStyles === void 0 ? void 0 : _props$focusStyles.color
36
+ }
37
+ }
38
+ },
18
39
  rootHovered: props.hoverStyles,
19
40
  rootFocused: props.focusStyles,
20
41
  rootPressed: props.hoverStyles
@@ -41,7 +62,7 @@ function CommandButton(props) {
41
62
  }), props.type === "icon" && /*#__PURE__*/React.createElement(IconButton, {
42
63
  id: props.id,
43
64
  iconProps: iconProp,
44
- title: props.ariaLabel,
65
+ title: props.hideButtonTitle ? undefined : props.ariaLabel,
45
66
  ariaLabel: props.ariaLabel,
46
67
  disabled: props.disabled,
47
68
  styles: buttonStyles,
@@ -1,13 +1,13 @@
1
1
  import React from "react";
2
2
  import { ElementType } from "../../../common/Constants";
3
- import CommandButton from "../../common/commandbutton/CommandButton";
3
+ import CommandButton from "../commandbutton/CommandButton";
4
4
 
5
5
  function CloseButton(props) {
6
6
  const {
7
7
  type
8
8
  } = props;
9
9
  const customEvent = {
10
- elementType: ElementType.HeaderCloseButton,
10
+ elementType: ElementType.CloseButton,
11
11
  elementId: props === null || props === void 0 ? void 0 : props.id,
12
12
  eventName: "OnClick"
13
13
  };
@@ -23,7 +23,8 @@ function CloseButton(props) {
23
23
  onClick: props.onClick,
24
24
  ariaLabel: props.ariaLabel ?? "Close",
25
25
  className: props.className,
26
- customEvent: customEvent
26
+ customEvent: customEvent,
27
+ hideButtonTitle: props.hideButtonTitle
27
28
  });
28
29
  }
29
30
 
@@ -4,32 +4,50 @@ import { BroadcastService } from "../../../services/BroadcastService";
4
4
  import { ElementType } from "../../../common/Constants";
5
5
 
6
6
  function AudioNotificationButton(props) {
7
+ var _props$styles, _props$styles2, _props$styles3, _props$hoverStyles, _props$hoverStyles2, _props$focusStyles;
8
+
7
9
  const {
8
10
  disabled
9
11
  } = props;
10
12
  const [muted, setMuted] = useState(props.isAudioMuted);
11
13
  const iconButtonStyles = {
12
- root: props === null || props === void 0 ? void 0 : props.styles,
13
- rootHovered: props === null || props === void 0 ? void 0 : props.hoverStyles,
14
- rootFocused: props === null || props === void 0 ? void 0 : props.focusStyles,
15
- rootPressed: props === null || props === void 0 ? void 0 : props.hoverStyles
14
+ icon: props.styles,
15
+ root: {
16
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
17
+ width: props === null || props === void 0 ? void 0 : (_props$styles = props.styles) === null || _props$styles === void 0 ? void 0 : _props$styles.width,
18
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
19
+ height: props === null || props === void 0 ? void 0 : (_props$styles2 = props.styles) === null || _props$styles2 === void 0 ? void 0 : _props$styles2.height,
20
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
+ backgroundColor: props === null || props === void 0 ? void 0 : (_props$styles3 = props.styles) === null || _props$styles3 === void 0 ? void 0 : _props$styles3.backgroundColor,
22
+ selectors: {
23
+ ":hover .ms-Button-icon": {
24
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
25
+ color: props === null || props === void 0 ? void 0 : (_props$hoverStyles = props.hoverStyles) === null || _props$hoverStyles === void 0 ? void 0 : _props$hoverStyles.color
26
+ },
27
+ ":active .ms-Button-icon": {
28
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
29
+ color: props === null || props === void 0 ? void 0 : (_props$hoverStyles2 = props.hoverStyles) === null || _props$hoverStyles2 === void 0 ? void 0 : _props$hoverStyles2.color
30
+ },
31
+ ":focus .ms-Button-icon": {
32
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
33
+ color: props === null || props === void 0 ? void 0 : (_props$focusStyles = props.focusStyles) === null || _props$focusStyles === void 0 ? void 0 : _props$focusStyles.color
34
+ }
35
+ }
36
+ },
37
+ rootHovered: props.hoverStyles,
38
+ rootFocused: props.focusStyles,
39
+ rootPressed: props.hoverStyles
16
40
  }; //imageIconProps > iconName
17
41
 
18
42
  const volume0Icon = props.imageToggleIconProps ? {
19
43
  imageProps: props === null || props === void 0 ? void 0 : props.imageToggleIconProps
20
44
  } : {
21
- iconName: (props === null || props === void 0 ? void 0 : props.toggleIconName) ?? "Volume0",
22
- styles: {
23
- root: props.styles
24
- }
45
+ iconName: (props === null || props === void 0 ? void 0 : props.toggleIconName) ?? "Volume0"
25
46
  };
26
47
  const volume3Icon = props.imageIconProps ? {
27
48
  imageProps: props === null || props === void 0 ? void 0 : props.imageIconProps
28
49
  } : {
29
- iconName: (props === null || props === void 0 ? void 0 : props.iconName) ?? "Volume3",
30
- styles: {
31
- root: props.styles
32
- }
50
+ iconName: (props === null || props === void 0 ? void 0 : props.iconName) ?? "Volume3"
33
51
  };
34
52
  const handleOnClick = useCallback(() => {
35
53
  setMuted(!muted);
@@ -2,7 +2,7 @@ function _extends() { _extends = Object.assign ? Object.assign.bind() : function
2
2
 
3
3
  import * as React from "react";
4
4
  import { Image, Label, Stack, initializeIcons } from "@fluentui/react";
5
- import CloseButton from "./subcomponents/CloseButton";
5
+ import CloseButton from "../common/subcomponents/CloseButton";
6
6
  import MinimizeButton from "./subcomponents/MinimizeButton";
7
7
  import { decodeComponentString } from "../../common/decodeComponentString";
8
8
  import { defaultHeaderProps } from "./common/defaultProps/defaultHeaderProps";
@@ -1,13 +1,14 @@
1
- import { IconButton, Label, Stack } from "@fluentui/react";
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
+
3
+ import { Label, Stack } from "@fluentui/react";
2
4
  import React, { useCallback } from "react";
3
5
  import { BroadcastService } from "../../services/BroadcastService";
4
6
  import { DefaultButton } from "@fluentui/react/lib/Button";
7
+ import CloseButton from "../common/subcomponents/CloseButton";
5
8
  import { KeyCodes } from "../../common/Constants";
6
9
  import { decodeComponentString } from "../../common/decodeComponentString";
7
10
  import { defaultProactiveChatPaneBodyContainerStyles } from "./common/default/defaultStyles/defaultProactiveChatPaneBodyContainerStyles";
8
11
  import { defaultProactiveChatPaneBodyTitleStyles } from "./common/default/defaultStyles/defaultProactiveChatPaneBodyTitleStyles";
9
- import { defaultProactiveChatPaneCloseButtonHoveredStyles } from "./common/default/defaultStyles/defaultProactiveChatPaneCloseButtonHoveredStyles";
10
- import { defaultProactiveChatPaneCloseButtonStyles } from "./common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles";
11
12
  import { defaultProactiveChatPaneControlProps } from "./common/default/defaultProps/defaultProactiveChatPaneControlProps";
12
13
  import { defaultProactiveChatPaneGeneralStyles } from "./common/default/defaultStyles/defaultProactiveChatPaneGeneralStyles";
13
14
  import { defaultProactiveChatPaneHeaderContainerStyles } from "./common/default/defaultStyles/defaultProactiveChatPaneHeaderContainerStyles";
@@ -17,9 +18,10 @@ import { defaultProactiveChatPaneSubtitleStyles } from "./common/default/default
17
18
  import { defaultProactiveChatPaneTextContainerStyles } from "./common/default/defaultStyles/defaultProactiveChatPaneTextContainerStyles";
18
19
  import { defaultProactiveChatPaneTitleStyles } from "./common/default/defaultStyles/defaultProactiveChatPaneTitleStyles";
19
20
  import { generateEventName } from "../../common/utils";
21
+ import { defaultProactiveChatPaneProps } from "./common/default/defaultProps/defaultProactiveChatPaneProps";
20
22
 
21
23
  function ProactiveChatPane(props) {
22
- 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$styleProps13, _props$controlProps6, _props$styleProps14, _props$styleProps14$c, _props$controlProps7, _props$controlProps8, _props$styleProps15, _props$styleProps15$c, _props$styleProps16, _props$styleProps16$c, _props$controlProps9, _props$componentOverr, _props$styleProps17, _props$styleProps17$c, _props$controlProps10, _props$controlProps11, _props$componentOverr2, _props$styleProps18, _props$styleProps18$c, _props$controlProps12, _props$controlProps13, _props$componentOverr3, _props$styleProps19, _props$styleProps19$c, _props$controlProps14, _props$controlProps15, _props$styleProps20, _props$styleProps20$c, _props$controlProps16, _props$componentOverr4, _props$styleProps21, _props$styleProps21$c, _props$controlProps17, _props$controlProps18, _props$componentOverr5, _props$styleProps22, _props$styleProps22$c, _props$controlProps19, _props$controlProps20;
24
+ 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;
23
25
 
24
26
  const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? defaultProactiveChatPaneControlProps.id;
25
27
 
@@ -68,6 +70,7 @@ function ProactiveChatPane(props) {
68
70
  (_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.onStart();
69
71
  }
70
72
  }, []);
73
+ const closeButtonProps = Object.assign({}, (_defaultProactiveChat = defaultProactiveChatPaneProps.controlProps) === null || _defaultProactiveChat === void 0 ? void 0 : _defaultProactiveChat.closeButtonProps, (_props$controlProps6 = props.controlProps) === null || _props$controlProps6 === void 0 ? void 0 : _props$controlProps6.closeButtonProps);
71
74
  const containerStyles = {
72
75
  root: Object.assign({}, defaultProactiveChatPaneGeneralStyles, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps)
73
76
  };
@@ -83,71 +86,67 @@ function ProactiveChatPane(props) {
83
86
  const subtitleStyles = {
84
87
  root: Object.assign({}, defaultProactiveChatPaneSubtitleStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.subtitleStyleProps)
85
88
  };
86
- const closeButtonStyles = {
87
- root: Object.assign({}, defaultProactiveChatPaneCloseButtonStyles, (_props$styleProps6 = props.styleProps) === null || _props$styleProps6 === void 0 ? void 0 : _props$styleProps6.closeButtonStyleProps),
88
- rootHovered: Object.assign({}, defaultProactiveChatPaneCloseButtonHoveredStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.closeButtonHoveredStyleProps),
89
- rootPressed: Object.assign({}, defaultProactiveChatPaneCloseButtonHoveredStyles, (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : _props$styleProps8.closeButtonHoveredStyleProps)
90
- };
89
+ const closeButtonStyles = Object.assign({}, (_defaultProactiveChat2 = defaultProactiveChatPaneProps.styleProps) === null || _defaultProactiveChat2 === void 0 ? void 0 : _defaultProactiveChat2.closeButtonStyleProps, (_props$styleProps6 = props.styleProps) === null || _props$styleProps6 === void 0 ? void 0 : _props$styleProps6.closeButtonStyleProps);
90
+ const closeButtonHoverStyles = Object.assign({}, (_defaultProactiveChat3 = defaultProactiveChatPaneProps.styleProps) === null || _defaultProactiveChat3 === void 0 ? void 0 : _defaultProactiveChat3.closeButtonHoveredStyleProps, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.closeButtonHoveredStyleProps);
91
91
  const bodyContainerStyles = {
92
- root: Object.assign({}, defaultProactiveChatPaneBodyContainerStyles, (_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 ? void 0 : _props$styleProps9.bodyContainerStyleProps)
92
+ root: Object.assign({}, defaultProactiveChatPaneBodyContainerStyles, (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : _props$styleProps8.bodyContainerStyleProps)
93
93
  };
94
94
  const bodyTitleStyles = {
95
- root: Object.assign({}, defaultProactiveChatPaneBodyTitleStyles, (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.bodyTitleStyleProps)
95
+ root: Object.assign({}, defaultProactiveChatPaneBodyTitleStyles, (_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 ? void 0 : _props$styleProps9.bodyTitleStyleProps)
96
96
  };
97
97
  const startButtonStyles = {
98
- root: Object.assign({}, defaultProactiveChatPaneStartButtonStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.startButtonStyleProps),
99
- rootHovered: Object.assign({}, defaultProactiveChatPaneStartButtonHoveredStyles, (_props$styleProps12 = props.styleProps) === null || _props$styleProps12 === void 0 ? void 0 : _props$styleProps12.startButtonHoveredStyleProps),
100
- rootPressed: Object.assign({}, defaultProactiveChatPaneStartButtonHoveredStyles, (_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : _props$styleProps13.startButtonHoveredStyleProps)
98
+ root: Object.assign({}, defaultProactiveChatPaneStartButtonStyles, (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.startButtonStyleProps),
99
+ rootHovered: Object.assign({}, defaultProactiveChatPaneStartButtonHoveredStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.startButtonHoveredStyleProps),
100
+ rootPressed: Object.assign({}, defaultProactiveChatPaneStartButtonHoveredStyles, (_props$styleProps12 = props.styleProps) === null || _props$styleProps12 === void 0 ? void 0 : _props$styleProps12.startButtonHoveredStyleProps)
101
101
  };
102
- return /*#__PURE__*/React.createElement(React.Fragment, null, !((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.hideProactiveChatPane) && /*#__PURE__*/React.createElement(Stack, {
103
- 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.containerClassName,
102
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !((_props$controlProps7 = props.controlProps) !== null && _props$controlProps7 !== void 0 && _props$controlProps7.hideProactiveChatPane) && /*#__PURE__*/React.createElement(Stack, {
103
+ 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,
104
104
  id: elementId,
105
105
  tabIndex: -1,
106
106
  onKeyDown: handleEscKeyDown,
107
- dir: ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.dir) || defaultProactiveChatPaneControlProps.dir,
108
- "aria-label": ((_props$controlProps8 = props.controlProps) === null || _props$controlProps8 === void 0 ? void 0 : _props$controlProps8.proactiveChatPaneAriaLabel) || defaultProactiveChatPaneControlProps.proactiveChatPaneAriaLabel,
107
+ dir: ((_props$controlProps8 = props.controlProps) === null || _props$controlProps8 === void 0 ? void 0 : _props$controlProps8.dir) || defaultProactiveChatPaneControlProps.dir,
108
+ "aria-label": ((_props$controlProps9 = props.controlProps) === null || _props$controlProps9 === void 0 ? void 0 : _props$controlProps9.proactiveChatPaneAriaLabel) || defaultProactiveChatPaneControlProps.proactiveChatPaneAriaLabel,
109
109
  styles: containerStyles
110
110
  }, /*#__PURE__*/React.createElement(Stack, {
111
111
  horizontal: true,
112
- 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.headerContainerClassName,
112
+ 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,
113
113
  styles: headerContainerStyles,
114
114
  tabIndex: -1,
115
115
  id: elementId + "-headercontainer"
116
116
  }, /*#__PURE__*/React.createElement(Stack, {
117
- 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.textContainerClassName,
117
+ 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,
118
118
  styles: textContainerStyles,
119
119
  tabIndex: -1,
120
120
  id: elementId + "-textcontainer"
121
- }, !((_props$controlProps9 = props.controlProps) !== null && _props$controlProps9 !== void 0 && _props$controlProps9.hideTitle) && (decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.title) || /*#__PURE__*/React.createElement(Label, {
122
- 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.titleClassName,
121
+ }, !((_props$controlProps10 = props.controlProps) !== null && _props$controlProps10 !== void 0 && _props$controlProps10.hideTitle) && (decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.title) || /*#__PURE__*/React.createElement(Label, {
122
+ 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,
123
123
  styles: titleStyles,
124
124
  tabIndex: -1,
125
125
  id: elementId + "-title"
126
- }, ((_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.titleText) || defaultProactiveChatPaneControlProps.titleText)), !((_props$controlProps11 = props.controlProps) !== null && _props$controlProps11 !== void 0 && _props$controlProps11.hideSubtitle) && (decodeComponentString((_props$componentOverr2 = props.componentOverrides) === null || _props$componentOverr2 === void 0 ? void 0 : _props$componentOverr2.subtitle) || /*#__PURE__*/React.createElement(Label, {
127
- 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.subtitleClassName,
126
+ }, ((_props$controlProps11 = props.controlProps) === null || _props$controlProps11 === void 0 ? void 0 : _props$controlProps11.titleText) || defaultProactiveChatPaneControlProps.titleText)), !((_props$controlProps12 = props.controlProps) !== null && _props$controlProps12 !== void 0 && _props$controlProps12.hideSubtitle) && (decodeComponentString((_props$componentOverr2 = props.componentOverrides) === null || _props$componentOverr2 === void 0 ? void 0 : _props$componentOverr2.subtitle) || /*#__PURE__*/React.createElement(Label, {
127
+ 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,
128
128
  styles: subtitleStyles,
129
129
  tabIndex: -1,
130
130
  id: elementId + "-subtitle"
131
- }, ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.subtitleText) || defaultProactiveChatPaneControlProps.subtitleText))), !((_props$controlProps13 = props.controlProps) !== null && _props$controlProps13 !== void 0 && _props$controlProps13.hideCloseButton) && (decodeComponentString((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.closeButton) || /*#__PURE__*/React.createElement(IconButton, {
132
- 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.closeButtonClassName,
133
- styles: closeButtonStyles,
134
- tabIndex: 0,
131
+ }, ((_props$controlProps13 = props.controlProps) === null || _props$controlProps13 === void 0 ? void 0 : _props$controlProps13.subtitleText) || defaultProactiveChatPaneControlProps.subtitleText))), !((_props$controlProps14 = props.controlProps) !== null && _props$controlProps14 !== void 0 && _props$controlProps14.hideCloseButton) && (decodeComponentString((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.closeButton) || /*#__PURE__*/React.createElement(CloseButton, _extends({}, closeButtonProps, {
132
+ 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,
135
133
  onClick: handleCloseClick,
136
- id: elementId + "-closebutton",
137
- "aria-label": ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.closeButtonAriaLabel) || defaultProactiveChatPaneControlProps.closeButtonAriaLabel
138
- }))), /*#__PURE__*/React.createElement(Stack, {
134
+ styles: closeButtonStyles,
135
+ hoverStyles: closeButtonHoverStyles,
136
+ id: elementId + "-closebutton"
137
+ })))), /*#__PURE__*/React.createElement(Stack, {
139
138
  horizontal: ((_props$controlProps15 = props.controlProps) === null || _props$controlProps15 === void 0 ? void 0 : _props$controlProps15.isBodyContainerHorizantal) || defaultProactiveChatPaneControlProps.isBodyContainerHorizantal,
140
- 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.bodyContainerClassName,
139
+ 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,
141
140
  styles: bodyContainerStyles,
142
141
  tabIndex: -1,
143
142
  id: elementId + "-bodycontainer"
144
143
  }, !((_props$controlProps16 = props.controlProps) !== null && _props$controlProps16 !== void 0 && _props$controlProps16.hideBodyTitle) && (decodeComponentString((_props$componentOverr4 = props.componentOverrides) === null || _props$componentOverr4 === void 0 ? void 0 : _props$componentOverr4.bodyTitle) || /*#__PURE__*/React.createElement(Label, {
145
- 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.bodyTitleClassName,
144
+ 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,
146
145
  styles: bodyTitleStyles,
147
146
  tabIndex: -1,
148
147
  id: elementId + "-bodytitle"
149
148
  }, ((_props$controlProps17 = props.controlProps) === null || _props$controlProps17 === void 0 ? void 0 : _props$controlProps17.bodyTitleText) || defaultProactiveChatPaneControlProps.bodyTitleText)), !((_props$controlProps18 = props.controlProps) !== null && _props$controlProps18 !== void 0 && _props$controlProps18.hideStartButton) && (decodeComponentString((_props$componentOverr5 = props.componentOverrides) === null || _props$componentOverr5 === void 0 ? void 0 : _props$componentOverr5.startButton) || /*#__PURE__*/React.createElement(DefaultButton, {
150
- className: (_props$styleProps22 = props.styleProps) === null || _props$styleProps22 === void 0 ? void 0 : (_props$styleProps22$c = _props$styleProps22.classNames) === null || _props$styleProps22$c === void 0 ? void 0 : _props$styleProps22$c.startButtonClassName,
149
+ 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,
151
150
  styles: startButtonStyles,
152
151
  tabIndex: 0,
153
152
  text: ((_props$controlProps19 = props.controlProps) === null || _props$controlProps19 === void 0 ? void 0 : _props$controlProps19.startButtonText) || defaultProactiveChatPaneControlProps.startButtonText,
@@ -8,7 +8,11 @@ export const defaultProactiveChatPaneControlProps = {
8
8
  hideSubtitle: false,
9
9
  subtitleText: "Live chat support!",
10
10
  hideCloseButton: false,
11
- closeButtonAriaLabel: "Close Button",
11
+ closeButtonProps: {
12
+ type: "icon",
13
+ iconName: "ChromeClose",
14
+ hideButtonTitle: true
15
+ },
12
16
  isBodyContainerHorizantal: false,
13
17
  hideBodyTitle: false,
14
18
  bodyTitleText: "Hi! Have any questions? I am here to help.",
@@ -1,13 +1,4 @@
1
- import { CloseChatButtonIconBase64 } from "../../../../../assets/Icons";
2
1
  export const defaultProactiveChatPaneCloseButtonStyles = {
3
- backgroundImage: `url(${CloseChatButtonIconBase64})`,
4
- backgroundPosition: "center",
5
- backgroundRepeat: "no-repeat",
6
- color: "#605e5c",
7
- cursor: "pointer",
8
- height: "14px",
9
- lineHeight: "14px",
10
- textAlign: "center",
11
- width: "14px",
12
- zIndex: "inherit"
2
+ color: "white",
3
+ fontSize: "12px"
13
4
  };
@@ -8,7 +8,11 @@ export const presetOneProactiveChatPaneControlProps = {
8
8
  hideSubtitle: false,
9
9
  subtitleText: "Live chat support!",
10
10
  hideCloseButton: false,
11
- closeButtonAriaLabel: "Close Button",
11
+ closeButtonProps: {
12
+ type: "icon",
13
+ iconName: "ChromeClose",
14
+ hideButtonTitle: true
15
+ },
12
16
  isBodyContainerHorizantal: true,
13
17
  hideBodyTitle: false,
14
18
  bodyTitleText: "Hi! Have any questions? I am here to help.",
@@ -8,7 +8,11 @@ export const presetThreeProactiveChatPaneControlProps = {
8
8
  hideSubtitle: false,
9
9
  subtitleText: "Live chat support!",
10
10
  hideCloseButton: false,
11
- closeButtonAriaLabel: "Close Button",
11
+ closeButtonProps: {
12
+ type: "icon",
13
+ iconName: "ChromeClose",
14
+ hideButtonTitle: true
15
+ },
12
16
  isBodyContainerHorizantal: false,
13
17
  hideBodyTitle: false,
14
18
  bodyTitleText: "Hi! Have any questions? I am here to help.",
@@ -35,7 +35,11 @@ export const BroadcastServiceInitialize = channelName => {
35
35
  export const BroadcastService = {
36
36
  //broadcast a message
37
37
  postMessage: message => {
38
- pubChannel.postMessage(message);
38
+ /**
39
+ * Omit copying methods to prevent 'DataCloneError' in older browsers when passing an object with functions
40
+ * This exception occurs when an object can't be clone with the 'structured clone algorithm' (used by postMessage)
41
+ */
42
+ pubChannel.postMessage(JSON.parse(JSON.stringify(message)));
39
43
  },
40
44
  getMessage: message => {
41
45
  return newMessage.pipe(filter(msg => msg.elementId == message.elementId && msg.elementType == message.elementType && msg.eventName == message.eventName));
@@ -19,7 +19,7 @@ export declare const Regex: {
19
19
  };
20
20
  export declare enum ElementType {
21
21
  ChatButton = "ChatButton",
22
- HeaderCloseButton = "HeaderCloseButton",
22
+ CloseButton = "CloseButton",
23
23
  HeaderMinimizeButton = "HeaderMinimizeButton",
24
24
  FooterDownloadTranscriptButton = "FooterDownloadTranscriptButton",
25
25
  FooterEmailTranscriptButton = "FooterEmailTranscriptButton",
@@ -14,4 +14,5 @@ export interface ICommandButtonControlProps {
14
14
  onClick?: () => void;
15
15
  className?: string;
16
16
  disabled?: boolean;
17
+ hideButtonTitle?: boolean;
17
18
  }
@@ -18,4 +18,5 @@ export interface ICommandButtonProps {
18
18
  className?: string;
19
19
  disabled?: boolean;
20
20
  customEvent?: ICustomEvent;
21
+ hideButtonTitle?: boolean;
21
22
  }
@@ -1,3 +1,3 @@
1
- import { ICommandButtonProps } from "../../common/interfaces/ICommandButtonProps";
1
+ import { ICommandButtonProps } from "../interfaces/ICommandButtonProps";
2
2
  declare function CloseButton(props: ICommandButtonProps): JSX.Element;
3
3
  export default CloseButton;
@@ -1,3 +1,4 @@
1
+ import { ICommandButtonControlProps } from "../../common/interfaces/ICommandButtonControlProps";
1
2
  export interface IProactiveChatPaneControlProps {
2
3
  id?: string;
3
4
  dir?: "ltr" | "rtl" | "auto";
@@ -8,7 +9,7 @@ export interface IProactiveChatPaneControlProps {
8
9
  hideSubtitle?: boolean;
9
10
  subtitleText?: string;
10
11
  hideCloseButton?: boolean;
11
- closeButtonAriaLabel?: string;
12
+ closeButtonProps?: ICommandButtonControlProps;
12
13
  isBodyContainerHorizantal?: boolean;
13
14
  hideBodyTitle?: boolean;
14
15
  bodyTitleText?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-components",
3
- "version": "0.1.0-main.5a87386",
3
+ "version": "0.1.0-main.600e05c",
4
4
  "description": "Microsoft Omnichannel Chat Components",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",