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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (109) hide show
  1. package/lib/cjs/common/Constants.js +11 -6
  2. package/lib/cjs/common/utils.js +21 -2
  3. package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +1 -1
  4. package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +15 -2
  5. package/lib/cjs/components/chatbutton/ChatButton.js +27 -23
  6. package/lib/cjs/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +5 -2
  7. package/lib/cjs/components/chatbutton/common/defaultStyles/defaultChatButtonSubTitleStyles.js +3 -1
  8. package/lib/cjs/components/chatbutton/common/defaultStyles/defaultChatButtonTitleStyles.js +1 -0
  9. package/lib/cjs/components/common/commandbutton/CommandButton.js +34 -9
  10. package/lib/cjs/components/{header → common}/subcomponents/CloseButton.js +4 -3
  11. package/lib/cjs/components/confirmationpane/ConfirmationPane.js +7 -0
  12. package/lib/cjs/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneButtonGroupStyles.js +5 -1
  13. package/lib/cjs/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneGeneralStyles.js +7 -4
  14. package/lib/cjs/components/footer/Footer.js +2 -2
  15. package/lib/cjs/components/footer/common/defaultProps/defaultFooterControlProps.js +1 -0
  16. package/lib/cjs/components/footer/common/defaultStyles/defaultFooterStyleProps.js +12 -6
  17. package/lib/cjs/components/footer/subcomponents/AudioNotificationButton.js +29 -12
  18. package/lib/cjs/components/header/Header.js +2 -2
  19. package/lib/cjs/components/inputvalidationpane/InputValidationPane.js +28 -28
  20. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -1
  21. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneGeneralStyles.js +1 -1
  22. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneInvalidInputErrorMessageStyles.js +1 -1
  23. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneSendButtonStyles.js +2 -1
  24. package/lib/cjs/components/loadingpane/LoadingPane.js +2 -1
  25. package/lib/cjs/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +3 -2
  26. package/lib/cjs/components/outofofficehourspane/OOOHPane.js +13 -6
  27. package/lib/cjs/components/outofofficehourspane/common/defaultProps/defaultOOOHPaneControlProps.js +3 -1
  28. package/lib/cjs/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.js +15 -0
  29. package/lib/cjs/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneProps.js +16 -0
  30. package/lib/cjs/components/postchatsurveypane/PostChatSurveyPane.js +2 -1
  31. package/lib/cjs/components/prechatsurveypane/PreChatSurveyPane.js +23 -9
  32. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultPreChatSurveyPaneControlProps.js +1 -0
  33. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +4 -1
  34. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.js +10 -0
  35. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneStyles.js +7 -1
  36. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.js +10 -0
  37. package/lib/cjs/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.js +1 -0
  38. package/lib/cjs/components/proactivechatpane/ProactiveChatPane.js +36 -35
  39. package/lib/cjs/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +5 -1
  40. package/lib/cjs/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -13
  41. package/lib/cjs/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +5 -1
  42. package/lib/cjs/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +5 -1
  43. package/lib/cjs/index.js +6 -0
  44. package/lib/cjs/services/BroadcastService.js +36 -8
  45. package/lib/esm/common/Constants.js +9 -4
  46. package/lib/esm/common/utils.js +16 -0
  47. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +1 -1
  48. package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +15 -2
  49. package/lib/esm/components/chatbutton/ChatButton.js +27 -23
  50. package/lib/esm/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +5 -2
  51. package/lib/esm/components/chatbutton/common/defaultStyles/defaultChatButtonSubTitleStyles.js +3 -1
  52. package/lib/esm/components/chatbutton/common/defaultStyles/defaultChatButtonTitleStyles.js +1 -0
  53. package/lib/esm/components/common/commandbutton/CommandButton.js +34 -9
  54. package/lib/esm/components/{header → common}/subcomponents/CloseButton.js +4 -3
  55. package/lib/esm/components/confirmationpane/ConfirmationPane.js +8 -1
  56. package/lib/esm/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneButtonGroupStyles.js +5 -1
  57. package/lib/esm/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneGeneralStyles.js +7 -4
  58. package/lib/esm/components/footer/Footer.js +2 -2
  59. package/lib/esm/components/footer/common/defaultProps/defaultFooterControlProps.js +1 -0
  60. package/lib/esm/components/footer/common/defaultStyles/defaultFooterStyleProps.js +12 -6
  61. package/lib/esm/components/footer/subcomponents/AudioNotificationButton.js +29 -12
  62. package/lib/esm/components/header/Header.js +2 -2
  63. package/lib/esm/components/inputvalidationpane/InputValidationPane.js +29 -29
  64. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -1
  65. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneGeneralStyles.js +1 -1
  66. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneInvalidInputErrorMessageStyles.js +1 -1
  67. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneSendButtonStyles.js +2 -1
  68. package/lib/esm/components/loadingpane/LoadingPane.js +2 -1
  69. package/lib/esm/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +3 -2
  70. package/lib/esm/components/outofofficehourspane/OOOHPane.js +13 -7
  71. package/lib/esm/components/outofofficehourspane/common/defaultProps/defaultOOOHPaneControlProps.js +3 -1
  72. package/lib/esm/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.js +6 -0
  73. package/lib/esm/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneProps.js +6 -0
  74. package/lib/esm/components/postchatsurveypane/PostChatSurveyPane.js +2 -1
  75. package/lib/esm/components/prechatsurveypane/PreChatSurveyPane.js +23 -9
  76. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultPreChatSurveyPaneControlProps.js +1 -0
  77. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +4 -1
  78. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.js +3 -0
  79. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneStyles.js +5 -1
  80. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.js +3 -0
  81. package/lib/esm/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.js +1 -0
  82. package/lib/esm/components/proactivechatpane/ProactiveChatPane.js +33 -34
  83. package/lib/esm/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +5 -1
  84. package/lib/esm/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -11
  85. package/lib/esm/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +5 -1
  86. package/lib/esm/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +5 -1
  87. package/lib/esm/index.js +1 -0
  88. package/lib/esm/services/BroadcastService.js +34 -8
  89. package/lib/types/common/Constants.d.ts +3 -2
  90. package/lib/types/common/utils.d.ts +1 -0
  91. package/lib/types/components/chatbutton/interfaces/IChatButtonControlProps.d.ts +3 -0
  92. package/lib/types/components/common/interfaces/ICommandButtonControlProps.d.ts +1 -0
  93. package/lib/types/components/common/interfaces/ICommandButtonProps.d.ts +1 -0
  94. package/lib/types/components/{header → common}/subcomponents/CloseButton.d.ts +1 -1
  95. package/lib/types/components/confirmationpane/interfaces/IConfirmationPaneControlProps.d.ts +0 -1
  96. package/lib/types/components/inputvalidationpane/interfaces/IInputValidationPaneControlProps.d.ts +0 -1
  97. package/lib/types/components/loadingpane/interfaces/ILoadingPaneProps.d.ts +2 -0
  98. package/lib/types/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.d.ts +2 -0
  99. package/lib/types/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneProps.d.ts +2 -0
  100. package/lib/types/components/outofofficehourspane/interfaces/IOOOHPaneControlProps.d.ts +1 -0
  101. package/lib/types/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.d.ts +2 -0
  102. package/lib/types/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.d.ts +2 -0
  103. package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneButtonStyles.d.ts +3 -0
  104. package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.d.ts +5 -0
  105. package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneStyleProps.d.ts +5 -0
  106. package/lib/types/components/proactivechatpane/interfaces/IProactiveChatPaneControlProps.d.ts +2 -1
  107. package/lib/types/index.d.ts +1 -0
  108. package/lib/types/services/BroadcastService.d.ts +1 -0
  109. package/package.json +2 -2
