@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.
- package/README.md +235 -0
- package/lib/cjs/common/Constants.js +2 -0
- package/lib/cjs/common/contextDataStore/DataStoreManager.js +14 -0
- package/lib/cjs/common/interfaces/IContextDataStore.js +1 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +5 -1
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +15 -28
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -2
- package/lib/cjs/components/livechatwidget/common/endChat.js +7 -3
- package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +5 -0
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +6 -12
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +20 -3
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +23 -22
- package/lib/cjs/components/livechatwidget/common/startChat.js +72 -26
- package/lib/cjs/components/livechatwidget/common/startProactiveChat.js +3 -3
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +27 -11
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
- package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +8 -0
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +28 -11
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +10 -4
- package/lib/cjs/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.js +1 -0
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +2 -0
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +2 -1
- package/lib/cjs/contexts/createReducer.js +13 -0
- package/lib/esm/common/Constants.js +2 -0
- package/lib/esm/common/contextDataStore/DataStoreManager.js +5 -0
- package/lib/esm/common/interfaces/IContextDataStore.js +1 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +5 -1
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +15 -28
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -2
- package/lib/esm/components/livechatwidget/common/endChat.js +7 -3
- package/lib/esm/components/livechatwidget/common/initCallingSdk.js +3 -0
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +6 -12
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +18 -3
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +22 -22
- package/lib/esm/components/livechatwidget/common/startChat.js +67 -22
- package/lib/esm/components/livechatwidget/common/startProactiveChat.js +5 -5
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +26 -11
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
- package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +6 -0
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +26 -10
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +8 -4
- package/lib/esm/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.js +1 -0
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +2 -0
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +2 -1
- package/lib/esm/contexts/createReducer.js +13 -0
- package/lib/types/common/Constants.d.ts +1 -0
- package/lib/types/common/contextDataStore/DataStoreManager.d.ts +4 -0
- package/lib/types/common/interfaces/IContextDataStore.d.ts +14 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +4 -0
- package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/startChat.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/startProactiveChat.d.ts +2 -1
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +3 -1
- package/lib/types/components/prechatsurveypanestateful/interfaces/IPreChatSurveyPaneStatefulParams.d.ts +1 -1
- package/lib/types/components/proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig.d.ts +3 -0
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +3 -1
- 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>,
|
|
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
|
-
|
|
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
|
|
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
|
}
|
|
@@ -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
|
}
|