@microsoft/omnichannel-chat-widget 1.0.3-main.527b216 → 1.0.3-main.c925679
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 +54 -1
- package/lib/cjs/common/storage/default/defaultCacheManager.js +7 -6
- package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +9 -7
- package/lib/cjs/common/telemetry/TelemetryConstants.js +6 -0
- package/lib/cjs/common/utils.js +27 -5
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -6
- package/lib/cjs/components/footerstateful/FooterStateful.js +1 -1
- package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +8 -1
- package/lib/cjs/components/headerstateful/HeaderStateful.js +14 -13
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +1 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +1 -0
- package/lib/cjs/components/livechatwidget/common/Deferred.js +2 -3
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +2 -1
- package/lib/cjs/components/livechatwidget/common/endChat.js +197 -99
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +29 -27
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +11 -8
- package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +139 -0
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +2 -255
- package/lib/cjs/components/livechatwidget/common/startChat.js +70 -57
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +162 -100
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +2 -2
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +15 -5
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +5 -4
- package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +4 -1
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +8 -6
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +7 -1
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +2 -0
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +16 -13
- package/lib/cjs/contexts/createReducer.js +13 -23
- package/lib/cjs/controller/componentController.js +2 -1
- package/lib/cjs/index.js +20 -0
- package/lib/esm/common/Constants.js +49 -0
- package/lib/esm/common/storage/default/defaultCacheManager.js +5 -4
- package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +9 -7
- package/lib/esm/common/telemetry/TelemetryConstants.js +6 -0
- package/lib/esm/common/utils.js +25 -4
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -6
- package/lib/esm/components/footerstateful/FooterStateful.js +1 -1
- package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +8 -1
- package/lib/esm/components/headerstateful/HeaderStateful.js +14 -13
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +1 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +1 -0
- package/lib/esm/components/livechatwidget/common/Deferred.js +2 -3
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +2 -1
- package/lib/esm/components/livechatwidget/common/endChat.js +196 -99
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +29 -27
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +11 -8
- package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +130 -0
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -255
- package/lib/esm/components/livechatwidget/common/startChat.js +71 -58
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +164 -102
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +2 -2
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +15 -5
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +5 -4
- package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +4 -1
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +8 -6
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +7 -1
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +2 -0
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +18 -15
- package/lib/esm/contexts/createReducer.js +13 -23
- package/lib/esm/controller/componentController.js +2 -1
- package/lib/esm/index.js +4 -1
- package/lib/types/common/Constants.d.ts +21 -0
- package/lib/types/common/interfaces/IContextDataStore.d.ts +3 -3
- package/lib/types/common/storage/default/defaultCacheManager.d.ts +2 -1
- package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +2 -1
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +6 -0
- package/lib/types/common/utils.d.ts +3 -2
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +6 -0
- package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +2 -1
- package/lib/types/components/livechatwidget/common/endChat.d.ts +4 -3
- package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/renderSurveyHelpers.d.ts +9 -0
- package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +1 -6
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +3 -1
- package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +4 -0
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +8 -7
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +3 -1
- package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +2 -1
- package/lib/types/index.d.ts +3 -0
- package/package.json +2 -1
- package/lib/cjs/components/livechatwidget/common/agentEndConversationHelper.js +0 -36
- package/lib/cjs/contexts/common/ConversationEndEntity.js +0 -12
- package/lib/esm/components/livechatwidget/common/agentEndConversationHelper.js +0 -30
- package/lib/esm/contexts/common/ConversationEndEntity.js +0 -5
- package/lib/types/components/livechatwidget/common/agentEndConversationHelper.d.ts +0 -6
- package/lib/types/contexts/common/ConversationEndEntity.d.ts +0 -4
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
exports.ConversationEndEntity = void 0;
|
|
7
|
-
let ConversationEndEntity;
|
|
8
|
-
exports.ConversationEndEntity = ConversationEndEntity;
|
|
9
|
-
(function (ConversationEndEntity) {
|
|
10
|
-
ConversationEndEntity[ConversationEndEntity["Customer"] = 0] = "Customer";
|
|
11
|
-
ConversationEndEntity[ConversationEndEntity["Agent"] = 1] = "Agent";
|
|
12
|
-
})(ConversationEndEntity || (exports.ConversationEndEntity = ConversationEndEntity = {}));
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import { LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
2
|
-
import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
|
|
3
|
-
import { ConversationEndEntity } from "../../../contexts/common/ConversationEndEntity";
|
|
4
|
-
import { LiveChatWidgetActionType } from "../../../contexts/common/LiveChatWidgetActionType";
|
|
5
|
-
import { checkPostChatEnabled } from "./setPostChatContextAndLoadSurvey";
|
|
6
|
-
const handleAgentEndConversation = (props, state, dispatch) => {
|
|
7
|
-
const isPostChatEnabled = checkPostChatEnabled(props, state);
|
|
8
|
-
if (isPostChatEnabled) {
|
|
9
|
-
if (!state.appStates.postChatWorkflowInProgress) {
|
|
10
|
-
dispatch({
|
|
11
|
-
type: LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY,
|
|
12
|
-
payload: ConversationEndEntity.Agent
|
|
13
|
-
});
|
|
14
|
-
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
15
|
-
Event: TelemetryEvent.ConversationEndedByAgent,
|
|
16
|
-
Description: "Conversation is ended from agent side"
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
} else {
|
|
20
|
-
dispatch({
|
|
21
|
-
type: LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY,
|
|
22
|
-
payload: ConversationEndEntity.Agent
|
|
23
|
-
});
|
|
24
|
-
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
25
|
-
Event: TelemetryEvent.ConversationEndedByAgent,
|
|
26
|
-
Description: "Conversation is ended from agent side"
|
|
27
|
-
});
|
|
28
|
-
}
|
|
29
|
-
};
|
|
30
|
-
export { handleAgentEndConversation };
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
export let ConversationEndEntity;
|
|
2
|
-
(function (ConversationEndEntity) {
|
|
3
|
-
ConversationEndEntity[ConversationEndEntity["Customer"] = 0] = "Customer";
|
|
4
|
-
ConversationEndEntity[ConversationEndEntity["Agent"] = 1] = "Agent";
|
|
5
|
-
})(ConversationEndEntity || (ConversationEndEntity = {}));
|
|
@@ -1,6 +0,0 @@
|
|
|
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 };
|