@microsoft/omnichannel-chat-components 0.1.0-main.b59a07c → 0.1.0-main.cb39af7
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 +2 -6
- package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +1 -1
- package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +1 -1
- package/lib/cjs/components/chatbutton/ChatButton.js +23 -22
- package/lib/cjs/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +2 -1
- package/lib/cjs/components/common/commandbutton/CommandButton.js +30 -2
- package/lib/cjs/components/{header → common}/subcomponents/CloseButton.js +4 -3
- 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 +28 -4
- package/lib/cjs/components/header/Header.js +2 -2
- 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/proactivechatpane/ProactiveChatPane.js +36 -35
- 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/index.js +6 -0
- package/lib/cjs/services/BroadcastService.js +36 -8
- package/lib/esm/common/Constants.js +1 -4
- package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +1 -1
- package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +1 -1
- package/lib/esm/components/chatbutton/ChatButton.js +22 -21
- package/lib/esm/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +2 -1
- package/lib/esm/components/common/commandbutton/CommandButton.js +30 -2
- package/lib/esm/components/{header → common}/subcomponents/CloseButton.js +4 -3
- 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 +28 -4
- package/lib/esm/components/header/Header.js +2 -2
- 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/proactivechatpane/ProactiveChatPane.js +33 -34
- 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/index.js +1 -0
- package/lib/esm/services/BroadcastService.js +34 -8
- package/lib/types/common/Constants.d.ts +1 -2
- package/lib/types/components/chatbutton/interfaces/IChatButtonControlProps.d.ts +1 -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/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 +2 -2
|
@@ -14,7 +14,11 @@ const defaultProactiveChatPaneControlProps = {
|
|
|
14
14
|
hideSubtitle: false,
|
|
15
15
|
subtitleText: "Live chat support!",
|
|
16
16
|
hideCloseButton: false,
|
|
17
|
-
|
|
17
|
+
closeButtonProps: {
|
|
18
|
+
type: "icon",
|
|
19
|
+
iconName: "ChromeClose",
|
|
20
|
+
hideButtonTitle: true
|
|
21
|
+
},
|
|
18
22
|
isBodyContainerHorizantal: false,
|
|
19
23
|
hideBodyTitle: false,
|
|
20
24
|
bodyTitleText: "Hi! Have any questions? I am here to help.",
|
|
@@ -4,19 +4,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.defaultProactiveChatPaneCloseButtonStyles = void 0;
|
|
7
|
-
|
|
8
|
-
var _Icons = require("../../../../../assets/Icons");
|
|
9
|
-
|
|
10
7
|
const defaultProactiveChatPaneCloseButtonStyles = {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
backgroundRepeat: "no-repeat",
|
|
14
|
-
color: "#605e5c",
|
|
15
|
-
cursor: "pointer",
|
|
16
|
-
height: "14px",
|
|
17
|
-
lineHeight: "14px",
|
|
18
|
-
textAlign: "center",
|
|
19
|
-
width: "14px",
|
|
20
|
-
zIndex: "inherit"
|
|
8
|
+
color: "white",
|
|
9
|
+
fontSize: "12px"
|
|
21
10
|
};
|
|
22
11
|
exports.defaultProactiveChatPaneCloseButtonStyles = defaultProactiveChatPaneCloseButtonStyles;
|
|
@@ -14,7 +14,11 @@ const presetOneProactiveChatPaneControlProps = {
|
|
|
14
14
|
hideSubtitle: false,
|
|
15
15
|
subtitleText: "Live chat support!",
|
|
16
16
|
hideCloseButton: false,
|
|
17
|
-
|
|
17
|
+
closeButtonProps: {
|
|
18
|
+
type: "icon",
|
|
19
|
+
iconName: "ChromeClose",
|
|
20
|
+
hideButtonTitle: true
|
|
21
|
+
},
|
|
18
22
|
isBodyContainerHorizantal: true,
|
|
19
23
|
hideBodyTitle: false,
|
|
20
24
|
bodyTitleText: "Hi! Have any questions? I am here to help.",
|
|
@@ -14,7 +14,11 @@ const presetThreeProactiveChatPaneControlProps = {
|
|
|
14
14
|
hideSubtitle: false,
|
|
15
15
|
subtitleText: "Live chat support!",
|
|
16
16
|
hideCloseButton: false,
|
|
17
|
-
|
|
17
|
+
closeButtonProps: {
|
|
18
|
+
type: "icon",
|
|
19
|
+
iconName: "ChromeClose",
|
|
20
|
+
hideButtonTitle: true
|
|
21
|
+
},
|
|
18
22
|
isBodyContainerHorizantal: false,
|
|
19
23
|
hideBodyTitle: false,
|
|
20
24
|
bodyTitleText: "Hi! Have any questions? I am here to help.",
|
package/lib/cjs/index.js
CHANGED
|
@@ -27,6 +27,12 @@ Object.defineProperty(exports, "BroadcastService", {
|
|
|
27
27
|
return _BroadcastService.BroadcastService;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
+
Object.defineProperty(exports, "BroadcastServiceInitialize", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () {
|
|
33
|
+
return _BroadcastService.BroadcastServiceInitialize;
|
|
34
|
+
}
|
|
35
|
+
});
|
|
30
36
|
Object.defineProperty(exports, "CallAcceptButtonBase64", {
|
|
31
37
|
enumerable: true,
|
|
32
38
|
get: function () {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.BroadcastService = void 0;
|
|
6
|
+
exports.BroadcastServiceInitialize = exports.BroadcastService = void 0;
|
|
7
7
|
|
|
8
8
|
var _rxjs = require("rxjs");
|
|
9
9
|
|
|
@@ -11,20 +11,48 @@ var _operators = require("rxjs/operators");
|
|
|
11
11
|
|
|
12
12
|
var _broadcastChannel = require("broadcast-channel");
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
const newMessage = new _rxjs.Subject(); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
15
|
|
|
16
|
-
const
|
|
17
|
-
const pubChannel = new _broadcastChannel.BroadcastChannel(_Constants.BROADCAST_CHANNEL_NAME);
|
|
18
|
-
const subChannel = new _broadcastChannel.BroadcastChannel(_Constants.BROADCAST_CHANNEL_NAME); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
|
+
const broadcastServicePubList = {}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
const broadcastServiceSubList = {}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
+
|
|
20
|
+
let pubChannel; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
|
|
22
|
+
let subChannel;
|
|
23
|
+
|
|
24
|
+
const BroadcastServiceInitialize = channelName => {
|
|
25
|
+
if (broadcastServicePubList[channelName]) {
|
|
26
|
+
pubChannel = broadcastServicePubList[channelName];
|
|
27
|
+
} else {
|
|
28
|
+
const newPubChannel = new _broadcastChannel.BroadcastChannel(channelName);
|
|
29
|
+
broadcastServicePubList[channelName] = newPubChannel;
|
|
30
|
+
pubChannel = newPubChannel;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
if (broadcastServiceSubList[channelName]) {
|
|
34
|
+
subChannel = broadcastServiceSubList[channelName];
|
|
35
|
+
} else {
|
|
36
|
+
const newSubChannel = new _broadcastChannel.BroadcastChannel(channelName);
|
|
37
|
+
broadcastServiceSubList[channelName] = newSubChannel;
|
|
38
|
+
subChannel = newSubChannel;
|
|
39
|
+
} // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
subChannel.onmessage = message => {
|
|
43
|
+
newMessage.next(message);
|
|
44
|
+
};
|
|
22
45
|
};
|
|
23
46
|
|
|
47
|
+
exports.BroadcastServiceInitialize = BroadcastServiceInitialize;
|
|
24
48
|
const BroadcastService = {
|
|
25
49
|
//broadcast a message
|
|
26
50
|
postMessage: message => {
|
|
27
|
-
|
|
51
|
+
/**
|
|
52
|
+
* Omit copying methods to prevent 'DataCloneError' in older browsers when passing an object with functions
|
|
53
|
+
* This exception occurs when an object can't be clone with the 'structured clone algorithm' (used by postMessage)
|
|
54
|
+
*/
|
|
55
|
+
pubChannel.postMessage(JSON.parse(JSON.stringify(message)));
|
|
28
56
|
},
|
|
29
57
|
getMessage: message => {
|
|
30
58
|
return newMessage.pipe((0, _operators.filter)(msg => msg.elementId == message.elementId && msg.elementType == message.elementType && msg.eventName == message.eventName));
|
|
@@ -4,9 +4,6 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
4
4
|
|
|
5
5
|
/* CSS Constants */
|
|
6
6
|
export const AccessibilityBrightnessRatio = 1.2;
|
|
7
|
-
/* App constants*/
|
|
8
|
-
|
|
9
|
-
export const BROADCAST_CHANNEL_NAME = "omnichannel_broadcast_channel";
|
|
10
7
|
export const HiddenTextStyles = {
|
|
11
8
|
position: "absolute",
|
|
12
9
|
height: "1px",
|
|
@@ -21,7 +18,7 @@ export let ElementType;
|
|
|
21
18
|
|
|
22
19
|
(function (ElementType) {
|
|
23
20
|
ElementType["ChatButton"] = "ChatButton";
|
|
24
|
-
ElementType["
|
|
21
|
+
ElementType["CloseButton"] = "CloseButton";
|
|
25
22
|
ElementType["HeaderMinimizeButton"] = "HeaderMinimizeButton";
|
|
26
23
|
ElementType["FooterDownloadTranscriptButton"] = "FooterDownloadTranscriptButton";
|
|
27
24
|
ElementType["FooterEmailTranscriptButton"] = "FooterEmailTranscriptButton";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { IconButton, Stack } from "@fluentui/react";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Label, Stack } from "@fluentui/react";
|
|
@@ -20,16 +20,17 @@ function NotificationBubble(props, parentId) {
|
|
|
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
21
|
|
|
22
22
|
if (unreadMessageCount !== "0") {
|
|
23
|
-
var _props$componentOverr, _props$styleProps2, _props$styleProps2$cl, _props$
|
|
23
|
+
var _props$componentOverr, _props$controlProps2, _props$controlProps3, _props$styleProps2, _props$styleProps2$cl, _props$controlProps4, _props$controlProps5;
|
|
24
24
|
|
|
25
25
|
return decodeComponentString((_props$componentOverr = props.componentOverrides) === null || _props$componentOverr === void 0 ? void 0 : _props$componentOverr.notificationBubble) || /*#__PURE__*/React.createElement(Stack, {
|
|
26
|
-
|
|
26
|
+
"aria-live": "polite",
|
|
27
27
|
styles: notificationBubbleStyles,
|
|
28
|
+
"aria-label": (_props$controlProps2 = props.controlProps) !== null && _props$controlProps2 !== void 0 && _props$controlProps2.ariaLabelUnreadMessageString ? (_props$controlProps3 = props.controlProps) === null || _props$controlProps3 === void 0 ? void 0 : _props$controlProps3.ariaLabelUnreadMessageString : defaultChatButtonControlProps.ariaLabelUnreadMessageString,
|
|
28
29
|
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
30
|
id: parentId + "-notification-bubble"
|
|
30
31
|
}, unreadMessageCount, /*#__PURE__*/React.createElement("span", {
|
|
31
32
|
style: HiddenTextStyles
|
|
32
|
-
}, (_props$
|
|
33
|
+
}, (_props$controlProps4 = props.controlProps) !== null && _props$controlProps4 !== void 0 && _props$controlProps4.unreadMessageString ? (_props$controlProps5 = props.controlProps) === null || _props$controlProps5 === void 0 ? void 0 : _props$controlProps5.unreadMessageString : defaultChatButtonControlProps.unreadMessageString));
|
|
33
34
|
}
|
|
34
35
|
|
|
35
36
|
return null;
|
|
@@ -49,7 +50,7 @@ function IconContainer(props, parentId) {
|
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
function TextContainer(props, parentId) {
|
|
52
|
-
var _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$
|
|
53
|
+
var _props$styleProps5, _props$styleProps6, _props$styleProps7, _props$controlProps6, _props$controlProps7, _props$controlProps8, _props$controlProps9, _props$controlProps10, _props$controlProps11, _props$componentOverr3, _props$styleProps8, _props$styleProps8$cl, _props$componentOverr4, _props$styleProps9, _props$styleProps9$cl, _props$componentOverr5, _props$styleProps10, _props$styleProps10$c;
|
|
53
54
|
|
|
54
55
|
const textContainerStyles = {
|
|
55
56
|
root: Object.assign({}, defaultChatButtonTextContainerStyles, (_props$styleProps5 = props.styleProps) === null || _props$styleProps5 === void 0 ? void 0 : _props$styleProps5.textContainerStyleProps)
|
|
@@ -60,12 +61,12 @@ function TextContainer(props, parentId) {
|
|
|
60
61
|
const subtitleStyles = {
|
|
61
62
|
root: Object.assign({}, defaultChatButtonSubTitleStyles, (_props$styleProps7 = props.styleProps) === null || _props$styleProps7 === void 0 ? void 0 : _props$styleProps7.subtitleStyleProps)
|
|
62
63
|
};
|
|
63
|
-
const hideChatTitle = ((_props$
|
|
64
|
-
const hideChatSubtitle = ((_props$
|
|
65
|
-
const titleDir = ((_props$
|
|
66
|
-
const titleText = ((_props$
|
|
67
|
-
const subtitleDir = ((_props$
|
|
68
|
-
const subtitleText = ((_props$
|
|
64
|
+
const hideChatTitle = ((_props$controlProps6 = props.controlProps) === null || _props$controlProps6 === void 0 ? void 0 : _props$controlProps6.hideChatTitle) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatTitle);
|
|
65
|
+
const hideChatSubtitle = ((_props$controlProps7 = props.controlProps) === null || _props$controlProps7 === void 0 ? void 0 : _props$controlProps7.hideChatSubtitle) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatSubtitle);
|
|
66
|
+
const titleDir = ((_props$controlProps8 = props.controlProps) === null || _props$controlProps8 === void 0 ? void 0 : _props$controlProps8.dir) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.dir);
|
|
67
|
+
const titleText = ((_props$controlProps9 = props.controlProps) === null || _props$controlProps9 === void 0 ? void 0 : _props$controlProps9.titleText) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.titleText);
|
|
68
|
+
const subtitleDir = ((_props$controlProps10 = props.controlProps) === null || _props$controlProps10 === void 0 ? void 0 : _props$controlProps10.dir) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.dir);
|
|
69
|
+
const subtitleText = ((_props$controlProps11 = props.controlProps) === null || _props$controlProps11 === void 0 ? void 0 : _props$controlProps11.subtitleText) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.subtitleText);
|
|
69
70
|
return decodeComponentString((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.textContainer) || /*#__PURE__*/React.createElement(Stack, {
|
|
70
71
|
styles: textContainerStyles,
|
|
71
72
|
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,
|
|
@@ -86,23 +87,23 @@ function TextContainer(props, parentId) {
|
|
|
86
87
|
}
|
|
87
88
|
|
|
88
89
|
function ChatButton(props) {
|
|
89
|
-
var _props$
|
|
90
|
+
var _props$controlProps12, _props$controlProps13, _props$controlProps14, _props$controlProps15, _props$controlProps16, _props$controlProps17, _props$controlProps18, _props$controlProps19, _props$styleProps11;
|
|
90
91
|
|
|
91
|
-
const elementId = ((_props$
|
|
92
|
-
const defaultAriaLabel = ((_props$
|
|
93
|
-
const defaultRole = ((_props$
|
|
94
|
-
const containersDir = ((_props$
|
|
95
|
-
const hideChatButton = ((_props$
|
|
96
|
-
const hideChatIcon = ((_props$
|
|
97
|
-
const hideChatTextContainer = ((_props$
|
|
98
|
-
const hideNotificationBubble = ((_props$
|
|
92
|
+
const elementId = ((_props$controlProps12 = props.controlProps) === null || _props$controlProps12 === void 0 ? void 0 : _props$controlProps12.id) ?? "lcw-components-chat-button";
|
|
93
|
+
const defaultAriaLabel = ((_props$controlProps13 = props.controlProps) === null || _props$controlProps13 === void 0 ? void 0 : _props$controlProps13.ariaLabel) ?? "live chat button";
|
|
94
|
+
const defaultRole = ((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : _props$controlProps14.role) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.role);
|
|
95
|
+
const containersDir = ((_props$controlProps15 = props.controlProps) === null || _props$controlProps15 === void 0 ? void 0 : _props$controlProps15.dir) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.dir);
|
|
96
|
+
const hideChatButton = ((_props$controlProps16 = props.controlProps) === null || _props$controlProps16 === void 0 ? void 0 : _props$controlProps16.hideChatButton) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatButton);
|
|
97
|
+
const hideChatIcon = ((_props$controlProps17 = props.controlProps) === null || _props$controlProps17 === void 0 ? void 0 : _props$controlProps17.hideChatIcon) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatIcon);
|
|
98
|
+
const hideChatTextContainer = ((_props$controlProps18 = props.controlProps) === null || _props$controlProps18 === void 0 ? void 0 : _props$controlProps18.hideChatTextContainer) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideChatTextContainer);
|
|
99
|
+
const hideNotificationBubble = ((_props$controlProps19 = props.controlProps) === null || _props$controlProps19 === void 0 ? void 0 : _props$controlProps19.hideNotificationBubble) ?? (defaultChatButtonControlProps === null || defaultChatButtonControlProps === void 0 ? void 0 : defaultChatButtonControlProps.hideNotificationBubble);
|
|
99
100
|
const chatButtonGroupStyles = {
|
|
100
101
|
root: Object.assign({}, defaultChatButtonGeneralStyles, (_props$styleProps11 = props.styleProps) === null || _props$styleProps11 === void 0 ? void 0 : _props$styleProps11.generalStyleProps)
|
|
101
102
|
};
|
|
102
103
|
const handleInitiateChatClick = useCallback(() => {
|
|
103
|
-
var _props$
|
|
104
|
+
var _props$controlProps20;
|
|
104
105
|
|
|
105
|
-
if ((_props$
|
|
106
|
+
if ((_props$controlProps20 = props.controlProps) !== null && _props$controlProps20 !== void 0 && _props$controlProps20.onClick) {
|
|
106
107
|
const customEvent = {
|
|
107
108
|
elementType: ElementType.ChatButton,
|
|
108
109
|
elementId: elementId,
|
|
@@ -16,5 +16,6 @@ export const defaultChatButtonControlProps = {
|
|
|
16
16
|
hideChatTitle: false,
|
|
17
17
|
hideNotificationBubble: true,
|
|
18
18
|
unreadMessageString: "new messages",
|
|
19
|
-
largeUnreadMessageString: "99+"
|
|
19
|
+
largeUnreadMessageString: "99+",
|
|
20
|
+
ariaLabelUnreadMessageString: "you have new messages"
|
|
20
21
|
};
|
|
@@ -4,14 +4,42 @@ import { BroadcastService } from "../../../services/BroadcastService";
|
|
|
4
4
|
import { ElementType } from "../../../common/Constants";
|
|
5
5
|
|
|
6
6
|
function CommandButton(props) {
|
|
7
|
+
var _props$hoverStyles, _props$hoverStyles2, _props$focusStyles;
|
|
8
|
+
|
|
7
9
|
//imageIconProps > iconName
|
|
8
10
|
const iconProp = props.imageIconProps ? {
|
|
9
11
|
imageProps: props.imageIconProps
|
|
10
12
|
} : {
|
|
11
13
|
iconName: props.iconName
|
|
12
14
|
};
|
|
15
|
+
let iconStyles = {};
|
|
16
|
+
|
|
17
|
+
if (props.type === "icon") {
|
|
18
|
+
var _props$styles;
|
|
19
|
+
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
|
+
iconStyles = { ...(props === null || props === void 0 ? void 0 : (_props$styles = props.styles) === null || _props$styles === void 0 ? void 0 : _props$styles.icon)
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
13
25
|
const buttonStyles = {
|
|
14
|
-
|
|
26
|
+
icon: { ...iconStyles
|
|
27
|
+
},
|
|
28
|
+
root: {
|
|
29
|
+
selectors: {
|
|
30
|
+
":hover .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
31
|
+
...(props === null || props === void 0 ? void 0 : (_props$hoverStyles = props.hoverStyles) === null || _props$hoverStyles === void 0 ? void 0 : _props$hoverStyles.icon)
|
|
32
|
+
},
|
|
33
|
+
":active .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
+
...(props === null || props === void 0 ? void 0 : (_props$hoverStyles2 = props.hoverStyles) === null || _props$hoverStyles2 === void 0 ? void 0 : _props$hoverStyles2.icon)
|
|
35
|
+
},
|
|
36
|
+
":focus .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
37
|
+
...(props === null || props === void 0 ? void 0 : (_props$focusStyles = props.focusStyles) === null || _props$focusStyles === void 0 ? void 0 : _props$focusStyles.icon)
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
|
+
...(props === null || props === void 0 ? void 0 : props.styles)
|
|
42
|
+
},
|
|
15
43
|
rootHovered: props.hoverStyles,
|
|
16
44
|
rootFocused: props.focusStyles,
|
|
17
45
|
rootPressed: props.hoverStyles
|
|
@@ -38,7 +66,7 @@ function CommandButton(props) {
|
|
|
38
66
|
}), props.type === "icon" && /*#__PURE__*/React.createElement(IconButton, {
|
|
39
67
|
id: props.id,
|
|
40
68
|
iconProps: iconProp,
|
|
41
|
-
title: props.ariaLabel,
|
|
69
|
+
title: props.hideButtonTitle ? undefined : props.ariaLabel,
|
|
42
70
|
ariaLabel: props.ariaLabel,
|
|
43
71
|
disabled: props.disabled,
|
|
44
72
|
styles: buttonStyles,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ElementType } from "../../../common/Constants";
|
|
3
|
-
import CommandButton from "
|
|
3
|
+
import CommandButton from "../commandbutton/CommandButton";
|
|
4
4
|
|
|
5
5
|
function CloseButton(props) {
|
|
6
6
|
const {
|
|
7
7
|
type
|
|
8
8
|
} = props;
|
|
9
9
|
const customEvent = {
|
|
10
|
-
elementType: ElementType.
|
|
10
|
+
elementType: ElementType.CloseButton,
|
|
11
11
|
elementId: props === null || props === void 0 ? void 0 : props.id,
|
|
12
12
|
eventName: "OnClick"
|
|
13
13
|
};
|
|
@@ -23,7 +23,8 @@ function CloseButton(props) {
|
|
|
23
23
|
onClick: props.onClick,
|
|
24
24
|
ariaLabel: props.ariaLabel ?? "Close",
|
|
25
25
|
className: props.className,
|
|
26
|
-
customEvent: customEvent
|
|
26
|
+
customEvent: customEvent,
|
|
27
|
+
hideButtonTitle: props.hideButtonTitle
|
|
27
28
|
});
|
|
28
29
|
}
|
|
29
30
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Stack, initializeIcons } from "@fluentui/react";
|
|
@@ -66,7 +66,7 @@ function Footer(props) {
|
|
|
66
66
|
verticalAlign: "start"
|
|
67
67
|
}, /*#__PURE__*/React.createElement(Stack, {
|
|
68
68
|
horizontal: true,
|
|
69
|
-
verticalAlign: "
|
|
69
|
+
verticalAlign: "center"
|
|
70
70
|
}, processCustomComponents((_props$controlProps14 = props.controlProps) === null || _props$controlProps14 === void 0 ? void 0 : (_props$controlProps15 = _props$controlProps14.rightGroup) === null || _props$controlProps15 === void 0 ? void 0 : _props$controlProps15.children), !((_props$controlProps16 = props.controlProps) !== null && _props$controlProps16 !== void 0 && _props$controlProps16.hideAudioNotificationButton) && (decodeComponentString((_props$componentOverr3 = props.componentOverrides) === null || _props$componentOverr3 === void 0 ? void 0 : _props$componentOverr3.AudioNotificationButton) || /*#__PURE__*/React.createElement(AudioNotificationButton, _extends({}, audioNotificationButtonProps, {
|
|
71
71
|
onClick: (_props$controlProps17 = props.controlProps) === null || _props$controlProps17 === void 0 ? void 0 : _props$controlProps17.onAudioNotificationClick,
|
|
72
72
|
styles: audioNotificationButtonStyles,
|
|
@@ -8,8 +8,10 @@ export const defaultFooterStyleProps = {
|
|
|
8
8
|
padding: "0 10px 5px 10px"
|
|
9
9
|
},
|
|
10
10
|
downloadTranscriptButtonStyleProps: {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
icon: {
|
|
12
|
+
color: "blue",
|
|
13
|
+
fontSize: 16
|
|
14
|
+
},
|
|
13
15
|
height: "25px",
|
|
14
16
|
lineHeight: "25px",
|
|
15
17
|
width: "25px"
|
|
@@ -19,8 +21,10 @@ export const defaultFooterStyleProps = {
|
|
|
19
21
|
backgroundColor: "#C8C8C8"
|
|
20
22
|
},
|
|
21
23
|
emailTranscriptButtonStyleProps: {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
+
icon: {
|
|
25
|
+
color: "blue",
|
|
26
|
+
fontSize: 16
|
|
27
|
+
},
|
|
24
28
|
height: "25px",
|
|
25
29
|
lineHeight: "25px",
|
|
26
30
|
width: "25px"
|
|
@@ -30,8 +34,10 @@ export const defaultFooterStyleProps = {
|
|
|
30
34
|
backgroundColor: "#C8C8C8"
|
|
31
35
|
},
|
|
32
36
|
audioNotificationButtonStyleProps: {
|
|
33
|
-
|
|
34
|
-
|
|
37
|
+
icon: {
|
|
38
|
+
color: "blue",
|
|
39
|
+
fontSize: 16
|
|
40
|
+
},
|
|
35
41
|
height: "25px",
|
|
36
42
|
lineHeight: "25px",
|
|
37
43
|
width: "25px"
|
|
@@ -8,11 +8,34 @@ function AudioNotificationButton(props) {
|
|
|
8
8
|
disabled
|
|
9
9
|
} = props;
|
|
10
10
|
const [muted, setMuted] = useState(props.isAudioMuted);
|
|
11
|
+
let iconStyles = {};
|
|
12
|
+
|
|
13
|
+
if (props.type === "icon") {
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
15
|
+
iconStyles = { ...(props === null || props === void 0 ? void 0 : props.styles).icon
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
|
|
11
19
|
const iconButtonStyles = {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
20
|
+
icon: iconStyles,
|
|
21
|
+
root: {
|
|
22
|
+
selectors: {
|
|
23
|
+
":hover .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
|
+
...(props === null || props === void 0 ? void 0 : props.hoverStyles).icon
|
|
25
|
+
},
|
|
26
|
+
":active .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
27
|
+
...(props === null || props === void 0 ? void 0 : props.hoverStyles).icon
|
|
28
|
+
},
|
|
29
|
+
":focus .ms-Button-icon": { // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
|
+
...(props === null || props === void 0 ? void 0 : props.focusStyles).icon
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
|
+
...(props === null || props === void 0 ? void 0 : props.styles)
|
|
35
|
+
},
|
|
36
|
+
rootHovered: props.hoverStyles,
|
|
37
|
+
rootFocused: props.focusStyles,
|
|
38
|
+
rootPressed: props.hoverStyles
|
|
16
39
|
}; //imageIconProps > iconName
|
|
17
40
|
|
|
18
41
|
const volume0Icon = props.imageToggleIconProps ? {
|
|
@@ -49,6 +72,7 @@ function AudioNotificationButton(props) {
|
|
|
49
72
|
disabled: disabled,
|
|
50
73
|
styles: iconButtonStyles,
|
|
51
74
|
className: props.className,
|
|
75
|
+
"aria-label": muted ? props.toggleAriaLabel ?? "Turn sound on" : props.ariaLabel ?? "Turn sound off",
|
|
52
76
|
title: muted ? props.toggleAriaLabel ?? "Turn sound on" : props.ariaLabel ?? "Turn sound off"
|
|
53
77
|
});
|
|
54
78
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
function _extends() { _extends = Object.assign
|
|
1
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
4
|
import { Image, Label, Stack, initializeIcons } from "@fluentui/react";
|
|
5
|
-
import CloseButton from "
|
|
5
|
+
import CloseButton from "../common/subcomponents/CloseButton";
|
|
6
6
|
import MinimizeButton from "./subcomponents/MinimizeButton";
|
|
7
7
|
import { decodeComponentString } from "../../common/decodeComponentString";
|
|
8
8
|
import { defaultHeaderProps } from "./common/defaultProps/defaultHeaderProps";
|
|
@@ -15,7 +15,8 @@ function PostChatSurveyPane(props) {
|
|
|
15
15
|
const iframeStyles = {
|
|
16
16
|
height: "100vh",
|
|
17
17
|
width: "100%",
|
|
18
|
-
display: "block"
|
|
18
|
+
display: "block",
|
|
19
|
+
maxHeight: "100%"
|
|
19
20
|
};
|
|
20
21
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Stack, {
|
|
21
22
|
id: elementId,
|