@microsoft/omnichannel-chat-components 0.1.0-main.91dd060 → 0.1.0-main.99bac9c
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 -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 +27 -23
- package/lib/cjs/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +4 -1
- package/lib/cjs/components/common/commandbutton/CommandButton.js +22 -2
- package/lib/cjs/components/{header → common}/subcomponents/CloseButton.js +4 -3
- package/lib/cjs/components/footer/Footer.js +1 -1
- package/lib/cjs/components/footer/subcomponents/AudioNotificationButton.js +26 -12
- 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/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 +9 -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 +27 -23
- package/lib/esm/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +4 -1
- package/lib/esm/components/common/commandbutton/CommandButton.js +22 -2
- package/lib/esm/components/{header → common}/subcomponents/CloseButton.js +4 -3
- package/lib/esm/components/footer/Footer.js +1 -1
- package/lib/esm/components/footer/subcomponents/AudioNotificationButton.js +26 -12
- 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/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 +3 -2
- package/lib/types/components/chatbutton/interfaces/IChatButtonControlProps.d.ts +3 -0
- package/lib/types/components/common/interfaces/ICommandButtonControlProps.d.ts +1 -0
- package/lib/types/components/common/interfaces/ICommandButtonProps.d.ts +1 -0
- package/lib/types/components/{header → common}/subcomponents/CloseButton.d.ts +1 -1
- package/lib/types/components/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
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import { CloseChatButtonIconBase64 } from "../../../../../assets/Icons";
|
|
2
1
|
export const defaultProactiveChatPaneCloseButtonStyles = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
backgroundRepeat: "no-repeat",
|
|
6
|
-
color: "#605e5c",
|
|
7
|
-
cursor: "pointer",
|
|
8
|
-
height: "14px",
|
|
9
|
-
lineHeight: "14px",
|
|
10
|
-
textAlign: "center",
|
|
11
|
-
width: "14px",
|
|
12
|
-
zIndex: "inherit"
|
|
2
|
+
color: "white",
|
|
3
|
+
fontSize: "12px"
|
|
13
4
|
};
|
|
@@ -8,7 +8,11 @@ export const presetOneProactiveChatPaneControlProps = {
|
|
|
8
8
|
hideSubtitle: false,
|
|
9
9
|
subtitleText: "Live chat support!",
|
|
10
10
|
hideCloseButton: false,
|
|
11
|
-
|
|
11
|
+
closeButtonProps: {
|
|
12
|
+
type: "icon",
|
|
13
|
+
iconName: "ChromeClose",
|
|
14
|
+
hideButtonTitle: true
|
|
15
|
+
},
|
|
12
16
|
isBodyContainerHorizantal: true,
|
|
13
17
|
hideBodyTitle: false,
|
|
14
18
|
bodyTitleText: "Hi! Have any questions? I am here to help.",
|
|
@@ -8,7 +8,11 @@ export const presetThreeProactiveChatPaneControlProps = {
|
|
|
8
8
|
hideSubtitle: false,
|
|
9
9
|
subtitleText: "Live chat support!",
|
|
10
10
|
hideCloseButton: false,
|
|
11
|
-
|
|
11
|
+
closeButtonProps: {
|
|
12
|
+
type: "icon",
|
|
13
|
+
iconName: "ChromeClose",
|
|
14
|
+
hideButtonTitle: true
|
|
15
|
+
},
|
|
12
16
|
isBodyContainerHorizantal: false,
|
|
13
17
|
hideBodyTitle: false,
|
|
14
18
|
bodyTitleText: "Hi! Have any questions? I am here to help.",
|
package/lib/esm/index.js
CHANGED
|
@@ -12,6 +12,7 @@ export { default as PostChatSurveyPane } from "./components/postchatsurveypane/P
|
|
|
12
12
|
export { encodeComponentString } from "./common/encodeComponentString";
|
|
13
13
|
export { decodeComponentString } from "./common/decodeComponentString";
|
|
14
14
|
export { BroadcastService } from "./services/BroadcastService";
|
|
15
|
+
export { BroadcastServiceInitialize } from "./services/BroadcastService";
|
|
15
16
|
export { ElementType } from "./common/Constants";
|
|
16
17
|
export { default as CallingContainer } from "./components/callingcontainer/CallingContainer";
|
|
17
18
|
export { default as CurrentCall } from "./components/callingcontainer/subcomponents/CurrentCall/CurrentCall";
|
|
@@ -1,19 +1,45 @@
|
|
|
1
1
|
import { Subject } from "rxjs";
|
|
2
2
|
import { filter } from "rxjs/operators";
|
|
3
3
|
import { BroadcastChannel } from "broadcast-channel";
|
|
4
|
-
|
|
5
|
-
const newMessage = new Subject();
|
|
6
|
-
const pubChannel = new BroadcastChannel(BROADCAST_CHANNEL_NAME);
|
|
7
|
-
const subChannel = new BroadcastChannel(BROADCAST_CHANNEL_NAME); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
|
+
const newMessage = new Subject(); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
5
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
6
|
+
const broadcastServicePubList = {}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
7
|
+
|
|
8
|
+
const broadcastServiceSubList = {}; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
+
|
|
10
|
+
let pubChannel; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
+
|
|
12
|
+
let subChannel;
|
|
13
|
+
export const BroadcastServiceInitialize = channelName => {
|
|
14
|
+
if (broadcastServicePubList[channelName]) {
|
|
15
|
+
pubChannel = broadcastServicePubList[channelName];
|
|
16
|
+
} else {
|
|
17
|
+
const newPubChannel = new BroadcastChannel(channelName);
|
|
18
|
+
broadcastServicePubList[channelName] = newPubChannel;
|
|
19
|
+
pubChannel = newPubChannel;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (broadcastServiceSubList[channelName]) {
|
|
23
|
+
subChannel = broadcastServiceSubList[channelName];
|
|
24
|
+
} else {
|
|
25
|
+
const newSubChannel = new BroadcastChannel(channelName);
|
|
26
|
+
broadcastServiceSubList[channelName] = newSubChannel;
|
|
27
|
+
subChannel = newSubChannel;
|
|
28
|
+
} // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
29
|
|
|
30
|
+
|
|
31
|
+
subChannel.onmessage = message => {
|
|
32
|
+
newMessage.next(message);
|
|
33
|
+
};
|
|
34
|
+
};
|
|
13
35
|
export const BroadcastService = {
|
|
14
36
|
//broadcast a message
|
|
15
37
|
postMessage: message => {
|
|
16
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Omit copying methods to prevent 'DataCloneError' in older browsers when passing an object with functions
|
|
40
|
+
* This exception occurs when an object can't be clone with the 'structured clone algorithm' (used by postMessage)
|
|
41
|
+
*/
|
|
42
|
+
pubChannel.postMessage(JSON.parse(JSON.stringify(message)));
|
|
17
43
|
},
|
|
18
44
|
getMessage: message => {
|
|
19
45
|
return newMessage.pipe(filter(msg => msg.elementId == message.elementId && msg.elementType == message.elementType && msg.eventName == message.eventName));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
export declare const AccessibilityBrightnessRatio = 1.2;
|
|
2
|
-
export declare const
|
|
3
|
+
export declare const HiddenTextStyles: React.CSSProperties;
|
|
3
4
|
export declare const KeyCodes: {
|
|
4
5
|
new (): {};
|
|
5
6
|
readonly ENTER: "Enter";
|
|
@@ -18,7 +19,7 @@ export declare const Regex: {
|
|
|
18
19
|
};
|
|
19
20
|
export declare enum ElementType {
|
|
20
21
|
ChatButton = "ChatButton",
|
|
21
|
-
|
|
22
|
+
CloseButton = "CloseButton",
|
|
22
23
|
HeaderMinimizeButton = "HeaderMinimizeButton",
|
|
23
24
|
FooterDownloadTranscriptButton = "FooterDownloadTranscriptButton",
|
|
24
25
|
FooterEmailTranscriptButton = "FooterEmailTranscriptButton",
|
package/lib/types/components/proactivechatpane/interfaces/IProactiveChatPaneControlProps.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ICommandButtonControlProps } from "../../common/interfaces/ICommandButtonControlProps";
|
|
1
2
|
export interface IProactiveChatPaneControlProps {
|
|
2
3
|
id?: string;
|
|
3
4
|
dir?: "ltr" | "rtl" | "auto";
|
|
@@ -8,7 +9,7 @@ export interface IProactiveChatPaneControlProps {
|
|
|
8
9
|
hideSubtitle?: boolean;
|
|
9
10
|
subtitleText?: string;
|
|
10
11
|
hideCloseButton?: boolean;
|
|
11
|
-
|
|
12
|
+
closeButtonProps?: ICommandButtonControlProps;
|
|
12
13
|
isBodyContainerHorizantal?: boolean;
|
|
13
14
|
hideBodyTitle?: boolean;
|
|
14
15
|
bodyTitleText?: string;
|
package/lib/types/index.d.ts
CHANGED
|
@@ -12,6 +12,7 @@ export { default as PostChatSurveyPane } from "./components/postchatsurveypane/P
|
|
|
12
12
|
export { encodeComponentString } from "./common/encodeComponentString";
|
|
13
13
|
export { decodeComponentString } from "./common/decodeComponentString";
|
|
14
14
|
export { BroadcastService } from "./services/BroadcastService";
|
|
15
|
+
export { BroadcastServiceInitialize } from "./services/BroadcastService";
|
|
15
16
|
export { ElementType } from "./common/Constants";
|
|
16
17
|
export { default as CallingContainer } from "./components/callingcontainer/CallingContainer";
|
|
17
18
|
export { default as CurrentCall } from "./components/callingcontainer/subcomponents/CurrentCall/CurrentCall";
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Subject } from "rxjs";
|
|
2
2
|
import { ICustomEvent } from "../interfaces/ICustomEvent";
|
|
3
|
+
export declare const BroadcastServiceInitialize: (channelName: string) => void;
|
|
3
4
|
export declare const BroadcastService: {
|
|
4
5
|
postMessage: (message: ICustomEvent) => void;
|
|
5
6
|
getMessage: (message: ICustomEvent) => import("rxjs").Observable<ICustomEvent>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/omnichannel-chat-components",
|
|
3
|
-
"version": "0.1.0-main.
|
|
3
|
+
"version": "0.1.0-main.99bac9c",
|
|
4
4
|
"description": "Microsoft Omnichannel Chat Components",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"types": "lib/types/index.d.ts",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
"dependencies": {
|
|
69
69
|
"@fluentui/react": "^8.46.0",
|
|
70
70
|
"adaptivecards": "^2.10.0",
|
|
71
|
-
"botframework-webchat": "4.
|
|
71
|
+
"botframework-webchat": "4.15.4",
|
|
72
72
|
"broadcast-channel": "^4.5.0",
|
|
73
73
|
"jest-transform-stub": "^2.0.0",
|
|
74
74
|
"rxjs": "^5.0.3",
|