@microsoft/omnichannel-chat-components 0.1.0-main.b59a07c → 0.1.0-main.b66307e

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 (104) hide show
  1. package/lib/cjs/common/Constants.js +2 -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 +23 -22
  6. package/lib/cjs/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +3 -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 +30 -2
  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 +27 -4
  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/defaultInputValidationPaneInvalidInputErrorMessageStyles.js +1 -1
  22. package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneSendButtonStyles.js +2 -1
  23. package/lib/cjs/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +1 -1
  24. package/lib/cjs/components/outofofficehourspane/OOOHPane.js +13 -6
  25. package/lib/cjs/components/outofofficehourspane/common/defaultProps/defaultOOOHPaneControlProps.js +3 -1
  26. package/lib/cjs/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.js +15 -0
  27. package/lib/cjs/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneProps.js +16 -0
  28. package/lib/cjs/components/postchatsurveypane/PostChatSurveyPane.js +2 -1
  29. package/lib/cjs/components/prechatsurveypane/PreChatSurveyPane.js +22 -9
  30. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultPreChatSurveyPaneControlProps.js +1 -0
  31. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +3 -1
  32. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.js +10 -0
  33. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneStyles.js +7 -1
  34. package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.js +10 -0
  35. package/lib/cjs/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.js +1 -0
  36. package/lib/cjs/components/proactivechatpane/ProactiveChatPane.js +36 -35
  37. package/lib/cjs/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +5 -1
  38. package/lib/cjs/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -13
  39. package/lib/cjs/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +5 -1
  40. package/lib/cjs/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +5 -1
  41. package/lib/cjs/index.js +6 -0
  42. package/lib/cjs/services/BroadcastService.js +36 -8
  43. package/lib/esm/common/Constants.js +1 -4
  44. package/lib/esm/common/utils.js +16 -0
  45. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +1 -1
  46. package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +15 -2
  47. package/lib/esm/components/chatbutton/ChatButton.js +22 -21
  48. package/lib/esm/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +3 -2
  49. package/lib/esm/components/chatbutton/common/defaultStyles/defaultChatButtonSubTitleStyles.js +3 -1
  50. package/lib/esm/components/chatbutton/common/defaultStyles/defaultChatButtonTitleStyles.js +1 -0
  51. package/lib/esm/components/common/commandbutton/CommandButton.js +30 -2
  52. package/lib/esm/components/{header → common}/subcomponents/CloseButton.js +4 -3
  53. package/lib/esm/components/confirmationpane/ConfirmationPane.js +8 -1
  54. package/lib/esm/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneButtonGroupStyles.js +5 -1
  55. package/lib/esm/components/confirmationpane/common/defaultStyles/defaultConfirmationPaneGeneralStyles.js +7 -4
  56. package/lib/esm/components/footer/Footer.js +2 -2
  57. package/lib/esm/components/footer/common/defaultProps/defaultFooterControlProps.js +1 -0
  58. package/lib/esm/components/footer/common/defaultStyles/defaultFooterStyleProps.js +12 -6
  59. package/lib/esm/components/footer/subcomponents/AudioNotificationButton.js +27 -4
  60. package/lib/esm/components/header/Header.js +2 -2
  61. package/lib/esm/components/inputvalidationpane/InputValidationPane.js +29 -29
  62. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -1
  63. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneInvalidInputErrorMessageStyles.js +1 -1
  64. package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneSendButtonStyles.js +2 -1
  65. package/lib/esm/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +1 -1
  66. package/lib/esm/components/outofofficehourspane/OOOHPane.js +13 -7
  67. package/lib/esm/components/outofofficehourspane/common/defaultProps/defaultOOOHPaneControlProps.js +3 -1
  68. package/lib/esm/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.js +6 -0
  69. package/lib/esm/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneProps.js +6 -0
  70. package/lib/esm/components/postchatsurveypane/PostChatSurveyPane.js +2 -1
  71. package/lib/esm/components/prechatsurveypane/PreChatSurveyPane.js +22 -9
  72. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultPreChatSurveyPaneControlProps.js +1 -0
  73. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +3 -1
  74. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.js +3 -0
  75. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneStyles.js +5 -1
  76. package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.js +3 -0
  77. package/lib/esm/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.js +1 -0
  78. package/lib/esm/components/proactivechatpane/ProactiveChatPane.js +33 -34
  79. package/lib/esm/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +5 -1
  80. package/lib/esm/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -11
  81. package/lib/esm/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +5 -1
  82. package/lib/esm/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +5 -1
  83. package/lib/esm/index.js +1 -0
  84. package/lib/esm/services/BroadcastService.js +34 -8
  85. package/lib/types/common/Constants.d.ts +1 -2
  86. package/lib/types/common/utils.d.ts +1 -0
  87. package/lib/types/components/chatbutton/interfaces/IChatButtonControlProps.d.ts +1 -0
  88. package/lib/types/components/common/interfaces/ICommandButtonControlProps.d.ts +1 -0
  89. package/lib/types/components/common/interfaces/ICommandButtonProps.d.ts +1 -0
  90. package/lib/types/components/{header → common}/subcomponents/CloseButton.d.ts +1 -1
  91. package/lib/types/components/confirmationpane/interfaces/IConfirmationPaneControlProps.d.ts +0 -1
  92. package/lib/types/components/inputvalidationpane/interfaces/IInputValidationPaneControlProps.d.ts +0 -1
  93. package/lib/types/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneControlProps.d.ts +2 -0
  94. package/lib/types/components/outofofficehourspane/common/presetFourProps/presetFourOOOHPaneProps.d.ts +2 -0
  95. package/lib/types/components/outofofficehourspane/interfaces/IOOOHPaneControlProps.d.ts +1 -0
  96. package/lib/types/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneMultilineTextInputStyles.d.ts +2 -0
  97. package/lib/types/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneTextInputStyles.d.ts +2 -0
  98. package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneButtonStyles.d.ts +2 -0
  99. package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneElementStyles.d.ts +5 -0
  100. package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneStyleProps.d.ts +5 -0
  101. package/lib/types/components/proactivechatpane/interfaces/IProactiveChatPaneControlProps.d.ts +2 -1
  102. package/lib/types/index.d.ts +1 -0
  103. package/lib/types/services/BroadcastService.d.ts +1 -0
  104. package/package.json +2 -2