@@ -4,17 +4,42 @@ import { BroadcastService } from "../../../services/BroadcastService";
4
4
  import { ElementType } from "../../../common/Constants";
5
5
 
6
6
  function CommandButton(props) {
7
+ var _props$hoverStyles, _props$hoverStyles2, _props$focusStyles;
8
+
7
9
  //imageIconProps > iconName
8
10
  const iconProp = props.imageIconProps ? {
9
11
  imageProps: props.imageIconProps
10
12
  } : {
11
- iconName: props.iconName,
12
- styles: {
13
- root: props.styles
14
- }
13
+ iconName: props.iconName
15
14
  };
16
- const iconButtonStyles = {
17
- root: props.styles,
15
+ let iconStyles = {};
16
+
17
+ if (props.type === "icon") {
18
+ var _props$styles;
19
+
20
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
21
+ iconStyles = { ...(props === null || props === void 0 ? void 0 : (_props$styles = props.styles) === null || _props$styles === void 0 ? void 0 : _props$styles.icon)
22
+ };
23
+ }
24
+
25
+ const buttonStyles = {
26
+ icon: { ...iconStyles
27
+ },
28
+ root: {
29
+ selectors: {
30
+ ":hover .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
31
+ ...(props === null || props === void 0 ? void 0 : (_props$hoverStyles = props.hoverStyles) === null || _props$hoverStyles === void 0 ? void 0 : _props$hoverStyles.icon)
32
+ },
33
+ ":active .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
+ ...(props === null || props === void 0 ? void 0 : (_props$hoverStyles2 = props.hoverStyles) === null || _props$hoverStyles2 === void 0 ? void 0 : _props$hoverStyles2.icon)
35
+ },
36
+ ":focus .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
37
+ ...(props === null || props === void 0 ? void 0 : (_props$focusStyles = props.focusStyles) === null || _props$focusStyles === void 0 ? void 0 : _props$focusStyles.icon)
38
+ }
39
+ },
40
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
41
+ ...(props === null || props === void 0 ? void 0 : props.styles)
42
+ },
18
43
  rootHovered: props.hoverStyles,
