@microsoft/omnichannel-chat-widget 0.1.0-main.21ab3ba → 0.1.0-main.23dc34f
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 +2 -0
- package/lib/cjs/common/storage/default/defaultCacheManager.js +2 -2
- package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +15 -6
- package/lib/cjs/common/telemetry/TelemetryConstants.js +5 -0
- package/lib/cjs/common/telemetry/TelemetryHelper.js +2 -1
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +1 -1
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +1 -1
- package/lib/cjs/components/headerstateful/HeaderStateful.js +4 -2
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +14 -10
- package/lib/cjs/components/livechatwidget/common/endChat.js +23 -17
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +25 -13
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +5 -5
- package/lib/cjs/components/livechatwidget/common/startChat.js +70 -59
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +43 -37
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +8 -1
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
- package/lib/cjs/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +1 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +2 -14
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -11
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +4 -2
- package/lib/cjs/hooks/useDebounce.js +28 -0
- package/lib/cjs/hooks/useWindowDimensions.js +30 -0
- package/lib/cjs/plugins/newMessageEventHandler.js +14 -0
- package/lib/esm/common/Constants.js +2 -0
- package/lib/esm/common/storage/default/defaultCacheManager.js +2 -2
- package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +15 -6
- package/lib/esm/common/telemetry/TelemetryConstants.js +5 -0
- package/lib/esm/common/telemetry/TelemetryHelper.js +2 -1
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +1 -1
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +1 -1
- package/lib/esm/components/headerstateful/HeaderStateful.js +4 -2
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +14 -10
- package/lib/esm/components/livechatwidget/common/endChat.js +23 -17
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +25 -13
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +6 -5
- package/lib/esm/components/livechatwidget/common/startChat.js +70 -59
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +44 -38
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +8 -1
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
- package/lib/esm/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +1 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +2 -14
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -11
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +4 -2
- package/lib/esm/hooks/useDebounce.js +22 -0
- package/lib/esm/hooks/useWindowDimensions.js +23 -0
- package/lib/esm/plugins/newMessageEventHandler.js +14 -0
- package/lib/types/common/Constants.d.ts +2 -0
- package/lib/types/common/storage/default/defaultCacheManager.d.ts +1 -1
- package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +1 -1
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +6 -1
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +2 -0
- package/lib/types/common/telemetry/definitions/Payload.d.ts +1 -0
- package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +4 -0
- package/lib/types/components/livechatwidget/common/startChat.d.ts +3 -3
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +1 -1
- package/lib/types/hooks/useDebounce.d.ts +3 -0
- package/lib/types/hooks/useWindowDimensions.d.ts +4 -0
- package/package.json +3 -3
|
@@ -229,7 +229,8 @@ const createAttachmentMiddleware = enableInlinePlaying => {
|
|
|
229
229
|
renderer: next
|
|
230
230
|
});
|
|
231
231
|
}
|
|
232
|
-
|
|
232
|
+
const isUnknownImageObject = contentType.toLowerCase().includes("image") && !imageExtension;
|
|
233
|
+
if (fileExtension === "txt" || isUnknownImageObject) {
|
|
233
234
|
return /*#__PURE__*/React.createElement(Attachment, {
|
|
234
235
|
iconData: iconData,
|
|
235
236
|
textCard: patchAttachment(card, {
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useRef } from "react";
|
|
2
|
-
import { HtmlAttributeNames } from "../../../../../../common/Constants";
|
|
3
2
|
import { KeyCodes } from "../../../../../../common/KeyCodes";
|
|
4
3
|
import { Stack } from "@fluentui/react";
|
|
5
4
|
import { defaultMiddlewareLocalizedTexts } from "../../../../common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
@@ -50,9 +49,8 @@ export const NotDeliveredTimestamp = _ref => {
|
|
|
50
49
|
timestampWebChatNodes[1].innerText = getTimestampHourMinute(timestamp);
|
|
51
50
|
}
|
|
52
51
|
}, [timestampRef]);
|
|
53
|
-
const onRetryClick = useCallback(async
|
|
52
|
+
const onRetryClick = useCallback(async () => {
|
|
54
53
|
var _activity$channelData;
|
|
55
|
-
removeNotDeliveredTimestamp(event);
|
|
56
54
|
activity.previousClientActivityID = (_activity$channelData = activity.channelData) === null || _activity$channelData === void 0 ? void 0 : _activity$channelData.clientActivityID;
|
|
57
55
|
await postActivity(activity);
|
|
58
56
|
focus("sendBox");
|
|
@@ -60,19 +58,9 @@ export const NotDeliveredTimestamp = _ref => {
|
|
|
60
58
|
const onRetryKeyEnter = event => {
|
|
61
59
|
if (event.code === KeyCodes.ENTER) {
|
|
62
60
|
event.preventDefault();
|
|
63
|
-
onRetryClick(
|
|
61
|
+
onRetryClick();
|
|
64
62
|
}
|
|
65
63
|
};
|
|
66
|
-
const removeNotDeliveredTimestamp = event => {
|
|
67
|
-
let parent = event.target.parentElement;
|
|
68
|
-
while (parent.tagName !== HtmlAttributeNames.listItem) {
|
|
69
|
-
parent = parent.parentElement;
|
|
70
|
-
if (parent.tagName === HtmlAttributeNames.unorderedList) {
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
parent.parentNode.removeChild(parent);
|
|
75
|
-
};
|
|
76
64
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
77
65
|
style: contentStyles,
|
|
78
66
|
dir: dir,
|
|
@@ -2,29 +2,20 @@ import React from "react";
|
|
|
2
2
|
import { Stack } from "@fluentui/react";
|
|
3
3
|
import { defaultMiddlewareLocalizedTexts } from "../../../../common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
4
4
|
import { defaultTimestampContentStyles } from "../defaultStyles/defaultTimestampContentStyles";
|
|
5
|
-
import { getTimestampHourMinute } from "../../../../../../common/utils";
|
|
6
5
|
import { useChatContextStore } from "../../../../../..";
|
|
7
6
|
|
|
8
7
|
/* eslint @typescript-eslint/no-explicit-any: "off" */
|
|
9
|
-
export const SendingTimestamp =
|
|
8
|
+
export const SendingTimestamp = () => {
|
|
10
9
|
var _state$domainStates$r, _state$domainStates$r2, _state$domainStates$m;
|
|
11
|
-
let {
|
|
12
|
-
args
|
|
13
|
-
} = _ref;
|
|
14
10
|
const [state] = useChatContextStore();
|
|
15
11
|
const dir = ((_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.timestampDir) ?? state.domainStates.globalDir;
|
|
16
12
|
const contentStyles = {
|
|
17
13
|
...defaultTimestampContentStyles,
|
|
18
14
|
...((_state$domainStates$r2 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.timestampContentStyleProps)
|
|
19
15
|
};
|
|
20
|
-
const {
|
|
21
|
-
activity: {
|
|
22
|
-
timestamp
|
|
23
|
-
}
|
|
24
|
-
} = args;
|
|
25
16
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
26
17
|
style: contentStyles,
|
|
27
18
|
dir: dir,
|
|
28
19
|
horizontal: true
|
|
29
|
-
}, /*#__PURE__*/React.createElement("span", null, " ",
|
|
20
|
+
}, /*#__PURE__*/React.createElement("span", null, " ", ((_state$domainStates$m = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m === void 0 ? void 0 : _state$domainStates$m.MIDDLEWARE_MESSAGE_SENDING) ?? defaultMiddlewareLocalizedTexts.MIDDLEWARE_MESSAGE_SENDING, " "));
|
|
30
21
|
};
|
|
@@ -2,10 +2,12 @@ import { ConversationState } from "./ConversationState";
|
|
|
2
2
|
import { defaultMiddlewareLocalizedTexts } from "../../components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
3
3
|
import { getWidgetCacheId, isNullOrUndefined } from "../../common/utils";
|
|
4
4
|
import { defaultClientDataStoreProvider } from "../../common/storage/default/defaultClientDataStoreProvider";
|
|
5
|
+
import { Constants } from "../../common/Constants";
|
|
5
6
|
export const getLiveChatWidgetContextInitialState = props => {
|
|
6
|
-
var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$controlProps, _props$webChatContain;
|
|
7
|
+
var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$controlProps, _props$controlProps2, _props$webChatContain;
|
|
7
8
|
const widgetCacheId = getWidgetCacheId(props === null || props === void 0 ? void 0 : (_props$chatSDK = props.chatSDK) === null || _props$chatSDK === void 0 ? void 0 : (_props$chatSDK$omnich = _props$chatSDK.omnichannelConfig) === null || _props$chatSDK$omnich === void 0 ? void 0 : _props$chatSDK$omnich.orgId, props === null || props === void 0 ? void 0 : (_props$chatSDK2 = props.chatSDK) === null || _props$chatSDK2 === void 0 ? void 0 : (_props$chatSDK2$omnic = _props$chatSDK2.omnichannelConfig) === null || _props$chatSDK2$omnic === void 0 ? void 0 : _props$chatSDK2$omnic.widgetId, (props === null || props === void 0 ? void 0 : (_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.widgetInstanceId) ?? "");
|
|
8
|
-
const
|
|
9
|
+
const cacheTtlInMins = (props === null || props === void 0 ? void 0 : (_props$controlProps2 = props.controlProps) === null || _props$controlProps2 === void 0 ? void 0 : _props$controlProps2.cacheTtlInMins) ?? Constants.CacheTtlInMinutes;
|
|
10
|
+
const initialState = defaultClientDataStoreProvider(cacheTtlInMins).getData(widgetCacheId, "localStorage");
|
|
9
11
|
if (!isNullOrUndefined(initialState)) {
|
|
10
12
|
return JSON.parse(initialState);
|
|
11
13
|
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useRef, useEffect } from "react";
|
|
2
|
+
export default function useDebounce(func) {
|
|
3
|
+
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
|
4
|
+
const timer = useRef();
|
|
5
|
+
useEffect(() => {
|
|
6
|
+
return () => {
|
|
7
|
+
if (!timer.current) return;
|
|
8
|
+
clearTimeout(timer.current);
|
|
9
|
+
};
|
|
10
|
+
}, []);
|
|
11
|
+
const debouncedFunction = function () {
|
|
12
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
13
|
+
args[_key] = arguments[_key];
|
|
14
|
+
}
|
|
15
|
+
const newTimer = setTimeout(() => {
|
|
16
|
+
func(...args);
|
|
17
|
+
}, delay);
|
|
18
|
+
clearTimeout(timer.current);
|
|
19
|
+
timer.current = newTimer;
|
|
20
|
+
};
|
|
21
|
+
return debouncedFunction;
|
|
22
|
+
}
|
|
@@ -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;
|
|
@@ -39,6 +40,10 @@ export const createOnNewAdapterActivityHandler = (chatId, userId) => {
|
|
|
39
40
|
if (activity !== null && activity !== void 0 && (_activity$channelData5 = activity.channelData) !== null && _activity$channelData5 !== void 0 && (_activity$channelData6 = _activity$channelData5.tags) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.includes(Constants.systemMessageTag)) {
|
|
40
41
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
41
42
|
payload.messageType = Constants.systemMessageTag;
|
|
43
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
44
|
+
Event: TelemetryEvent.SystemMessageReceived,
|
|
45
|
+
Description: "System message received"
|
|
46
|
+
});
|
|
42
47
|
} else {
|
|
43
48
|
var _activity$channelData7, _activity$channelData8, _activity$channelData9;
|
|
44
49
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -63,6 +68,15 @@ export const createOnNewAdapterActivityHandler = (chatId, userId) => {
|
|
|
63
68
|
Description: "New message received",
|
|
64
69
|
Data: payload
|
|
65
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
|
+
}
|
|
66
80
|
}
|
|
67
81
|
}
|
|
68
82
|
}
|
|
@@ -78,6 +78,7 @@ export declare class Constants {
|
|
|
78
78
|
static readonly ChatWidgetStateChangedPrefix = "ChatWidgetStateChanged";
|
|
79
79
|
static readonly PostChatLoadingDurationInMs = 2000;
|
|
80
80
|
static readonly BrowserUnloadConfirmationMessage = "Do you want to leave chat?";
|
|
81
|
+
static readonly CacheTtlInMinutes = 15;
|
|
81
82
|
}
|
|
82
83
|
export declare const Regex: {
|
|
83
84
|
new (): {};
|
|
@@ -125,6 +126,7 @@ export declare class HtmlAttributeNames {
|
|
|
125
126
|
static readonly adaptiveCardClassName = "ac-adaptiveCard";
|
|
126
127
|
static readonly adaptiveCardTextBlockClassName = "ac-textBlock";
|
|
127
128
|
static readonly adaptiveCardToggleInputClassName = "ac-toggleInput";
|
|
129
|
+
static readonly adaptiveCardActionSetClassName = "ac-actionSet";
|
|
128
130
|
}
|
|
129
131
|
export declare class WebChatMiddlewareConstants {
|
|
130
132
|
static readonly nextVisibleActivity = "nextVisibleActivity";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare class defaultCacheManager {
|
|
2
2
|
static InternalCache: any;
|
|
3
3
|
}
|
|
4
|
-
export declare const registerBroadcastServiceForLocalStorage: (orgid: string, widgetId: string, widgetInstanceId: string) => void;
|
|
4
|
+
export declare const registerBroadcastServiceForLocalStorage: (orgid: string, widgetId: string, widgetInstanceId: string, ttlInMins: number) => void;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IContextDataStore } from "../../interfaces/IContextDataStore";
|
|
2
|
-
export declare const defaultClientDataStoreProvider: () => IContextDataStore;
|
|
2
|
+
export declare const defaultClientDataStoreProvider: (cacheTtlinMins?: number) => IContextDataStore;
|
|
@@ -42,7 +42,9 @@ export declare enum BroadcastEvent {
|
|
|
42
42
|
CloseChat = "CloseChat",
|
|
43
43
|
InitiateEndChatOnBrowserUnload = "InitiateEndChatOnBrowserUnload",
|
|
44
44
|
ClosePopoutWindow = "ClosePopoutWindow",
|
|
45
|
-
RaiseErrorEvent = "RaiseErrorEvent"
|
|
45
|
+
RaiseErrorEvent = "RaiseErrorEvent",
|
|
46
|
+
NetworkDisconnected = "NetworkDisconnected",
|
|
47
|
+
NetworkReconnected = "NetworkReconnected"
|
|
46
48
|
}
|
|
47
49
|
export declare enum TelemetryEvent {
|
|
48
50
|
CallAdded = "CallAdded",
|
|
@@ -102,6 +104,7 @@ export declare enum TelemetryEvent {
|
|
|
102
104
|
DownloadTranscriptResponseNullOrUndefined = "DownloadTranscriptResponseNullOrUndefined",
|
|
103
105
|
EmailTranscriptSent = "EmailTranscriptSent",
|
|
104
106
|
EmailTranscriptFailed = "EmailTranscriptFailed",
|
|
107
|
+
ErrorUIPaneLoaded = "ErrorUIPaneLoaded",
|
|
105
108
|
DownloadTranscriptFailed = "DownloadTranscriptFailed",
|
|
106
109
|
StartChatFailed = "StartChatFailed",
|
|
107
110
|
IC3ThreadUpdateEventReceived = "IC3ThreadUpdateEventReceived",
|
|
@@ -157,6 +160,8 @@ export declare enum TelemetryEvent {
|
|
|
157
160
|
ReconnectChatMinimize = "ReconnectChatMinimize",
|
|
158
161
|
MessageSent = "MessageSent",
|
|
159
162
|
MessageReceived = "MessageReceived",
|
|
163
|
+
SystemMessageReceived = "SystemMessageReceived",
|
|
164
|
+
HistoryMessageReceived = "HistoryMessageReceived",
|
|
160
165
|
CustomContextReceived = "CustomContextReceived",
|
|
161
166
|
NetworkDisconnected = "NetworkDisconnected",
|
|
162
167
|
NetworkReconnected = "NetworkReconnected"
|
|
@@ -32,6 +32,8 @@ export interface LoadContract extends BaseContract {
|
|
|
32
32
|
export interface ActionsContract extends BaseContract {
|
|
33
33
|
Event?: string;
|
|
34
34
|
ActionType?: string;
|
|
35
|
+
Description?: string;
|
|
36
|
+
CustomProperties?: any;
|
|
35
37
|
}
|
|
36
38
|
export interface IC3ClientContract extends BaseContract {
|
|
37
39
|
Event?: string;
|
|
@@ -72,6 +72,7 @@ export interface ActionTelemetryData extends BaseTelemetryData {
|
|
|
72
72
|
ActionType?: string;
|
|
73
73
|
ExceptionDetails?: object;
|
|
74
74
|
Description?: string;
|
|
75
|
+
CustomProperties?: any;
|
|
75
76
|
}
|
|
76
77
|
export interface CallingTelemetryData extends BaseTelemetryData {
|
|
77
78
|
CallId?: string;
|
|
@@ -1,10 +1,10 @@
|
|
|
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";
|
|
5
4
|
import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
|
|
5
|
+
import StartChatOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/StartChatOptionalParams";
|
|
6
6
|
declare const prepareStartChat: (props: ILiveChatWidgetProps, chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any) => Promise<void>;
|
|
7
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>;
|
|
8
|
-
declare const initStartChat: (chatSDK: any,
|
|
9
|
-
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>;
|
|
10
10
|
export { prepareStartChat, initStartChat, setPreChatAndInitiateChat, checkIfConversationStillValid };
|
|
@@ -4,6 +4,7 @@ export interface ILiveChatWidgetControlProps {
|
|
|
4
4
|
hideCallingContainer?: boolean;
|
|
5
5
|
hideChatButton?: boolean;
|
|
6
6
|
hideConfirmationPane?: boolean;
|
|
7
|
+
hideErrorUIPane?: boolean;
|
|
7
8
|
hideFooter?: boolean;
|
|
8
9
|
hideHeader?: boolean;
|
|
9
10
|
hideLoadingPane?: boolean;
|
|
@@ -15,4 +16,5 @@ export interface ILiveChatWidgetControlProps {
|
|
|
15
16
|
hideWebChatContainer?: boolean;
|
|
16
17
|
hideStartChatButton?: boolean;
|
|
17
18
|
widgetInstanceId?: string | undefined;
|
|
19
|
+
cacheTtlInMins?: number;
|
|
18
20
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SendingTimestamp: (
|
|
1
|
+
export declare const SendingTimestamp: () => JSX.Element;
|
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.23dc34f",
|
|
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": "
|
|
77
|
+
"@microsoft/omnichannel-chat-components": "0.1.0-main.f4c21f0",
|
|
78
|
+
"@microsoft/omnichannel-chat-sdk": "1.2.1-main.cb2cd37",
|
|
79
79
|
"abort-controller-es5": "^2.0.1",
|
|
80
80
|
"dompurify": "^2.3.4",
|
|
81
81
|
"markdown-it": "^12.3.2",
|