@@ -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
  };
@@ -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
  };
@@ -1,7 +1,7 @@
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",
@@ -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,
@@ -10,7 +10,7 @@ import { defaultPreChatSurveyPaneGeneralStyles } from "./common/defaultProps/def
10
10
  import { defaultPreChatSurveyPaneStyles } from "./common/defaultProps/defaultStyles/defaultPreChatSurveyPaneStyles";
11
11
 
12
12
  function PreChatSurveyPane(props) {
13
- var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps3$cu, _defaultPreChatSurvey, _props$styleProps4, _props$styleProps4$cu, _defaultPreChatSurvey2, _props$styleProps5, _props$styleProps5$cu, _defaultPreChatSurvey3, _props$controlProps6, _props$controlProps7, _props$controlProps8;
13
+ var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps3$cu, _props$styleProps4, _props$styleProps4$cu, _props$styleProps5, _props$styleProps5$cu, _props$styleProps6, _props$styleProps6$cu, _props$styleProps7, _props$styleProps7$cu, _props$styleProps8, _props$styleProps8$cu, _props$styleProps9, _props$styleProps9$cu, _defaultPreChatSurvey, _props$styleProps10, _props$styleProps10$c, _props$styleProps11, _props$styleProps11$c, _defaultPreChatSurvey2, _props$styleProps12, _props$styleProps12$c, _props$styleProps13, _props$styleProps13$c, _defaultPreChatSurvey3, _props$styleProps14, _props$styleProps14$c, _defaultPreChatSurvey4, _props$styleProps15, _props$styleProps15$c, _defaultPreChatSurvey5, _props$styleProps16, _props$styleProps16$c, _defaultPreChatSurvey6, _props$styleProps17, _props$styleProps17$c, _defaultPreChatSurvey7, _props$controlProps6, _props$controlProps7, _props$controlProps8;
14
14
 
15
15
  const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? "lcw-components-prechatsurvey-pane";
16
16
  let adpativeCardPayload;
@@ -60,6 +60,7 @@ function PreChatSurveyPane(props) {
60
60
  }
61
61
  }, []); //Adaptive Card Initilializations
62
62
 
63
+ AdaptiveCards.GlobalSettings.setTabIndexAtCardRoot = false;
63
64
  const adaptiveCard = new AdaptiveCards.AdaptiveCard();
64
65
  adaptiveCard.hostConfig = new AdaptiveCards.HostConfig(adaptiveCardHostConfig);