19
44
  rootFocused: props.focusStyles,
20
45
  rootPressed: props.hoverStyles
@@ -37,14 +62,14 @@ function CommandButton(props) {
37
62
  onClick: handleOnClick,
38
63
  disabled: props.disabled,
39
64
  className: props.className,
40
- styles: iconButtonStyles
65
+ styles: buttonStyles
41
66
  }), props.type === "icon" && /*#__PURE__*/React.createElement(IconButton, {
42
67
  id: props.id,
43
68
  iconProps: iconProp,
44
- title: props.ariaLabel,
69
+ title: props.hideButtonTitle ? undefined : props.ariaLabel,
45
70
  ariaLabel: props.ariaLabel,
46
71
  disabled: props.disabled,
47
- styles: iconButtonStyles,
72
+ styles: buttonStyles,
48
73
  onClick: handleOnClick,
49
74
  className: props.className
50
75
  }));
@@ -1,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
 
@@ -2,7 +2,7 @@ import { DefaultButton, PrimaryButton } from "@fluentui/react/lib/Button";
2
2
  import { Label, Stack } from "@fluentui/react";
3
3
  import React, { useCallback } from "react";
4
4
  import { BroadcastService } from "../../services/BroadcastService";
5
- import { ElementType } from "../../common/Constants";
5
+ import { ElementType, KeyCodes } from "../../common/Constants";
6
6
  import { decodeComponentString } from "../../common/decodeComponentString";
7
7
  import { defaultConfirmationPaneButtonGroupStyles } from "./common/defaultStyles/defaultConfirmationPaneButtonGroupStyles";
8
8
  import { defaultConfirmationPaneCancelButtonHoveredStyles } from "./common/defaultStyles/defaultConfirmationPaneCancelButtonHoveredStyles";
@@ -49,6 +49,12 @@ function ConfirmationPane(props) {
49
49
  BroadcastService.postMessage(customEvent);
50
50
  (_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.onCancel();
51
51
  }
52
+ }, []); // eslint-disable-next-line @typescript-eslint/no-explicit-any
53
+
54
+ const handleEscKeyDown = useCallback(e => {
55
+ if (e.code === KeyCodes.ESCAPE) {
56
+ handleCancelClick();
57
+ }
52
58
  }, []);
