@microsoft/omnichannel-chat-widget 0.1.0-main.15c1e2b → 0.1.0-main.18d1166
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 +7 -34
- package/lib/cjs/common/Constants.js +3 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +31 -4
- package/lib/cjs/common/utils.js +23 -2
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +11 -18
- package/lib/cjs/components/headerstateful/HeaderStateful.js +5 -4
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +139 -0
- package/lib/cjs/components/livechatwidget/common/agentEndConversationHelper.js +36 -0
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -0
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +5 -2
- package/lib/cjs/components/livechatwidget/common/endChat.js +43 -63
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +11 -43
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +3 -3
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +254 -2
- package/lib/cjs/components/livechatwidget/common/startChat.js +35 -50
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +64 -27
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +8 -1
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +3 -1
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +7 -3
- package/lib/cjs/contexts/common/ConversationEndEntity.js +12 -0
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +10 -7
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +4 -1
- package/lib/cjs/contexts/createReducer.js +28 -2
- package/lib/cjs/hooks/useDebounce.js +28 -0
- package/lib/cjs/hooks/useWindowDimensions.js +30 -0
- package/lib/cjs/plugins/newMessageEventHandler.js +10 -0
- package/lib/esm/common/Constants.js +3 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +31 -4
- package/lib/esm/common/utils.js +20 -0
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +11 -18
- package/lib/esm/components/headerstateful/HeaderStateful.js +5 -4
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +134 -0
- package/lib/esm/components/livechatwidget/common/agentEndConversationHelper.js +30 -0
- package/lib/esm/components/livechatwidget/common/createAdapter.js +2 -0
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +5 -2
- package/lib/esm/components/livechatwidget/common/endChat.js +45 -65
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +13 -45
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +3 -3
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +254 -3
- package/lib/esm/components/livechatwidget/common/startChat.js +35 -50
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +64 -27
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +8 -1
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +3 -1
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +5 -3
- package/lib/esm/contexts/common/ConversationEndEntity.js +5 -0
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +10 -7
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +4 -1
- package/lib/esm/contexts/createReducer.js +28 -2
- package/lib/esm/hooks/useDebounce.js +22 -0
- package/lib/esm/hooks/useWindowDimensions.js +23 -0
- package/lib/esm/plugins/newMessageEventHandler.js +10 -0
- package/lib/types/common/Constants.d.ts +3 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +27 -6
- package/lib/types/common/utils.d.ts +1 -0
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +0 -7
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.d.ts +9 -0
- package/lib/types/components/livechatwidget/common/agentEndConversationHelper.d.ts +6 -0
- package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +6 -1
- package/lib/types/components/livechatwidget/common/startChat.d.ts +2 -3
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +1 -0
- package/lib/types/contexts/common/ConversationEndEntity.d.ts +4 -0
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +5 -1
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +10 -7
- package/lib/types/hooks/useDebounce.d.ts +3 -0
- package/lib/types/hooks/useWindowDimensions.d.ts +4 -0
- package/package.json +3 -3
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { useState, useEffect } from "react";
|
|
2
|
+
import useDebounce from "./useDebounce";
|
|
3
|
+
function getWindowDimensions() {
|
|
4
|
+
const {
|
|
5
|
+
innerWidth: width,
|
|
6
|
+
innerHeight: height
|
|
7
|
+
} = window;
|
|
8
|
+
return {
|
|
9
|
+
width,
|
|
10
|
+
height
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
export default function useWindowDimensions() {
|
|
14
|
+
let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 200;
|
|
15
|
+
const [windowDimensions, setWindowDimensions] = useState(getWindowDimensions());
|
|
16
|
+
const handleResize = () => setWindowDimensions(getWindowDimensions());
|
|
17
|
+
const debouncedHandleResize = useDebounce(handleResize, delay);
|
|
18
|
+
useEffect(() => {
|
|
19
|
+
window.addEventListener("resize", debouncedHandleResize);
|
|
20
|
+
return () => window.removeEventListener("resize", debouncedHandleResize);
|
|
21
|
+
}, []);
|
|
22
|
+
return windowDimensions;
|
|
23
|
+
}
|
|
@@ -9,6 +9,7 @@ export const createOnNewAdapterActivityHandler = (chatId, userId) => {
|
|
|
9
9
|
const isHistoryMessage = isActivityMessage && ((activity === null || activity === void 0 ? void 0 : (_activity$channelData = activity.channelData) === null || _activity$channelData === void 0 ? void 0 : (_activity$channelData2 = _activity$channelData.tags) === null || _activity$channelData2 === void 0 ? void 0 : _activity$channelData2.includes(Constants.historyMessageTag)) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData3 = activity.channelData) === null || _activity$channelData3 === void 0 ? void 0 : _activity$channelData3.fromList));
|
|
10
10
|
raiseMessageEvent(activity, isHistoryMessage);
|
|
11
11
|
};
|
|
12
|
+
let isHistoryMessageReceivedEventRasied = false;
|
|
12
13
|
const raiseMessageEvent = (activity, isHistoryMessage) => {
|
|
13
14
|
if ((activity === null || activity === void 0 ? void 0 : activity.type) === Constants.message) {
|
|
14
15
|
var _text, _text2, _activity$channelData4, _activity$from;
|
|
@@ -67,6 +68,15 @@ export const createOnNewAdapterActivityHandler = (chatId, userId) => {
|
|
|
67
68
|
Description: "New message received",
|
|
68
69
|
Data: payload
|
|
69
70
|
});
|
|
71
|
+
} else {
|
|
72
|
+
if (!isHistoryMessageReceivedEventRasied) {
|
|
73
|
+
isHistoryMessageReceivedEventRasied = true;
|
|
74
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
75
|
+
Event: TelemetryEvent.HistoryMessageReceived,
|
|
76
|
+
Description: "History message received",
|
|
77
|
+
Data: payload
|
|
78
|
+
});
|
|
79
|
+
}
|
|
70
80
|
}
|
|
71
81
|
}
|
|
72
82
|
}
|
|
@@ -17,6 +17,8 @@ export declare class Constants {
|
|
|
17
17
|
static readonly true = "true";
|
|
18
18
|
static readonly false = "false";
|
|
19
19
|
static readonly maximumUnreadMessageCount = 99;
|
|
20
|
+
static readonly userParticipantTypeTag = "User";
|
|
21
|
+
static readonly botParticipantTypeTag = "Bot";
|
|
20
22
|
static readonly channelIdKey = "ChannelId-";
|
|
21
23
|
static readonly ChannelId = "lcw";
|
|
22
24
|
static readonly CustomerTag = "FromCustomer";
|
|
@@ -126,6 +128,7 @@ export declare class HtmlAttributeNames {
|
|
|
126
128
|
static readonly adaptiveCardClassName = "ac-adaptiveCard";
|
|
127
129
|
static readonly adaptiveCardTextBlockClassName = "ac-textBlock";
|
|
128
130
|
static readonly adaptiveCardToggleInputClassName = "ac-toggleInput";
|
|
131
|
+
static readonly adaptiveCardActionSetClassName = "ac-actionSet";
|
|
129
132
|
}
|
|
130
133
|
export declare class WebChatMiddlewareConstants {
|
|
131
134
|
static readonly nextVisibleActivity = "nextVisibleActivity";
|
|
@@ -44,7 +44,11 @@ export declare enum BroadcastEvent {
|
|
|
44
44
|
ClosePopoutWindow = "ClosePopoutWindow",
|
|
45
45
|
RaiseErrorEvent = "RaiseErrorEvent",
|
|
46
46
|
NetworkDisconnected = "NetworkDisconnected",
|
|
47
|
-
NetworkReconnected = "NetworkReconnected"
|
|
47
|
+
NetworkReconnected = "NetworkReconnected",
|
|
48
|
+
SigninCardReceived = "SignInCardReceived",
|
|
49
|
+
BotAuthConfigRequest = "BotAuthConfigRequest",
|
|
50
|
+
BotAuthConfigResponse = "BotAuthConfigResponse",
|
|
51
|
+
HideChatVisibilityChangeEvent = "hideChatVisibilityChangeEvent"
|
|
48
52
|
}
|
|
49
53
|
export declare enum TelemetryEvent {
|
|
50
54
|
CallAdded = "CallAdded",
|
|
@@ -79,11 +83,10 @@ export declare enum TelemetryEvent {
|
|
|
79
83
|
GetConversationDetailsCallFailed = "GetConversationDetailsCallFailed",
|
|
80
84
|
EndChatSDKCallFailed = "EndChatSDKCallFailed",
|
|
81
85
|
GetChatReconnectContextSDKCallFailed = "GetChatReconnectContextSDKCallFailed",
|
|
82
|
-
PostChatContextCallSucceed = "PostChatContextCallSucceed",
|
|
83
|
-
PostChatContextCallFailed = "PostChatContextCallFailed",
|
|
84
86
|
ParseAdaptiveCardFailed = "ParseAdaptiveCardFailed",
|
|
85
87
|
ClientDataStoreProviderFailed = "ClientDataStoreProviderFailed",
|
|
86
88
|
InMemoryDataStoreFailed = "InMemoryDataStoreFailed",
|
|
89
|
+
ChatVisibilityChanged = "ChatVisibilityChanged",
|
|
87
90
|
WebChatLoaded = "WebChatLoaded",
|
|
88
91
|
LCWChatButtonClicked = "LCWChatButtonClicked",
|
|
89
92
|
LCWChatButtonShow = "LCWChatButtonShow",
|
|
@@ -91,6 +94,7 @@ export declare enum TelemetryEvent {
|
|
|
91
94
|
WidgetLoadComplete = "WidgetLoadComplete",
|
|
92
95
|
WidgetLoadFailed = "WidgetLoadFailed",
|
|
93
96
|
StartChatMethodException = "StartChatMethodException",
|
|
97
|
+
CloseChatCall = "CloseChatCall",
|
|
94
98
|
CloseChatMethodException = "CloseChatMethodException",
|
|
95
99
|
PrechatSurveyLoaded = "PrechatSurveyLoaded",
|
|
96
100
|
PrechatSubmitted = "PrechatSubmitted",
|
|
@@ -104,6 +108,7 @@ export declare enum TelemetryEvent {
|
|
|
104
108
|
DownloadTranscriptResponseNullOrUndefined = "DownloadTranscriptResponseNullOrUndefined",
|
|
105
109
|
EmailTranscriptSent = "EmailTranscriptSent",
|
|
106
110
|
EmailTranscriptFailed = "EmailTranscriptFailed",
|
|
111
|
+
ErrorUIPaneLoaded = "ErrorUIPaneLoaded",
|
|
107
112
|
DownloadTranscriptFailed = "DownloadTranscriptFailed",
|
|
108
113
|
StartChatFailed = "StartChatFailed",
|
|
109
114
|
IC3ThreadUpdateEventReceived = "IC3ThreadUpdateEventReceived",
|
|
@@ -112,8 +117,6 @@ export declare enum TelemetryEvent {
|
|
|
112
117
|
LoadingPaneLoaded = "LoadingPaneLoaded",
|
|
113
118
|
EmailTranscriptLoaded = "EmailTranscriptLoaded",
|
|
114
119
|
OutOfOfficePaneLoaded = "OutOfOfficePaneLoaded",
|
|
115
|
-
PostChatSurveyLoadingPaneLoaded = "PostChatSurveyLoadingPaneLoaded",
|
|
116
|
-
PostChatSurveyLoaded = "PostChatSurveyLoaded",
|
|
117
120
|
ConfirmationPaneLoaded = "ConfirmationPaneLoaded",
|
|
118
121
|
ProactiveChatPaneLoaded = "ProactiveChatPaneLoaded",
|
|
119
122
|
ReconnectChatPaneLoaded = "ReconnectChatPaneLoaded",
|
|
@@ -126,6 +129,7 @@ export declare enum TelemetryEvent {
|
|
|
126
129
|
SuppressBotMagicCodeSucceeded = "SuppressBotMagicCodeSucceeded",
|
|
127
130
|
SuppressBotMagicCodeFailed = "SuppressBotMagicCodeFailed",
|
|
128
131
|
GetConversationDetailsException = "GetConversationDetailsException",
|
|
132
|
+
AppStatesException = "AppStatesException",
|
|
129
133
|
BrowserUnloadEventStarted = "BrowserUnloadEventStarted",
|
|
130
134
|
GetAuthTokenCalled = "GetAuthTokenCalled",
|
|
131
135
|
GetAuthTokenFailed = "GetAuthTokenFailed",
|
|
@@ -133,6 +137,11 @@ export declare enum TelemetryEvent {
|
|
|
133
137
|
CustomerVoiceResponsePageLoaded = "CustomerVoiceResponsePageLoaded",
|
|
134
138
|
CustomerVoiceFormResponseSubmitted = "CustomerVoiceFormResponseSubmitted",
|
|
135
139
|
CustomerVoiceFormResponseError = "CustomerVoiceFormResponseError",
|
|
140
|
+
BotAuthActivityEmptySasUrl = "BotAuthActivityEmptySasUrl",
|
|
141
|
+
SetBotAuthProviderFetchConfig = "SetBotAuthProviderFetchConfig",
|
|
142
|
+
SetBotAuthProviderHideCard = "SetBotAuthProviderHideCard",
|
|
143
|
+
SetBotAuthProviderDisplayCard = "SetBotAuthProviderDisplayCard",
|
|
144
|
+
SetBotAuthProviderNotFound = "SetBotAuthProviderNotFound",
|
|
136
145
|
ProcessingHTMLTextMiddlewareFailed = "ProcessingHTMLTextMiddlewareFailed",
|
|
137
146
|
ProcessingSanitizationMiddlewareFailed = "ProcessingSanitizationMiddlewareFailed",
|
|
138
147
|
FormatTagsMiddlewareJSONStringifyFailed = "FormatTagsMiddlewareJSONStringifyFailed",
|
|
@@ -142,6 +151,8 @@ export declare enum TelemetryEvent {
|
|
|
142
151
|
DataMaskingRuleApplyFailed = "DataMaskingRuleApplyFailed",
|
|
143
152
|
IC3ClientEvent = "IC3ClientEvent",
|
|
144
153
|
ConversationEndedThreadEventReceived = "ConversationEndedThreadEventReceived",
|
|
154
|
+
ConversationEndedByCustomer = "ConversationEndedByCustomer",
|
|
155
|
+
ConversationEndedByAgent = "ConversationEndedByAgent",
|
|
145
156
|
InvalidConfiguration = "InvalidConfiguration",
|
|
146
157
|
SendTypingIndicatorSucceeded = "SendTypingIndicatorSucceeded",
|
|
147
158
|
SendTypingIndicatorFailed = "SendTypingIndicatorFailed",
|
|
@@ -160,9 +171,19 @@ export declare enum TelemetryEvent {
|
|
|
160
171
|
MessageSent = "MessageSent",
|
|
161
172
|
MessageReceived = "MessageReceived",
|
|
162
173
|
SystemMessageReceived = "SystemMessageReceived",
|
|
174
|
+
HistoryMessageReceived = "HistoryMessageReceived",
|
|
163
175
|
CustomContextReceived = "CustomContextReceived",
|
|
164
176
|
NetworkDisconnected = "NetworkDisconnected",
|
|
165
|
-
NetworkReconnected = "NetworkReconnected"
|
|
177
|
+
NetworkReconnected = "NetworkReconnected",
|
|
178
|
+
LinkModePostChatWorkflowStarted = "LinkModePostChatWorkflowStarted",
|
|
179
|
+
EmbedModePostChatWorkflowStarted = "EmbedModePostChatWorkflowStarted",
|
|
180
|
+
PostChatWorkflowFromCustomer = "PostChatWorkflowFromCustomer",
|
|
181
|
+
PostChatWorkflowFromAgent = "PostChatWorkflowFromAgent",
|
|
182
|
+
PostChatWorkflowFromBot = "PostChatWorkflowFromBot",
|
|
183
|
+
PostChatContextCallSucceed = "PostChatContextCallSucceed",
|
|
184
|
+
PostChatContextCallFailed = "PostChatContextCallFailed",
|
|
185
|
+
PostChatSurveyLoadingPaneLoaded = "PostChatSurveyLoadingPaneLoaded",
|
|
186
|
+
PostChatSurveyLoaded = "PostChatSurveyLoaded"
|
|
166
187
|
}
|
|
167
188
|
export interface TelemetryInput {
|
|
168
189
|
scenarioType: ScenarioType;
|
|
@@ -28,3 +28,4 @@ export declare const getStateFromCache: (orgId: string, widgetId: string, widget
|
|
|
28
28
|
export declare const isUndefinedOrEmpty: (object: any) => boolean;
|
|
29
29
|
export declare const addDelayInMs: (ms: number) => Promise<void>;
|
|
30
30
|
export declare const getBroadcastChannelName: (widgetId: string, widgetInstanceId: string) => string;
|
|
31
|
+
export declare const debounceLeading: (fn: any, ms?: number) => (...args: any[]) => void;
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
|
|
2
1
|
import { IConfirmationPaneStatefulProps } from "./IConfirmationPaneStatefulProps";
|
|
3
2
|
export interface IConfirmationPaneStatefulParams extends IConfirmationPaneStatefulProps {
|
|
4
3
|
/**
|
|
5
4
|
* setPostChatContext: Internal Prop injected for setting Post Chat Context
|
|
6
5
|
*/
|
|
7
6
|
setPostChatContext: () => Promise<void>;
|
|
8
|
-
/**
|
|
9
|
-
* prepareEndChat: Internal Prop injected for checking PostChat contexts and trigerring end of chat
|
|
10
|
-
* @param adapter : The chat adapter for the live chat session
|
|
11
|
-
* @param state : The chat state where the conversation is currently in
|
|
12
|
-
*/
|
|
13
|
-
prepareEndChat: (adapter: any, state: ILiveChatWidgetContext) => Promise<void>;
|
|
14
7
|
}
|
package/lib/types/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IActivitySubscriber } from "./IActivitySubscriber";
|
|
2
|
+
export declare class BotAuthActivitySubscriber implements IActivitySubscriber {
|
|
3
|
+
observer: any;
|
|
4
|
+
private signInCardSeen;
|
|
5
|
+
constructor();
|
|
6
|
+
applicable(activity: any): boolean;
|
|
7
|
+
apply(activity: any): Promise<any>;
|
|
8
|
+
next(activity: any): Promise<any>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Dispatch } from "react";
|
|
2
|
+
import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
|
|
3
|
+
import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
|
|
4
|
+
import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
5
|
+
declare const handleAgentEndConversation: (props: ILiveChatWidgetProps, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>) => void;
|
|
6
|
+
export { handleAgentEndConversation };
|
|
@@ -3,4 +3,4 @@ import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetA
|
|
|
3
3
|
import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
|
|
4
4
|
import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
5
5
|
import { IWebChatProps } from "../../webchatcontainerstateful/interfaces/IWebChatProps";
|
|
6
|
-
export declare const initWebChatComposer: (props: ILiveChatWidgetProps, chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setWebChatStyles: any) => IWebChatProps;
|
|
6
|
+
export declare const initWebChatComposer: (props: ILiveChatWidgetProps, chatSDK: any, setAdapter: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, adapter: any, setWebChatStyles: any) => IWebChatProps;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
1
|
import { Dispatch } from "react";
|
|
2
2
|
import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
|
|
3
|
-
|
|
3
|
+
import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
|
|
4
|
+
import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
5
|
+
declare const setPostChatContextAndLoadSurvey: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, persistedChat?: boolean | undefined) => Promise<void>;
|
|
6
|
+
declare const checkPostChatEnabled: (props: ILiveChatWidgetProps, state: ILiveChatWidgetContext) => boolean;
|
|
7
|
+
declare const initiatePostChat: (props: ILiveChatWidgetProps, chatSDK: any, setAdapter: any, setWebChatStyles: any, dispatch: Dispatch<ILiveChatWidgetAction>, adapter: any, state: ILiveChatWidgetContext) => Promise<void>;
|
|
8
|
+
export { setPostChatContextAndLoadSurvey, checkPostChatEnabled, initiatePostChat };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
|
|
2
1
|
import { Dispatch } from "react";
|
|
3
2
|
import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
|
|
4
3
|
import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
|
|
@@ -6,6 +5,6 @@ import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
|
6
5
|
import StartChatOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/StartChatOptionalParams";
|
|
7
6
|
declare const prepareStartChat: (props: ILiveChatWidgetProps, chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any) => Promise<void>;
|
|
8
7
|
declare const setPreChatAndInitiateChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, isProactiveChat?: boolean | undefined, proactiveChatEnablePrechatState?: boolean | undefined, state?: ILiveChatWidgetContext | undefined, props?: ILiveChatWidgetProps | undefined) => Promise<void>;
|
|
9
|
-
declare const initStartChat: (chatSDK: any,
|
|
10
|
-
declare const checkIfConversationStillValid: (chatSDK: any, props:
|
|
8
|
+
declare const initStartChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, props?: ILiveChatWidgetProps | undefined, params?: StartChatOptionalParams | undefined, persistedState?: any) => Promise<void>;
|
|
9
|
+
declare const checkIfConversationStillValid: (chatSDK: any, props: ILiveChatWidgetProps, requestId: any, dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<boolean>;
|
|
11
10
|
export { prepareStartChat, initStartChat, setPreChatAndInitiateChat, checkIfConversationStillValid };
|
|
@@ -3,6 +3,7 @@ import { ConversationState } from "./ConversationState";
|
|
|
3
3
|
import { IInternalTelemetryData } from "../../common/telemetry/interfaces/IInternalTelemetryData";
|
|
4
4
|
import { ILiveChatWidgetLocalizedTexts } from "./ILiveChatWidgetLocalizedTexts";
|
|
5
5
|
import { IRenderingMiddlewareProps } from "../../components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps";
|
|
6
|
+
import { ConversationEndEntity } from "./ConversationEndEntity";
|
|
6
7
|
export interface ILiveChatWidgetContext {
|
|
7
8
|
domainStates: {
|
|
8
9
|
liveChatConfig: ChatConfig | undefined;
|
|
@@ -37,7 +38,10 @@ export interface ILiveChatWidgetContext {
|
|
|
37
38
|
};
|
|
38
39
|
e2vvEnabled: boolean;
|
|
39
40
|
unreadMessageCount: number;
|
|
40
|
-
|
|
41
|
+
conversationEndedByAgentEventReceived: boolean;
|
|
42
|
+
conversationEndedBy: ConversationEndEntity | undefined;
|
|
43
|
+
postChatWorkflowInProgress: boolean;
|
|
44
|
+
shouldUseBotSurvey: boolean;
|
|
41
45
|
};
|
|
42
46
|
uiStates: {
|
|
43
47
|
showConfirmationPane: boolean;
|
|
@@ -28,11 +28,14 @@ export declare enum LiveChatWidgetActionType {
|
|
|
28
28
|
SET_RECONNECT_ID = 26,
|
|
29
29
|
SET_UNREAD_MESSAGE_COUNT = 27,
|
|
30
30
|
SET_FOCUS_CHAT_BUTTON = 28,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED = 29,
|
|
32
|
+
SET_CONVERSATION_ENDED_BY = 30,
|
|
33
|
+
SET_WIDGET_STATE = 31,
|
|
34
|
+
SET_LIVE_CHAT_CONTEXT = 32,
|
|
35
|
+
SET_BOT_OAUTH_SIGNIN_ID = 33,
|
|
36
|
+
SET_WIDGET_SIZE = 34,
|
|
37
|
+
SET_WIDGET_INSTANCE_ID = 35,
|
|
38
|
+
SET_LIVE_CHAT_CONFIG = 36,
|
|
39
|
+
SET_POST_CHAT_WORKFLOW_IN_PROGRESS = 37,
|
|
40
|
+
SET_SHOULD_USE_BOT_SURVEY = 38
|
|
38
41
|
}
|
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.18d1166",
|
|
4
4
|
"description": "Microsoft Omnichannel Chat Widget",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"types": "lib/types/index.d.ts",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
76
|
"@fluentui/react": "^8.49.1",
|
|
77
|
-
"@microsoft/omnichannel-chat-components": "0.1.0-main.
|
|
78
|
-
"@microsoft/omnichannel-chat-sdk": "1.2.1-main.
|
|
77
|
+
"@microsoft/omnichannel-chat-components": "0.1.0-main.f4c21f0",
|
|
78
|
+
"@microsoft/omnichannel-chat-sdk": "1.2.1-main.171bfbe",
|
|
79
79
|
"abort-controller-es5": "^2.0.1",
|
|
80
80
|
"dompurify": "^2.3.4",
|
|
81
81
|
"markdown-it": "^12.3.2",
|