@microsoft/omnichannel-chat-widget 1.8.2-main.5199342 → 1.8.2-main.5a42a08
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 +48 -1
- package/lib/cjs/common/Constants.js +17 -3
- package/lib/cjs/common/telemetry/TelemetryConstants.js +2 -0
- package/lib/cjs/common/utils.js +27 -2
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +4 -4
- package/lib/cjs/components/draggable/DraggableChatWidget.js +16 -1
- package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +22 -9
- package/lib/cjs/components/livechatwidget/common/createMarkdown.js +54 -1
- package/lib/cjs/components/livechatwidget/common/customEventHandler.js +53 -0
- package/lib/cjs/components/livechatwidget/common/endChat.js +18 -7
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +33 -1
- package/lib/cjs/components/livechatwidget/common/liveChatConfigUtils.js +18 -1
- package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +31 -7
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +15 -2
- package/lib/cjs/components/livechatwidget/common/startChat.js +6 -4
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +27 -12
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +18 -14
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/callActionMiddleware.js +42 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +4 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +12 -6
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware.js +41 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +45 -0
- package/lib/cjs/contexts/common/CustomEventType.js +1 -0
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +3 -1
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +3 -1
- package/lib/cjs/contexts/createReducer.js +30 -0
- package/lib/cjs/controller/componentController.js +2 -2
- package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +101 -36
- package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +39 -21
- package/lib/cjs/firstresponselatency/util.js +60 -31
- package/lib/cjs/plugins/newMessageEventHandler.js +12 -6
- package/lib/esm/common/Constants.js +15 -2
- package/lib/esm/common/telemetry/TelemetryConstants.js +2 -0
- package/lib/esm/common/utils.js +21 -0
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +4 -4
- package/lib/esm/components/draggable/DraggableChatWidget.js +16 -1
- package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +22 -9
- package/lib/esm/components/livechatwidget/common/createMarkdown.js +54 -1
- package/lib/esm/components/livechatwidget/common/customEventHandler.js +45 -0
- package/lib/esm/components/livechatwidget/common/endChat.js +18 -7
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +33 -1
- package/lib/esm/components/livechatwidget/common/liveChatConfigUtils.js +16 -0
- package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +33 -9
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +16 -3
- package/lib/esm/components/livechatwidget/common/startChat.js +6 -4
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +27 -12
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +18 -14
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/callActionMiddleware.js +36 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +4 -4
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.js +12 -6
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware.js +33 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +38 -0
- package/lib/esm/contexts/common/CustomEventType.js +1 -0
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +3 -1
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +3 -1
- package/lib/esm/contexts/createReducer.js +30 -0
- package/lib/esm/controller/componentController.js +2 -2
- package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +101 -36
- package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +39 -21
- package/lib/esm/firstresponselatency/util.js +57 -29
- package/lib/esm/plugins/newMessageEventHandler.js +12 -6
- package/lib/types/common/Constants.d.ts +14 -2
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +2 -0
- package/lib/types/common/utils.d.ts +8 -0
- package/lib/types/components/livechatwidget/common/customEventHandler.d.ts +4 -0
- package/lib/types/components/livechatwidget/common/liveChatConfigUtils.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/callActionMiddleware.d.ts +8 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware.d.ts +22 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.d.ts +5 -0
- package/lib/types/contexts/common/CustomEventType.d.ts +6 -0
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +3 -1
- package/lib/types/firstresponselatency/FirstResponseLatencyTracker.d.ts +2 -2
- package/lib/types/firstresponselatency/util.d.ts +17 -0
- package/lib/types/plugins/newMessageEventHandler.d.ts +1 -1
- package/package.json +4 -4
|
@@ -48,6 +48,8 @@ export interface ILiveChatWidgetContext {
|
|
|
48
48
|
chatDisconnectEventReceived: boolean;
|
|
49
49
|
selectedSurveyMode: string | null;
|
|
50
50
|
postChatParticipantType: undefined | ParticipantType;
|
|
51
|
+
isConversationalSurvey: boolean;
|
|
52
|
+
isConversationalSurveyEnabled: boolean;
|
|
51
53
|
};
|
|
52
54
|
uiStates: {
|
|
53
55
|
showConfirmationPane: boolean;
|
|
@@ -44,5 +44,7 @@ export declare enum LiveChatWidgetActionType {
|
|
|
44
44
|
SET_SURVEY_MODE = 42,
|
|
45
45
|
SET_CONFIRMATION_STATE = 43,
|
|
46
46
|
SET_POST_CHAT_PARTICIPANT_TYPE = 44,
|
|
47
|
-
|
|
47
|
+
SET_CONVERSATIONAL_SURVEY_ENABLED = 45,
|
|
48
|
+
SET_CONVERSATIONAL_SURVEY_DISPLAY = 46,
|
|
49
|
+
GET_IN_MEMORY_STATE = 47
|
|
48
50
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { MessagePayload } from "./Constants";
|
|
2
2
|
export declare class FirstResponseLatencyTracker {
|
|
3
3
|
private isABotConversation;
|
|
4
|
-
private
|
|
5
|
-
private isEnded;
|
|
4
|
+
private isTracking;
|
|
6
5
|
private startTrackingMessage?;
|
|
7
6
|
private stopTrackingMessage?;
|
|
8
7
|
private isReady;
|
|
8
|
+
private trackingTimeoutId?;
|
|
9
9
|
constructor();
|
|
10
10
|
private createTrackingMessage;
|
|
11
11
|
private startTracking;
|
|
@@ -1,6 +1,23 @@
|
|
|
1
1
|
import { MessagePayload, ScenarioType, TrackingMessage } from "./Constants";
|
|
2
2
|
import { IActivity } from "botframework-directlinejs";
|
|
3
|
+
/**
|
|
4
|
+
* Determines whether a given activity is a historical message.
|
|
5
|
+
*
|
|
6
|
+
* This function checks if the activity is a message type and uses a combination
|
|
7
|
+
* of legacy tags and timestamp-based logic to determine if the message is historical.
|
|
8
|
+
*
|
|
9
|
+
* @param {IActivity} activity - The activity object to evaluate.
|
|
10
|
+
* @param {number} startTime - The start time (in milliseconds since epoch) to compare against.
|
|
11
|
+
* @returns {boolean} - Returns true if the activity is a historical message, false otherwise.
|
|
12
|
+
*
|
|
13
|
+
* Logic:
|
|
14
|
+
* - If the activity type is not a message, it is not historical.
|
|
15
|
+
* - If the activity contains a legacy history message tag, it is considered historical.
|
|
16
|
+
* - Otherwise, the function extracts a timestamp from the activity ID using `extractTimestampFromId`.
|
|
17
|
+
* - If the ID is valid and the timestamp is older than the start time, the message is historical.
|
|
18
|
+
*/
|
|
3
19
|
export declare const isHistoryMessage: (activity: IActivity, startTime: number) => boolean;
|
|
20
|
+
export declare const extractTimestampFromId: (activity: IActivity) => number;
|
|
4
21
|
export declare const buildMessagePayload: (activity: IActivity, userId: string) => MessagePayload;
|
|
5
22
|
export declare const polyfillMessagePayloadForEvent: (activity: IActivity, payload: MessagePayload, conversationId?: string) => MessagePayload;
|
|
6
23
|
export declare const getScenarioType: (activity: IActivity) => ScenarioType;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IActivity } from "botframework-directlinejs";
|
|
2
|
-
export declare const createOnNewAdapterActivityHandler: (chatId: string, userId: string) => (activity: IActivity) => void;
|
|
2
|
+
export declare const createOnNewAdapterActivityHandler: (chatId: string, userId: string, startTime: number) => (activity: IActivity) => void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/omnichannel-chat-widget",
|
|
3
|
-
"version": "1.8.2-main.
|
|
3
|
+
"version": "1.8.2-main.5a42a08",
|
|
4
4
|
"description": "Microsoft Omnichannel Chat Widget",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"types": "lib/types/index.d.ts",
|
|
@@ -86,7 +86,7 @@
|
|
|
86
86
|
"dependencies": {
|
|
87
87
|
"@azure/core-tracing": "^1.2.0",
|
|
88
88
|
"@microsoft/applicationinsights-web": "^3.3.6",
|
|
89
|
-
"@microsoft/omnichannel-chat-components": "1.1.
|
|
89
|
+
"@microsoft/omnichannel-chat-components": "1.1.13",
|
|
90
90
|
"@microsoft/omnichannel-chat-sdk": "^1.11.4",
|
|
91
91
|
"@opentelemetry/api": "^1.9.0",
|
|
92
92
|
"abort-controller": "^3",
|
|
@@ -121,8 +121,8 @@
|
|
|
121
121
|
"build:umd": "webpack --config ./webpack.umd.config.cjs",
|
|
122
122
|
"verify": "yarn install && yarn build-storybook && yarn test:all && yarn build && yarn storybook",
|
|
123
123
|
"testpack": "yarn build && yarn pack",
|
|
124
|
-
"build-sample": "yarn build && webpack --config ./webpack.config.cjs",
|
|
125
|
-
"build-sample:dev": "yarn build && webpack --config ./webpack.dev.config.cjs",
|
|
124
|
+
"build-sample": "yarn build && cross-env NODE_OPTIONS=--openssl-legacy-provider webpack --config ./webpack.config.cjs",
|
|
125
|
+
"build-sample:dev": "yarn build && cross-env NODE_OPTIONS=--openssl-legacy-provider webpack --config ./webpack.dev.config.cjs",
|
|
126
126
|
"test:visual:build": "yarn build-storybook && yarn test:visual",
|
|
127
127
|
"lint": "yarn eslint . --max-warnings=0",
|
|
128
128
|
"prepush": "yarn lint && yarn danger:prepush",
|