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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/lib/cjs/common/Constants.js +2 -6
  2. package/lib/cjs/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +1 -1
  3. package/lib/cjs/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +1 -1
  4. package/lib/cjs/components/chatbutton/ChatButton.js +23 -22
  5. package/lib/cjs/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +2 -1
  6. package/lib/cjs/components/common/commandbutton/CommandButton.js +22 -2
  7. package/lib/cjs/components/{header → common}/subcomponents/CloseButton.js +4 -3
  8. package/lib/cjs/components/footer/Footer.js +1 -1
  9. package/lib/cjs/components/footer/subcomponents/AudioNotificationButton.js +24 -4
  10. package/lib/cjs/components/header/Header.js +2 -2
  11. package/lib/cjs/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +1 -1
  12. package/lib/cjs/components/proactivechatpane/ProactiveChatPane.js +36 -35
  13. package/lib/cjs/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +5 -1
  14. package/lib/cjs/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -13
  15. package/lib/cjs/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +5 -1
  16. package/lib/cjs/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +5 -1
  17. package/lib/cjs/index.js +6 -0
  18. package/lib/cjs/services/BroadcastService.js +31 -7
  19. package/lib/esm/common/Constants.js +1 -4
  20. package/lib/esm/components/callingcontainer/subcomponents/CurrentCall/CurrentCall.js +1 -1
  21. package/lib/esm/components/callingcontainer/subcomponents/IncomingCall/IncomingCall.js +1 -1
  22. package/lib/esm/components/chatbutton/ChatButton.js +22 -21
  23. package/lib/esm/components/chatbutton/common/defaultProps/defaultChatButtonControlProps.js +2 -1
  24. package/lib/esm/components/common/commandbutton/CommandButton.js +22 -2
  25. package/lib/esm/components/{header → common}/subcomponents/CloseButton.js +4 -3
  26. package/lib/esm/components/footer/Footer.js +1 -1
  27. package/lib/esm/components/footer/subcomponents/AudioNotificationButton.js +24 -4
  28. package/lib/esm/components/header/Header.js +2 -2
  29. package/lib/esm/components/loadingpane/common/defaultProps/defaultStyles/defaultLoadingPaneIconStyles.js +1 -1
  30. package/lib/esm/components/proactivechatpane/ProactiveChatPane.js +33 -34
  31. package/lib/esm/components/proactivechatpane/common/default/defaultProps/defaultProactiveChatPaneControlProps.js +5 -1
  32. package/lib/esm/components/proactivechatpane/common/default/defaultStyles/defaultProactiveChatPaneCloseButtonStyles.js +2 -11
  33. package/lib/esm/components/proactivechatpane/common/presetOne/presetOneProps/presetOneProactiveChatPaneControlProps.js +5 -1
  34. package/lib/esm/components/proactivechatpane/common/presetThree/presetThreeProps/presetThreeProactiveChatPaneControlProps.js +5 -1
  35. package/lib/esm/index.js +1 -0
  36. package/lib/esm/services/BroadcastService.js +29 -7
  37. package/lib/types/common/Constants.d.ts +1 -2
  38. package/lib/types/components/chatbutton/interfaces/IChatButtonControlProps.d.ts +1 -0
  39. package/lib/types/components/common/interfaces/ICommandButtonControlProps.d.ts +1 -0
  40. package/lib/types/components/common/interfaces/ICommandButtonProps.d.ts +1 -0
  41. package/lib/types/components/{header → common}/subcomponents/CloseButton.d.ts +1 -1
  42. package/lib/types/components/proactivechatpane/interfaces/IProactiveChatPaneControlProps.d.ts +2 -1
  43. package/lib/types/index.d.ts +1 -0
  44. package/lib/types/services/BroadcastService.d.ts +1 -0
  45. package/package.json +2 -2
@@ -1,15 +1,37 @@
1
1
  import { Subject } from "rxjs";
2
2
  import { filter } from "rxjs/operators";
3
3
  import { BroadcastChannel } from "broadcast-channel";
4
- import { BROADCAST_CHANNEL_NAME } from "../common/Constants";
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
- subChannel.onmessage = message => {
10
- newMessage.next(message);
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 => {
@@ -1,6 +1,5 @@
1
1
  /// <reference types="react" />
2
2
  export declare const AccessibilityBrightnessRatio = 1.2;
3
- export declare const BROADCAST_CHANNEL_NAME = "omnichannel_broadcast_channel";
4
3
  export declare const HiddenTextStyles: React.CSSProperties;
5
4
  export declare const KeyCodes: {
6
5
  new (): {};
@@ -20,7 +19,7 @@ export declare const Regex: {
20
19
  };
21
20
  export declare enum ElementType {
22
21
  ChatButton = "ChatButton",
23
- HeaderCloseButton = "HeaderCloseButton",
22
+ CloseButton = "CloseButton",
24
23
  HeaderMinimizeButton = "HeaderMinimizeButton",
25
24
  FooterDownloadTranscriptButton = "FooterDownloadTranscriptButton",
26
25
  FooterEmailTranscriptButton = "FooterEmailTranscriptButton",
@@ -15,4 +15,5 @@ export interface IChatButtonControlProps {
15
15
  hideNotificationBubble?: boolean;
16
16
  unreadMessageString?: string;
17
17
  largeUnreadMessageString?: string;
18
+ ariaLabelUnreadMessageString?: string;
18
19
  }
@@ -14,4 +14,5 @@ export interface ICommandButtonControlProps {
14
14
  onClick?: () => void;
15
15
  className?: string;
16
16
  disabled?: boolean;
17
+ hideButtonTitle?: boolean;
17
18
  }
@@ -18,4 +18,5 @@ export interface ICommandButtonProps {
18
18
  className?: string;
19
19
  disabled?: boolean;
20
20
  customEvent?: ICustomEvent;
21
+ hideButtonTitle?: boolean;
21
22
  }
@@ -1,3 +1,3 @@
1
- import { ICommandButtonProps } from "../../common/interfaces/ICommandButtonProps";
1
+ import { ICommandButtonProps } from "../interfaces/ICommandButtonProps";
2
2
  declare function CloseButton(props: ICommandButtonProps): JSX.Element;
3
3
  export default CloseButton;
@@ -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
- closeButtonAriaLabel?: string;
12
+ closeButtonProps?: ICommandButtonControlProps;
12
13
  isBodyContainerHorizantal?: boolean;
13
14
  hideBodyTitle?: boolean;
14
15
  bodyTitleText?: string;
@@ -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.b59a07c",
3
+ "version": "0.1.0-main.d40108a",
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.14.1",
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",