@microsoft/omnichannel-chat-widget 0.1.0-main.bcfe8a3 → 0.1.0-main.cde77ea

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 (75) hide show
  1. package/lib/cjs/common/Constants.js +2 -0
  2. package/lib/cjs/common/telemetry/TelemetryConstants.js +4 -0
  3. package/lib/cjs/common/utils.js +48 -2
  4. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +4 -0
  5. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +0 -1
  6. package/lib/cjs/components/headerstateful/HeaderStateful.js +2 -2
  7. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +23 -0
  8. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
  9. package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +70 -0
  10. package/lib/cjs/components/livechatwidget/common/createAdapter.js +9 -1
  11. package/lib/cjs/components/livechatwidget/common/createMarkdown.js +31 -30
  12. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +4 -1
  13. package/lib/cjs/components/livechatwidget/common/endChat.js +49 -17
  14. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +8 -0
  15. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +15 -15
  16. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +0 -4
  17. package/lib/cjs/components/livechatwidget/common/shareObservable.js +45 -0
  18. package/lib/cjs/components/livechatwidget/common/startChat.js +124 -84
  19. package/lib/cjs/components/livechatwidget/interfaces/IAuthProps.js +1 -0
  20. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +92 -98
  21. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +4 -8
  22. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +1 -1
  23. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +2 -0
  24. package/lib/cjs/contexts/common/ConversationState.js +3 -2
  25. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +0 -1
  26. package/lib/cjs/controller/componentController.js +2 -2
  27. package/lib/esm/common/Constants.js +2 -0
  28. package/lib/esm/common/telemetry/TelemetryConstants.js +4 -0
  29. package/lib/esm/common/utils.js +36 -0
  30. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +4 -0
  31. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +0 -1
  32. package/lib/esm/components/headerstateful/HeaderStateful.js +2 -2
  33. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +14 -0
  34. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
  35. package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +59 -0
  36. package/lib/esm/components/livechatwidget/common/createAdapter.js +9 -2
  37. package/lib/esm/components/livechatwidget/common/createMarkdown.js +31 -30
  38. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +4 -1
  39. package/lib/esm/components/livechatwidget/common/endChat.js +50 -18
  40. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +9 -2
  41. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +17 -16
  42. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +0 -4
  43. package/lib/esm/components/livechatwidget/common/shareObservable.js +38 -0
  44. package/lib/esm/components/livechatwidget/common/startChat.js +125 -86
  45. package/lib/esm/components/livechatwidget/interfaces/IAuthProps.js +1 -0
  46. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +92 -97
  47. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +5 -8
  48. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +1 -1
  49. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +2 -0
  50. package/lib/esm/contexts/common/ConversationState.js +3 -2
  51. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +0 -1
  52. package/lib/esm/controller/componentController.js +2 -2
  53. package/lib/types/common/Constants.d.ts +1 -0
  54. package/lib/types/common/telemetry/TelemetryConstants.d.ts +4 -1
  55. package/lib/types/common/telemetry/TelemetryHelper.d.ts +1 -1
  56. package/lib/types/common/utils.d.ts +3 -0
  57. package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +1 -1
  58. package/lib/types/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.d.ts +5 -0
  59. package/lib/types/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.d.ts +6 -0
  60. package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -0
  61. package/lib/types/components/livechatwidget/common/endChat.d.ts +1 -1
  62. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +5 -4
  63. package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +1 -1
  64. package/lib/types/components/livechatwidget/common/shareObservable.d.ts +1 -0
  65. package/lib/types/components/livechatwidget/common/startChat.d.ts +4 -2
  66. package/lib/types/components/livechatwidget/common/startProactiveChat.d.ts +1 -1
  67. package/lib/types/components/livechatwidget/interfaces/IAuthProps.d.ts +4 -0
  68. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -0
  69. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +0 -1
  70. package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +1 -0
  71. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +1 -1
  72. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.d.ts +1 -1
  73. package/lib/types/contexts/common/ConversationState.d.ts +3 -2
  74. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +0 -1
  75. package/package.json +1 -1