53
59
  const containerStyles = {
54
60
  root: Object.assign({}, defaultConfirmationPaneGeneralStyles, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps)
@@ -76,6 +82,7 @@ function ConfirmationPane(props) {
76
82
  };
77
83
  return /*#__PURE__*/React.createElement(React.Fragment, null, !((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.hideConfirmationPane) && /*#__PURE__*/React.createElement(Stack, {
78
84
  id: elementId,
85
+ onKeyDown: handleEscKeyDown,
79
86
  tabIndex: -1,
80
87
  dir: ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.dir) || defaultConfirmationPaneControlProps.dir,
81
88
  styles: containerStyles,
@@ -1,7 +1,11 @@
1
1
  export const defaultConfirmationPaneButtonGroupStyles = {
2
2
  display: "flex",
3
+ width: "auto",
4
+ height: "auto",
5
+ boxSizing: "border-box",
3
6
  flexFlow: "row",
4
7
  justifyContent: "center",
5
8
  alignItems: "center",
6
- gap: "10px"
9
+ gap: "10px",
10
+ marginBottom: "10px"
7
11
  };
@@ -1,16 +1,19 @@
1
1
  export const defaultConfirmationPaneGeneralStyles = {
2
+ display: "flex",
3
+ minHeight: "160px",
4
+ maxHeight: "300px",
5
+ boxSizing: "border-box",
2
6
  backgroundColor: "white",
3
7
  borderRadius: "2px",
4
8
  color: "black",
5
9
  fontFamily: "Segoe UI, Arial, sans-serif",
6
10
  fontSize: "14px",
7
- height: "160px",
8
11
  padding: "10px 20px",
9
- width: "262px",
10
12
  position: "absolute",
11
13
  justifyContent: "center",
12
14
  alignItems: "center",
13
- display: "flex",
14
15
  flexFlow: "column",
15
- zIndex: "9999"
16
+ zIndex: "9999",
17
+ left: "26px",
18
+ right: "26px"
16
19
  };
@@ -1,4 +1,4 @@
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 { Stack, initializeIcons } from "@fluentui/react";
@@ -66,7 +66,7 @@ function Footer(props) {
66
66
  verticalAlign: "start"
67
67
  }, /*#__PURE__*/React.createElement(Stack, {
68
68
  horizontal: true,
69
- verticalAlign: "start"
69
+ verticalAlign: "center"
70
70
  }, processCustomComponents((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : (_props$controlProps15 = _props$controlProps14.rightGroup) === null || _props$controlProps15 === void 0 ? void 0 : _props$controlProps15.children), !((_props$controlProps16 = props.controlProps) !== null && _props$controlProps16 !== void 0 && _props$controlProps16.hideAudioNotificationButton) && (decodeComponentString((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.AudioNotificationButton) || /*#__PURE__*/React.createElement(AudioNotificationButton, _extends({}, audioNotificationButtonProps, {
71
71
  onClick: (_props$controlProps17 = props.controlProps) === null || _props$controlProps17 === void 0 ? void 0 : _props$controlProps17.onAudioNotificationClick,
72
72
  styles: audioNotificationButtonStyles,
@@ -35,6 +35,7 @@ export const defaultFooterControlProps = {
35
35
  },
36
36
  audioNotificationButtonProps: {
37
37
  id: "oc-lcw-footer-audionotification-button",
38
+ type: "icon",
38
39
  ariaLabel: "Turn sound off",
39
40
  toggleAriaLabel: "Turn sound on",
40
41
  iconName: "Volume3",
@@ -8,8 +8,10 @@ export const defaultFooterStyleProps = {
8
8
  padding: "0 10px 5px 10px"
9
9
  },
10
10
  downloadTranscriptButtonStyleProps: {
11
- color: "blue",
12
- fontSize: 16,
11
+ icon: {
12
+ color: "blue",
13
+ fontSize: 16
14
+ },
13
15
  height: "25px",
14
16
  lineHeight: "25px",
15
17
  width: "25px"
@@ -19,8 +21,10 @@ export const defaultFooterStyleProps = {
19
21
  backgroundColor: "#C8C8C8"
20
22
  },
21
23
  emailTranscriptButtonStyleProps: {
22
- color: "blue",
23
- fontSize: 16,
24
+ icon: {
25
+ color: "blue",
26
+ fontSize: 16
27
+ },
24
28
  height: "25px",
25
29
  lineHeight: "25px",
26
30
  width: "25px"
@@ -30,8 +34,10 @@ export const defaultFooterStyleProps = {
30
34
  backgroundColor: "#C8C8C8"
31
35
  },
32
36
  audioNotificationButtonStyleProps: {
33
- color: "blue",
34
- fontSize: 16,
37
+ icon: {
38
+ color: "blue",
39
+ fontSize: 16
40
+ },
35
41
  height: "25px",
36
42
  lineHeight: "25px",
37
43
  width: "25px"
@@ -8,28 +8,45 @@ function AudioNotificationButton(props) {
8
8
  disabled
9
9
  } = props;
10
10
  const [muted, setMuted] = useState(props.isAudioMuted);
11
+ let iconStyles = {};
12
+
13
+ if (props.type === "icon") {
14
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
15
+ iconStyles = { ...(props === null || props === void 0 ? void 0 : props.styles).icon
16
+ };
17
+ }
18
+
11
19
  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
20
+ icon: iconStyles,
21
+ root: {
22
+ selectors: {
23
+ ":hover .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
24
+ ...(props === null || props === void 0 ? void 0 : props.hoverStyles).icon
25
+ },
26
+ ":active .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
27
+ ...(props === null || props === void 0 ? void 0 : props.hoverStyles).icon
28
+ },
29
+ ":focus .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
30
+ ...(props === null || props === void 0 ? void 0 : props.focusStyles).icon
31
+ }
32
+ },
33
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
34
+ ...(props === null || props === void 0 ? void 0 : props.styles)
35
+ },
36
+ rootHovered: props.hoverStyles,
37
+ rootFocused: props.focusStyles,
38
+ rootPressed: props.hoverStyles
16
39
  }; //imageIconProps > iconName
17
40
 
18
41
  const volume0Icon = props.imageToggleIconProps ? {
19
42
  imageProps: props === null || props === void 0 ? void 0 : props.imageToggleIconProps
20
43
  } : {
21
- iconName: (props === null || props === void 0 ? void 0 : props.toggleIconName) ?? "Volume0",
22
- styles: {
23
- root: props.styles
24
- }
44
+ iconName: (props === null || props === void 0 ? void 0 : props.toggleIconName) ?? "Volume0"
25
45
  };
26
46
  const volume3Icon = props.imageIconProps ? {
27
47
  imageProps: props === null || props === void 0 ? void 0 : props.imageIconProps
28
48
  } : {
29
- iconName: (props === null || props === void 0 ? void 0 : props.iconName) ?? "Volume3",
30
- styles: {
31
- root: props.styles
32
- }
49
+ iconName: (props === null || props === void 0 ? void 0 : props.iconName) ?? "Volume3"
33
50
  };
34
51
  const handleOnClick = useCallback(() => {
35
52
  setMuted(!muted);
@@ -1,8 +1,8 @@
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 { 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,6 +1,6 @@
1
1
  import { DefaultButton, PrimaryButton } from "@fluentui/react/lib/Button";
2
2
  import { Label, Stack, TextField } from "@fluentui/react";
3
- import React, { useEffect, useState } from "react";
3
+ import React, { useCallback, useEffect, useState } from "react";
4
4
  import { BroadcastService } from "../../services/BroadcastService";
5
5
  import { KeyCodes } from "../../common/Constants";
6
6
  import { decodeComponentString } from "../../common/decodeComponentString";
@@ -26,23 +26,28 @@ function InputValidationPane(props) {
26
26
  const [isInitialRendering, setIsInitialRendering] = useState(true);
27
27
  const [isInvalidInput, setIsInvalidInput] = useState(false);
28
28
  const [isSendButtonEnabled, setIsSendButtonEnabled] = useState(false);
29
-
30
- const isValidInput = () => {
29
+ const isValidInput = useCallback(() => {
31
30
  var _props$controlProps2, _props$controlProps3;
32
31
 
33
- return (_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.checkInput ? inputValue && ((_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.checkInput(inputValue)) : true;
34
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
32
+ if (!((_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.checkInput)) {
33
+ return true;
34
+ }
35
+
36
+ if (!inputValue) {
37
+ return false;
38
+ }
35
39
 
40
+ return (_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.checkInput(inputValue);
41
+ }, [inputValue]); // eslint-disable-next-line @typescript-eslint/no-explicit-any
36
42
 
37
- const handleInputChange = e => {
43
+ const handleInputChange = useCallback(e => {
38
44
  var _props$controlProps4, _props$controlProps5;
39
45
 
40
46
  setInputValue(e.target.value);
41
47
  e.target.value ? setIsSendButtonEnabled(((_props$controlProps4 = props.controlProps) === null || _props$controlProps4 === void 0 ? void 0 : _props$controlProps4.enableSendButton) || e.target.value !== "") : setIsSendButtonEnabled(((_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.enableSendButton) ?? false);
42
48
  setIsInvalidInput(false);
43
- };
44
-
45
- const send = (controlId, suffix) => {
49
+ }, []);
50
+ const send = useCallback((controlId, suffix) => {
46
51
  var _props$controlProps6;
47
52
 
48
53
  if ((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.onSend) {
@@ -59,20 +64,17 @@ function InputValidationPane(props) {
59
64
  setIsInvalidInput(true);
60
65
  }
61
66
  }
62
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
67
+ }, [inputValue]); // eslint-disable-next-line @typescript-eslint/no-explicit-any
63
68
 
64
-
65
- const handleInputKeyDown = e => {
69
+ const handleInputKeyUp = useCallback(e => {
66
70
  if (e.code === KeyCodes.ENTER) {
67
- send(elementId + "-textField", "KeyDown");
71
+ send(elementId + "-textField", "KeyUp");
68
72
  }
69
- };
70
-
71
- const handleSendClick = () => {
73
+ }, [inputValue]);
74
+ const handleSendClick = useCallback(() => {
72
75
  send(elementId + "-sendbutton", "Click");
73
- };
74
-
75
- const cancel = (controlId, suffix) => {
76
+ }, [inputValue]);
77
+ const cancel = useCallback((controlId, suffix) => {
76
78
  var _props$controlProps8;
77
79
 
78
80
  if ((_props$controlProps8 = props.controlProps) !== null && _props$controlProps8 !== void 0 && _props$controlProps8.onCancel) {
@@ -88,19 +90,16 @@ function InputValidationPane(props) {
88
90
  BroadcastService.postMessage(customEvent);
89
91
  (_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.onCancel();
90
92
  }
91
- }; // eslint-disable-next-line @typescript-eslint/no-explicit-any
92
-
93
+ }, []); // eslint-disable-next-line @typescript-eslint/no-explicit-any
93
94
 
94
- const handleEscKeyDown = e => {
95
+ const handleEscKeyDown = useCallback(e => {
95
96
  if (e.code === KeyCodes.ESCAPE) {
96
97
  cancel(elementId, "KeyDown");
97
98
  }
98
- };
99
-
100
- const handleCancelClick = () => {
99
+ }, []);
100
+ const handleCancelClick = useCallback(() => {
101
101
  cancel(elementId + "-cancelbutton", "Click");
102
- };
103
-
102
+ }, []);
104
103
  useEffect(() => {
105
104
  var _props$controlProps11, _props$controlProps12, _props$controlProps13;
106
105
 
@@ -127,7 +126,8 @@ function InputValidationPane(props) {
127
126
  const redBorderStyles = {
128
127
  borderColor: ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.inputWithErrorMessageBorderColor) ?? defaultInputValidationPaneControlProps.inputWithErrorMessageBorderColor,
129
128
  borderRadius: "1px",
130
- borderStyle: "solid"
129
+ borderStyle: "solid",
130
+ borderWidth: "1px"
131
131
  };
132
132
  const inputStyles = {
133
133
  root: Object.assign({}, defaultInputValidationPaneInputStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.inputStyleProps),
@@ -211,7 +211,7 @@ function InputValidationPane(props) {
211
211
  ariaLabel: ((_props$controlProps24 = props.controlProps) === null || _props$controlProps24 === void 0 ? void 0 : _props$controlProps24.inputAriaLabel) || defaultInputValidationPaneControlProps.inputAriaLabel,
212
212
  borderless: isInvalidInput,
213
213
  onChange: handleInputChange,
214
- onKeyDown: handleInputKeyDown
214
+ onKeyUp: handleInputKeyUp
215
215
  })), isInvalidInput && (decodeComponentString((_props$componentOverr4 = props.componentOverrides) === null || _props$componentOverr4 === void 0 ? void 0 : _props$componentOverr4.invalidInputErrorMessage) || /*#__PURE__*/React.createElement(Stack, {
216
216
  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.invalidInputErrorMessageClassName,
217
217
  styles: invalidInputErrorMessageStyles,
@@ -10,5 +10,6 @@ export const defaultInputValidationPaneCancelButtonStyles = {
10
10
  fontWeight: "500",
11
11
  lineHeight: "19px",
12
12
  textOverflow: "ellipsis",
13
- whiteSpace: "nowrap"
13
+ whiteSpace: "nowrap",
14
+ width: "80px"
14
15
  };
@@ -7,9 +7,9 @@ export const defaultInputValidationPaneGeneralStyles = {
7
7
  borderTopWidth: "1px",
8
8
  bottom: "0",
9
9
  left: "0",
10
- minHeight: "180px",
11
10
  padding: "10px",
12
11
  position: "absolute",
13
12
  width: "100%",
13
+ maxHeight: "100%",
14
14
  zIndex: "9999"
15
15
  };
@@ -2,7 +2,7 @@ export const defaultInputValidationPaneInvalidInputErrorMessageStyles = {
2
2
  color: "#a4262c",
3
3
  fontFamily: "'Segoe UI', Arial, sans-serif",
4
4
  fontSize: "12px",
5
- height: "16px,",
5
+ height: "16px",
6
6
  lineHeight: "16px",
7
7
  marginTop: "4px"
8
8
  };
@@ -6,5 +6,6 @@ export const defaultInputValidationPaneSendButtonStyles = {
6
6
  fontWeight: "500",
7
7
  lineHeight: "19px",
8
8
  textOverflow: "ellipsis",
9
- whiteSpace: "nowrap"
9
+ whiteSpace: "nowrap",
10
+ width: "80px"
10
11
  };
@@ -33,13 +33,14 @@ function LoadingPane(props) {
33
33
  const spinnerTextStyles = {
34
34
  root: Object.assign({}, defaultLoadingPaneSpinnerTextStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.spinnerTextStyleProps)
35
35
  };
36
+ const showInSmallWindow = props.windowHeight ? props.windowHeight > 375 : true;
36
37
  return /*#__PURE__*/React.createElement(React.Fragment, null, !((_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.hideLoadingPane) && /*#__PURE__*/React.createElement(Stack, {
37
38
  id: elementId,
38
39
  tabIndex: -1,
39
40
  styles: containerStyles,
40
41
  role: (_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.role,
41
42
  dir: ((_props$controlProps4 = props.controlProps) === null || _props$controlProps4 === void 0 ? void 0 : _props$controlProps4.dir) ?? defaultLoadingPaneControlProps.dir
42
- }, !((_props$controlProps5 = props.controlProps) !== null && _props$controlProps5 !== void 0 && _props$controlProps5.hideIcon) && (decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.icon) || /*#__PURE__*/React.createElement(Icon, {
43
+ }, !((_props$controlProps5 = props.controlProps) !== null && _props$controlProps5 !== void 0 && _props$controlProps5.hideIcon) && showInSmallWindow && (decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.icon) || /*#__PURE__*/React.createElement(Icon, {
43
44
  className: (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : (_props$styleProps8$cl = _props$styleProps8.classNames) === null || _props$styleProps8$cl === void 0 ? void 0 : _props$styleProps8$cl.iconClassName,
44
45
  styles: iconStyles,
45
46
  imageProps: iconImageProps,
@@ -1,11 +1,12 @@
1
1
  export const defaultLoadingPaneIconStyles = {
2
2
  borderRadius: "50%",
3
3
  backgroundColor: "#F1F1F1",
4
- boxShadow: "0px 0px 0.5px 7px #3F75AB",
4
+ boxShadow: "0px 0px 0.5px 7px rgba(196, 196, 196, 0.15)",
5
5
  width: "86px",
6
6
  height: "86px",
7
7
  margin: "0px 0px 20px 0px",
8
8
  display: "flex",
9
9
  order: 1,
10
- alignSelf: "auto"
10
+ alignSelf: "auto",
11
+ overflow: "visible"
11
12
  };
@@ -1,12 +1,13 @@
1
- import { Label, Stack } from "@fluentui/react";
1
+ import { Stack, Text } from "@fluentui/react";
2
2
  import React from "react";
3
3
  import { decodeComponentString } from "../../common/decodeComponentString";
4
4
  import { defaultOOOHPaneControlProps } from "./common/defaultProps/defaultOOOHPaneControlProps";
5
5
  import { defaultOOOHPaneGeneralStyles } from "./common/defaultProps/defaultStyles/defaultOOOHPaneGeneralStyles";
6
6
  import { defaultOOOHPaneTitleStyles } from "./common/defaultProps/defaultStyles/defaultOOOHPaneTitleStyles";
7
+ import { replaceURLWithAnchor } from "../../common/utils";
7
8
 
8
9
  function OOOHPane(props) {
9
- var _props$controlProps, _props$styleProps, _props$styleProps2, _props$controlProps2, _props$controlProps3, _props$styleProps3, _props$styleProps3$cl, _props$controlProps4, _props$controlProps5, _props$componentOverr, _props$styleProps4, _props$styleProps4$cl, _props$controlProps6;
10
+ var _props$controlProps, _props$styleProps, _props$styleProps2, _props$controlProps2, _props$controlProps3, _props$controlProps4, _props$controlProps5, _props$styleProps3, _props$styleProps3$cl, _props$controlProps6, _props$controlProps7, _props$componentOverr, _props$styleProps4, _props$styleProps4$cl;
10
11
 
11
12
  const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? defaultOOOHPaneControlProps.id;
12
13
  const containerStyles = {
@@ -15,19 +16,24 @@ function OOOHPane(props) {
15
16
  const titleStyles = {
16
17
  root: Object.assign({}, defaultOOOHPaneTitleStyles, (_props$styleProps2 = props.styleProps) === null || _props$styleProps2 === void 0 ? void 0 : _props$styleProps2.titleStyleProps)
17
18
  };
18
- return /*#__PURE__*/React.createElement(React.Fragment, null, !((_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.hideOOOHPane) && /*#__PURE__*/React.createElement(Stack, {
19
+ const displayText = replaceURLWithAnchor(((_props$controlProps2 = props.controlProps) === null || _props$controlProps2 === void 0 ? void 0 : _props$controlProps2.titleText) ?? defaultOOOHPaneControlProps.titleText, ((_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.openLinkInNewTab) ?? defaultOOOHPaneControlProps.openLinkInNewTab) ?? "";
20
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !((_props$controlProps4 = props.controlProps) !== null && _props$controlProps4 !== void 0 && _props$controlProps4.hideOOOHPane) && /*#__PURE__*/React.createElement(Stack, {
19
21
  id: elementId,
20
22
  tabIndex: -1,
21
23
  styles: containerStyles,
22
- role: (_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.role,
24
+ role: ((_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.role) ?? defaultOOOHPaneControlProps.role,
23
25
  className: (_props$styleProps3 = props.styleProps) === null || _props$styleProps3 === void 0 ? void 0 : (_props$styleProps3$cl = _props$styleProps3.classNames) === null || _props$styleProps3$cl === void 0 ? void 0 : _props$styleProps3$cl.containerClassName,
24
- dir: ((_props$controlProps4 = props.controlProps) === null || _props$controlProps4 === void 0 ? void 0 : _props$controlProps4.dir) ?? defaultOOOHPaneControlProps.dir
25
- }, !((_props$controlProps5 = props.controlProps) !== null && _props$controlProps5 !== void 0 && _props$controlProps5.hideTitle) && (decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.title) || /*#__PURE__*/React.createElement(Label, {
26
+ dir: ((_props$controlProps6 = props.controlProps) === null || _props$controlProps6 === void 0 ? void 0 : _props$controlProps6.dir) ?? defaultOOOHPaneControlProps.dir
27
+ }, !((_props$controlProps7 = props.controlProps) !== null && _props$controlProps7 !== void 0 && _props$controlProps7.hideTitle) && (decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.title) || /*#__PURE__*/React.createElement(Text, {
26
28
  className: (_props$styleProps4 = props.styleProps) === null || _props$styleProps4 === void 0 ? void 0 : (_props$styleProps4$cl = _props$styleProps4.classNames) === null || _props$styleProps4$cl === void 0 ? void 0 : _props$styleProps4$cl.titleClassName,
27
29
  styles: titleStyles,
28
30
  tabIndex: -1,
29
31
  id: elementId + "-title"
30
- }, ((_props$controlProps6 = props.controlProps) === null || _props$controlProps6 === void 0 ? void 0 : _props$controlProps6.titleText) ?? defaultOOOHPaneControlProps.titleText))));
32
+ }, /*#__PURE__*/React.createElement("div", {
33
+ dangerouslySetInnerHTML: {
34
+ __html: displayText
35
+ }
36
+ })))));
31
37
  }
32
38
 
33
39
  export default OOOHPane;
@@ -3,5 +3,7 @@ export const defaultOOOHPaneControlProps = {
3
3
  dir: "auto",
4
4
  hideOOOHPane: false,
5
5
  hideTitle: false,
6
- titleText: "Thanks for contacting us. You have reached us outside of our operating hours. An agent will respond when we open."
6
+ role: "alert",
7
+ titleText: "Thanks for contacting us. You have reached us outside of our operating hours. An agent will respond when we open.",
8
+ openLinkInNewTab: false
7
9
  };
@@ -0,0 +1,6 @@
1
+ import { defaultOOOHPaneControlProps } from "../defaultProps/defaultOOOHPaneControlProps";
2
+ export const presetFourOOOHPaneControlProps = { ...defaultOOOHPaneControlProps,
3
+ id: "oc-lcw-outofofficehourspane-preset1",
4
+ titleText: "We are out of office. Please contact us here https://www.microsoft.com for further assisstance",
5
+ openLinkInNewTab: true
6
+ };
@@ -0,0 +1,6 @@
1
+ import { defaultOOOHPaneStyles } from "../defaultProps/defaultStyles/defaultOOOHPaneStyles";
2
+ import { presetFourOOOHPaneControlProps } from "./presetFourOOOHPaneControlProps";
3
+ export const presetFourOOOHPaneProps = {
4
+ controlProps: presetFourOOOHPaneControlProps,
5
+ styleProps: defaultOOOHPaneStyles
6
+ };
@@ -15,7 +15,8 @@ function PostChatSurveyPane(props) {
15
15
  const iframeStyles = {
16
16
  height: "100vh",
17
17
  width: "100%",
18
- display: "block"
18
+ display: "block",
19
+ maxHeight: "100%"
19
20
  };
20
21
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Stack, {
21
22
  id: elementId,