@microsoft/omnichannel-chat-widget 0.1.0-main.3d1c026 → 0.1.0-main.7338c17

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 (58) hide show
  1. package/README.md +235 -0
  2. package/lib/cjs/common/Constants.js +2 -0
  3. package/lib/cjs/common/contextDataStore/DataStoreManager.js +14 -0
  4. package/lib/cjs/common/interfaces/IContextDataStore.js +1 -0
  5. package/lib/cjs/common/telemetry/TelemetryConstants.js +5 -1
  6. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +15 -28
  7. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -2
  8. package/lib/cjs/components/livechatwidget/common/endChat.js +7 -3
  9. package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +5 -0
  10. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +6 -12
  11. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +20 -3
  12. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +23 -22
  13. package/lib/cjs/components/livechatwidget/common/startChat.js +72 -26
  14. package/lib/cjs/components/livechatwidget/common/startProactiveChat.js +3 -3
  15. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +27 -11
  16. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
  17. package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +8 -0
  18. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +28 -11
  19. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +10 -4
  20. package/lib/cjs/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.js +1 -0
  21. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +2 -0
  22. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +2 -1
  23. package/lib/cjs/contexts/createReducer.js +13 -0
  24. package/lib/esm/common/Constants.js +2 -0
  25. package/lib/esm/common/contextDataStore/DataStoreManager.js +5 -0
  26. package/lib/esm/common/interfaces/IContextDataStore.js +1 -0
  27. package/lib/esm/common/telemetry/TelemetryConstants.js +5 -1
  28. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +15 -28
  29. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -2
  30. package/lib/esm/components/livechatwidget/common/endChat.js +7 -3
  31. package/lib/esm/components/livechatwidget/common/initCallingSdk.js +3 -0
  32. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +6 -12
  33. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +18 -3
  34. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +22 -22
  35. package/lib/esm/components/livechatwidget/common/startChat.js +67 -22
  36. package/lib/esm/components/livechatwidget/common/startProactiveChat.js +5 -5
  37. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +26 -11
  38. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
  39. package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +6 -0
  40. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +26 -10
  41. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +8 -4
  42. package/lib/esm/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.js +1 -0
  43. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +2 -0
  44. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +2 -1
  45. package/lib/esm/contexts/createReducer.js +13 -0
  46. package/lib/types/common/Constants.d.ts +1 -0
  47. package/lib/types/common/contextDataStore/DataStoreManager.d.ts +4 -0
  48. package/lib/types/common/interfaces/IContextDataStore.d.ts +14 -0
  49. package/lib/types/common/telemetry/TelemetryConstants.d.ts +4 -0
  50. package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +1 -1
  51. package/lib/types/components/livechatwidget/common/startChat.d.ts +1 -1
  52. package/lib/types/components/livechatwidget/common/startProactiveChat.d.ts +2 -1
  53. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +3 -1
  54. package/lib/types/components/prechatsurveypanestateful/interfaces/IPreChatSurveyPaneStatefulParams.d.ts +1 -1
  55. package/lib/types/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.d.ts +3 -0
  56. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
  57. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +3 -1
  58. package/package.json +1 -1
@@ -0,0 +1,14 @@
1
+ export interface IContextDataStore {
2
+ /**
3
+ * getData: Get data from data store
4
+ */
5
+ getData: (key: string, type: string) => any;
6
+ /**
7
+ * setData: Set data to data store
8
+ */
9
+ setData: (key: string, value: string) => void;
10
+ /**
11
+ * removeData: Remove data from data store by key
12
+ */
13
+ removeData?: (key: string) => void;
14
+ }
@@ -99,11 +99,15 @@ export declare enum TelemetryEvent {
99
99
  SendTypingIndicatorSucceeded = "SendTypingIndicatorSucceeded",
100
100
  SendTypingIndicatorFailed = "SendTypingIndicatorFailed",
101
101
  PreChatSurveyStartChatMethodFailed = "PreChatSurveyStartChatMethodFailed",
102
+ ChatAlreadyTriggered = "ChatAlreadyTriggered",
103
+ StartProactiveChatEventReceived = "StartProactiveChatEventReceived",
102
104
  StartProactiveChatMethodFailed = "StartProactiveChatMethodFailed",
103
105
  ProactiveChatAccepted = "ProactiveChatAccepted",
104
106
  ProactiveChatRejected = "ProactiveChatRejected",
105
107
  IncomingProactiveChatScreenLoaded = "IncomingProactiveChatScreenLoaded",
106
108
  ProactiveChatClosed = "ProactiveChatClosed",
109
+ ProactiveChatStartChat = "ProactiveChatStartChat",
110
+ ProactiveChatStartPopoutChat = "ProactiveChatStartPopoutChat",
107
111
  ReconnectChatContinueConversation = "ReconnectChatContinueConversation",
108
112
  ReconnectChatStartNewConversation = "ReconnectChatStartNewConversation",
109
113
  ReconnectChatMinimize = "ReconnectChatMinimize",
@@ -1,3 +1,3 @@
1
1
  import { Dispatch } from "react";
2
2
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
- export declare const setPostChatContextAndLoadSurvey: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, loadSurvey: boolean) => Promise<void>;
3
+ export declare const setPostChatContextAndLoadSurvey: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, persistedChat?: boolean | undefined) => Promise<void>;
@@ -3,5 +3,5 @@ import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetA
3
3
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
4
4
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
5
  declare const prepareStartChat: (props: ILiveChatWidgetProps, chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any) => Promise<void>;
