@microsoft/omnichannel-chat-widget 0.1.0-main.c2417f9 → 0.1.0-main.c9a643a
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 +4 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +11 -0
- package/lib/cjs/common/utils.js +64 -5
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +4 -0
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +0 -1
- package/lib/cjs/components/headerstateful/HeaderStateful.js +4 -3
- package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +44 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +23 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +39 -0
- package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +70 -0
- package/lib/cjs/components/livechatwidget/common/Deferred.js +42 -0
- package/lib/cjs/components/livechatwidget/common/authHelper.js +65 -0
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +13 -1
- package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +12 -0
- package/lib/cjs/components/livechatwidget/common/createMarkdown.js +31 -30
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +8 -3
- package/lib/cjs/components/livechatwidget/common/endChat.js +52 -20
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +12 -0
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +55 -35
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +0 -4
- package/lib/cjs/components/livechatwidget/common/shareObservable.js +45 -0
- package/lib/cjs/components/livechatwidget/common/startChat.js +153 -85
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +183 -114
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +4 -8
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +11 -0
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +4 -1
- package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +11 -0
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +2 -0
- package/lib/cjs/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +2 -1
- package/lib/cjs/contexts/common/ConversationState.js +3 -2
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +1 -0
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +2 -2
- package/lib/cjs/contexts/createReducer.js +8 -0
- package/lib/cjs/controller/componentController.js +3 -3
- package/lib/esm/common/Constants.js +4 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +11 -0
- package/lib/esm/common/utils.js +48 -3
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +4 -0
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +0 -1
- package/lib/esm/components/headerstateful/HeaderStateful.js +4 -3
- package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +34 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +14 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +29 -0
- package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +59 -0
- package/lib/esm/components/livechatwidget/common/Deferred.js +33 -0
- package/lib/esm/components/livechatwidget/common/authHelper.js +50 -0
- package/lib/esm/components/livechatwidget/common/createAdapter.js +12 -2
- package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +8 -0
- package/lib/esm/components/livechatwidget/common/createMarkdown.js +31 -30
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +8 -3
- package/lib/esm/components/livechatwidget/common/endChat.js +53 -21
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +13 -2
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +56 -37
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +0 -4
- package/lib/esm/components/livechatwidget/common/shareObservable.js +38 -0
- package/lib/esm/components/livechatwidget/common/startChat.js +148 -86
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +180 -114
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +5 -8
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +10 -0
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +4 -0
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +2 -0
- package/lib/esm/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +2 -1
- package/lib/esm/contexts/common/ConversationState.js +3 -2
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +1 -0
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +2 -2
- package/lib/esm/contexts/createReducer.js +8 -0
- package/lib/esm/controller/componentController.js +3 -3
- package/lib/types/common/Constants.d.ts +2 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +10 -2
- package/lib/types/common/utils.d.ts +7 -3
- package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +2 -1
- package/lib/types/components/livechatwidget/common/ActivityStreamHandler.d.ts +14 -0
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.d.ts +5 -0
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.d.ts +6 -0
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.d.ts +7 -0
- package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -0
- package/lib/types/components/livechatwidget/common/Deferred.d.ts +9 -0
- package/lib/types/components/livechatwidget/common/authHelper.d.ts +5 -0
- package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +5 -4
- package/lib/types/components/livechatwidget/common/shareObservable.d.ts +1 -0
- package/lib/types/components/livechatwidget/common/startChat.d.ts +4 -2
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +1 -0
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +1 -0
- package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +0 -1
- package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -1
- package/lib/types/contexts/common/ConversationState.d.ts +3 -2
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -1
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +2 -1
- package/package.json +4 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,6 +8,7 @@ export let ConversationState;
|
|
|
8
8
|
ConversationState[ConversationState["ProactiveChat"] = 4] = "ProactiveChat";
|
|
9
9
|
ConversationState[ConversationState["Active"] = 5] = "Active";
|
|
10
10
|
ConversationState[ConversationState["InActive"] = 6] = "InActive";
|
|
11
|
-
ConversationState[ConversationState["
|
|
12
|
-
ConversationState[ConversationState["
|
|
11
|
+
ConversationState[ConversationState["PostchatLoading"] = 7] = "PostchatLoading";
|
|
12
|
+
ConversationState[ConversationState["Postchat"] = 8] = "Postchat";
|
|
13
|
+
ConversationState[ConversationState["Closed"] = 9] = "Closed";
|
|
13
14
|
})(ConversationState || (ConversationState = {}));
|
|
@@ -34,4 +34,5 @@ export let LiveChatWidgetActionType;
|
|
|
34
34
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 30] = "SET_LIVE_CHAT_CONTEXT";
|
|
35
35
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_OAUTH_SIGNIN_ID"] = 31] = "SET_BOT_OAUTH_SIGNIN_ID";
|
|
36
36
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_SIZE"] = 32] = "SET_WIDGET_SIZE";
|
|
37
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_INSTANCE_ID"] = 33] = "SET_WIDGET_INSTANCE_ID";
|
|
37
38
|
})(LiveChatWidgetActionType || (LiveChatWidgetActionType = {}));
|
|
@@ -20,14 +20,14 @@ export const getLiveChatWidgetContextInitialState = props => {
|
|
|
20
20
|
globalDir: "ltr",
|
|
21
21
|
liveChatContext: undefined,
|
|
22
22
|
customContext: undefined,
|
|
23
|
-
widgetSize: undefined
|
|
23
|
+
widgetSize: undefined,
|
|
24
|
+
widgetInstanceId: ""
|
|
24
25
|
},
|
|
25
26
|
appStates: {
|
|
26
27
|
conversationState: ConversationState.Closed,
|
|
27
28
|
isMinimized: false,
|
|
28
29
|
previousElementOnFocusBeforeModalOpen: null,
|
|
29
30
|
outsideOperatingHours: false,
|
|
30
|
-
shouldShowPostChat: false,
|
|
31
31
|
preChatResponseEmail: "",
|
|
32
32
|
isAudioMuted: null,
|
|
33
33
|
newMessage: false,
|
|
@@ -235,6 +235,14 @@ export const createReducer = () => {
|
|
|
235
235
|
}
|
|
236
236
|
};
|
|
237
237
|
|
|
238
|
+
case LiveChatWidgetActionType.SET_WIDGET_INSTANCE_ID:
|
|
239
|
+
return { ...state,
|
|
240
|
+
domainStates: { ...state.domainStates,
|
|
241
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
242
|
+
widgetInstanceId: action.payload
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
|
|
238
246
|
default:
|
|
239
247
|
return state;
|
|
240
248
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ConversationState } from "../contexts/common/ConversationState";
|
|
2
2
|
export const shouldShowChatButton = state => {
|
|
3
|
-
return state.appStates.isMinimized || state.appStates.conversationState === ConversationState.Closed;
|
|
3
|
+
return (state.appStates.isMinimized || state.appStates.conversationState === ConversationState.Closed) && state.appStates.skipChatButtonRendering == false; // Do not show chat button in case of popout
|
|
4
4
|
};
|
|
5
5
|
export const shouldShowProactiveChatPane = state => {
|
|
6
6
|
return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.ProactiveChat;
|
|
@@ -18,13 +18,13 @@ export const shouldShowWebChatContainer = state => {
|
|
|
18
18
|
return state.appStates.conversationState === ConversationState.Active || state.appStates.conversationState === ConversationState.InActive;
|
|
19
19
|
};
|
|
20
20
|
export const shouldShowLoadingPane = state => {
|
|
21
|
-
return !state.appStates.isMinimized &&
|
|
21
|
+
return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.Loading;
|
|
22
22
|
};
|
|
23
23
|
export const shouldShowReconnectChatPane = state => {
|
|
24
24
|
return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.ReconnectChat;
|
|
25
25
|
};
|
|
26
26
|
export const shouldShowPostChatLoadingPane = state => {
|
|
27
|
-
return !state.appStates.isMinimized && state.appStates.
|
|
27
|
+
return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.PostchatLoading;
|
|
28
28
|
};
|
|
29
29
|
export const shouldShowOutOfOfficeHoursPane = state => {
|
|
30
30
|
return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.OutOfOffice;
|
|
@@ -76,6 +76,8 @@ export declare class Constants {
|
|
|
76
76
|
static readonly internetConnectionTestUrl = "https://ocsdk-prod.azureedge.net/public/connecttest.txt";
|
|
77
77
|
static readonly internetConnectionTestUrlText = "Omnichannel Connect Test";
|
|
78
78
|
static readonly ChatWidgetStateChangedPrefix = "ChatWidgetStateChanged";
|
|
79
|
+
static readonly PostChatLoadingDurationInMs = 2000;
|
|
80
|
+
static readonly BrowserUnloadConfirmationMessage = "Do you want to leave chat?";
|
|
79
81
|
}
|
|
80
82
|
export declare const Regex: {
|
|
81
83
|
new (): {};
|
|
@@ -39,7 +39,9 @@ export declare enum BroadcastEvent {
|
|
|
39
39
|
ChatRetrievedFromCache = "ChatRetrievedFromCache",
|
|
40
40
|
MaximizeChat = "MaximizeChat",
|
|
41
41
|
ChatInitiated = "ChatInitiated",
|
|
42
|
-
CloseChat = "CloseChat"
|
|
42
|
+
CloseChat = "CloseChat",
|
|
43
|
+
InitiateEndChatOnBrowserUnload = "InitiateEndChatOnBrowserUnload",
|
|
44
|
+
ClosePopoutWindow = "ClosePopoutWindow"
|
|
43
45
|
}
|
|
44
46
|
export declare enum TelemetryEvent {
|
|
45
47
|
CallAdded = "CallAdded",
|
|
@@ -117,6 +119,10 @@ export declare enum TelemetryEvent {
|
|
|
117
119
|
AudioToggleButtonClicked = "AudioToggleButtonClicked",
|
|
118
120
|
SuppressBotMagicCodeSucceeded = "SuppressBotMagicCodeSucceeded",
|
|
119
121
|
SuppressBotMagicCodeFailed = "SuppressBotMagicCodeFailed",
|
|
122
|
+
GetConversationDetailsException = "GetConversationDetailsException",
|
|
123
|
+
BrowserUnloadEventStarted = "BrowserUnloadEventStarted",
|
|
124
|
+
GetAuthTokenCalled = "GetAuthTokenCalled",
|
|
125
|
+
ReceivedNullOrEmptyToken = "ReceivedNullOrEmptyToken",
|
|
120
126
|
ProcessingHTMLTextMiddlewareFailed = "ProcessingHTMLTextMiddlewareFailed",
|
|
121
127
|
ProcessingSanitizationMiddlewareFailed = "ProcessingSanitizationMiddlewareFailed",
|
|
122
128
|
FormatTagsMiddlewareJSONStringifyFailed = "FormatTagsMiddlewareJSONStringifyFailed",
|
|
@@ -142,7 +148,9 @@ export declare enum TelemetryEvent {
|
|
|
142
148
|
ReconnectChatMinimize = "ReconnectChatMinimize",
|
|
143
149
|
MessageSent = "MessageSent",
|
|
144
150
|
MessageReceived = "MessageReceived",
|
|
145
|
-
CustomContextReceived = "CustomContextReceived"
|
|
151
|
+
CustomContextReceived = "CustomContextReceived",
|
|
152
|
+
NetworkDisconnected = "NetworkDisconnected",
|
|
153
|
+
NetworkReconnected = "NetworkReconnected"
|
|
146
154
|
}
|
|
147
155
|
export interface TelemetryInput {
|
|
148
156
|
scenarioType: ScenarioType;
|
|
@@ -18,9 +18,13 @@ export declare const extractPreChatSurveyResponseValues: (preChatSurvey: string,
|
|
|
18
18
|
value: string;
|
|
19
19
|
}[]) => {};
|
|
20
20
|
export declare const isNullOrUndefined: (obj: any) => boolean;
|
|
21
|
-
export declare const isNullOrEmptyString: (s: string) => boolean;
|
|
21
|
+
export declare const isNullOrEmptyString: (s: string | null) => boolean;
|
|
22
22
|
export declare const newGuid: () => string;
|
|
23
23
|
export declare const createTimer: () => ITimer;
|
|
24
24
|
export declare const getDomain: (hostValue: any) => string;
|
|
25
|
-
export declare const getWidgetCacheId: (orgId: string, widgetId: string) => string;
|
|
26
|
-
export declare const getWidgetEndChatEventName: (orgId: string, widgetId: string) => string;
|
|
25
|
+
export declare const getWidgetCacheId: (orgId: string, widgetId: string, widgetInstanceId: string) => string;
|
|
26
|
+
export declare const getWidgetEndChatEventName: (orgId: string, widgetId: string, widgetInstanceId: string) => string;
|
|
27
|
+
export declare const getStateFromCache: (orgId: string, widgetId: string, widgetInstanceId: string) => any;
|
|
28
|
+
export declare const isUndefinedOrEmpty: (object: any) => boolean;
|
|
29
|
+
export declare const addDelayInMs: (ms: number) => Promise<void>;
|
|
30
|
+
export declare const getBroadcastChannelName: (widgetId: string, widgetInstanceId: string) => string;
|
|
@@ -15,6 +15,7 @@ export interface IHeaderStatefulParams {
|
|
|
15
15
|
* @param adapter : The chat adapter for the live chat session
|
|
16
16
|
* @param skipEndChatSDK : If set to true endchat will skip chatSDK endChat call
|
|
17
17
|
* @param skipCloseChat : If set to true endchat will skip closing the live chat instance
|
|
18
|
+
* @param postMessageToOtherTab : If set to true endchat will send a message to other tabs(multi-tabs)
|
|
18
19
|
*/
|
|
19
|
-
endChat: (adapter: any, skipEndChatSDK?: boolean, skipCloseChat?: boolean) => Promise<void>;
|
|
20
|
+
endChat: (adapter: any, skipEndChatSDK?: boolean, skipCloseChat?: boolean, postMessageToOtherTab?: boolean) => Promise<void>;
|
|
20
21
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export declare class ActivityStreamHandler {
|
|
2
|
+
static restoreDeferred: any;
|
|
3
|
+
static restorePromise: Promise<any>;
|
|
4
|
+
/**
|
|
5
|
+
* Use of a deferred pattern, to hold the execution of the activity.
|
|
6
|
+
*
|
|
7
|
+
* */
|
|
8
|
+
static cork(): void;
|
|
9
|
+
/**
|
|
10
|
+
* Resolve the promise, releasing it to continue with the execution of the activity.
|
|
11
|
+
*
|
|
12
|
+
* */
|
|
13
|
+
static uncork(): void;
|
|
14
|
+
}
|
package/lib/types/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IActivitySubscriber } from "./IActivitySubscriber";
|
|
2
|
+
export declare class PauseActivitySubscriber implements IActivitySubscriber {
|
|
3
|
+
observer: any;
|
|
4
|
+
apply(activity: any): Promise<void>;
|
|
5
|
+
applicable(activity: any): boolean;
|
|
6
|
+
next(activity: any): Promise<any>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
|
|
2
|
+
declare const getAuthClientFunction: (chatConfig: ChatConfig | undefined) => string | undefined;
|
|
3
|
+
declare const handleAuthentication: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined) => Promise<boolean>;
|
|
4
|
+
declare const removeAuthTokenProvider: (chatSDK: any) => void;
|
|
5
|
+
export { getAuthClientFunction, handleAuthentication, removeAuthTokenProvider };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import "regenerator-runtime/runtime";
|
|
2
|
+
import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
|
|
2
3
|
import { Dispatch } from "react";
|
|
3
4
|
import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
|
|
4
5
|
import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
5
|
-
declare const getChatReconnectContext: (chatSDK: any, reconnectId?: string | undefined) => Promise<any>;
|
|
6
|
+
declare const getChatReconnectContext: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, isReconnectEnabled?: boolean | undefined, reconnectId?: string | undefined) => Promise<any>;
|
|
6
7
|
declare const getReconnectIdForAuthenticatedChat: (props: ILiveChatWidgetProps, chatSDK: any) => Promise<string | undefined>;
|
|
7
|
-
declare const handleUnauthenticatedReconnectChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, reconnectId: string, initStartChat: any, redirectInSameWindow: boolean | undefined) => Promise<void>;
|
|
8
|
-
declare const startUnauthenticatedReconnectChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, reconnectId: string, initStartChat: any) => Promise<void>;
|
|
9
|
-
declare const handleRedirectUnauthenticatedReconnectChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, initStartChat: any, reconnectId: string, redirectInSameWindow: boolean | undefined) => Promise<void>;
|
|
8
|
+
declare const handleUnauthenticatedReconnectChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, isReconnectEnabled: boolean | undefined, reconnectId: string, initStartChat: any, redirectInSameWindow: boolean | undefined) => Promise<void>;
|
|
9
|
+
declare const startUnauthenticatedReconnectChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, isReconnectEnabled: boolean | undefined, reconnectId: string, initStartChat: any) => Promise<void>;
|
|
10
|
+
declare const handleRedirectUnauthenticatedReconnectChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, initStartChat: any, isReconnectEnabled: boolean | undefined, reconnectId: string, redirectInSameWindow: boolean | undefined) => Promise<void>;
|
|
10
11
|
export { getChatReconnectContext, getReconnectIdForAuthenticatedChat, handleUnauthenticatedReconnectChat, startUnauthenticatedReconnectChat, handleRedirectUnauthenticatedReconnectChat };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function shareObservable(observable: any): any;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
|
|
1
2
|
import { Dispatch } from "react";
|
|
2
3
|
import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
|
|
3
4
|
import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
|
|
4
5
|
import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
5
6
|
declare const prepareStartChat: (props: ILiveChatWidgetProps, chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any) => Promise<void>;
|
|
6
|
-
declare const
|
|
7
|
-
|
|
7
|
+
declare const setPreChatAndInitiateChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, isProactiveChat?: boolean | undefined, proactiveChatEnablePrechatState?: boolean | undefined) => Promise<void>;
|
|
8
|
+
declare const initStartChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, params?: any, persistedState?: any) => Promise<void>;
|
|
9
|
+
export { prepareStartChat, initStartChat, setPreChatAndInitiateChat };
|
|
@@ -49,4 +49,5 @@ export interface ILiveChatWidgetProps {
|
|
|
49
49
|
webChatContainerProps?: IWebChatContainerStatefulProps;
|
|
50
50
|
liveChatContextFromCache?: ILiveChatWidgetContext;
|
|
51
51
|
contextDataStore?: IContextDataStore;
|
|
52
|
+
getAuthToken?: (authClientFunction?: string) => Promise<string | null>;
|
|
52
53
|
}
|
|
@@ -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;
|
package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import { IRenderingMiddlewareProps } from "./IRenderingMiddlewareProps";
|
|
|
4
4
|
import { IStyle } from "@fluentui/react";
|
|
5
5
|
import { IWebChatProps } from "./IWebChatProps";
|
|
6
6
|
import { StyleOptions } from "botframework-webchat-api";
|
|
7
|
+
import { IAdaptiveCardStyles } from "./IAdaptiveCardStyles";
|
|
7
8
|
export interface IWebChatContainerStatefulProps {
|
|
8
9
|
containerStyles?: IStyle;
|
|
9
10
|
disableNewLineMarkdownSupport?: boolean;
|
|
@@ -15,4 +16,5 @@ export interface IWebChatContainerStatefulProps {
|
|
|
15
16
|
renderingMiddlewareProps?: IRenderingMiddlewareProps;
|
|
16
17
|
localizedTexts?: ILiveChatWidgetLocalizedTexts;
|
|
17
18
|
botMagicCode?: IBotMagicCodeConfig;
|
|
19
|
+
adaptiveCardStyles?: IAdaptiveCardStyles;
|
|
18
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const activityStatusMiddleware: () => (next: any) => (args: any) =>
|
|
1
|
+
export declare const activityStatusMiddleware: () => (next: any) => (args: any) => any;
|
|
@@ -17,13 +17,13 @@ export interface ILiveChatWidgetContext {
|
|
|
17
17
|
liveChatContext: any;
|
|
18
18
|
customContext: any;
|
|
19
19
|
widgetSize: any;
|
|
20
|
+
widgetInstanceId: string;
|
|
20
21
|
};
|
|
21
22
|
appStates: {
|
|
22
23
|
conversationState: ConversationState;
|
|
23
24
|
isMinimized: boolean;
|
|
24
25
|
previousElementOnFocusBeforeModalOpen: HTMLElement | null;
|
|
25
26
|
outsideOperatingHours: boolean;
|
|
26
|
-
shouldShowPostChat: boolean;
|
|
27
27
|
preChatResponseEmail: string;
|
|
28
28
|
isAudioMuted: boolean | null;
|
|
29
29
|
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.
|
|
3
|
+
"version": "0.1.0-main.c9a643a",
|
|
4
4
|
"description": "Microsoft Omnichannel Chat Widget",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"types": "lib/types/index.d.ts",
|
|
@@ -68,18 +68,19 @@
|
|
|
68
68
|
"storybook-addon-playwright": "^4.9.2",
|
|
69
69
|
"terser-webpack-plugin": "^4.2.3",
|
|
70
70
|
"ts-loader": "^9.2.6",
|
|
71
|
-
"typescript": "
|
|
71
|
+
"typescript": "4.6.4",
|
|
72
72
|
"webpack": "^4.44.2",
|
|
73
73
|
"webpack-cli": "^4.9.2"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@fluentui/react": "^8.49.1",
|
|
77
|
-
"@microsoft/omnichannel-chat-components": "0.1.0-main.
|
|
77
|
+
"@microsoft/omnichannel-chat-components": "0.1.0-main.5a87386",
|
|
78
78
|
"@microsoft/omnichannel-chat-sdk": "1.0.1-main.077d17c",
|
|
79
79
|
"abort-controller-es5": "^2.0.1",
|
|
80
80
|
"dompurify": "^2.3.4",
|
|
81
81
|
"markdown-it": "^12.3.2",
|
|
82
82
|
"markdown-it-for-inline": "^0.1.1",
|
|
83
|
+
"md5-typescript": "^1.0.5",
|
|
83
84
|
"p-defer-es5": "^2.0.1",
|
|
84
85
|
"slack-markdown-it": "^1.0.5"
|
|
85
86
|
},
|