@microsoft/omnichannel-chat-components 0.1.0-main.2eda736 → 0.1.0-main.353ecff
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 +11 -2
- package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +30 -0
- 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 +30 -0
- package/lib/cjs/components/chatbutton/ChatButton.js +36 -26
- package/lib/cjs/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +3 -1
- package/lib/cjs/components/common/commandbutton/CommandButton.js +6 -8
- package/lib/cjs/components/confirmationpane/ConfirmationPane.js +12 -10
- package/lib/cjs/components/footer/subcomponents/AudioNotificationButton.js +4 -9
- package/lib/cjs/components/inputvalidationpane/InputValidationPane.js +48 -18
- package/lib/cjs/components/prechatsurveypane/PreChatSurveyPane.js +5 -4
- package/lib/cjs/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +2 -1
- package/lib/cjs/components/proactivechatpane/ProactiveChatPane.js +17 -15
- package/lib/cjs/components/reconnectchatpane/ReconnectChatPane.js +14 -12
- package/lib/esm/common/Constants.js +9 -1
- package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +32 -2
- 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 +32 -2
- package/lib/esm/components/chatbutton/ChatButton.js +36 -26
- package/lib/esm/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +3 -1
- package/lib/esm/components/common/commandbutton/CommandButton.js +6 -8
- package/lib/esm/components/confirmationpane/ConfirmationPane.js +12 -10
- package/lib/esm/components/footer/subcomponents/AudioNotificationButton.js +4 -9
- package/lib/esm/components/inputvalidationpane/InputValidationPane.js +48 -18
- package/lib/esm/components/prechatsurveypane/PreChatSurveyPane.js +5 -4
- package/lib/esm/components/prechatsurveypane/common/defaultProps/defaultStyles/defaultPreChatSurveyPaneButtonStyles.js +2 -1
- package/lib/esm/components/proactivechatpane/ProactiveChatPane.js +17 -15
- package/lib/esm/components/reconnectchatpane/ReconnectChatPane.js +14 -12
- package/lib/types/common/Constants.d.ts +7 -0
- package/lib/types/components/callingcontainer/subcomponents/CurrentCall/interfaces/ICurrentCallStyleProps.d.ts +0 -4
- package/lib/types/components/chatbutton/interfaces/IChatButtonControlProps.d.ts +2 -0
- package/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneButtonStyles.d.ts +1 -0
- package/package.json +3 -6
|
@@ -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;
|
|
@@ -111,11 +111,12 @@ function PreChatSurveyPane(props) {
|
|
|
111
111
|
margin: 2px;
|
|
112
112
|
height: 48px;
|
|
113
113
|
border-radius: 5px;
|
|
114
|
+
cursor: pointer;
|
|
114
115
|
font-weight: bold;
|
|
115
116
|
font-size: 15px;
|
|
116
|
-
|
|
117
|
-
color: ${((_props$
|
|
118
|
-
background-color: ${((_props$
|
|
117
|
+
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)};
|
|
118
|
+
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)};
|
|
119
|
+
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
120
|
}`), !((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.hidePreChatSurveyPane) && /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
120
121
|
id: elementId,
|
|
121
122
|
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;
|
|
@@ -48,7 +48,7 @@ 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 ProactiveChatPane(props) {
|
|
51
|
-
var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$styleProps8, _props$styleProps9, _props$styleProps10, _props$styleProps11, _props$controlProps6, _props$
|
|
51
|
+
var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$styleProps8, _props$styleProps9, _props$styleProps10, _props$styleProps11, _props$styleProps12, _props$styleProps13, _props$controlProps6, _props$styleProps14, _props$styleProps14$c, _props$controlProps7, _props$controlProps8, _props$styleProps15, _props$styleProps15$c, _props$styleProps16, _props$styleProps16$c, _props$controlProps9, _props$componentOverr, _props$styleProps17, _props$styleProps17$c, _props$controlProps10, _props$controlProps11, _props$componentOverr2, _props$styleProps18, _props$styleProps18$c, _props$controlProps12, _props$controlProps13, _props$componentOverr3, _props$styleProps19, _props$styleProps19$c, _props$controlProps14, _props$controlProps15, _props$styleProps20, _props$styleProps20$c, _props$controlProps16, _props$componentOverr4, _props$styleProps21, _props$styleProps21$c, _props$controlProps17, _props$controlProps18, _props$componentOverr5, _props$styleProps22, _props$styleProps22$c, _props$controlProps19, _props$controlProps20;
|
|
52
52
|
|
|
53
53
|
const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.id;
|
|
54
54
|
|
|
@@ -117,20 +117,22 @@ function ProactiveChatPane(props) {
|
|
|
117
117
|
};
|
|
118
118
|
const closeButtonStyles = {
|
|
119
119
|
root: Object.assign({}, _defaultProactiveChatPaneCloseButtonStyles.defaultProactiveChatPaneCloseButtonStyles, (_props$styleProps6 = props.styleProps) === null || _props$styleProps6 === void 0 ? void 0 : _props$styleProps6.closeButtonStyleProps),
|
|
120
|
-
rootHovered: Object.assign({}, _defaultProactiveChatPaneCloseButtonHoveredStyles.defaultProactiveChatPaneCloseButtonHoveredStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.closeButtonHoveredStyleProps)
|
|
120
|
+
rootHovered: Object.assign({}, _defaultProactiveChatPaneCloseButtonHoveredStyles.defaultProactiveChatPaneCloseButtonHoveredStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.closeButtonHoveredStyleProps),
|
|
121
|
+
rootPressed: Object.assign({}, _defaultProactiveChatPaneCloseButtonHoveredStyles.defaultProactiveChatPaneCloseButtonHoveredStyles, (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : _props$styleProps8.closeButtonHoveredStyleProps)
|
|
121
122
|
};
|
|
122
123
|
const bodyContainerStyles = {
|
|
123
|
-
root: Object.assign({}, _defaultProactiveChatPaneBodyContainerStyles.defaultProactiveChatPaneBodyContainerStyles, (_props$
|
|
124
|
+
root: Object.assign({}, _defaultProactiveChatPaneBodyContainerStyles.defaultProactiveChatPaneBodyContainerStyles, (_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 ? void 0 : _props$styleProps9.bodyContainerStyleProps)
|
|
124
125
|
};
|
|
125
126
|
const bodyTitleStyles = {
|
|
126
|
-
root: Object.assign({}, _defaultProactiveChatPaneBodyTitleStyles.defaultProactiveChatPaneBodyTitleStyles, (_props$
|
|
127
|
+
root: Object.assign({}, _defaultProactiveChatPaneBodyTitleStyles.defaultProactiveChatPaneBodyTitleStyles, (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.bodyTitleStyleProps)
|
|
127
128
|
};
|
|
128
129
|
const startButtonStyles = {
|
|
129
|
-
root: Object.assign({}, _defaultProactiveChatPaneStartButtonStyles.defaultProactiveChatPaneStartButtonStyles, (_props$
|
|
130
|
-
rootHovered: Object.assign({}, _defaultProactiveChatPaneStartButtonHoveredStyles.defaultProactiveChatPaneStartButtonHoveredStyles, (_props$
|
|
130
|
+
root: Object.assign({}, _defaultProactiveChatPaneStartButtonStyles.defaultProactiveChatPaneStartButtonStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.startButtonStyleProps),
|
|
131
|
+
rootHovered: Object.assign({}, _defaultProactiveChatPaneStartButtonHoveredStyles.defaultProactiveChatPaneStartButtonHoveredStyles, (_props$styleProps12 = props.styleProps) === null || _props$styleProps12 === void 0 ? void 0 : _props$styleProps12.startButtonHoveredStyleProps),
|
|
132
|
+
rootPressed: Object.assign({}, _defaultProactiveChatPaneStartButtonHoveredStyles.defaultProactiveChatPaneStartButtonHoveredStyles, (_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : _props$styleProps13.startButtonHoveredStyleProps)
|
|
131
133
|
};
|
|
132
134
|
return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, !((_props$controlProps6 = props.controlProps) !== null && _props$controlProps6 !== void 0 && _props$controlProps6.hideProactiveChatPane) && /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
133
|
-
className: (_props$
|
|
135
|
+
className: (_props$styleProps14 = props.styleProps) === null || _props$styleProps14 === void 0 ? void 0 : (_props$styleProps14$c = _props$styleProps14.classNames) === null || _props$styleProps14$c === void 0 ? void 0 : _props$styleProps14$c.containerClassName,
|
|
134
136
|
id: elementId,
|
|
135
137
|
tabIndex: -1,
|
|
136
138
|
onKeyDown: handleEscKeyDown,
|
|
@@ -139,27 +141,27 @@ function ProactiveChatPane(props) {
|
|
|
139
141
|
styles: containerStyles
|
|
140
142
|
}, /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
141
143
|
horizontal: true,
|
|
142
|
-
className: (_props$
|
|
144
|
+
className: (_props$styleProps15 = props.styleProps) === null || _props$styleProps15 === void 0 ? void 0 : (_props$styleProps15$c = _props$styleProps15.classNames) === null || _props$styleProps15$c === void 0 ? void 0 : _props$styleProps15$c.headerContainerClassName,
|
|
143
145
|
styles: headerContainerStyles,
|
|
144
146
|
tabIndex: -1,
|
|
145
147
|
id: elementId + "-headercontainer"
|
|
146
148
|
}, /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
147
|
-
className: (_props$
|
|
149
|
+
className: (_props$styleProps16 = props.styleProps) === null || _props$styleProps16 === void 0 ? void 0 : (_props$styleProps16$c = _props$styleProps16.classNames) === null || _props$styleProps16$c === void 0 ? void 0 : _props$styleProps16$c.textContainerClassName,
|
|
148
150
|
styles: textContainerStyles,
|
|
149
151
|
tabIndex: -1,
|
|
150
152
|
id: elementId + "-textcontainer"
|
|
151
153
|
}, !((_props$controlProps9 = props.controlProps) !== null && _props$controlProps9 !== void 0 && _props$controlProps9.hideTitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.title) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
|
|
152
|
-
className: (_props$
|
|
154
|
+
className: (_props$styleProps17 = props.styleProps) === null || _props$styleProps17 === void 0 ? void 0 : (_props$styleProps17$c = _props$styleProps17.classNames) === null || _props$styleProps17$c === void 0 ? void 0 : _props$styleProps17$c.titleClassName,
|
|
153
155
|
styles: titleStyles,
|
|
154
156
|
tabIndex: -1,
|
|
155
157
|
id: elementId + "-title"
|
|
156
158
|
}, ((_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.titleText) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.titleText)), !((_props$controlProps11 = props.controlProps) !== null && _props$controlProps11 !== void 0 && _props$controlProps11.hideSubtitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr2 = props.componentOverrides) === null || _props$componentOverr2 === void 0 ? void 0 : _props$componentOverr2.subtitle) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
|
|
157
|
-
className: (_props$
|
|
159
|
+
className: (_props$styleProps18 = props.styleProps) === null || _props$styleProps18 === void 0 ? void 0 : (_props$styleProps18$c = _props$styleProps18.classNames) === null || _props$styleProps18$c === void 0 ? void 0 : _props$styleProps18$c.subtitleClassName,
|
|
158
160
|
styles: subtitleStyles,
|
|
159
161
|
tabIndex: -1,
|
|
160
162
|
id: elementId + "-subtitle"
|
|
161
163
|
}, ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.subtitleText) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.subtitleText))), !((_props$controlProps13 = props.controlProps) !== null && _props$controlProps13 !== void 0 && _props$controlProps13.hideCloseButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.closeButton) || /*#__PURE__*/_react2.default.createElement(_react.IconButton, {
|
|
162
|
-
className: (_props$
|
|
164
|
+
className: (_props$styleProps19 = props.styleProps) === null || _props$styleProps19 === void 0 ? void 0 : (_props$styleProps19$c = _props$styleProps19.classNames) === null || _props$styleProps19$c === void 0 ? void 0 : _props$styleProps19$c.closeButtonClassName,
|
|
163
165
|
styles: closeButtonStyles,
|
|
164
166
|
tabIndex: 0,
|
|
165
167
|
onClick: handleCloseClick,
|
|
@@ -167,17 +169,17 @@ function ProactiveChatPane(props) {
|
|
|
167
169
|
"aria-label": ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.closeButtonAriaLabel) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.closeButtonAriaLabel
|
|
168
170
|
}))), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
169
171
|
horizontal: ((_props$controlProps15 = props.controlProps) === null || _props$controlProps15 === void 0 ? void 0 : _props$controlProps15.isBodyContainerHorizantal) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.isBodyContainerHorizantal,
|
|
170
|
-
className: (_props$
|
|
172
|
+
className: (_props$styleProps20 = props.styleProps) === null || _props$styleProps20 === void 0 ? void 0 : (_props$styleProps20$c = _props$styleProps20.classNames) === null || _props$styleProps20$c === void 0 ? void 0 : _props$styleProps20$c.bodyContainerClassName,
|
|
171
173
|
styles: bodyContainerStyles,
|
|
172
174
|
tabIndex: -1,
|
|
173
175
|
id: elementId + "-bodycontainer"
|
|
174
176
|
}, !((_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$
|
|
177
|
+
className: (_props$styleProps21 = props.styleProps) === null || _props$styleProps21 === void 0 ? void 0 : (_props$styleProps21$c = _props$styleProps21.classNames) === null || _props$styleProps21$c === void 0 ? void 0 : _props$styleProps21$c.bodyTitleClassName,
|
|
176
178
|
styles: bodyTitleStyles,
|
|
177
179
|
tabIndex: -1,
|
|
178
180
|
id: elementId + "-bodytitle"
|
|
179
181
|
}, ((_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$
|
|
182
|
+
className: (_props$styleProps22 = props.styleProps) === null || _props$styleProps22 === void 0 ? void 0 : (_props$styleProps22$c = _props$styleProps22.classNames) === null || _props$styleProps22$c === void 0 ? void 0 : _props$styleProps22$c.startButtonClassName,
|
|
181
183
|
styles: startButtonStyles,
|
|
182
184
|
tabIndex: 0,
|
|
183
185
|
text: ((_props$controlProps19 = props.controlProps) === null || _props$controlProps19 === void 0 ? void 0 : _props$controlProps19.startButtonText) || _defaultProactiveChatPaneControlProps.defaultProactiveChatPaneControlProps.startButtonText,
|
|
@@ -42,7 +42,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
42
42
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
43
43
|
|
|
44
44
|
function ReconnectChatPane(props) {
|
|
45
|
-
var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$styleProps8, _props$styleProps9, _props$styleProps10, _props$controlProps8, _props$
|
|
45
|
+
var _props$controlProps, _props$styleProps, _props$styleProps2, _props$styleProps3, _props$styleProps4, _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$styleProps8, _props$styleProps9, _props$styleProps10, _props$styleProps11, _props$styleProps12, _props$controlProps8, _props$styleProps13, _props$styleProps13$c, _props$controlProps9, _props$controlProps10, _props$styleProps14, _props$styleProps14$c, _props$controlProps11, _props$componentOverr, _props$styleProps15, _props$styleProps15$c, _props$controlProps12, _props$controlProps13, _props$componentOverr2, _props$styleProps16, _props$styleProps16$c, _props$controlProps14, _props$controlProps15, _props$componentOverr3, _props$styleProps17, _props$styleProps17$c, _props$controlProps16, _props$controlProps17, _props$styleProps18, _props$styleProps18$c, _props$controlProps18, _props$componentOverr4, _props$styleProps19, _props$styleProps19$c, _props$controlProps19, _props$controlProps20, _props$controlProps21, _props$componentOverr5, _props$styleProps20, _props$styleProps20$c, _props$controlProps22, _props$controlProps23;
|
|
46
46
|
|
|
47
47
|
const elementId = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.id) ?? _defaultReconnectChatPaneControlProps.defaultReconnectChatPaneControlProps.id;
|
|
48
48
|
const handleContinueChatClick = (0, _react2.useCallback)(() => {
|
|
@@ -117,14 +117,16 @@ function ReconnectChatPane(props) {
|
|
|
117
117
|
};
|
|
118
118
|
const continueChatButtonStyles = {
|
|
119
119
|
root: Object.assign({}, _defaultReconnectChatPaneContinueChatButtonStyles.defaultReconnectChatPaneContinueChatButtonStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.continueChatButtonStyleProps),
|
|
120
|
-
rootHovered: Object.assign({}, _defaultReconnectChatPaneContinueChatButtonHoveredStyles.defaultReconnectChatPaneContinueChatButtonHoveredStyles, (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : _props$styleProps8.continueChatButtonHoveredStyleProps)
|
|
120
|
+
rootHovered: Object.assign({}, _defaultReconnectChatPaneContinueChatButtonHoveredStyles.defaultReconnectChatPaneContinueChatButtonHoveredStyles, (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : _props$styleProps8.continueChatButtonHoveredStyleProps),
|
|
121
|
+
rootPressed: Object.assign({}, _defaultReconnectChatPaneContinueChatButtonHoveredStyles.defaultReconnectChatPaneContinueChatButtonHoveredStyles, (_props$styleProps9 = props.styleProps) === null || _props$styleProps9 === void 0 ? void 0 : _props$styleProps9.continueChatButtonHoveredStyleProps)
|
|
121
122
|
};
|
|
122
123
|
const startNewChatButtonStyles = {
|
|
123
|
-
root: Object.assign({}, _defaultReconnectChatPaneStartNewChatButtonStyles.defaultReconnectChatPaneStartNewChatButtonStyles, (_props$
|
|
124
|
-
rootHovered: Object.assign({}, _defaultReconnectChatPaneStartNewChatButtonHoveredStyles.defaultReconnectChatPaneStartNewChatButtonHoveredStyles, (_props$
|
|
124
|
+
root: Object.assign({}, _defaultReconnectChatPaneStartNewChatButtonStyles.defaultReconnectChatPaneStartNewChatButtonStyles, (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.startNewChatButtonStyleProps),
|
|
125
|
+
rootHovered: Object.assign({}, _defaultReconnectChatPaneStartNewChatButtonHoveredStyles.defaultReconnectChatPaneStartNewChatButtonHoveredStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.startNewChatButtonHoveredStyleProps),
|
|
126
|
+
rootPressed: Object.assign({}, _defaultReconnectChatPaneStartNewChatButtonHoveredStyles.defaultReconnectChatPaneStartNewChatButtonHoveredStyles, (_props$styleProps12 = props.styleProps) === null || _props$styleProps12 === void 0 ? void 0 : _props$styleProps12.startNewChatButtonHoveredStyleProps)
|
|
125
127
|
};
|
|
126
128
|
return /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, !((_props$controlProps8 = props.controlProps) !== null && _props$controlProps8 !== void 0 && _props$controlProps8.hideReconnectChatPane) && /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
127
|
-
className: (_props$
|
|
129
|
+
className: (_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : (_props$styleProps13$c = _props$styleProps13.classNames) === null || _props$styleProps13$c === void 0 ? void 0 : _props$styleProps13$c.containerClassName,
|
|
128
130
|
id: elementId,
|
|
129
131
|
tabIndex: -1,
|
|
130
132
|
onKeyDown: handleEscKeyDown,
|
|
@@ -132,22 +134,22 @@ function ReconnectChatPane(props) {
|
|
|
132
134
|
"aria-label": ((_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.reconnectChatPaneAriaLabel) || _defaultReconnectChatPaneControlProps.defaultReconnectChatPaneControlProps.reconnectChatPaneAriaLabel,
|
|
133
135
|
styles: containerStyles
|
|
134
136
|
}, /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
135
|
-
className: (_props$
|
|
137
|
+
className: (_props$styleProps14 = props.styleProps) === null || _props$styleProps14 === void 0 ? void 0 : (_props$styleProps14$c = _props$styleProps14.classNames) === null || _props$styleProps14$c === void 0 ? void 0 : _props$styleProps14$c.wrapperClassName,
|
|
136
138
|
styles: wrapperStyles,
|
|
137
139
|
tabIndex: -1,
|
|
138
140
|
id: elementId + "-wrapper"
|
|
139
141
|
}, !((_props$controlProps11 = props.controlProps) !== null && _props$controlProps11 !== void 0 && _props$controlProps11.hideTitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.title) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
|
|
140
|
-
className: (_props$
|
|
142
|
+
className: (_props$styleProps15 = props.styleProps) === null || _props$styleProps15 === void 0 ? void 0 : (_props$styleProps15$c = _props$styleProps15.classNames) === null || _props$styleProps15$c === void 0 ? void 0 : _props$styleProps15$c.titleClassName,
|
|
141
143
|
styles: titleStyles,
|
|
142
144
|
tabIndex: -1,
|
|
143
145
|
id: elementId + "-title"
|
|
144
146
|
}, ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.titleText) || _defaultReconnectChatPaneControlProps.defaultReconnectChatPaneControlProps.titleText)), !((_props$controlProps13 = props.controlProps) !== null && _props$controlProps13 !== void 0 && _props$controlProps13.hideSubtitle) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr2 = props.componentOverrides) === null || _props$componentOverr2 === void 0 ? void 0 : _props$componentOverr2.subtitle) || /*#__PURE__*/_react2.default.createElement(_react.Label, {
|
|
145
|
-
className: (_props$
|
|
147
|
+
className: (_props$styleProps16 = props.styleProps) === null || _props$styleProps16 === void 0 ? void 0 : (_props$styleProps16$c = _props$styleProps16.classNames) === null || _props$styleProps16$c === void 0 ? void 0 : _props$styleProps16$c.subtitleClassName,
|
|
146
148
|
styles: subtitleStyles,
|
|
147
149
|
tabIndex: -1,
|
|
148
150
|
id: elementId + "-subtitle"
|
|
149
151
|
}, ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.subtitleText) || _defaultReconnectChatPaneControlProps.defaultReconnectChatPaneControlProps.subtitleText)), !((_props$controlProps15 = props.controlProps) !== null && _props$controlProps15 !== void 0 && _props$controlProps15.hideIcon) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.icon) || /*#__PURE__*/_react2.default.createElement(_react.Icon, {
|
|
150
|
-
className: (_props$
|
|
152
|
+
className: (_props$styleProps17 = props.styleProps) === null || _props$styleProps17 === void 0 ? void 0 : (_props$styleProps17$c = _props$styleProps17.classNames) === null || _props$styleProps17$c === void 0 ? void 0 : _props$styleProps17$c.iconClassName,
|
|
151
153
|
styles: iconStyles,
|
|
152
154
|
tabIndex: -1,
|
|
153
155
|
role: "img",
|
|
@@ -155,12 +157,12 @@ function ReconnectChatPane(props) {
|
|
|
155
157
|
"aria-label": ((_props$controlProps16 = props.controlProps) === null || _props$controlProps16 === void 0 ? void 0 : _props$controlProps16.iconAriaLabel) || _defaultReconnectChatPaneControlProps.defaultReconnectChatPaneControlProps.iconAriaLabel
|
|
156
158
|
})), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
157
159
|
horizontal: ((_props$controlProps17 = props.controlProps) === null || _props$controlProps17 === void 0 ? void 0 : _props$controlProps17.isButtonGroupHorizontal) || _defaultReconnectChatPaneControlProps.defaultReconnectChatPaneControlProps.isButtonGroupHorizontal,
|
|
158
|
-
className: (_props$
|
|
160
|
+
className: (_props$styleProps18 = props.styleProps) === null || _props$styleProps18 === void 0 ? void 0 : (_props$styleProps18$c = _props$styleProps18.classNames) === null || _props$styleProps18$c === void 0 ? void 0 : _props$styleProps18$c.buttonGroupClassName,
|
|
159
161
|
styles: buttonGroupStyles,
|
|
160
162
|
tabIndex: -1,
|
|
161
163
|
id: elementId + "-buttongroup"
|
|
162
164
|
}, !((_props$controlProps18 = props.controlProps) !== null && _props$controlProps18 !== void 0 && _props$controlProps18.hideContinueChatButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr4 = props.componentOverrides) === null || _props$componentOverr4 === void 0 ? void 0 : _props$componentOverr4.continueChatButton) || /*#__PURE__*/_react2.default.createElement(_react.DefaultButton, {
|
|
163
|
-
className: (_props$
|
|
165
|
+
className: (_props$styleProps19 = props.styleProps) === null || _props$styleProps19 === void 0 ? void 0 : (_props$styleProps19$c = _props$styleProps19.classNames) === null || _props$styleProps19$c === void 0 ? void 0 : _props$styleProps19$c.continueChatButtonClassName,
|
|
164
166
|
styles: continueChatButtonStyles,
|
|
165
167
|
tabIndex: 0,
|
|
166
168
|
text: ((_props$controlProps19 = props.controlProps) === null || _props$controlProps19 === void 0 ? void 0 : _props$controlProps19.continueChatButtonText) || _defaultReconnectChatPaneControlProps.defaultReconnectChatPaneControlProps.continueChatButtonText,
|
|
@@ -168,7 +170,7 @@ function ReconnectChatPane(props) {
|
|
|
168
170
|
id: elementId + "-continueconversationbutton",
|
|
169
171
|
"aria-label": ((_props$controlProps20 = props.controlProps) === null || _props$controlProps20 === void 0 ? void 0 : _props$controlProps20.continueChatButtonAriaLabel) || _defaultReconnectChatPaneControlProps.defaultReconnectChatPaneControlProps.continueChatButtonAriaLabel
|
|
170
172
|
})), !((_props$controlProps21 = props.controlProps) !== null && _props$controlProps21 !== void 0 && _props$controlProps21.hideStartNewChatButton) && ((0, _decodeComponentString.decodeComponentString)((_props$componentOverr5 = props.componentOverrides) === null || _props$componentOverr5 === void 0 ? void 0 : _props$componentOverr5.startNewChatButton) || /*#__PURE__*/_react2.default.createElement(_react.DefaultButton, {
|
|
171
|
-
className: (_props$
|
|
173
|
+
className: (_props$styleProps20 = props.styleProps) === null || _props$styleProps20 === void 0 ? void 0 : (_props$styleProps20$c = _props$styleProps20.classNames) === null || _props$styleProps20$c === void 0 ? void 0 : _props$styleProps20$c.startNewChatButtonClassName,
|
|
172
174
|
styles: startNewChatButtonStyles,
|
|
173
175
|
tabIndex: 0,
|
|
174
176
|
text: ((_props$controlProps22 = props.controlProps) === null || _props$controlProps22 === void 0 ? void 0 : _props$controlProps22.startNewChatButtonText) || _defaultReconnectChatPaneControlProps.defaultReconnectChatPaneControlProps.startNewChatButtonText,
|
|
@@ -7,7 +7,15 @@ export const AccessibilityBrightnessRatio = 1.2;
|
|
|
7
7
|
/* App constants*/
|
|
8
8
|
|
|
9
9
|
export const BROADCAST_CHANNEL_NAME = "omnichannel_broadcast_channel";
|
|
10
|
-
export const
|
|
10
|
+
export const HiddenTextStyles = {
|
|
11
|
+
position: "absolute",
|
|
12
|
+
height: "1px",
|
|
13
|
+
width: "1px",
|
|
14
|
+
overflow: "hidden",
|
|
15
|
+
clip: "rect(1px, 1px, 1px, 1px)",
|
|
16
|
+
whiteSpace: "nowrap"
|
|
17
|
+
};
|
|
18
|
+
export const KeyCodes = (_class = class KeyCodes {}, _defineProperty(_class, "ENTER", "Enter"), _defineProperty(_class, "ESCAPE", "Escape"), _defineProperty(_class, "SPACE", "Space"), _defineProperty(_class, "DeclineCallHotKey", "D"), _defineProperty(_class, "AcceptAudioCallHotKey", "S"), _defineProperty(_class, "AcceptVideoCallHotKey", "A"), _defineProperty(_class, "ToggleMicHotKey", "M"), _defineProperty(_class, "ToggleCameraHotKey", "O"), _class);
|
|
11
19
|
export const Regex = (_class2 = class Regex {}, _defineProperty(_class2, "EmailRegex", "(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])"), _defineProperty(_class2, "URLRegex", /(https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|www\.[a-zA-Z0-9][a-zA-Z0-9-]+[a-zA-Z0-9]\.[^\s]{2,}|https?:\/\/(?:www\.|(?!www))[a-zA-Z0-9]+\.[^\s]{2,}|www\.[a-zA-Z0-9]+\.[^\s]{2,})/gi), _class2);
|
|
12
20
|
export let ElementType;
|
|
13
21
|
|
|
@@ -4,12 +4,12 @@ import * as React from "react";
|
|
|
4
4
|
import { IconButton, Stack } from "@fluentui/react";
|
|
5
5
|
import { BroadcastService } from "../../../../services/BroadcastService";
|
|
6
6
|
import CommandButton from "../../../common/commandbutton/CommandButton";
|
|
7
|
-
import { ElementType } from "../../../../common/Constants";
|
|
7
|
+
import { ElementType, KeyCodes } from "../../../../common/Constants";
|
|
8
8
|
import Timer from "../Timer/Timer";
|
|
9
9
|
import { defaultCurrentCallProps } from "./common/defaultProps/defaultCurrentCallProps";
|
|
10
10
|
import { processCustomComponents } from "../../../../common/utils";
|
|
11
11
|
import { useBoolean } from "@fluentui/react-hooks";
|
|
12
|
-
import { useCallback } from "react";
|
|
12
|
+
import { useCallback, useEffect } from "react";
|
|
13
13
|
|
|
14
14
|
function CurrentCall(props) {
|
|
15
15
|
var _props$controlProps, _defaultCurrentCallPr, _props$controlProps2, _props$controlProps2$, _defaultCurrentCallPr2, _defaultCurrentCallPr3, _props$controlProps3, _props$controlProps3$, _defaultCurrentCallPr4, _defaultCurrentCallPr5, _props$controlProps4, _props$controlProps4$, _defaultCurrentCallPr6, _defaultCurrentCallPr7, _props$controlProps5, _props$controlProps5$, _defaultCurrentCallPr8, _defaultCurrentCallPr9, _props$controlProps6, _props$controlProps6$, _defaultCurrentCallPr10, _defaultCurrentCallPr11, _props$controlProps7, _props$controlProps7$, _defaultCurrentCallPr12, _defaultCurrentCallPr13, _props$controlProps8, _props$controlProps8$, _defaultCurrentCallPr14, _defaultCurrentCallPr15, _props$controlProps9, _props$controlProps10, _defaultCurrentCallPr16, _defaultCurrentCallPr17, _props$styleProps, _props$controlProps11, _props$controlProps12, _defaultCurrentCallPr18, _defaultCurrentCallPr19, _props$controlProps13, _props$controlProps14, _defaultCurrentCallPr20, _defaultCurrentCallPr21, _props$controlProps15, _props$controlProps16, _defaultCurrentCallPr22, _defaultCurrentCallPr23, _props$controlProps17, _props$controlProps18, _props$controlProps19, _props$controlProps20, _defaultCurrentCallPr24, _defaultCurrentCallPr25, _props$controlProps21, _props$controlProps22, _defaultCurrentCallPr26, _defaultCurrentCallPr27, _props$controlProps23, _props$controlProps24, _defaultCurrentCallPr28, _defaultCurrentCallPr29, _props$controlProps25, _props$controlProps26, _defaultCurrentCallPr30, _defaultCurrentCallPr31, _props$controlProps27, _props$controlProps28, _props$controlProps29, _props$controlProps30, _defaultCurrentCallPr32, _defaultCurrentCallPr33, _props$controlProps31, _props$controlProps32, _defaultCurrentCallPr34, _defaultCurrentCallPr35, _props$controlProps33, _props$controlProps34, _defaultCurrentCallPr36, _defaultCurrentCallPr37, _props$controlProps35, _props$controlProps36, _defaultCurrentCallPr38, _defaultCurrentCallPr39, _props$controlProps37, _defaultCurrentCallPr40, _props$controlProps38, _defaultCurrentCallPr41, _props$controlProps39, _defaultCurrentCallPr42, _props$controlProps40, _props$controlProps41, _props$controlProps42, _props$controlProps43, _defaultCurrentCallPr43, _defaultCurrentCallPr44, _props$controlProps44, _props$controlProps45, _defaultCurrentCallPr45, _defaultCurrentCallPr46, _props$controlProps46, _props$controlProps47, _defaultCurrentCallPr47, _defaultCurrentCallPr48, _props$controlProps48, _props$controlProps49, _defaultCurrentCallPr49, _defaultCurrentCallPr50, _props$controlProps50, _props$controlProps51, _props$controlProps52, _props$controlProps53, _defaultCurrentCallPr51, _defaultCurrentCallPr52, _props$controlProps54, _props$controlProps55, _defaultCurrentCallPr53, _defaultCurrentCallPr54, _props$controlProps56, _props$controlProps57, _defaultCurrentCallPr55, _defaultCurrentCallPr56, _props$controlProps58, _props$controlProps59, _defaultCurrentCallPr57, _defaultCurrentCallPr58, _defaultCurrentCallPr59, _props$controlProps60, _defaultCurrentCallPr60, _props$controlProps61, _defaultCurrentCallPr61, _props$styleProps2, _defaultCurrentCallPr62, _props$styleProps3, _defaultCurrentCallPr63, _props$styleProps4, _defaultCurrentCallPr67, _props$styleProps8, _defaultCurrentCallPr68, _props$styleProps9, _defaultCurrentCallPr69, _props$styleProps10, _defaultCurrentCallPr70, _props$styleProps11, _defaultCurrentCallPr71, _props$styleProps12, _props$controlProps68, _defaultCurrentCallPr72, _props$styleProps13, _props$styleProps13$c, _props$styleProps14, _props$styleProps14$c, _props$styleProps15, _props$styleProps15$c, _props$styleProps16, _props$styleProps16$c, _props$styleProps17, _props$styleProps17$c, _props$controlProps69, _props$controlProps70, _props$controlProps71, _props$controlProps72, _props$controlProps73, _props$controlProps74, _props$controlProps75, _props$controlProps76, _props$controlProps77, _defaultCurrentCallPr73, _defaultCurrentCallPr74, _props$controlProps78, _props$controlProps79, _defaultCurrentCallPr75, _defaultCurrentCallPr76, _props$controlProps80, _props$controlProps81, _props$controlProps82, _props$controlProps83, _defaultCurrentCallPr77, _defaultCurrentCallPr78, _props$controlProps84, _props$controlProps85, _defaultCurrentCallPr79, _defaultCurrentCallPr80, _props$controlProps86, _props$controlProps87, _props$controlProps88, _props$controlProps89, _props$controlProps90, _defaultCurrentCallPr81, _defaultCurrentCallPr82, _props$controlProps91, _props$controlProps92, _defaultCurrentCallPr83, _defaultCurrentCallPr84, _props$controlProps93, _props$controlProps94, _props$controlProps95, _props$controlProps96, _defaultCurrentCallPr85, _defaultCurrentCallPr86, _props$controlProps97, _props$controlProps98, _defaultCurrentCallPr87, _defaultCurrentCallPr88, _props$controlProps99, _props$controlProps100, _props$controlProps101;
|
|
@@ -189,6 +189,36 @@ function CurrentCall(props) {
|
|
|
189
189
|
}
|
|
190
190
|
}, []);
|
|
191
191
|
const hideCallTimer = ((_props$controlProps68 = props.controlProps) === null || _props$controlProps68 === void 0 ? void 0 : _props$controlProps68.hideCallTimer) ?? ((_defaultCurrentCallPr72 = defaultCurrentCallProps.controlProps) === null || _defaultCurrentCallPr72 === void 0 ? void 0 : _defaultCurrentCallPr72.hideCallTimer);
|
|
192
|
+
useEffect(() => {
|
|
193
|
+
const endCallShortcut = e => e.key === KeyCodes.ENTER;
|
|
194
|
+
|
|
195
|
+
const toggleMicShortcut = e => e.ctrlKey && e.shiftKey && e.key === KeyCodes.ToggleMicHotKey;
|
|
196
|
+
|
|
197
|
+
const toggleVideoShortcut = e => e.ctrlKey && e.shiftKey && e.key === KeyCodes.ToggleCameraHotKey;
|
|
198
|
+
|
|
199
|
+
const shortcutKeysHandler = e => {
|
|
200
|
+
if (endCallShortcut(e)) {
|
|
201
|
+
handleEndCallClick();
|
|
202
|
+
} else if (toggleMicShortcut(e)) {
|
|
203
|
+
handleMicClick();
|
|
204
|
+
} else if (toggleVideoShortcut(e)) {
|
|
205
|
+
handleVideoOffClick();
|
|
206
|
+
}
|
|
207
|
+
};
|
|
208
|
+
|
|
209
|
+
const ignoreDefault = e => {
|
|
210
|
+
if (endCallShortcut(e) || toggleMicShortcut(e) || toggleVideoShortcut(e)) {
|
|
211
|
+
e.preventDefault();
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
window.addEventListener("keyup", shortcutKeysHandler);
|
|
216
|
+
window.addEventListener("keydown", ignoreDefault);
|
|
217
|
+
return () => {
|
|
218
|
+
window.removeEventListener("keyup", shortcutKeysHandler);
|
|
219
|
+
window.removeEventListener("keydown", ignoreDefault);
|
|
220
|
+
};
|
|
221
|
+
}, []);
|
|
192
222
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
193
223
|
className: (_props$styleProps13 = props.styleProps) === null || _props$styleProps13 === void 0 ? void 0 : (_props$styleProps13$c = _props$styleProps13.classNames) === null || _props$styleProps13$c === void 0 ? void 0 : _props$styleProps13$c.currentCallComponentClassName,
|
|
194
224
|
horizontalAlign: "space-between",
|
|
@@ -47,18 +47,6 @@ export const customizedCurrentCallStyleProps = {
|
|
|
47
47
|
width: "50px",
|
|
48
48
|
margin: "1px"
|
|
49
49
|
},
|
|
50
|
-
currentCallTimerStyleProps: {
|
|
51
|
-
borderRadius: "2px",
|
|
52
|
-
margin: "1px",
|
|
53
|
-
color: "white",
|
|
54
|
-
paddingTop: "18px",
|
|
55
|
-
fontSize: 12,
|
|
56
|
-
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
57
|
-
backgroundColor: "transparent",
|
|
58
|
-
height: "50px",
|
|
59
|
-
width: "55px",
|
|
60
|
-
textAlign: "center"
|
|
61
|
-
},
|
|
62
50
|
videoTileStyleProps: {
|
|
63
51
|
minHeight: "180px",
|
|
64
52
|
height: "300px",
|
|
@@ -39,18 +39,6 @@ export const defaultCurrentCallStyleProps = {
|
|
|
39
39
|
width: "50px",
|
|
40
40
|
fontSize: "18px"
|
|
41
41
|
},
|
|
42
|
-
currentCallTimerStyleProps: {
|
|
43
|
-
borderRadius: "2px",
|
|
44
|
-
margin: "1px",
|
|
45
|
-
color: "#FFFFFF",
|
|
46
|
-
paddingTop: "18px",
|
|
47
|
-
fontSize: 12,
|
|
48
|
-
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
49
|
-
backgroundColor: "darkgrey",
|
|
50
|
-
height: "45px",
|
|
51
|
-
width: "50px",
|
|
52
|
-
textAlign: "center"
|
|
53
|
-
},
|
|
54
42
|
videoTileStyleProps: {
|
|
55
43
|
width: "100%",
|
|
56
44
|
marginLeft: "auto",
|
|
@@ -3,11 +3,11 @@ function _extends() { _extends = Object.assign || function (target) { for (var i
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Label, Stack } from "@fluentui/react";
|
|
5
5
|
import CommandButton from "../../../common/commandbutton/CommandButton";
|
|
6
|
-
import { ElementType } from "../../../../common/Constants";
|
|
6
|
+
import { ElementType, KeyCodes } from "../../../../common/Constants";
|
|
7
7
|
import { decodeComponentString } from "../../../../common/decodeComponentString";
|
|
8
8
|
import { defaultIncomingCallProps } from "./common/defaultProps/defaultIncomingCallProps";
|
|
9
9
|
import { processCustomComponents } from "../../../../common/utils";
|
|
10
|
-
import { useCallback } from "react";
|
|
10
|
+
import { useCallback, useEffect } from "react";
|
|
11
11
|
|
|
12
12
|
function IncomingCall(props) {
|
|
13
13
|
var _props$controlProps, _defaultIncomingCallP, _props$controlProps2, _props$controlProps2$, _defaultIncomingCallP2, _defaultIncomingCallP3, _props$controlProps3, _props$controlProps3$, _defaultIncomingCallP4, _defaultIncomingCallP5, _props$controlProps4, _props$controlProps4$, _defaultIncomingCallP6, _defaultIncomingCallP7, _defaultIncomingCallP8, _props$styleProps, _props$controlProps5, _props$controlProps5$, _defaultIncomingCallP9, _defaultIncomingCallP10, _props$controlProps6, _props$controlProps6$, _defaultIncomingCallP11, _defaultIncomingCallP12, _props$controlProps7, _props$controlProps7$, _defaultIncomingCallP13, _defaultIncomingCallP14, _defaultIncomingCallP15, _props$controlProps8, _defaultIncomingCallP16, _props$controlProps9, _defaultIncomingCallP17, _props$controlProps10, _defaultIncomingCallP18, _props$controlProps11, _defaultIncomingCallP19, _props$styleProps2, _defaultIncomingCallP20, _props$styleProps3, _defaultIncomingCallP21, _props$styleProps4, _defaultIncomingCallP22, _props$styleProps5, _defaultIncomingCallP23, _props$styleProps6, _defaultIncomingCallP24, _props$styleProps7, _defaultIncomingCallP25, _props$styleProps8, _defaultIncomingCallP26, _props$styleProps9, _props$styleProps10, _props$controlProps18, _defaultIncomingCallP27, _props$controlProps19, _props$componentOverr, _props$controlProps20, _props$controlProps21, _props$controlProps22, _props$controlProps23, _props$controlProps24, _props$controlProps25, _props$controlProps26, _props$controlProps27, _props$controlProps28;
|
|
@@ -84,6 +84,36 @@ function IncomingCall(props) {
|
|
|
84
84
|
(_props$controlProps17 = props.controlProps) === null || _props$controlProps17 === void 0 ? void 0 : _props$controlProps17.onAudioCallClick();
|
|
85
85
|
}
|
|
86
86
|
}, []);
|
|
87
|
+
useEffect(() => {
|
|
88
|
+
const declineCallShortcut = e => e.ctrlKey && e.shiftKey && e.key === KeyCodes.DeclineCallHotKey;
|
|
89
|
+
|
|
90
|
+
const acceptAudioCallShortcut = e => e.ctrlKey && e.shiftKey && e.key === KeyCodes.AcceptAudioCallHotKey;
|
|
91
|
+
|
|
92
|
+
const acceptVideoCallShortcut = e => e.ctrlKey && e.shiftKey && e.key === KeyCodes.AcceptVideoCallHotKey;
|
|
93
|
+
|
|
94
|
+
const shortcutKeysHandler = e => {
|
|
95
|
+
if (declineCallShortcut(e)) {
|
|
96
|
+
handleDeclineCallClick();
|
|
97
|
+
} else if (acceptAudioCallShortcut(e)) {
|
|
98
|
+
handleAudioCallClick();
|
|
99
|
+
} else if (acceptVideoCallShortcut(e)) {
|
|
100
|
+
handleVideoCallClick();
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
const ignoreDefault = e => {
|
|
105
|
+
if (declineCallShortcut(e) || acceptAudioCallShortcut(e) || acceptVideoCallShortcut(e)) {
|
|
106
|
+
e.preventDefault();
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
window.addEventListener("keyup", shortcutKeysHandler);
|
|
111
|
+
window.addEventListener("keydown", ignoreDefault);
|
|
112
|
+
return () => {
|
|
113
|
+
window.removeEventListener("keyup", shortcutKeysHandler);
|
|
114
|
+
window.removeEventListener("keydown", ignoreDefault);
|
|
115
|
+
};
|
|
116
|
+
}, []);
|
|
87
117
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
88
118
|
horizontal: true,
|
|
89
119
|
className: (_props$styleProps10 = props.styleProps) === null || _props$styleProps10 === void 0 ? void 0 : _props$styleProps10.className,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Icon, Label, Stack } from "@fluentui/react";
|
|
2
2
|
import React, { useCallback } from "react";
|
|
3
3
|
import { BroadcastService } from "../../services/BroadcastService";
|
|
4
|
-
import { ElementType, KeyCodes } from "../../common/Constants";
|
|
4
|
+
import { ElementType, KeyCodes, HiddenTextStyles } from "../../common/Constants";
|
|
5
5
|
import { decodeComponentString } from "../../common/decodeComponentString";
|
|
6
6
|
import { defaultChatButtonControlProps } from "./common/defaultProps/defaultChatButtonControlProps";
|
|
7
7
|
import { defaultChatButtonGeneralStyles } from "./common/defaultStyles/defaultChatButtonGeneralStyles";
|
|
@@ -12,17 +12,27 @@ import { defaultChatButtonTextContainerStyles } from "./common/defaultStyles/def
|
|
|
12
12
|
import { defaultChatButtonTitleStyles } from "./common/defaultStyles/defaultChatButtonTitleStyles";
|
|
13
13
|
|
|
14
14
|
function NotificationBubble(props, parentId) {
|
|
15
|
-
var _props$styleProps, _props$controlProps
|
|
15
|
+
var _props$styleProps, _props$controlProps;
|
|
16
16
|
|
|
17
17
|
const notificationBubbleStyles = {
|
|
18
18
|
root: Object.assign({}, defaultChatButtonNotificationBubbleStyles, (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.notificationBubbleStyleProps)
|
|
19
19
|
};
|
|
20
20
|
const unreadMessageCount = ((_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.unreadMessageCount) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.unreadMessageCount);
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
|
|
22
|
+
if (unreadMessageCount !== "0") {
|
|
23
|
+
var _props$componentOverr, _props$styleProps2, _props$styleProps2$cl, _props$controlProps2;
|
|
24
|
+
|
|
25
|
+
return decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.notificationBubble) || /*#__PURE__*/React.createElement(Stack, {
|
|
26
|
+
role: "alert",
|
|
27
|
+
styles: notificationBubbleStyles,
|
|
28
|
+
className: (_props$styleProps2 = props.styleProps) === null || _props$styleProps2 === void 0 ? void 0 : (_props$styleProps2$cl = _props$styleProps2.classNames) === null || _props$styleProps2$cl === void 0 ? void 0 : _props$styleProps2$cl.notificationBubbleClassName,
|
|
29
|
+
id: parentId + "-notification-bubble"
|
|
30
|
+
}, unreadMessageCount, /*#__PURE__*/React.createElement("span", {
|
|
31
|
+
style: HiddenTextStyles
|
|
32
|
+
}, (_props$controlProps2 = props.controlProps) === null || _props$controlProps2 === void 0 ? void 0 : _props$controlProps2.unreadMessageString));
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return null;
|
|
26
36
|
}
|
|
27
37
|
|
|
28
38
|
function IconContainer(props, parentId) {
|
|
@@ -39,7 +49,7 @@ function IconContainer(props, parentId) {
|
|
|
39
49
|
}
|
|
40
50
|
|
|
41
51
|
function TextContainer(props, parentId) {
|
|
42
|
-
var _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$
|
|
52
|
+
var _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$controlProps3, _props$controlProps4, _props$controlProps5, _props$controlProps6, _props$controlProps7, _props$controlProps8, _props$componentOverr3, _props$styleProps8, _props$styleProps8$cl, _props$componentOverr4, _props$styleProps9, _props$styleProps9$cl, _props$componentOverr5, _props$styleProps10, _props$styleProps10$c;
|
|
43
53
|
|
|
44
54
|
const textContainerStyles = {
|
|
45
55
|
root: Object.assign({}, defaultChatButtonTextContainerStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.textContainerStyleProps)
|
|
@@ -50,12 +60,12 @@ function TextContainer(props, parentId) {
|
|
|
50
60
|
const subtitleStyles = {
|
|
51
61
|
root: Object.assign({}, defaultChatButtonSubTitleStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.subtitleStyleProps)
|
|
52
62
|
};
|
|
53
|
-
const hideChatTitle = ((_props$
|
|
54
|
-
const hideChatSubtitle = ((_props$
|
|
55
|
-
const titleDir = ((_props$
|
|
56
|
-
const titleText = ((_props$
|
|
57
|
-
const subtitleDir = ((_props$
|
|
58
|
-
const subtitleText = ((_props$
|
|
63
|
+
const hideChatTitle = ((_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.hideChatTitle) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatTitle);
|
|
64
|
+
const hideChatSubtitle = ((_props$controlProps4 = props.controlProps) === null || _props$controlProps4 === void 0 ? void 0 : _props$controlProps4.hideChatSubtitle) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatSubtitle);
|
|
65
|
+
const titleDir = ((_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.dir) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.dir);
|
|
66
|
+
const titleText = ((_props$controlProps6 = props.controlProps) === null || _props$controlProps6 === void 0 ? void 0 : _props$controlProps6.titleText) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.titleText);
|
|
67
|
+
const subtitleDir = ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.dir) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.dir);
|
|
68
|
+
const subtitleText = ((_props$controlProps8 = props.controlProps) === null || _props$controlProps8 === void 0 ? void 0 : _props$controlProps8.subtitleText) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.subtitleText);
|
|
59
69
|
return decodeComponentString((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.textContainer) || /*#__PURE__*/React.createElement(Stack, {
|
|
60
70
|
styles: textContainerStyles,
|
|
61
71
|
className: (_props$styleProps8 = props.styleProps) === null || _props$styleProps8 === void 0 ? void 0 : (_props$styleProps8$cl = _props$styleProps8.classNames) === null || _props$styleProps8$cl === void 0 ? void 0 : _props$styleProps8$cl.textContainerClassName,
|
|
@@ -76,23 +86,23 @@ function TextContainer(props, parentId) {
|
|
|
76
86
|
}
|
|
77
87
|
|
|
78
88
|
function ChatButton(props) {
|
|
79
|
-
var _props$
|
|
89
|
+
var _props$controlProps9, _props$controlProps10, _props$controlProps11, _props$controlProps12, _props$controlProps13, _props$controlProps14, _props$controlProps15, _props$controlProps16, _props$styleProps11;
|
|
80
90
|
|
|
81
|
-
const elementId = ((_props$
|
|
82
|
-
const defaultAriaLabel = ((_props$
|
|
83
|
-
const defaultRole = ((_props$
|
|
84
|
-
const containersDir = ((_props$
|
|
85
|
-
const hideChatButton = ((_props$
|
|
86
|
-
const hideChatIcon = ((_props$
|
|
87
|
-
const hideChatTextContainer = ((_props$
|
|
88
|
-
const hideNotificationBubble = ((_props$
|
|
91
|
+
const elementId = ((_props$controlProps9 = props.controlProps) === null || _props$controlProps9 === void 0 ? void 0 : _props$controlProps9.id) ?? "lcw-components-chat-button";
|
|
92
|
+
const defaultAriaLabel = ((_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.ariaLabel) ?? "live chat button";
|
|
93
|
+
const defaultRole = ((_props$controlProps11 = props.controlProps) === null || _props$controlProps11 === void 0 ? void 0 : _props$controlProps11.role) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.role);
|
|
94
|
+
const containersDir = ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.dir) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.dir);
|
|
95
|
+
const hideChatButton = ((_props$controlProps13 = props.controlProps) === null || _props$controlProps13 === void 0 ? void 0 : _props$controlProps13.hideChatButton) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatButton);
|
|
96
|
+
const hideChatIcon = ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.hideChatIcon) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatIcon);
|
|
97
|
+
const hideChatTextContainer = ((_props$controlProps15 = props.controlProps) === null || _props$controlProps15 === void 0 ? void 0 : _props$controlProps15.hideChatTextContainer) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatTextContainer);
|
|
98
|
+
const hideNotificationBubble = ((_props$controlProps16 = props.controlProps) === null || _props$controlProps16 === void 0 ? void 0 : _props$controlProps16.hideNotificationBubble) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideNotificationBubble);
|
|
89
99
|
const chatButtonGroupStyles = {
|
|
90
100
|
root: Object.assign({}, defaultChatButtonGeneralStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.generalStyleProps)
|
|
91
101
|
};
|
|
92
102
|
const handleInitiateChatClick = useCallback(() => {
|
|
93
|
-
var _props$
|
|
103
|
+
var _props$controlProps17;
|
|
94
104
|
|
|
95
|
-
if ((_props$
|
|
105
|
+
if ((_props$controlProps17 = props.controlProps) !== null && _props$controlProps17 !== void 0 && _props$controlProps17.onClick) {
|
|
96
106
|
const customEvent = {
|
|
97
107
|
elementType: ElementType.ChatButton,
|
|
98
108
|
elementId: elementId,
|
|
@@ -119,7 +129,7 @@ function ChatButton(props) {
|
|
|
119
129
|
onClick: handleInitiateChatClick,
|
|
120
130
|
onKeyDown: handleInputKeyDown,
|
|
121
131
|
"aria-label": defaultAriaLabel
|
|
122
|
-
}, !hideChatIcon && IconContainer(props, elementId), !
|
|
132
|
+
}, !hideChatIcon && IconContainer(props, elementId), !hideNotificationBubble && NotificationBubble(props, elementId), !hideChatTextContainer && TextContainer(props, elementId)));
|
|
123
133
|
}
|
|
124
134
|
|
|
125
135
|
export default ChatButton;
|
|
@@ -14,5 +14,7 @@ export const defaultChatButtonControlProps = {
|
|
|
14
14
|
hideChatTextContainer: false,
|
|
15
15
|
hideChatSubtitle: false,
|
|
16
16
|
hideChatTitle: false,
|
|
17
|
-
hideNotificationBubble: true
|
|
17
|
+
hideNotificationBubble: true,
|
|
18
|
+
unreadMessageString: "new messages",
|
|
19
|
+
largeUnreadMessageString: "99+"
|
|
18
20
|
};
|
|
@@ -8,15 +8,13 @@ function CommandButton(props) {
|
|
|
8
8
|
const iconProp = props.imageIconProps ? {
|
|
9
9
|
imageProps: props.imageIconProps
|
|
10
10
|
} : {
|
|
11
|
-
iconName: props.iconName
|
|
12
|
-
styles: {
|
|
13
|
-
root: props.styles
|
|
14
|
-
}
|
|
11
|
+
iconName: props.iconName
|
|
15
12
|
};
|
|
16
|
-
const
|
|
13
|
+
const buttonStyles = {
|
|
17
14
|
root: props.styles,
|
|
18
15
|
rootHovered: props.hoverStyles,
|
|
19
|
-
rootFocused: props.focusStyles
|
|
16
|
+
rootFocused: props.focusStyles,
|
|
17
|
+
rootPressed: props.hoverStyles
|
|
20
18
|
};
|
|
21
19
|
const handleOnClick = useCallback(() => {
|
|
22
20
|
if (props !== null && props !== void 0 && props.onClick) {
|
|
@@ -36,14 +34,14 @@ function CommandButton(props) {
|
|
|
36
34
|
onClick: handleOnClick,
|
|
37
35
|
disabled: props.disabled,
|
|
38
36
|
className: props.className,
|
|
39
|
-
styles:
|
|
37
|
+
styles: buttonStyles
|
|
40
38
|
}), props.type === "icon" && /*#__PURE__*/React.createElement(IconButton, {
|
|
41
39
|
id: props.id,
|
|
42
40
|
iconProps: iconProp,
|
|
43
41
|
title: props.ariaLabel,
|
|
44
42
|
ariaLabel: props.ariaLabel,
|
|
45
43
|
disabled: props.disabled,
|
|
46
|
-
styles:
|
|
44
|
+
styles: buttonStyles,
|
|
47
45
|
onClick: handleOnClick,
|
|
48
46
|
className: props.className
|
|
49
47
|
}));
|