@microsoft/omnichannel-chat-widget 1.7.8-main.7a07fc5 → 1.7.8-main.8428c08
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 +66 -20
- package/lib/cjs/common/KeyCodes.js +6 -1
- package/lib/cjs/common/contextDataStore/DataStoreManager.js +6 -1
- package/lib/cjs/common/facades/FacadeChatSDK.js +392 -295
- package/lib/cjs/common/storage/default/defaultCacheManager.js +6 -3
- package/lib/cjs/common/telemetry/ScenarioMarker.js +66 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +179 -148
- package/lib/cjs/common/telemetry/TelemetryHelper.js +281 -250
- package/lib/cjs/common/telemetry/TelemetryManager.js +31 -11
- package/lib/cjs/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +11 -0
- package/lib/cjs/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
- package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +119 -0
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +17 -14
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +5 -4
- package/lib/cjs/components/footerstateful/FooterStateful.js +13 -8
- package/lib/cjs/components/headerstateful/HeaderStateful.js +24 -14
- package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +71 -56
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +17 -8
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +65 -52
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +31 -18
- package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +14 -6
- package/lib/cjs/components/livechatwidget/common/Deferred.js +14 -6
- package/lib/cjs/components/livechatwidget/common/chatDisconnectHelper.js +3 -1
- package/lib/cjs/components/livechatwidget/common/endChat.js +4 -18
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +0 -5
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
- package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +7 -4
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -3
- package/lib/cjs/components/livechatwidget/common/startChat.js +5 -26
- package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +7 -6
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +28 -20
- package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +12 -8
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +31 -10
- package/lib/cjs/components/postchatsurveypanestateful/common/isValidSurveyUrl.js +28 -0
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
- package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +9 -7
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +4 -3
- package/lib/cjs/components/webchatcontainerstateful/common/DemoChatAdapter.js +88 -65
- package/lib/cjs/components/webchatcontainerstateful/common/DemoChatSDK.js +26 -7
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +49 -26
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +57 -35
- package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +62 -52
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +95 -61
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +53 -39
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +4 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +18 -6
- package/lib/cjs/firstresponselatency/Constants.js +13 -0
- package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +118 -0
- package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +201 -0
- package/lib/cjs/firstresponselatency/util.js +98 -0
- package/lib/cjs/plugins/createChatTranscript.js +92 -62
- package/lib/cjs/plugins/newMessageEventHandler.js +102 -88
- package/lib/esm/common/Constants.js +64 -19
- package/lib/esm/common/KeyCodes.js +6 -1
- package/lib/esm/common/contextDataStore/DataStoreManager.js +6 -1
- package/lib/esm/common/facades/FacadeChatSDK.js +392 -295
- package/lib/esm/common/storage/default/defaultCacheManager.js +6 -1
- package/lib/esm/common/telemetry/ScenarioMarker.js +59 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +179 -148
- package/lib/esm/common/telemetry/TelemetryHelper.js +281 -250
- package/lib/esm/common/telemetry/TelemetryManager.js +31 -11
- package/lib/esm/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +4 -0
- package/lib/esm/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
- package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +111 -0
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +17 -14
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +5 -4
- package/lib/esm/components/footerstateful/FooterStateful.js +13 -8
- package/lib/esm/components/headerstateful/HeaderStateful.js +24 -14
- package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +32 -19
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +71 -56
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +17 -8
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/HiddenAdaptiveCardActivitySubscriber.js +65 -52
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +31 -18
- package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +14 -6
- package/lib/esm/components/livechatwidget/common/Deferred.js +14 -6
- package/lib/esm/components/livechatwidget/common/chatDisconnectHelper.js +3 -1
- package/lib/esm/components/livechatwidget/common/endChat.js +4 -18
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +1 -6
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
- package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +7 -4
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -3
- package/lib/esm/components/livechatwidget/common/startChat.js +6 -27
- package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +7 -6
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +28 -20
- package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +12 -8
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +31 -10
- package/lib/esm/components/postchatsurveypanestateful/common/isValidSurveyUrl.js +21 -0
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
- package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +9 -7
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +4 -3
- package/lib/esm/components/webchatcontainerstateful/common/DemoChatAdapter.js +88 -65
- package/lib/esm/components/webchatcontainerstateful/common/DemoChatSDK.js +26 -7
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +49 -26
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +57 -35
- package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +63 -52
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +95 -61
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer.js +53 -39
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +4 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/notification/NotificationHandler.js +88 -60
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +18 -6
- package/lib/esm/firstresponselatency/Constants.js +6 -0
- package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +112 -0
- package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +194 -0
- package/lib/esm/firstresponselatency/util.js +87 -0
- package/lib/esm/plugins/createChatTranscript.js +92 -62
- package/lib/esm/plugins/newMessageEventHandler.js +100 -86
- package/lib/types/common/Constants.d.ts +5 -0
- package/lib/types/common/facades/FacadeChatSDK.d.ts +1 -0
- package/lib/types/common/telemetry/ScenarioMarker.d.ts +19 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +50 -33
- package/lib/types/common/telemetry/TelemetryHelper.d.ts +5 -0
- package/lib/types/common/telemetry/defaultConfigs/defaultAppInsightsConfig.d.ts +2 -0
- package/lib/types/common/telemetry/interfaces/IAppInsightsConfig.d.ts +4 -0
- package/lib/types/common/telemetry/interfaces/IChatSDKLogger.d.ts +1 -0
- package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +2 -0
- package/lib/types/common/telemetry/loggers/appInsightsLogger.d.ts +5 -0
- package/lib/types/components/callingcontainerstateful/CallingContainerStateful.d.ts +2 -1
- package/lib/types/components/chatbuttonstateful/ChatButtonStateful.d.ts +2 -1
- package/lib/types/components/confirmationpanestateful/ConfirmationPaneStateful.d.ts +2 -1
- package/lib/types/components/dimlayer/DimLayer.d.ts +2 -1
- package/lib/types/components/draggable/DraggableChatWidget.d.ts +2 -2
- package/lib/types/components/draggable/DraggableEventEmitter.d.ts +2 -2
- package/lib/types/components/draggable/DraggableEventReceiver.d.ts +2 -2
- package/lib/types/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.d.ts +2 -1
- package/lib/types/components/footerstateful/FooterStateful.d.ts +2 -1
- package/lib/types/components/footerstateful/audionotificationstateful/AudioNotificationStateful.d.ts +2 -1
- package/lib/types/components/headerstateful/HeaderStateful.d.ts +2 -1
- package/lib/types/components/livechatwidget/LiveChatWidget.d.ts +2 -1
- package/lib/types/components/livechatwidget/common/createFooter.d.ts +2 -1
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -0
- package/lib/types/components/loadingpanestateful/LoadingPaneStateful.d.ts +2 -1
- package/lib/types/components/notificationpanestateful/NotificationPaneStateful.d.ts +2 -1
- package/lib/types/components/ooohpanestateful/OOOHPaneStateful.d.ts +2 -1
- package/lib/types/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.d.ts +2 -1
- package/lib/types/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.d.ts +2 -1
- package/lib/types/components/postchatsurveypanestateful/common/isValidSurveyUrl.d.ts +2 -0
- package/lib/types/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.d.ts +2 -1
- package/lib/types/components/proactivechatpanestateful/ProactiveChatPaneStateful.d.ts +2 -1
- package/lib/types/components/reconnectchatpanestateful/ReconnectChatPaneStateful.d.ts +2 -1
- package/lib/types/components/startchaterrorpanestateful/StartChatErrorPaneStateful.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/WebChatContainerStateful.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatProps.d.ts +2 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentContent.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentIcon.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Spinner.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.d.ts +2 -1
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -1
- package/lib/types/firstresponselatency/Constants.d.ts +30 -0
- package/lib/types/firstresponselatency/FirstMessageTrackerFromBot.d.ts +1 -0
- package/lib/types/firstresponselatency/FirstResponseLatencyTracker.d.ts +22 -0
- package/lib/types/firstresponselatency/util.d.ts +7 -0
- package/package.json +27 -13
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { ILoadingPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/loadingpane/interfaces/ILoadingPaneProps";
|
|
2
|
-
export declare const PostChatLoadingPaneStateful: (props: ILoadingPaneProps) => JSX.Element;
|
|
3
|
+
export declare const PostChatLoadingPaneStateful: (props: ILoadingPaneProps) => React.JSX.Element;
|
|
3
4
|
export default PostChatLoadingPaneStateful;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { IPostChatSurveyPaneStatefulProps } from "./interfaces/IPostChatSurveyPaneStatefulProps";
|
|
2
|
-
export declare const PostChatSurveyPaneStateful: (props: IPostChatSurveyPaneStatefulProps) => JSX.Element;
|
|
3
|
+
export declare const PostChatSurveyPaneStateful: (props: IPostChatSurveyPaneStatefulProps) => React.JSX.Element;
|
|
3
4
|
export default PostChatSurveyPaneStateful;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { IPreChatSurveyPaneStatefulParams } from "./interfaces/IPreChatSurveyPaneStatefulParams";
|
|
2
|
-
export declare const PreChatSurveyPaneStateful: (props: IPreChatSurveyPaneStatefulParams) => JSX.Element;
|
|
3
|
+
export declare const PreChatSurveyPaneStateful: (props: IPreChatSurveyPaneStatefulParams) => React.JSX.Element;
|
|
3
4
|
export default PreChatSurveyPaneStateful;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { IReconnectChatPaneStatefulParams } from "./interfaces/IReconnectChatPaneStatefulParams";
|
|
2
|
-
export declare const ReconnectChatPaneStateful: (props: IReconnectChatPaneStatefulParams) => JSX.Element;
|
|
3
|
+
export declare const ReconnectChatPaneStateful: (props: IReconnectChatPaneStatefulParams) => React.JSX.Element;
|
|
3
4
|
export default ReconnectChatPaneStateful;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { IStartChatErrorPaneProps } from "./interfaces/IStartChatErrorPaneProps";
|
|
2
|
-
export declare const StartChatErrorPaneStateful: (startChatErrorPaneProps: IStartChatErrorPaneProps) => JSX.Element;
|
|
3
|
+
export declare const StartChatErrorPaneStateful: (startChatErrorPaneProps: IStartChatErrorPaneProps) => React.JSX.Element;
|
|
3
4
|
export default StartChatErrorPaneStateful;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
import { ILiveChatWidgetProps } from "../livechatwidget/interfaces/ILiveChatWidgetProps";
|
|
2
|
-
export declare const WebChatContainerStateful: (props: ILiveChatWidgetProps) => JSX.Element;
|
|
3
|
+
export declare const WebChatContainerStateful: (props: ILiveChatWidgetProps) => React.JSX.Element;
|
|
3
4
|
export default WebChatContainerStateful;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ActivityMiddleware, ActivityStatusMiddleware, AttachmentForScreenReaderMiddleware, AttachmentMiddleware, AvatarMiddleware, CardActionMiddleware, GroupActivitiesMiddleware, ScrollToEndButtonMiddleware, ToastMiddleware, TypingIndicatorMiddleware, WebSpeechPonyfillFactory } from "botframework-webchat-api";
|
|
2
|
+
import { ComponentType, ReactNode } from "react";
|
|
2
3
|
import { DirectLineActivity, OneOrMany } from "botframework-webchat-core";
|
|
3
|
-
import { ReactNode } from "react";
|
|
4
4
|
export interface IWebChatProps {
|
|
5
5
|
activityMiddleware?: OneOrMany<ActivityMiddleware>;
|
|
6
6
|
activityStatusMiddleware?: OneOrMany<ActivityStatusMiddleware>;
|
|
@@ -15,7 +15,7 @@ export interface IWebChatProps {
|
|
|
15
15
|
downscaleImageToDataURL?: (blob: Blob, maxWidth: number, maxHeight: number, type: string, quality: number) => Promise<URL>;
|
|
16
16
|
grammars?: any;
|
|
17
17
|
groupActivitiesMiddleware?: OneOrMany<GroupActivitiesMiddleware>;
|
|
18
|
-
internalErrorBoxClass?:
|
|
18
|
+
internalErrorBoxClass?: ComponentType<any>;
|
|
19
19
|
internalRenderErrorBox?: any;
|
|
20
20
|
locale?: string;
|
|
21
21
|
onTelemetry?: any;
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
* 1. Renders the first two letters of the sender as the profile pic
|
|
6
6
|
******/
|
|
7
7
|
import React from "react";
|
|
8
|
-
export declare const createAvatarMiddleware: (avatarStyleProps?: React.CSSProperties, avatarTextStyleProps?: React.CSSProperties) => () => (next: any) => (args_0: any) => false | (() => JSX.Element);
|
|
8
|
+
export declare const createAvatarMiddleware: (avatarStyleProps?: React.CSSProperties, avatarTextStyleProps?: React.CSSProperties) => () => (next: any) => (args_0: any) => false | (() => React.JSX.Element);
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const DeliveredTimestamp: ({ args, role, name }: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const NotDeliveredTimestamp: ({ args }: any) => React.JSX.Element;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import React from "react";
|
|
2
|
+
export declare const SendingTimestamp: () => React.JSX.Element;
|
|
@@ -3,4 +3,5 @@
|
|
|
3
3
|
*
|
|
4
4
|
* This middleware changes the component that shows who's actively typing. It uses the default Microsoft LiveChatWidget styles.
|
|
5
5
|
******/
|
|
6
|
-
|
|
6
|
+
import React from "react";
|
|
7
|
+
export declare const typingIndicatorMiddleware: () => (next: any) => (args: any) => React.JSX.Element;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
+
import { ConfirmationState, ConversationEndEntity, ParticipantType } from "../../common/Constants";
|
|
1
2
|
import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
|
|
2
3
|
import { ConversationState } from "./ConversationState";
|
|
3
4
|
import { IInternalTelemetryData } from "../../common/telemetry/interfaces/IInternalTelemetryData";
|
|
4
5
|
import { ILiveChatWidgetLocalizedTexts } from "./ILiveChatWidgetLocalizedTexts";
|
|
5
6
|
import { IRenderingMiddlewareProps } from "../../components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps";
|
|
6
|
-
import { ConfirmationState, ConversationEndEntity, ParticipantType } from "../../common/Constants";
|
|
7
7
|
import { StartChatFailureType } from "./StartChatFailureType";
|
|
8
8
|
export interface ILiveChatWidgetContext {
|
|
9
9
|
domainStates: {
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare enum ScenarioType {
|
|
2
|
+
UserSendMessageStrategy = "UserSendMessageStrategy",
|
|
3
|
+
SystemMessageStrategy = "SystemMessageStrategy",
|
|
4
|
+
ReceivedMessageStrategy = "ReceivedMessageStrategy"
|
|
5
|
+
}
|
|
6
|
+
export type MessagePayload = {
|
|
7
|
+
text: string;
|
|
8
|
+
type: string;
|
|
9
|
+
timestamp?: string | undefined;
|
|
10
|
+
userId: string;
|
|
11
|
+
tags: string[];
|
|
12
|
+
messageType: string;
|
|
13
|
+
Id: string | undefined;
|
|
14
|
+
role: string | undefined;
|
|
15
|
+
channelData?: any;
|
|
16
|
+
chatId?: string;
|
|
17
|
+
conversationId?: string;
|
|
18
|
+
isChatComplete: boolean;
|
|
19
|
+
attachment?: any[];
|
|
20
|
+
};
|
|
21
|
+
export type TrackingMessage = {
|
|
22
|
+
Id: string | undefined;
|
|
23
|
+
role: string | undefined;
|
|
24
|
+
timestamp: string | undefined;
|
|
25
|
+
tags: string[];
|
|
26
|
+
messageType: string;
|
|
27
|
+
text: string;
|
|
28
|
+
checkTime?: number;
|
|
29
|
+
type: string;
|
|
30
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const createTrackingForFirstMessage: () => void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { MessagePayload } from "./Constants";
|
|
2
|
+
export declare class FirstResponseLatencyTracker {
|
|
3
|
+
private isABotConversation;
|
|
4
|
+
private isStarted;
|
|
5
|
+
private isEnded;
|
|
6
|
+
private startTrackingMessage?;
|
|
7
|
+
private stopTrackingMessage?;
|
|
8
|
+
private isReady;
|
|
9
|
+
constructor();
|
|
10
|
+
private createTrackingMessage;
|
|
11
|
+
private startTracking;
|
|
12
|
+
private handleAgentMessage;
|
|
13
|
+
private stopTracking;
|
|
14
|
+
private isMessageFromValidSender;
|
|
15
|
+
startClock(payload: MessagePayload): void;
|
|
16
|
+
stopClock(payload: MessagePayload): void;
|
|
17
|
+
private offlineNetworkListener;
|
|
18
|
+
private fmltrackingListener;
|
|
19
|
+
private rehydrateListener;
|
|
20
|
+
private historyListener;
|
|
21
|
+
private deregister;
|
|
22
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MessagePayload, ScenarioType, TrackingMessage } from "./Constants";
|
|
2
|
+
import { IActivity } from "botframework-directlinejs";
|
|
3
|
+
export declare const isHistoryMessage: (activity: IActivity, startTime: number) => boolean;
|
|
4
|
+
export declare const buildMessagePayload: (activity: IActivity, userId: string) => MessagePayload;
|
|
5
|
+
export declare const polyfillMessagePayloadForEvent: (activity: IActivity, payload: MessagePayload, conversationId?: string) => MessagePayload;
|
|
6
|
+
export declare const getScenarioType: (activity: IActivity) => ScenarioType;
|
|
7
|
+
export declare const createTrackingMessage: (payload: MessagePayload, type: string) => TrackingMessage;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/omnichannel-chat-widget",
|
|
3
|
-
"version": "1.7.8-main.
|
|
3
|
+
"version": "1.7.8-main.8428c08",
|
|
4
4
|
"description": "Microsoft Omnichannel Chat Widget",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"types": "lib/types/index.d.ts",
|
|
@@ -32,21 +32,23 @@
|
|
|
32
32
|
"@storybook/addon-storyshots": "^6.4.8",
|
|
33
33
|
"@storybook/react": "^6.4.8",
|
|
34
34
|
"@storybook/testing-react": "^1.2.1",
|
|
35
|
-
"@testing-library/
|
|
36
|
-
"@testing-library/
|
|
35
|
+
"@testing-library/dom": "^10.4.0",
|
|
36
|
+
"@testing-library/jest-dom": "^6.6.3",
|
|
37
|
+
"@testing-library/react": "^16.2.0",
|
|
37
38
|
"@types/core-js": "^2.5.5",
|
|
38
39
|
"@types/dompurify": "^2.3.3",
|
|
39
40
|
"@types/jest": "^27.0.2",
|
|
40
41
|
"@types/jest-image-snapshot": "^4.3.1",
|
|
41
42
|
"@types/markdown-it": "^12.2.3",
|
|
42
|
-
"@types/react": "^
|
|
43
|
-
"@types/react-dom": "^
|
|
43
|
+
"@types/react": "^18.3.13",
|
|
44
|
+
"@types/react-dom": "^18.3.6",
|
|
44
45
|
"@types/styled-components": "^5.1.15",
|
|
45
46
|
"@typescript-eslint/eslint-plugin": "^5.3.0",
|
|
46
47
|
"@typescript-eslint/parser": "^5.2.0",
|
|
47
48
|
"babel-jest": "^27.3.1",
|
|
48
49
|
"babel-loader": "^8.2.3",
|
|
49
50
|
"botframework-directlinejs": "^0.15.0",
|
|
51
|
+
"concurrently": "^9.1.2",
|
|
50
52
|
"copyfiles": "^2.4.1",
|
|
51
53
|
"eslint": "^7.32.0",
|
|
52
54
|
"eslint-config-standard": "^16.0.3",
|
|
@@ -56,20 +58,24 @@
|
|
|
56
58
|
"eslint-plugin-react": "^7.26.1",
|
|
57
59
|
"eslint-plugin-storybook": "^0.5.3",
|
|
58
60
|
"file-loader": "^6.2.0",
|
|
61
|
+
"husky": "^9.1.7",
|
|
59
62
|
"jest": "^27.3.1",
|
|
60
63
|
"jest-dom": "^4.0.0",
|
|
61
64
|
"jest-image-snapshot": "^4.5.1",
|
|
62
65
|
"json": "^11.0.0",
|
|
66
|
+
"lint-staged": "^15.5.2",
|
|
63
67
|
"p-defer": "^4.0.1",
|
|
64
68
|
"playwright": "^1.20.0",
|
|
65
69
|
"postcss": "^8.3.9",
|
|
66
|
-
"react": "^
|
|
70
|
+
"react": "^18.3.1",
|
|
67
71
|
"react-docgen-typescript-plugin": "^1.0.8",
|
|
68
|
-
"react-dom": "^
|
|
69
|
-
"react-test-renderer": "^
|
|
72
|
+
"react-dom": "^18.3.1",
|
|
73
|
+
"react-test-renderer": "^18.3.1",
|
|
74
|
+
"rimraf": "^6.0.1",
|
|
70
75
|
"storybook-addon-playwright": "^4.9.2",
|
|
71
76
|
"swiper": "^9.0.5",
|
|
72
77
|
"terser-webpack-plugin": "^4.2.3",
|
|
78
|
+
"thread-loader": "^2.1.3",
|
|
73
79
|
"ts-loader": "^9.2.6",
|
|
74
80
|
"typescript": "4.9.5",
|
|
75
81
|
"webpack": "^4.44.2",
|
|
@@ -77,10 +83,13 @@
|
|
|
77
83
|
},
|
|
78
84
|
"dependencies": {
|
|
79
85
|
"@azure/core-tracing": "^1.2.0",
|
|
80
|
-
"@microsoft/
|
|
86
|
+
"@microsoft/applicationinsights-web": "^3.3.6",
|
|
87
|
+
"@microsoft/omnichannel-chat-components": "1.1.9",
|
|
81
88
|
"@microsoft/omnichannel-chat-sdk": "^1.10.17",
|
|
82
89
|
"@opentelemetry/api": "^1.9.0",
|
|
90
|
+
"abort-controller": "^3",
|
|
83
91
|
"abort-controller-es5": "^2.0.1",
|
|
92
|
+
"core-js-pure": "^3.42.0",
|
|
84
93
|
"dompurify": "^3.2.4",
|
|
85
94
|
"markdown-it": "^12.3.2",
|
|
86
95
|
"markdown-it-attrs": "^4.1.6",
|
|
@@ -88,7 +97,7 @@
|
|
|
88
97
|
"markdown-it-for-inline": "^0.1.1",
|
|
89
98
|
"md5-typescript": "^1.0.5",
|
|
90
99
|
"p-defer-es5": "^2.0.1",
|
|
91
|
-
"sanitize-html": "2.
|
|
100
|
+
"sanitize-html": "2.14.0",
|
|
92
101
|
"simple-update-in": "2.2.0",
|
|
93
102
|
"slack-markdown-it": "^1.0.5"
|
|
94
103
|
},
|
|
@@ -97,7 +106,7 @@
|
|
|
97
106
|
"compose-storybook": "start-storybook -c stories/.storybook -p 9009",
|
|
98
107
|
"build-composite-storybook": "build-storybook -c stories/.storybook -o storybook-build",
|
|
99
108
|
"build-storybook": "build-storybook",
|
|
100
|
-
"build": "yarn lint && yarn build:esm && yarn build:cjs && tsc",
|
|
109
|
+
"build": "yarn clean yarn lint && yarn build:esm && yarn build:cjs && tsc",
|
|
101
110
|
"test:unit": "jest -c jest.config.unit.cjs --env=jsdom --runInBand --force-exit",
|
|
102
111
|
"test:e2e": "cd automation_tests && yarn test",
|
|
103
112
|
"test:e2e:build": "yarn build-sample && cd automation_tests && yarn test",
|
|
@@ -105,6 +114,8 @@
|
|
|
105
114
|
"test:all": "yarn test:unit && yarn test:visual",
|
|
106
115
|
"build:esm": "babel ./src --config-file ./babel.esm.config.json --out-dir lib/esm --extensions .ts,.js,.tsx --ignore **/*.test.ts,**/*.stories.tsx,**/*.test.tsx,**/*.spec.ts,**/*.spec.tsx",
|
|
107
116
|
"build:cjs": "babel ./src --config-file ./babel.config.json --out-dir lib/cjs --extensions .ts,.js,.tsx --ignore **/*.test.ts,**/*.stories.tsx,**/*.test.tsx,**/*.spec.ts,**/*.spec.tsx",
|
|
117
|
+
"build:esm:watch": "babel ./src --config-file ./babel.esm.config.json --out-dir lib/esm --extensions .ts,.js,.tsx --watch --ignore **/*.test.ts,**/*.stories.tsx,**/*.test.tsx,**/*.spec.ts,**/*.spec.tsx",
|
|
118
|
+
"build:cjs:watch": "babel ./src --config-file ./babel.config.json --out-dir lib/cjs --extensions .ts,.js,.tsx --watch --ignore **/*.test.ts,**/*.stories.tsx,**/*.test.tsx,**/*.spec.ts,**/*.spec.tsx",
|
|
108
119
|
"build:umd": "webpack --config ./webpack.umd.config.cjs",
|
|
109
120
|
"verify": "yarn install && yarn build-storybook && yarn test:all && yarn build && yarn storybook",
|
|
110
121
|
"testpack": "yarn build && yarn pack",
|
|
@@ -112,14 +123,17 @@
|
|
|
112
123
|
"build-sample:dev": "yarn build && webpack --config ./webpack.dev.config.cjs",
|
|
113
124
|
"test:visual:build": "yarn build-storybook && yarn test:visual",
|
|
114
125
|
"lint": "yarn eslint . --max-warnings=0",
|
|
115
|
-
"pretest:visual": "yarn playwright install"
|
|
126
|
+
"pretest:visual": "yarn playwright install",
|
|
127
|
+
"prepare": "husky install",
|
|
128
|
+
"clean": "rimraf lib",
|
|
129
|
+
"dev": "concurrently \"yarn build:esm:watch\" \"webpack --config ./webpack.config.cjs --watch\""
|
|
116
130
|
},
|
|
117
131
|
"resolutions": {
|
|
118
132
|
"**/url-parse": "1.5.9",
|
|
119
133
|
"**/p-defer-es5": "^2.0.1",
|
|
120
134
|
"**/abort-controller-es5": "^2.0.1",
|
|
121
135
|
"**/minimist": "1.2.6",
|
|
122
|
-
"**/sanitize-html": "2.
|
|
136
|
+
"**/sanitize-html": "2.14.0"
|
|
123
137
|
},
|
|
124
138
|
"jest": {
|
|
125
139
|
"verbose": true,
|