@@ -0,0 +1,4 @@
1
+ export interface IAuthProps {
2
+ authClientFunction?: string;
3
+ setAuthTokenProviderToChatSdk?: (chatSDK: any, authClientFunction?: string) => Promise<void>;
4
+ }
@@ -21,6 +21,7 @@ import { IWebChatContainerStatefulProps } from "../../webchatcontainerstateful/i
21
21
  import { OmnichannelChatSDK } from "@microsoft/omnichannel-chat-sdk";
22
22
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
23
23
  import { IContextDataStore } from "../../../common/interfaces/IContextDataStore";
24
+ import { IAuthProps } from "./IAuthProps";
24
25
  export interface ILiveChatWidgetProps {
25
26
  audioNotificationProps?: IAudioNotificationProps;
26
27
  callingContainerProps?: ICallingContainerProps;
@@ -49,4 +50,5 @@ export interface ILiveChatWidgetProps {
49
50
  webChatContainerProps?: IWebChatContainerStatefulProps;
50
51
  liveChatContextFromCache?: ILiveChatWidgetContext;
51
52
  contextDataStore?: IContextDataStore;
53
+ authProps?: IAuthProps;
52
54
  }
@@ -1,6 +1,5 @@
1
1
  import { IReconnectChatPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/reconnectchatpane/interfaces/IReconnectChatPaneProps";
2
2
  export interface IReconnectChatPaneStatefulProps extends IReconnectChatPaneProps {
3
- authClientFunction?: string;
4
3
  isReconnectEnabled?: boolean;
5
4
  reconnectId?: string;
6
5
  redirectInSameWindow?: boolean;
@@ -1,6 +1,7 @@
1
1
  import MockAdapter from "./mockadapter";
2
2
  export declare class MockChatSDK {
3
3
  protected sleep: (ms: any) => Promise<unknown>;
4
+ isMockModeOn: boolean;
4
5
  startChat(): Promise<void>;
5
6
  endChat(): null;
6
7
  getChatToken(): null;
@@ -7,4 +7,4 @@
7
7
  * 3. Decodes certain html characters that came through from chat services
8
8
  ******/
9
9
  import React from "react";
10
- export declare const createActivityMiddleware: (systemMessageStyleProps?: React.CSSProperties | undefined, userMessageStyleProps?: React.CSSProperties | undefined) => () => (next: any) => (...args: any) => any;
10
+ export declare const createActivityMiddleware: (systemMessageStyleProps?: React.CSSProperties, userMessageStyleProps?: React.CSSProperties) => () => (next: any) => (...args: any) => any;
@@ -5,4 +5,4 @@
5
5
  * 1. Renders the first two letters of the sender as the profile pic
6
6
  ******/
7
7
  import React from "react";
8
- export declare const createAvatarMiddleware: (avatarStyleProps?: React.CSSProperties | undefined, avatarTextStyleProps?: React.CSSProperties | undefined) => () => (next: any) => (args_0: any) => false | (() => JSX.Element);
8
+ export declare const createAvatarMiddleware: (avatarStyleProps?: React.CSSProperties, avatarTextStyleProps?: React.CSSProperties) => () => (next: any) => (args_0: any) => false | (() => JSX.Element);
@@ -6,6 +6,7 @@ export declare enum ConversationState {
6
6
  ProactiveChat = 4,
7
7
  Active = 5,
8
8
  InActive = 6,
9
- Postchat = 7,
10
- Closed = 8
9
+ PostchatLoading = 7,
10
+ Postchat = 8,
11
+ Closed = 9
11
12
  }
@@ -23,7 +23,6 @@ export interface ILiveChatWidgetContext {
23
23
  isMinimized: boolean;
24
24
  previousElementOnFocusBeforeModalOpen: HTMLElement | null;
25
25
  outsideOperatingHours: boolean;
26
- shouldShowPostChat: boolean;
27
26
  preChatResponseEmail: string;
28
27
  isAudioMuted: boolean | null;
29
28
  newMessage: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "0.1.0-main.bcfe8a3",
3
+ "version": "0.1.0-main.cde77ea",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",