65
66
  adaptiveCard.parse(adpativeCardPayload);
@@ -68,18 +69,30 @@ function PreChatSurveyPane(props) {
68
69
  const renderedCard = adaptiveCard.render();
69
70
  addNoreferrerNoopenerTag(renderedCard);
70
71
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, `
72
+ .ac-textBlock {
73
+ font-size: ${(_props$styleProps3 = props.styleProps) === null || _props$styleProps3 === void 0 ? void 0 : (_props$styleProps3$cu = _props$styleProps3.customTextStyleProps) === null || _props$styleProps3$cu === void 0 ? void 0 : _props$styleProps3$cu.fontSize} !important;
74
+ height: ${(_props$styleProps4 = props.styleProps) === null || _props$styleProps4 === void 0 ? void 0 : (_props$styleProps4$cu = _props$styleProps4.customTextStyleProps) === null || _props$styleProps4$cu === void 0 ? void 0 : _props$styleProps4$cu.height};
75
+ padding-top: ${(_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : (_props$styleProps5$cu = _props$styleProps5.customTextStyleProps) === null || _props$styleProps5$cu === void 0 ? void 0 : _props$styleProps5$cu.paddingTop};
76
+ }
77
+ .ac-textRun {
78
+ font-size: ${(_props$styleProps6 = props.styleProps) === null || _props$styleProps6 === void 0 ? void 0 : (_props$styleProps6$cu = _props$styleProps6.customTextStyleProps) === null || _props$styleProps6$cu === void 0 ? void 0 : _props$styleProps6$cu.fontSize} !important;
79
+ padding-top: ${(_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : (_props$styleProps7$cu = _props$styleProps7.customTextStyleProps) === null || _props$styleProps7$cu === void 0 ? void 0 : _props$styleProps7$cu.paddingTop};
80
+ }
71
81
  .ac-input {
72
82
  margin-bottom: 6px;
73
83
  }
74
84
  .ac-input.ac-textInput {
75
- height: 20px;
85
+ font-size: ${(_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : (_props$styleProps8$cu = _props$styleProps8.customTextInputStyleProps) === null || _props$styleProps8$cu === void 0 ? void 0 : _props$styleProps8$cu.fontSize};
86
+ height: ${((_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 ? void 0 : (_props$styleProps9$cu = _props$styleProps9.customTextInputStyleProps) === null || _props$styleProps9$cu === void 0 ? void 0 : _props$styleProps9$cu.height) ?? ((_defaultPreChatSurvey = defaultPreChatSurveyPaneStyles.customTextInputStyleProps) === null || _defaultPreChatSurvey === void 0 ? void 0 : _defaultPreChatSurvey.height)};
76
87
  padding: 8px;
77
88
  }
78
89
  .ac-input.ac-textInput.ac-multiline {
79
- height: 52px;
90
+ font-size: ${(_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : (_props$styleProps10$c = _props$styleProps10.customMultilineTextInputStyleProps) === null || _props$styleProps10$c === void 0 ? void 0 : _props$styleProps10$c.fontSize};
91
+ height: ${((_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : (_props$styleProps11$c = _props$styleProps11.customMultilineTextInputStyleProps) === null || _props$styleProps11$c === void 0 ? void 0 : _props$styleProps11$c.height) ?? ((_defaultPreChatSurvey2 = defaultPreChatSurveyPaneStyles.customMultilineTextInputStyleProps) === null || _defaultPreChatSurvey2 === void 0 ? void 0 : _defaultPreChatSurvey2.height)};
80
92
  resize: none;
81
93
  }
82
94
  .ac-input.ac-multichoiceInput {
95
+ font-size: ${(_props$styleProps12 = props.styleProps) === null || _props$styleProps12 === void 0 ? void 0 : (_props$styleProps12$c = _props$styleProps12.customMultichoiceInputStyleProps) === null || _props$styleProps12$c === void 0 ? void 0 : _props$styleProps12$c.fontSize};
83
96
  padding: 3px;
84
97
  padding-top: 7px;
85
98
  padding-bottom: 7px;
@@ -87,18 +100,18 @@ function PreChatSurveyPane(props) {
87
100
  .ac-pushButton {
88
101
  border: 1px solid #00000000;
89
102
  margin: 2px;
90
- height: 48px;
103
+ height: ${((_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : (_props$styleProps13$c = _props$styleProps13.customButtonStyleProps) === null || _props$styleProps13$c === void 0 ? void 0 : _props$styleProps13$c.height) ?? ((_defaultPreChatSurvey3 = defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey3 === void 0 ? void 0 : _defaultPreChatSurvey3.height)};
91
104
  border-radius: 5px;
92
105
  cursor: pointer;
93
106
  font-weight: bold;
94
- font-size: 15px;
95
- font-family: ${((_props$styleProps3 = props.styleProps) === null || _props$styleProps3 === void 0 ? void 0 : (_props$styleProps3$cu = _props$styleProps3.customButtonStyleProps) === null || _props$styleProps3$cu === void 0 ? void 0 : _props$styleProps3$cu.fontFamily) ?? ((_defaultPreChatSurvey = defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey === void 0 ? void 0 : _defaultPreChatSurvey.fontFamily)};
96
- color: ${((_props$styleProps4 = props.styleProps) === null || _props$styleProps4 === void 0 ? void 0 : (_props$styleProps4$cu = _props$styleProps4.customButtonStyleProps) === null || _props$styleProps4$cu === void 0 ? void 0 : _props$styleProps4$cu.color) ?? ((_defaultPreChatSurvey2 = defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey2 === void 0 ? void 0 : _defaultPreChatSurvey2.color)};
97
- background-color: ${((_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : (_props$styleProps5$cu = _props$styleProps5.customButtonStyleProps) === null || _props$styleProps5$cu === void 0 ? void 0 : _props$styleProps5$cu.backgroundColor) ?? ((_defaultPreChatSurvey3 = defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey3 === void 0 ? void 0 : _defaultPreChatSurvey3.backgroundColor)};
107
+ font-size: ${((_props$styleProps14 = props.styleProps) === null || _props$styleProps14 === void 0 ? void 0 : (_props$styleProps14$c = _props$styleProps14.customButtonStyleProps) === null || _props$styleProps14$c === void 0 ? void 0 : _props$styleProps14$c.fontSize) ?? ((_defaultPreChatSurvey4 = defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey4 === void 0 ? void 0 : _defaultPreChatSurvey4.fontSize)};
108
+ font-family: ${((_props$styleProps15 = props.styleProps) === null || _props$styleProps15 === void 0 ? void 0 : (_props$styleProps15$c = _props$styleProps15.customButtonStyleProps) === null || _props$styleProps15$c === void 0 ? void 0 : _props$styleProps15$c.fontFamily) ?? ((_defaultPreChatSurvey5 = defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey5 === void 0 ? void 0 : _defaultPreChatSurvey5.fontFamily)};
109
+ color: ${((_props$styleProps16 = props.styleProps) === null || _props$styleProps16 === void 0 ? void 0 : (_props$styleProps16$c = _props$styleProps16.customButtonStyleProps) === null || _props$styleProps16$c === void 0 ? void 0 : _props$styleProps16$c.color) ?? ((_defaultPreChatSurvey6 = defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey6 === void 0 ? void 0 : _defaultPreChatSurvey6.color)};
110
+ background-color: ${((_props$styleProps17 = props.styleProps) === null || _props$styleProps17 === void 0 ? void 0 : (_props$styleProps17$c = _props$styleProps17.customButtonStyleProps) === null || _props$styleProps17$c === void 0 ? void 0 : _props$styleProps17$c.backgroundColor) ?? ((_defaultPreChatSurvey7 = defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey7 === void 0 ? void 0 : _defaultPreChatSurvey7.backgroundColor)};
98
111
  }`), !((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.hidePreChatSurveyPane) && /*#__PURE__*/React.createElement(Stack, {
99
112
  id: elementId,
100
113
  tabIndex: -1,
101
- role: (_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.role,
114
+ role: ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.role) ?? defaultPreChatSurveyPaneControlProps.role,
102
115
  dir: ((_props$controlProps8 = props.controlProps) === null || _props$controlProps8 === void 0 ? void 0 : _props$controlProps8.dir) ?? defaultPreChatSurveyPaneControlProps.dir,
103
116
  styles: containerStyles
104
117
  }, /*#__PURE__*/React.createElement(Stack, {
@@ -1,6 +1,7 @@
1
1
  export const defaultPreChatSurveyPaneControlProps = {
2
2
  id: "oc-lcw-prechatsurveypane-default",
3
3
  dir: "auto",
4
+ role: "alert",
4
5
  hidePreChatSurveyPane: false,
5
6
  adaptiveCardHostConfig: "{\"fontFamily\":\"Segoe UI, Helvetica Neue, sans-serif\",\"containerStyles\":{\"default\":{\"foregroundColors\":{\"default\":{\"default\":\"#000000\"}},\"backgroundColor\":\"#FFFFFF\"}},\"actions\":{\"actionsOrientation\":\"Vertical\",\"actionAlignment\":\"stretch\"}}",
6
7
  payload: "{\"$schema\":\"http://adaptivecards.io/schemas/adaptive-card.json\",\"type\":\"AdaptiveCard\",\"version\":\"1.1\",\"body\":[{\"type\":\"TextBlock\",\"weight\":\"bolder\",\"text\":\"Please answer below questions.\"},{\"type\":\"Input.Text\",\"id\":\"1e5e4e7a-8f0b-ec11-b6e6-000d3a305d38\",\"label\":\"name pls?\",\"maxLength\":100,\"isRequired\":true,\"errorMessage\":\"Name is required\"},{\"type\":\"Input.Text\",\"id\":\"7f8f5d6d-995e-ec11-8f8f-000d3a31376e\",\"label\":\"multi\\nmulti\\nmulti\",\"style\":\"text\",\"isMultiline\":true,\"maxLength\":250},{\"type\":\"Input.ChoiceSet\",\"id\":\"e4bdf7cb-995e-ec11-8f8f-000d3a31376e\",\"label\":\"options\",\"isMultiSelect\":false,\"value\":\"1\",\"style\":\"compact\",\"choices\":[{\"title\":\"one\",\"value\":\"1\"},{\"title\":\"two\",\"value\":\"2\"},{\"title\":\"three\",\"value\":\"3\"}]},{\"type\":\"Input.Toggle\",\"id\":\"b26011d2-995e-ec11-8f8f-000d3a31376e\",\"title\":\"consent\",\"valueOn\":\"True\",\"valueOff\":\"False\",\"value\":\"false\"},{\"type\":\"TextBlock\",\"isSubtle\":true,\"text\":\"Fields marked with * are mandatory.\",\"wrap\":true}],\"actions\":[{\"type\":\"Action.Submit\",\"title\":\"Submit\",\"data\":{\"Type\":\"InputSubmit\"}}]}",
@@ -1,5 +1,7 @@
1
1
  export const defaultPreChatSurveyPaneButtonStyles = {
2
2
  backgroundColor: "rgb(49, 95, 162)",
3
3
  color: "#FFFFFF",
4
- fontFamily: "Segoe UI, Arial, sans-serif"
4
+ fontFamily: "Segoe UI, Arial, sans-serif",
5
+ fontSize: "15px",
6
+ height: "48px"
5
7
  };
@@ -0,0 +1,3 @@
1
+ export const defaultPreChatSurveyPaneMultilineTextInputStyles = {
2
+ height: "52px"
3
+ };
@@ -1,8 +1,12 @@
1
1
  import { defaultPreChatSurveyPaneACContainerStyles } from "./defaultPreChatSurveyPaneACContainerStyles";
2
2
  import { defaultPreChatSurveyPaneButtonStyles } from "./defaultPreChatSurveyPaneButtonStyles";
3
3
  import { defaultPreChatSurveyPaneGeneralStyles } from "./defaultPreChatSurveyPaneGeneralStyles";
4
+ import { defaultPreChatSurveyPaneMultilineTextInputStyles } from "./defaultPreChatSurveyPaneMultilineTextInputStyles";
5
+ import { defaultPreChatSurveyPaneTextInputStyles } from "./defaultPreChatSurveyPaneTextInputStyles";
4
6
  export const defaultPreChatSurveyPaneStyles = {
5
7
  generalStyleProps: defaultPreChatSurveyPaneGeneralStyles,
6
8
  customButtonStyleProps: defaultPreChatSurveyPaneButtonStyles,
7
- adaptiveCardContainerStyleProps: defaultPreChatSurveyPaneACContainerStyles
9
+ adaptiveCardContainerStyleProps: defaultPreChatSurveyPaneACContainerStyles,
10
+ customTextInputStyleProps: defaultPreChatSurveyPaneTextInputStyles,
11
+ customMultilineTextInputStyleProps: defaultPreChatSurveyPaneMultilineTextInputStyles
8
12
  };
@@ -0,0 +1,3 @@
1
+ export const defaultPreChatSurveyPaneTextInputStyles = {
2
+ height: "20px"
3
+ };
@@ -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.",