6
- declare const initStartChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, params?: any) => Promise<void>;
6
+ declare const initStartChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, params?: any, persistedState?: any) => Promise<void>;
7
7
  export { prepareStartChat, initStartChat };
@@ -1,3 +1,4 @@
1
1
  import { Dispatch } from "react";
2
2
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
- export declare const startProactiveChat: (dispatch: Dispatch<ILiveChatWidgetAction>, bodyTitle?: string | undefined, showPrechat?: boolean | undefined, inNewWindow?: boolean | undefined) => void;
3
+ import { IProactiveChatNotificationConfig } from "../../proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig";
4
+ export declare const startProactiveChat: (dispatch: Dispatch<ILiveChatWidgetAction>, notificationConfig?: IProactiveChatNotificationConfig | undefined, enablePreChat?: boolean | undefined, inNewWindow?: boolean | undefined) => void;
@@ -20,6 +20,7 @@ import { ITelemetryConfig } from "../../../common/telemetry/interfaces/ITelemetr
20
20
  import { IWebChatContainerStatefulProps } from "../../webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps";
21
21
  import { OmnichannelChatSDK } from "@microsoft/omnichannel-chat-sdk";
22
22
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
23
+ import { IContextDataStore } from "../../../common/interfaces/IContextDataStore";
23
24
  export interface ILiveChatWidgetProps {
24
25
  audioNotificationProps?: IAudioNotificationProps;
25
26
  callingContainerProps?: ICallingContainerProps;
@@ -44,7 +45,8 @@ export interface ILiveChatWidgetProps {
44
45
  proactiveChatPaneProps?: IProactiveChatPaneStatefulProps;
45
46
  reconnectChatPaneProps?: IReconnectChatPaneStatefulProps;
46
47
  styleProps?: ILiveChatWidgetStyleProps;
47
- telemetryConfig: ITelemetryConfig;
48
+ telemetryConfig?: ITelemetryConfig;
48
49
  webChatContainerProps?: IWebChatContainerStatefulProps;
49
50
  liveChatContextFromCache?: ILiveChatWidgetContext;
51
+ contextDataStore?: IContextDataStore;
50
52
  }
@@ -1,5 +1,5 @@
1
1
  import { IPreChatSurveyPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneProps";
2
2
  export interface IPreChatSurveyPaneStatefulParams {
3
3
  surveyProps?: IPreChatSurveyPaneProps;
4
- initStartChat: (params?: any) => Promise<void>;
4
+ initStartChat: (params?: any, persistedState?: any) => Promise<void>;
5
5
  }
@@ -0,0 +1,3 @@
1
+ export interface IProactiveChatNotificationConfig {
2
+ message?: string;
3
+ }
@@ -14,6 +14,7 @@ export interface ILiveChatWidgetContext {
14
14
  middlewareLocalizedTexts: ILiveChatWidgetLocalizedTexts | undefined;
15
15
  telemetryInternalData: IInternalTelemetryData;
16
16
  globalDir: "rtl" | "ltr";
17
+ liveChatContext: any;
17
18
  };
18
19
  appStates: {
19
20
  conversationState: ConversationState;
@@ -27,5 +27,7 @@ export declare enum LiveChatWidgetActionType {
27
27
  SET_RECONNECT_ID = 25,
28
28
  SET_UNREAD_MESSAGE_COUNT = 26,
29
29
  SET_FOCUS_CHAT_BUTTON = 27,
30
- SET_CONVERSATION_ENDED_BY_AGENT = 28
30
+ SET_CONVERSATION_ENDED_BY_AGENT = 28,
31
+ SET_WIDGET_STATE = 29,
32
+ SET_LIVE_CHAT_CONTEXT = 30
31
33
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "0.1.0-main.3d1c026",
3
+ "version": "0.1.0-main.7338c17",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",