@microsoft/omnichannel-chat-components 0.1.0-main.2eda736 → 0.1.0-main.307185
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.
- package/lib/cjs/common/Constants.js +12 -7
- package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +31 -1
- package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/common/defaultStyles/customizedCurrentCallStyleProps.js +0 -12
- package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/common/defaultStyles/defaultCurrentCallStyleProps.js +0 -12
- package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +31 -1
- package/lib/cjs/components/chatbutton/ChatButton.js +37 -26
- package/lib/cjs/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +4 -1
- package/lib/cjs/components/common/commandbutton/CommandButton.js +36 -10
- package/lib/cjs/components/{header → common}/subcomponents/CloseButton.js +4 -3
- package/lib/cjs/components/confirmationpane/ConfirmationPane.js +12 -10
- package/lib/cjs/components/footer/Footer.js +2 -2
- package/lib/cjs/components/footer/common/defaultProps/defaultFooterControlProps.js +1 -0
- package/lib/cjs/components/footer/common/defaultStyles/defaultFooterStyleProps.js +12 -6
- package/lib/cjs/components/footer/subcomponents/AudioNotificationButton.js +30 -11
- package/lib/cjs/components/header/Header.js +2 -2
- package/lib/cjs/components/inputvalidationpane/InputValidationPane.js +76 -46
- package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -1
- package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneInvalidInputErrorMessageStyles.js +1 -1
- package/lib/cjs/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneSendButtonStyles.js +2 -1
- package/lib/cjs/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +1 -1
- package/lib/cjs/components/postchatsurveypane/PostChatSurveyPane.js +2 -1
- package/lib/cjs/components/prechatsurveypane/PreChatSurveyPane.js +6 -4
- package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +2 -1
- package/lib/cjs/components/proactivechatpane/ProactiveChatPane.js +33 -30
- package/lib/cjs/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +5 -1
- package/lib/cjs/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -13
- package/lib/cjs/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +5 -1
- package/lib/cjs/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +5 -1
- package/lib/cjs/components/reconnectchatpane/ReconnectChatPane.js +14 -12
- package/lib/cjs/index.js +6 -0
- package/lib/cjs/services/BroadcastService.js +36 -8
- package/lib/esm/common/Constants.js +10 -5
- package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +33 -3
- package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultStyles/customizedCurrentCallStyleProps.js +0 -12
- package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/common/defaultStyles/defaultCurrentCallStyleProps.js +0 -12
- package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +33 -3
- package/lib/esm/components/chatbutton/ChatButton.js +37 -26
- package/lib/esm/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +4 -1
- package/lib/esm/components/common/commandbutton/CommandButton.js +36 -10
- package/lib/esm/components/{header → common}/subcomponents/CloseButton.js +4 -3
- package/lib/esm/components/confirmationpane/ConfirmationPane.js +12 -10
- package/lib/esm/components/footer/Footer.js +2 -2
- package/lib/esm/components/footer/common/defaultProps/defaultFooterControlProps.js +1 -0
- package/lib/esm/components/footer/common/defaultStyles/defaultFooterStyleProps.js +12 -6
- package/lib/esm/components/footer/subcomponents/AudioNotificationButton.js +30 -11
- package/lib/esm/components/header/Header.js +2 -2
- package/lib/esm/components/inputvalidationpane/InputValidationPane.js +77 -47
- package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneCancelButtonStyles.js +2 -1
- package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneInvalidInputErrorMessageStyles.js +1 -1
- package/lib/esm/components/inputvalidationpane/common/default/defaultStyles/defaultInputValidationPaneSendButtonStyles.js +2 -1
- package/lib/esm/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +1 -1
- package/lib/esm/components/postchatsurveypane/PostChatSurveyPane.js +2 -1
- package/lib/esm/components/prechatsurveypane/PreChatSurveyPane.js +6 -4
- package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +2 -1
- package/lib/esm/components/proactivechatpane/ProactiveChatPane.js +30 -29
- package/lib/esm/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +5 -1
- package/lib/esm/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -11
- package/lib/esm/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +5 -1
- package/lib/esm/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +5 -1
- package/lib/esm/components/reconnectchatpane/ReconnectChatPane.js +14 -12
- package/lib/esm/index.js +1 -0
- package/lib/esm/services/BroadcastService.js +34 -8
- package/lib/types/common/Constants.d.ts +8 -2
- package/lib/types/components/callingcontainer/subcomponents/CurrentCall/interfaces/ICurrentCallStyleProps.d.ts +0 -4
- package/lib/types/components/chatbutton/interfaces/IChatButtonControlProps.d.ts +3 -0
- package/lib/types/components/common/interfaces/ICommandButtonControlProps.d.ts +1 -0
- package/lib/types/components/common/interfaces/ICommandButtonProps.d.ts +1 -0
- package/lib/types/components/{header → common}/subcomponents/CloseButton.d.ts +1 -1
- package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneButtonStyles.d.ts +1 -0
- package/lib/types/components/proactivechatpane/interfaces/IProactiveChatPaneControlProps.d.ts +2 -1
- package/lib/types/index.d.ts +1 -0
- package/lib/types/services/BroadcastService.d.ts +1 -0
- package/package.json +4 -7
|
@@ -22,27 +22,45 @@ function AudioNotificationButton(props) {
|
|
|
22
22
|
disabled
|
|
23
23
|
} = props;
|
|
24
24
|
const [muted, setMuted] = (0, _react2.useState)(props.isAudioMuted);
|
|
25
|
+
let iconStyles = {};
|
|
26
|
+
|
|
27
|
+
if (props.type === "icon") {
|
|
28
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
29
|
+
iconStyles = { ...(props === null || props === void 0 ? void 0 : props.styles).icon
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
|
|
25
33
|
const iconButtonStyles = {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
34
|
+
icon: iconStyles,
|
|
35
|
+
root: {
|
|
36
|
+
selectors: {
|
|
37
|
+
":hover .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
38
|
+
...(props === null || props === void 0 ? void 0 : props.hoverStyles).icon
|
|
39
|
+
},
|
|
40
|
+
":active .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
+
...(props === null || props === void 0 ? void 0 : props.hoverStyles).icon
|
|
42
|
+
},
|
|
43
|
+
":focus .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
44
|
+
...(props === null || props === void 0 ? void 0 : props.focusStyles).icon
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
|
+
...(props === null || props === void 0 ? void 0 : props.styles)
|
|
49
|
+
},
|
|
50
|
+
rootHovered: props.hoverStyles,
|
|
51
|
+
rootFocused: props.focusStyles,
|
|
52
|
+
rootPressed: props.hoverStyles
|
|
29
53
|
}; //imageIconProps > iconName
|
|
30
54
|
|
|
31
55
|
const volume0Icon = props.imageToggleIconProps ? {
|
|
32
56
|
imageProps: props === null || props === void 0 ? void 0 : props.imageToggleIconProps
|
|
33
57
|
} : {
|
|
34
|
-
iconName: (props === null || props === void 0 ? void 0 : props.toggleIconName) ?? "Volume0"
|
|
35
|
-
styles: {
|
|
36
|
-
root: props.styles
|
|
37
|
-
}
|
|
58
|
+
iconName: (props === null || props === void 0 ? void 0 : props.toggleIconName) ?? "Volume0"
|
|
38
59
|
};
|
|
39
60
|
const volume3Icon = props.imageIconProps ? {
|
|
40
61
|
imageProps: props === null || props === void 0 ? void 0 : props.imageIconProps
|
|
41
62
|
} : {
|
|
42
|
-
iconName: (props === null || props === void 0 ? void 0 : props.iconName) ?? "Volume3"
|
|
43
|
-
styles: {
|
|
44
|
-
root: props.styles
|
|
45
|
-
}
|
|
63
|
+
iconName: (props === null || props === void 0 ? void 0 : props.iconName) ?? "Volume3"
|
|
46
64
|
};
|
|
47
65
|
const handleOnClick = (0, _react2.useCallback)(() => {
|
|
48
66
|
setMuted(!muted);
|
|
@@ -70,6 +88,7 @@ function AudioNotificationButton(props) {
|
|
|
70
88
|
disabled: disabled,
|
|
71
89
|
styles: iconButtonStyles,
|
|
72
90
|
className: props.className,
|
|
91
|
+
"aria-label": muted ? props.toggleAriaLabel ?? "Turn sound on" : props.ariaLabel ?? "Turn sound off",
|
|
73
92
|
title: muted ? props.toggleAriaLabel ?? "Turn sound on" : props.ariaLabel ?? "Turn sound off"
|
|
74
93
|
});
|
|
75
94
|
}
|
|
@@ -9,7 +9,7 @@ var React = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
|
|
10
10
|
var _react2 = require("@fluentui/react");
|
|
11
11
|
|
|
12
|
-
var _CloseButton = _interopRequireDefault(require("
|
|
12
|
+
var _CloseButton = _interopRequireDefault(require("../common/subcomponents/CloseButton"));
|
|
13
13
|
|
|
14
14
|
var _MinimizeButton = _interopRequireDefault(require("./subcomponents/MinimizeButton"));
|
|
15
15
|
|
|
@@ -25,7 +25,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
25
25
|
|
|
26
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
27
|
|
|
28
|
-
function _extends() { _extends = Object.assign
|
|
28
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
29
29
|
|
|
30
30
|
(0, _react2.initializeIcons)();
|
|
31
31
|
|
|
@@ -48,30 +48,35 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
48
48
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
49
49
|
|
|
50
50
|
function InputValidationPane(props) {
|
|
51
|
-
var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$controlProps14, _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$styleProps8, _props$styleProps9, _props$styleProps10, _props$styleProps11, _props$styleProps12, _props$controlProps15, _props$
|
|
51
|
+
var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$controlProps14, _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$styleProps8, _props$styleProps9, _props$styleProps10, _props$styleProps11, _props$styleProps12, _props$styleProps13, _props$styleProps14, _props$styleProps15, _props$styleProps16, _props$controlProps15, _props$styleProps17, _props$styleProps17$c, _props$controlProps16, _props$controlProps17, _props$styleProps18, _props$styleProps18$c, _props$controlProps18, _props$componentOverr, _props$styleProps19, _props$styleProps19$c, _props$controlProps19, _props$controlProps20, _props$componentOverr2, _props$styleProps20, _props$styleProps20$c, _props$controlProps21, _props$controlProps22, _props$componentOverr3, _props$styleProps21, _props$styleProps21$c, _props$controlProps23, _props$controlProps24, _props$componentOverr4, _props$styleProps22, _props$styleProps22$c, _props$controlProps25, _props$controlProps26, _props$controlProps27, _props$styleProps23, _props$styleProps23$c, _props$controlProps28, _props$componentOverr5, _props$styleProps24, _props$styleProps24$c, _props$controlProps29, _props$controlProps30, _props$controlProps31, _props$controlProps32, _props$componentOverr6, _props$styleProps25, _props$styleProps25$c, _props$controlProps33, _props$controlProps34, _props$controlProps35;
|
|
52
52
|
|
|
53
53
|
const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.id;
|
|
54
54
|
const [inputValue, setInputValue] = (0, _react2.useState)("");
|
|
55
55
|
const [isInitialRendering, setIsInitialRendering] = (0, _react2.useState)(true);
|
|
56
56
|
const [isInvalidInput, setIsInvalidInput] = (0, _react2.useState)(false);
|
|
57
57
|
const [isSendButtonEnabled, setIsSendButtonEnabled] = (0, _react2.useState)(false);
|
|
58
|
-
|
|
59
|
-
const isValidInput = () => {
|
|
58
|
+
const isValidInput = (0, _react2.useCallback)(() => {
|
|
60
59
|
var _props$controlProps2, _props$controlProps3;
|
|
61
60
|
|
|
62
|
-
|
|
63
|
-
|
|
61
|
+
if (!((_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.checkInput)) {
|
|
62
|
+
return true;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (!inputValue) {
|
|
66
|
+
return false;
|
|
67
|
+
}
|
|
64
68
|
|
|
69
|
+
return (_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.checkInput(inputValue);
|
|
70
|
+
}, [inputValue]); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
65
71
|
|
|
66
|
-
const handleInputChange = e => {
|
|
72
|
+
const handleInputChange = (0, _react2.useCallback)(e => {
|
|
67
73
|
var _props$controlProps4, _props$controlProps5;
|
|
68
74
|
|
|
69
75
|
setInputValue(e.target.value);
|
|
70
76
|
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);
|
|
71
77
|
setIsInvalidInput(false);
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
const send = (controlId, suffix) => {
|
|
78
|
+
}, []);
|
|
79
|
+
const send = (0, _react2.useCallback)((controlId, suffix) => {
|
|
75
80
|
var _props$controlProps6;
|
|
76
81
|
|
|
77
82
|
if ((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.onSend) {
|
|
@@ -90,20 +95,17 @@ function InputValidationPane(props) {
|
|
|
90
95
|
setIsInvalidInput(true);
|
|
91
96
|
}
|
|
92
97
|
}
|
|
93
|
-
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
98
|
+
}, [inputValue]); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
94
99
|
|
|
95
|
-
|
|
96
|
-
const handleInputKeyDown = e => {
|
|
100
|
+
const handleInputKeyUp = (0, _react2.useCallback)(e => {
|
|
97
101
|
if (e.code === _Constants.KeyCodes.ENTER) {
|
|
98
|
-
send(elementId + "-textField", "
|
|
102
|
+
send(elementId + "-textField", "KeyUp");
|
|
99
103
|
}
|
|
100
|
-
};
|
|
101
|
-
|
|
102
|
-
const handleSendClick = () => {
|
|
104
|
+
}, [inputValue]);
|
|
105
|
+
const handleSendClick = (0, _react2.useCallback)(() => {
|
|
103
106
|
send(elementId + "-sendbutton", "Click");
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
const cancel = (controlId, suffix) => {
|
|
107
|
+
}, [inputValue]);
|
|
108
|
+
const cancel = (0, _react2.useCallback)((controlId, suffix) => {
|
|
107
109
|
var _props$controlProps8;
|
|
108
110
|
|
|
109
111
|
if ((_props$controlProps8 = props.controlProps) !== null && _props$controlProps8 !== void 0 && _props$controlProps8.onCancel) {
|
|
@@ -121,19 +123,16 @@ function InputValidationPane(props) {
|
|
|
121
123
|
|
|
122
124
|
(_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.onCancel();
|
|
123
125
|
}
|
|
124
|
-
}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
125
|
-
|
|
126
|
+
}, []); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
126
127
|
|
|
127
|
-
const handleEscKeyDown = e => {
|
|
128
|
+
const handleEscKeyDown = (0, _react2.useCallback)(e => {
|
|
128
129
|
if (e.code === _Constants.KeyCodes.ESCAPE) {
|
|
129
130
|
cancel(elementId, "KeyDown");
|
|
130
131
|
}
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
const handleCancelClick = () => {
|
|
132
|
+
}, []);
|
|
133
|
+
const handleCancelClick = (0, _react2.useCallback)(() => {
|
|
134
134
|
cancel(elementId + "-cancelbutton", "Click");
|
|
135
|
-
};
|
|
136
|
-
|
|
135
|
+
}, []);
|
|
137
136
|
(0, _react2.useEffect)(() => {
|
|
138
137
|
var _props$controlProps11, _props$controlProps12, _props$controlProps13;
|
|
139
138
|
|
|
@@ -160,30 +159,61 @@ function InputValidationPane(props) {
|
|
|
160
159
|
const redBorderStyles = {
|
|
161
160
|
borderColor: ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.inputWithErrorMessageBorderColor) ?? _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.inputWithErrorMessageBorderColor,
|
|
162
161
|
borderRadius: "1px",
|
|
163
|
-
borderStyle: "solid"
|
|
162
|
+
borderStyle: "solid",
|
|
163
|
+
borderWidth: "1px"
|
|
164
164
|
};
|
|
165
165
|
const inputStyles = {
|
|
166
|
-
root: Object.assign({}, _defaultInputValidationPaneInputStyles.defaultInputValidationPaneInputStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.inputStyleProps)
|
|
166
|
+
root: Object.assign({}, _defaultInputValidationPaneInputStyles.defaultInputValidationPaneInputStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.inputStyleProps),
|
|
167
|
+
field: Object.assign({}, _defaultInputValidationPaneInputStyles.defaultInputValidationPaneInputStyles, (_props$styleProps6 = props.styleProps) === null || _props$styleProps6 === void 0 ? void 0 : _props$styleProps6.inputStyleProps),
|
|
168
|
+
fieldGroup: undefined,
|
|
169
|
+
prefix: undefined,
|
|
170
|
+
suffix: undefined,
|
|
171
|
+
icon: undefined,
|
|
172
|
+
description: undefined,
|
|
173
|
+
wrapper: undefined,
|
|
174
|
+
errorMessage: undefined,
|
|
175
|
+
subComponentStyles: {
|
|
176
|
+
label: {}
|
|
177
|
+
},
|
|
178
|
+
revealButton: undefined,
|
|
179
|
+
revealSpan: undefined,
|
|
180
|
+
revealIcon: undefined
|
|
167
181
|
};
|
|
168
182
|
const inputWithErrorMessageStyles = {
|
|
169
|
-
root: Object.assign({}, _defaultInputValidationPaneInputStyles.defaultInputValidationPaneInputStyles, redBorderStyles, (_props$
|
|
183
|
+
root: Object.assign({}, _defaultInputValidationPaneInputStyles.defaultInputValidationPaneInputStyles, redBorderStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.inputStyleProps),
|
|
184
|
+
field: Object.assign({}, _defaultInputValidationPaneInputStyles.defaultInputValidationPaneInputStyles, redBorderStyles, (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : _props$styleProps8.inputStyleProps),
|
|
185
|
+
fieldGroup: undefined,
|
|
186
|
+
prefix: undefined,
|
|
187
|
+
suffix: undefined,
|
|
188
|
+
icon: undefined,
|
|
189
|
+
description: undefined,
|
|
190
|
+
wrapper: undefined,
|
|
191
|
+
errorMessage: undefined,
|
|
192
|
+
subComponentStyles: {
|
|
193
|
+
label: {}
|
|
194
|
+
},
|
|
195
|
+
revealButton: undefined,
|
|
196
|
+
revealSpan: undefined,
|
|
197
|
+
revealIcon: undefined
|
|
170
198
|
};
|
|
171
199
|
const invalidInputErrorMessageStyles = {
|
|
172
|
-
root: Object.assign({}, _defaultInputValidationPaneInvalidInputErrorMessageStyles.defaultInputValidationPaneInvalidInputErrorMessageStyles, (_props$
|
|
200
|
+
root: Object.assign({}, _defaultInputValidationPaneInvalidInputErrorMessageStyles.defaultInputValidationPaneInvalidInputErrorMessageStyles, (_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 ? void 0 : _props$styleProps9.invalidInputErrorMessageStyleProps)
|
|
173
201
|
};
|
|
174
202
|
const buttonGroupStyles = {
|
|
175
|
-
root: Object.assign({}, _defaultInputValidationPaneButtonGroupStyles.defaultInputValidationPaneButtonGroupStyles, (_props$
|
|
203
|
+
root: Object.assign({}, _defaultInputValidationPaneButtonGroupStyles.defaultInputValidationPaneButtonGroupStyles, (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.buttonGroupStyleProps)
|
|
176
204
|
};
|
|
177
205
|
const sendButtonStyles = {
|
|
178
|
-
root: Object.assign({}, _defaultInputValidationPaneSendButtonStyles.defaultInputValidationPaneSendButtonStyles, (_props$
|
|
179
|
-
rootHovered: Object.assign({}, _defaultInputValidationPaneSendButtonHoveredStyles.defaultInputValidationPaneSendButtonHoveredStyles, (_props$
|
|
206
|
+
root: Object.assign({}, _defaultInputValidationPaneSendButtonStyles.defaultInputValidationPaneSendButtonStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.sendButtonStyleProps),
|
|
207
|
+
rootHovered: Object.assign({}, _defaultInputValidationPaneSendButtonHoveredStyles.defaultInputValidationPaneSendButtonHoveredStyles, (_props$styleProps12 = props.styleProps) === null || _props$styleProps12 === void 0 ? void 0 : _props$styleProps12.sendButtonHoveredStyleProps),
|
|
208
|
+
rootPressed: Object.assign({}, _defaultInputValidationPaneSendButtonHoveredStyles.defaultInputValidationPaneSendButtonHoveredStyles, (_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : _props$styleProps13.sendButtonHoveredStyleProps)
|
|
180
209
|
};
|
|
181
210
|
const cancelButtonStyles = {
|
|
182
|
-
root: Object.assign({}, _defaultInputValidationPaneCancelButtonStyles.defaultInputValidationPaneCancelButtonStyles, (_props$
|
|
183
|
-
rootHovered: Object.assign({}, _defaultInputValidationPaneCancelButtonHoveredStyles.defaultInputValidationPaneCancelButtonHoveredStyles, (_props$
|
|
211
|
+
root: Object.assign({}, _defaultInputValidationPaneCancelButtonStyles.defaultInputValidationPaneCancelButtonStyles, (_props$styleProps14 = props.styleProps) === null || _props$styleProps14 === void 0 ? void 0 : _props$styleProps14.cancelButtonStyleProps),
|
|
212
|
+
rootHovered: Object.assign({}, _defaultInputValidationPaneCancelButtonHoveredStyles.defaultInputValidationPaneCancelButtonHoveredStyles, (_props$styleProps15 = props.styleProps) === null || _props$styleProps15 === void 0 ? void 0 : _props$styleProps15.cancelButtonHoveredStyleProps),
|
|
213
|
+
rootPressed: Object.assign({}, _defaultInputValidationPaneCancelButtonHoveredStyles.defaultInputValidationPaneCancelButtonHoveredStyles, (_props$styleProps16 = props.styleProps) === null || _props$styleProps16 === void 0 ? void 0 : _props$styleProps16.cancelButtonHoveredStyleProps)
|
|
184
214
|
};
|
|
185
215
|
return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, !((_props$controlProps15 = props.controlProps) !== null && _props$controlProps15 !== void 0 && _props$controlProps15.hideInputValidationPane) && /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
186
|
-
className: (_props$
|
|
216
|
+
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.containerClassName,
|
|
187
217
|
id: elementId,
|
|
188
218
|
tabIndex: -1,
|
|
189
219
|
onKeyDown: handleEscKeyDown,
|
|
@@ -191,22 +221,22 @@ function InputValidationPane(props) {
|
|
|
191
221
|
"aria-label": ((_props$controlProps17 = props.controlProps) === null || _props$controlProps17 === void 0 ? void 0 : _props$controlProps17.inputValidationPaneAriaLabel) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.inputValidationPaneAriaLabel,
|
|
192
222
|
styles: containerStyles
|
|
193
223
|
}, /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
194
|
-
className: (_props$
|
|
224
|
+
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.headerGroupClassName,
|
|
195
225
|
styles: headerGroupStyles,
|
|
196
226
|
tabIndex: -1,
|
|
197
227
|
id: elementId + "-headergroup"
|
|
198
228
|
}, !((_props$controlProps18 = props.controlProps) !== null && _props$controlProps18 !== void 0 && _props$controlProps18.hideTitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.title) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
|
|
199
|
-
className: (_props$
|
|
229
|
+
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.titleClassName,
|
|
200
230
|
styles: titleStyles,
|
|
201
231
|
tabIndex: -1,
|
|
202
232
|
id: elementId + "-title"
|
|
203
233
|
}, ((_props$controlProps19 = props.controlProps) === null || _props$controlProps19 === void 0 ? void 0 : _props$controlProps19.titleText) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.titleText)), !((_props$controlProps20 = props.controlProps) !== null && _props$controlProps20 !== void 0 && _props$controlProps20.hideSubtitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr2 = props.componentOverrides) === null || _props$componentOverr2 === void 0 ? void 0 : _props$componentOverr2.subtitle) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
|
|
204
|
-
className: (_props$
|
|
234
|
+
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.subtitleClassName,
|
|
205
235
|
styles: subtitleStyles,
|
|
206
236
|
tabIndex: -1,
|
|
207
237
|
id: elementId + "-subtitle"
|
|
208
238
|
}, ((_props$controlProps21 = props.controlProps) === null || _props$controlProps21 === void 0 ? void 0 : _props$controlProps21.subtitleText) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.subtitleText)), !((_props$controlProps22 = props.controlProps) !== null && _props$controlProps22 !== void 0 && _props$controlProps22.hideInput) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.input) || /*#__PURE__*/_react2.default.createElement(_react.TextField, {
|
|
209
|
-
className: (_props$
|
|
239
|
+
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.inputClassName,
|
|
210
240
|
styles: isInvalidInput ? inputWithErrorMessageStyles : inputStyles,
|
|
211
241
|
tabIndex: 0,
|
|
212
242
|
value: inputValue ?? _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.inputInitialText,
|
|
@@ -214,9 +244,9 @@ function InputValidationPane(props) {
|
|
|
214
244
|
ariaLabel: ((_props$controlProps24 = props.controlProps) === null || _props$controlProps24 === void 0 ? void 0 : _props$controlProps24.inputAriaLabel) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.inputAriaLabel,
|
|
215
245
|
borderless: isInvalidInput,
|
|
216
246
|
onChange: handleInputChange,
|
|
217
|
-
|
|
247
|
+
onKeyUp: handleInputKeyUp
|
|
218
248
|
})), isInvalidInput && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr4 = props.componentOverrides) === null || _props$componentOverr4 === void 0 ? void 0 : _props$componentOverr4.invalidInputErrorMessage) || /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
219
|
-
className: (_props$
|
|
249
|
+
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,
|
|
220
250
|
styles: invalidInputErrorMessageStyles,
|
|
221
251
|
"aria-label": ((_props$controlProps25 = props.controlProps) === null || _props$controlProps25 === void 0 ? void 0 : _props$controlProps25.invalidInputErrorMessageText) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.invalidInputErrorMessageText,
|
|
222
252
|
tabIndex: -1,
|
|
@@ -224,12 +254,12 @@ function InputValidationPane(props) {
|
|
|
224
254
|
id: elementId + "-invalidinputerrormessage"
|
|
225
255
|
}, ((_props$controlProps26 = props.controlProps) === null || _props$controlProps26 === void 0 ? void 0 : _props$controlProps26.invalidInputErrorMessageText) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.invalidInputErrorMessageText))), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
226
256
|
horizontal: ((_props$controlProps27 = props.controlProps) === null || _props$controlProps27 === void 0 ? void 0 : _props$controlProps27.isButtonGroupHorizontal) ?? _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.isButtonGroupHorizontal,
|
|
227
|
-
className: (_props$
|
|
257
|
+
className: (_props$styleProps23 = props.styleProps) === null || _props$styleProps23 === void 0 ? void 0 : (_props$styleProps23$c = _props$styleProps23.classNames) === null || _props$styleProps23$c === void 0 ? void 0 : _props$styleProps23$c.buttonGroupClassName,
|
|
228
258
|
styles: buttonGroupStyles,
|
|
229
259
|
tabIndex: -1,
|
|
230
260
|
id: elementId + "-buttongroup"
|
|
231
261
|
}, !((_props$controlProps28 = props.controlProps) !== null && _props$controlProps28 !== void 0 && _props$controlProps28.hideSendButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr5 = props.componentOverrides) === null || _props$componentOverr5 === void 0 ? void 0 : _props$componentOverr5.sendButton) || /*#__PURE__*/_react2.default.createElement(_Button.PrimaryButton, {
|
|
232
|
-
className: (_props$
|
|
262
|
+
className: (_props$styleProps24 = props.styleProps) === null || _props$styleProps24 === void 0 ? void 0 : (_props$styleProps24$c = _props$styleProps24.classNames) === null || _props$styleProps24$c === void 0 ? void 0 : _props$styleProps24$c.sendButtonClassName,
|
|
233
263
|
styles: sendButtonStyles,
|
|
234
264
|
title: ((_props$controlProps29 = props.controlProps) === null || _props$controlProps29 === void 0 ? void 0 : _props$controlProps29.sendButtonText) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.sendButtonText,
|
|
235
265
|
tabIndex: 0,
|
|
@@ -239,7 +269,7 @@ function InputValidationPane(props) {
|
|
|
239
269
|
id: elementId + "-sendbutton",
|
|
240
270
|
ariaLabel: ((_props$controlProps31 = props.controlProps) === null || _props$controlProps31 === void 0 ? void 0 : _props$controlProps31.sendButtonAriaLabel) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.sendButtonAriaLabel
|
|
241
271
|
})), !((_props$controlProps32 = props.controlProps) !== null && _props$controlProps32 !== void 0 && _props$controlProps32.hideCancelButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr6 = props.componentOverrides) === null || _props$componentOverr6 === void 0 ? void 0 : _props$componentOverr6.cancelButton) || /*#__PURE__*/_react2.default.createElement(_Button.DefaultButton, {
|
|
242
|
-
className: (_props$
|
|
272
|
+
className: (_props$styleProps25 = props.styleProps) === null || _props$styleProps25 === void 0 ? void 0 : (_props$styleProps25$c = _props$styleProps25.classNames) === null || _props$styleProps25$c === void 0 ? void 0 : _props$styleProps25$c.cancelButtonClassName,
|
|
243
273
|
styles: cancelButtonStyles,
|
|
244
274
|
title: ((_props$controlProps33 = props.controlProps) === null || _props$controlProps33 === void 0 ? void 0 : _props$controlProps33.cancelButtonText) || _defaultInputValidationPaneControlProps.defaultInputValidationPaneControlProps.cancelButtonText,
|
|
245
275
|
tabIndex: 0,
|
|
@@ -16,6 +16,7 @@ const defaultInputValidationPaneCancelButtonStyles = {
|
|
|
16
16
|
fontWeight: "500",
|
|
17
17
|
lineHeight: "19px",
|
|
18
18
|
textOverflow: "ellipsis",
|
|
19
|
-
whiteSpace: "nowrap"
|
|
19
|
+
whiteSpace: "nowrap",
|
|
20
|
+
width: "80px"
|
|
20
21
|
};
|
|
21
22
|
exports.defaultInputValidationPaneCancelButtonStyles = defaultInputValidationPaneCancelButtonStyles;
|
|
@@ -12,6 +12,7 @@ const defaultInputValidationPaneSendButtonStyles = {
|
|
|
12
12
|
fontWeight: "500",
|
|
13
13
|
lineHeight: "19px",
|
|
14
14
|
textOverflow: "ellipsis",
|
|
15
|
-
whiteSpace: "nowrap"
|
|
15
|
+
whiteSpace: "nowrap",
|
|
16
|
+
width: "80px"
|
|
16
17
|
};
|
|
17
18
|
exports.defaultInputValidationPaneSendButtonStyles = defaultInputValidationPaneSendButtonStyles;
|
|
@@ -7,7 +7,7 @@ exports.defaultLoadingPaneIconStyles = void 0;
|
|
|
7
7
|
const defaultLoadingPaneIconStyles = {
|
|
8
8
|
borderRadius: "50%",
|
|
9
9
|
backgroundColor: "#F1F1F1",
|
|
10
|
-
boxShadow: "0px 0px 0.5px 7px
|
|
10
|
+
boxShadow: "0px 0px 0.5px 7px rgba(196, 196, 196, 0.15)",
|
|
11
11
|
width: "86px",
|
|
12
12
|
height: "86px",
|
|
13
13
|
margin: "0px 0px 20px 0px",
|
|
@@ -28,7 +28,8 @@ function PostChatSurveyPane(props) {
|
|
|
28
28
|
const iframeStyles = {
|
|
29
29
|
height: "100vh",
|
|
30
30
|
width: "100%",
|
|
31
|
-
display: "block"
|
|
31
|
+
display: "block",
|
|
32
|
+
maxHeight: "100%"
|
|
32
33
|
};
|
|
33
34
|
return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
34
35
|
id: elementId,
|
|
@@ -30,7 +30,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
30
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
31
|
|
|
32
32
|
function PreChatSurveyPane(props) {
|
|
33
|
-
var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps3$cu, _defaultPreChatSurvey, _props$styleProps4, _props$styleProps4$cu, _defaultPreChatSurvey2, _props$controlProps6, _props$controlProps7, _props$controlProps8;
|
|
33
|
+
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;
|
|
34
34
|
|
|
35
35
|
const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? "lcw-components-prechatsurvey-pane";
|
|
36
36
|
let adpativeCardPayload;
|
|
@@ -82,6 +82,7 @@ function PreChatSurveyPane(props) {
|
|
|
82
82
|
}
|
|
83
83
|
}, []); //Adaptive Card Initilializations
|
|
84
84
|
|
|
85
|
+
AdaptiveCards.GlobalSettings.setTabIndexAtCardRoot = false;
|
|
85
86
|
const adaptiveCard = new AdaptiveCards.AdaptiveCard();
|
|
86
87
|
adaptiveCard.hostConfig = new AdaptiveCards.HostConfig(adaptiveCardHostConfig);
|
|
87
88
|
adaptiveCard.parse(adpativeCardPayload);
|
|
@@ -111,11 +112,12 @@ function PreChatSurveyPane(props) {
|
|
|
111
112
|
margin: 2px;
|
|
112
113
|
height: 48px;
|
|
113
114
|
border-radius: 5px;
|
|
115
|
+
cursor: pointer;
|
|
114
116
|
font-weight: bold;
|
|
115
117
|
font-size: 15px;
|
|
116
|
-
|
|
117
|
-
color: ${((_props$
|
|
118
|
-
background-color: ${((_props$
|
|
118
|
+
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.defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey === void 0 ? void 0 : _defaultPreChatSurvey.fontFamily)};
|
|
119
|
+
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.defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey2 === void 0 ? void 0 : _defaultPreChatSurvey2.color)};
|
|
120
|
+
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.defaultPreChatSurveyPaneStyles.customButtonStyleProps) === null || _defaultPreChatSurvey3 === void 0 ? void 0 : _defaultPreChatSurvey3.backgroundColor)};
|
|
119
121
|
}`), !((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.hidePreChatSurveyPane) && /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
120
122
|
id: elementId,
|
|
121
123
|
tabIndex: -1,
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.defaultPreChatSurveyPaneButtonStyles = void 0;
|
|
7
7
|
const defaultPreChatSurveyPaneButtonStyles = {
|
|
8
8
|
backgroundColor: "rgb(49, 95, 162)",
|
|
9
|
-
color: "#FFFFFF"
|
|
9
|
+
color: "#FFFFFF",
|
|
10
|
+
fontFamily: "Segoe UI, Arial, sans-serif"
|
|
10
11
|
};
|
|
11
12
|
exports.defaultPreChatSurveyPaneButtonStyles = defaultPreChatSurveyPaneButtonStyles;
|
|
@@ -13,6 +13,8 @@ var _BroadcastService = require("../../services/BroadcastService");
|
|
|
13
13
|
|
|
14
14
|
var _Button = require("@fluentui/react/lib/Button");
|
|
15
15
|
|
|
16
|
+
var _CloseButton = _interopRequireDefault(require("../common/subcomponents/CloseButton"));
|
|
17
|
+
|
|
16
18
|
var _Constants = require("../../common/Constants");
|
|
17
19
|
|
|
18
20
|
var _decodeComponentString = require("../../common/decodeComponentString");
|
|
@@ -21,10 +23,6 @@ var _defaultProactiveChatPaneBodyContainerStyles = require("./common/default/def
|
|
|
21
23
|
|
|
22
24
|
var _defaultProactiveChatPaneBodyTitleStyles = require("./common/default/defaultStyles/defaultProactiveChatPaneBodyTitleStyles");
|
|
23
25
|
|
|
24
|
-
var _defaultProactiveChatPaneCloseButtonHoveredStyles = require("./common/default/defaultStyles/defaultProactiveChatPaneCloseButtonHoveredStyles");
|
|
25
|
-
|
|
26
|
-
var _defaultProactiveChatPaneCloseButtonStyles = require("./common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles");
|
|
27
|
-
|
|
28
26
|
var _defaultProactiveChatPaneControlProps = require("./common/default/defaultProps/defaultProactiveChatPaneControlProps");
|
|
29
27
|
|
|
30
28
|
var _defaultProactiveChatPaneGeneralStyles = require("./common/default/defaultStyles/defaultProactiveChatPaneGeneralStyles");
|
|
@@ -43,12 +41,18 @@ var _defaultProactiveChatPaneTitleStyles = require("./common/default/defaultStyl
|
|
|
43
41
|
|
|
44
42
|
var _utils = require("../../common/utils");
|
|
45
43
|
|
|
44
|
+
var _defaultProactiveChatPaneProps = require("./common/default/defaultProps/defaultProactiveChatPaneProps");
|
|
45
|
+
|
|
46
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
47
|
+
|
|
46
48
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
47
49
|
|
|
48
50
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
49
51
|
|
|
52
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
53
|
+
|
|
50
54
|
function ProactiveChatPane(props) {
|
|
51
|
-
var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$styleProps8, _props$styleProps9, _props$styleProps10, _props$styleProps11, _props$
|
|
55
|
+
var _props$controlProps, _defaultProactiveChat, _props$controlProps6, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$styleProps5, _defaultProactiveChat2, _props$styleProps6, _defaultProactiveChat3, _props$styleProps7, _props$styleProps8, _props$styleProps9, _props$styleProps10, _props$styleProps11, _props$styleProps12, _props$controlProps7, _props$styleProps13, _props$styleProps13$c, _props$controlProps8, _props$controlProps9, _props$styleProps14, _props$styleProps14$c, _props$styleProps15, _props$styleProps15$c, _props$controlProps10, _props$componentOverr, _props$styleProps16, _props$styleProps16$c, _props$controlProps11, _props$controlProps12, _props$componentOverr2, _props$styleProps17, _props$styleProps17$c, _props$controlProps13, _props$controlProps14, _props$componentOverr3, _props$styleProps18, _props$styleProps18$c, _props$controlProps15, _props$styleProps19, _props$styleProps19$c, _props$controlProps16, _props$componentOverr4, _props$styleProps20, _props$styleProps20$c, _props$controlProps17, _props$controlProps18, _props$componentOverr5, _props$styleProps21, _props$styleProps21$c, _props$controlProps19, _props$controlProps20;
|
|
52
56
|
|
|
53
57
|
const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.id;
|
|
54
58
|
|
|
@@ -100,6 +104,7 @@ function ProactiveChatPane(props) {
|
|
|
100
104
|
(_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.onStart();
|
|
101
105
|
}
|
|
102
106
|
}, []);
|
|
107
|
+
const closeButtonProps = Object.assign({}, (_defaultProactiveChat = _defaultProactiveChatPaneProps.defaultProactiveChatPaneProps.controlProps) === null || _defaultProactiveChat === void 0 ? void 0 : _defaultProactiveChat.closeButtonProps, (_props$controlProps6 = props.controlProps) === null || _props$controlProps6 === void 0 ? void 0 : _props$controlProps6.closeButtonProps);
|
|
103
108
|
const containerStyles = {
|
|
104
109
|
root: Object.assign({}, _defaultProactiveChatPaneGeneralStyles.defaultProactiveChatPaneGeneralStyles, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps)
|
|
105
110
|
};
|
|
@@ -115,10 +120,8 @@ function ProactiveChatPane(props) {
|
|
|
115
120
|
const subtitleStyles = {
|
|
116
121
|
root: Object.assign({}, _defaultProactiveChatPaneSubtitleStyles.defaultProactiveChatPaneSubtitleStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.subtitleStyleProps)
|
|
117
122
|
};
|
|
118
|
-
const closeButtonStyles = {
|
|
119
|
-
|
|
120
|
-
rootHovered: Object.assign({}, _defaultProactiveChatPaneCloseButtonHoveredStyles.defaultProactiveChatPaneCloseButtonHoveredStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.closeButtonHoveredStyleProps)
|
|
121
|
-
};
|
|
123
|
+
const closeButtonStyles = Object.assign({}, (_defaultProactiveChat2 = _defaultProactiveChatPaneProps.defaultProactiveChatPaneProps.styleProps) === null || _defaultProactiveChat2 === void 0 ? void 0 : _defaultProactiveChat2.closeButtonStyleProps, (_props$styleProps6 = props.styleProps) === null || _props$styleProps6 === void 0 ? void 0 : _props$styleProps6.closeButtonStyleProps);
|
|
124
|
+
const closeButtonHoverStyles = Object.assign({}, (_defaultProactiveChat3 = _defaultProactiveChatPaneProps.defaultProactiveChatPaneProps.styleProps) === null || _defaultProactiveChat3 === void 0 ? void 0 : _defaultProactiveChat3.closeButtonHoveredStyleProps, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.closeButtonHoveredStyleProps);
|
|
122
125
|
const bodyContainerStyles = {
|
|
123
126
|
root: Object.assign({}, _defaultProactiveChatPaneBodyContainerStyles.defaultProactiveChatPaneBodyContainerStyles, (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : _props$styleProps8.bodyContainerStyleProps)
|
|
124
127
|
};
|
|
@@ -127,57 +130,57 @@ function ProactiveChatPane(props) {
|
|
|
127
130
|
};
|
|
128
131
|
const startButtonStyles = {
|
|
129
132
|
root: Object.assign({}, _defaultProactiveChatPaneStartButtonStyles.defaultProactiveChatPaneStartButtonStyles, (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.startButtonStyleProps),
|
|
130
|
-
rootHovered: Object.assign({}, _defaultProactiveChatPaneStartButtonHoveredStyles.defaultProactiveChatPaneStartButtonHoveredStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.startButtonHoveredStyleProps)
|
|
133
|
+
rootHovered: Object.assign({}, _defaultProactiveChatPaneStartButtonHoveredStyles.defaultProactiveChatPaneStartButtonHoveredStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.startButtonHoveredStyleProps),
|
|
134
|
+
rootPressed: Object.assign({}, _defaultProactiveChatPaneStartButtonHoveredStyles.defaultProactiveChatPaneStartButtonHoveredStyles, (_props$styleProps12 = props.styleProps) === null || _props$styleProps12 === void 0 ? void 0 : _props$styleProps12.startButtonHoveredStyleProps)
|
|
131
135
|
};
|
|
132
|
-
return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, !((_props$
|
|
133
|
-
className: (_props$
|
|
136
|
+
return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, !((_props$controlProps7 = props.controlProps) !== null && _props$controlProps7 !== void 0 && _props$controlProps7.hideProactiveChatPane) && /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
137
|
+
className: (_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : (_props$styleProps13$c = _props$styleProps13.classNames) === null || _props$styleProps13$c === void 0 ? void 0 : _props$styleProps13$c.containerClassName,
|
|
134
138
|
id: elementId,
|
|
135
139
|
tabIndex: -1,
|
|
136
140
|
onKeyDown: handleEscKeyDown,
|
|
137
|
-
dir: ((_props$
|
|
138
|
-
"aria-label": ((_props$
|
|
141
|
+
dir: ((_props$controlProps8 = props.controlProps) === null || _props$controlProps8 === void 0 ? void 0 : _props$controlProps8.dir) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.dir,
|
|
142
|
+
"aria-label": ((_props$controlProps9 = props.controlProps) === null || _props$controlProps9 === void 0 ? void 0 : _props$controlProps9.proactiveChatPaneAriaLabel) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.proactiveChatPaneAriaLabel,
|
|
139
143
|
styles: containerStyles
|
|
140
144
|
}, /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
141
145
|
horizontal: true,
|
|
142
|
-
className: (_props$
|
|
146
|
+
className: (_props$styleProps14 = props.styleProps) === null || _props$styleProps14 === void 0 ? void 0 : (_props$styleProps14$c = _props$styleProps14.classNames) === null || _props$styleProps14$c === void 0 ? void 0 : _props$styleProps14$c.headerContainerClassName,
|
|
143
147
|
styles: headerContainerStyles,
|
|
144
148
|
tabIndex: -1,
|
|
145
149
|
id: elementId + "-headercontainer"
|
|
146
150
|
}, /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
147
|
-
className: (_props$
|
|
151
|
+
className: (_props$styleProps15 = props.styleProps) === null || _props$styleProps15 === void 0 ? void 0 : (_props$styleProps15$c = _props$styleProps15.classNames) === null || _props$styleProps15$c === void 0 ? void 0 : _props$styleProps15$c.textContainerClassName,
|
|
148
152
|
styles: textContainerStyles,
|
|
149
153
|
tabIndex: -1,
|
|
150
154
|
id: elementId + "-textcontainer"
|
|
151
|
-
}, !((_props$
|
|
152
|
-
className: (_props$
|
|
155
|
+
}, !((_props$controlProps10 = props.controlProps) !== null && _props$controlProps10 !== void 0 && _props$controlProps10.hideTitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.title) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
|
|
156
|
+
className: (_props$styleProps16 = props.styleProps) === null || _props$styleProps16 === void 0 ? void 0 : (_props$styleProps16$c = _props$styleProps16.classNames) === null || _props$styleProps16$c === void 0 ? void 0 : _props$styleProps16$c.titleClassName,
|
|
153
157
|
styles: titleStyles,
|
|
154
158
|
tabIndex: -1,
|
|
155
159
|
id: elementId + "-title"
|
|
156
|
-
}, ((_props$
|
|
157
|
-
className: (_props$
|
|
160
|
+
}, ((_props$controlProps11 = props.controlProps) === null || _props$controlProps11 === void 0 ? void 0 : _props$controlProps11.titleText) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.titleText)), !((_props$controlProps12 = props.controlProps) !== null && _props$controlProps12 !== void 0 && _props$controlProps12.hideSubtitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr2 = props.componentOverrides) === null || _props$componentOverr2 === void 0 ? void 0 : _props$componentOverr2.subtitle) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
|
|
161
|
+
className: (_props$styleProps17 = props.styleProps) === null || _props$styleProps17 === void 0 ? void 0 : (_props$styleProps17$c = _props$styleProps17.classNames) === null || _props$styleProps17$c === void 0 ? void 0 : _props$styleProps17$c.subtitleClassName,
|
|
158
162
|
styles: subtitleStyles,
|
|
159
163
|
tabIndex: -1,
|
|
160
164
|
id: elementId + "-subtitle"
|
|
161
|
-
}, ((_props$
|
|
162
|
-
className: (_props$
|
|
163
|
-
styles: closeButtonStyles,
|
|
164
|
-
tabIndex: 0,
|
|
165
|
+
}, ((_props$controlProps13 = props.controlProps) === null || _props$controlProps13 === void 0 ? void 0 : _props$controlProps13.subtitleText) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.subtitleText))), !((_props$controlProps14 = props.controlProps) !== null && _props$controlProps14 !== void 0 && _props$controlProps14.hideCloseButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.closeButton) || /*#__PURE__*/_react2.default.createElement(_CloseButton.default, _extends({}, closeButtonProps, {
|
|
166
|
+
className: (_props$styleProps18 = props.styleProps) === null || _props$styleProps18 === void 0 ? void 0 : (_props$styleProps18$c = _props$styleProps18.classNames) === null || _props$styleProps18$c === void 0 ? void 0 : _props$styleProps18$c.closeButtonClassName,
|
|
165
167
|
onClick: handleCloseClick,
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
168
|
+
styles: closeButtonStyles,
|
|
169
|
+
hoverStyles: closeButtonHoverStyles,
|
|
170
|
+
id: elementId + "-closebutton"
|
|
171
|
+
})))), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
169
172
|
horizontal: ((_props$controlProps15 = props.controlProps) === null || _props$controlProps15 === void 0 ? void 0 : _props$controlProps15.isBodyContainerHorizantal) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.isBodyContainerHorizantal,
|
|
170
|
-
className: (_props$
|
|
173
|
+
className: (_props$styleProps19 = props.styleProps) === null || _props$styleProps19 === void 0 ? void 0 : (_props$styleProps19$c = _props$styleProps19.classNames) === null || _props$styleProps19$c === void 0 ? void 0 : _props$styleProps19$c.bodyContainerClassName,
|
|
171
174
|
styles: bodyContainerStyles,
|
|
172
175
|
tabIndex: -1,
|
|
173
176
|
id: elementId + "-bodycontainer"
|
|
174
177
|
}, !((_props$controlProps16 = props.controlProps) !== null && _props$controlProps16 !== void 0 && _props$controlProps16.hideBodyTitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr4 = props.componentOverrides) === null || _props$componentOverr4 === void 0 ? void 0 : _props$componentOverr4.bodyTitle) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
|
|
175
|
-
className: (_props$
|
|
178
|
+
className: (_props$styleProps20 = props.styleProps) === null || _props$styleProps20 === void 0 ? void 0 : (_props$styleProps20$c = _props$styleProps20.classNames) === null || _props$styleProps20$c === void 0 ? void 0 : _props$styleProps20$c.bodyTitleClassName,
|
|
176
179
|
styles: bodyTitleStyles,
|
|
177
180
|
tabIndex: -1,
|
|
178
181
|
id: elementId + "-bodytitle"
|
|
179
182
|
}, ((_props$controlProps17 = props.controlProps) === null || _props$controlProps17 === void 0 ? void 0 : _props$controlProps17.bodyTitleText) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.bodyTitleText)), !((_props$controlProps18 = props.controlProps) !== null && _props$controlProps18 !== void 0 && _props$controlProps18.hideStartButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr5 = props.componentOverrides) === null || _props$componentOverr5 === void 0 ? void 0 : _props$componentOverr5.startButton) || /*#__PURE__*/_react2.default.createElement(_Button.DefaultButton, {
|
|
180
|
-
className: (_props$
|
|
183
|
+
className: (_props$styleProps21 = props.styleProps) === null || _props$styleProps21 === void 0 ? void 0 : (_props$styleProps21$c = _props$styleProps21.classNames) === null || _props$styleProps21$c === void 0 ? void 0 : _props$styleProps21$c.startButtonClassName,
|
|
181
184
|
styles: startButtonStyles,
|
|
182
185
|
tabIndex: 0,
|
|
183
186
|
text: ((_props$controlProps19 = props.controlProps) === null || _props$controlProps19 === void 0 ? void 0 : _props$controlProps19.startButtonText) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.startButtonText,
|