@microsoft/omnichannel-chat-widget 0.1.0-main.a7ac5de → 0.1.0-main.a7b2241
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/assets/Icons.js +4 -2
- package/lib/cjs/common/Constants.js +7 -3
- package/lib/cjs/common/KeyCodes.js +3 -1
- package/lib/cjs/common/contextDataStore/DataStoreManager.js +3 -1
- package/lib/cjs/common/storage/default/defaultCacheManager.js +5 -3
- package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +15 -6
- package/lib/cjs/common/telemetry/TelemetryConstants.js +13 -0
- package/lib/cjs/common/telemetry/TelemetryHelper.js +5 -2
- package/lib/cjs/common/telemetry/TelemetryManager.js +3 -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 +6 -4
- package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +3 -1
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +139 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +3 -1
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +3 -1
- package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +3 -1
- package/lib/cjs/components/livechatwidget/common/Deferred.js +3 -1
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -0
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +66 -14
- 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 +6 -9
- package/lib/cjs/components/livechatwidget/common/startChat.js +76 -53
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +44 -38
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +22 -2
- package/lib/cjs/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +57 -0
- 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/common/mockadapter.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +2 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +3 -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/DeliveredTimestamp.js +5 -6
- 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/LiveChatWidgetActionType.js +29 -28
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +5 -2
- package/lib/cjs/contexts/createReducer.js +8 -0
- 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/assets/Icons.js +2 -1
- package/lib/esm/common/Constants.js +7 -3
- package/lib/esm/common/KeyCodes.js +3 -1
- package/lib/esm/common/contextDataStore/DataStoreManager.js +3 -1
- package/lib/esm/common/storage/default/defaultCacheManager.js +5 -3
- package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +15 -6
- package/lib/esm/common/telemetry/TelemetryConstants.js +13 -0
- package/lib/esm/common/telemetry/TelemetryHelper.js +5 -2
- package/lib/esm/common/telemetry/TelemetryManager.js +3 -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 +6 -4
- package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +3 -1
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +134 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +3 -1
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +3 -1
- package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +3 -1
- package/lib/esm/components/livechatwidget/common/Deferred.js +3 -1
- package/lib/esm/components/livechatwidget/common/createAdapter.js +2 -0
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +66 -14
- 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 +7 -9
- package/lib/esm/components/livechatwidget/common/startChat.js +76 -53
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +45 -39
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +22 -2
- package/lib/esm/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +50 -0
- 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/common/mockadapter.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +2 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +3 -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/DeliveredTimestamp.js +5 -6
- 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/LiveChatWidgetActionType.js +29 -28
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +5 -2
- package/lib/esm/contexts/createReducer.js +8 -0
- 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/assets/Icons.d.ts +1 -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 +14 -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/ActivitySubscriber/BotAuthActivitySubscriber.d.ts +9 -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/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +1 -1
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +29 -28
- package/lib/types/hooks/useDebounce.d.ts +3 -0
- package/lib/types/hooks/useWindowDimensions.d.ts +4 -0
- package/package.json +3 -3
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
2
4
|
import "rxjs/add/operator/share";
|
|
3
5
|
import "rxjs/add/observable/of";
|
|
4
6
|
import { ConnectionStatus } from "botframework-directlinejs";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
2
4
|
import MockAdapter from "./mockadapter";
|
|
3
5
|
export class MockChatSDK {
|
|
4
6
|
constructor() {
|
package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js
CHANGED
|
@@ -6,6 +6,7 @@ const FileAttachmentIconMap = {
|
|
|
6
6
|
"aac": AudioIcon,
|
|
7
7
|
"aiff": AudioIcon,
|
|
8
8
|
"alac": AudioIcon,
|
|
9
|
+
"amr": AudioIcon,
|
|
9
10
|
"avchd": VideoIcon,
|
|
10
11
|
"avi": VideoIcon,
|
|
11
12
|
"bmp": ImageIcon,
|
|
@@ -44,6 +45,7 @@ const FileAttachmentIconMap = {
|
|
|
44
45
|
"vsdx": VisioIcon,
|
|
45
46
|
"wav": AudioIcon,
|
|
46
47
|
"webm": VideoIcon,
|
|
48
|
+
"webp": ImageIcon,
|
|
47
49
|
"wma": AudioIcon,
|
|
48
50
|
"wmv": VideoIcon,
|
|
49
51
|
"xls": ExcelIcon,
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
2
4
|
export class BotMagicCodeStore {}
|
|
3
5
|
_defineProperty(BotMagicCodeStore, "botOAuthSignInId", "");
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
2
4
|
export class WebChatStoreLoader {}
|
|
3
5
|
_defineProperty(WebChatStoreLoader, "store", void 0);
|
|
@@ -51,9 +51,7 @@ export const activityStatusMiddleware = () => next => args => {
|
|
|
51
51
|
style: {
|
|
52
52
|
padding: "2px"
|
|
53
53
|
}
|
|
54
|
-
}, sendState === SendStatus.Sending && /*#__PURE__*/React.createElement(SendingTimestamp, {
|
|
55
|
-
args: args
|
|
56
|
-
}), sendState === SendStatus.SendFailed && /*#__PURE__*/React.createElement(NotDeliveredTimestamp, {
|
|
54
|
+
}, sendState === SendStatus.Sending && /*#__PURE__*/React.createElement(SendingTimestamp, null), sendState === SendStatus.SendFailed && /*#__PURE__*/React.createElement(NotDeliveredTimestamp, {
|
|
57
55
|
args: args
|
|
58
56
|
}), sendState === SendStatus.Sent && /*#__PURE__*/React.createElement(DeliveredTimestamp, {
|
|
59
57
|
args: args,
|
|
@@ -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, {
|
|
@@ -27,13 +27,12 @@ export const DeliveredTimestamp = _ref => {
|
|
|
27
27
|
} = args;
|
|
28
28
|
return /*#__PURE__*/React.createElement(Stack, {
|
|
29
29
|
style: contentStyles,
|
|
30
|
+
dir: dir
|
|
31
|
+
}, role === DirectLineSenderRole.Bot && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
30
32
|
dir: dir,
|
|
31
|
-
horizontal: true
|
|
32
|
-
}, role === DirectLineSenderRole.Bot && /*#__PURE__*/React.createElement("span", {
|
|
33
33
|
"aria-hidden": "false"
|
|
34
|
-
}, name), role === DirectLineSenderRole.
|
|
34
|
+
}, name, " - ", getTimestampHourMinute(timestamp))), role === DirectLineSenderRole.User && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
35
|
+
"aria-hidden": "false",
|
|
35
36
|
dir: dir
|
|
36
|
-
}, " ", getTimestampHourMinute(timestamp)
|
|
37
|
-
"aria-hidden": "false"
|
|
38
|
-
}, ((_state$domainStates$m = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m === void 0 ? void 0 : _state$domainStates$m.MIDDLEWARE_MESSAGE_DELIVERED) ?? defaultMiddlewareLocalizedTexts.MIDDLEWARE_MESSAGE_DELIVERED));
|
|
37
|
+
}, " ", getTimestampHourMinute(timestamp), " - ", ((_state$domainStates$m = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m === void 0 ? void 0 : _state$domainStates$m.MIDDLEWARE_MESSAGE_DELIVERED) ?? defaultMiddlewareLocalizedTexts.MIDDLEWARE_MESSAGE_DELIVERED)));
|
|
39
38
|
};
|
|
@@ -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
|
};
|
|
@@ -7,32 +7,33 @@ export let LiveChatWidgetActionType;
|
|
|
7
7
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_MINIMIZED"] = 4] = "SET_MINIMIZED";
|
|
8
8
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_STATE"] = 5] = "SET_CONVERSATION_STATE";
|
|
9
9
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PREVIOUS_FOCUSED_ELEMENT_ID"] = 6] = "SET_PREVIOUS_FOCUSED_ELEMENT_ID";
|
|
10
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
11
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
12
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
13
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
14
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
15
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
16
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
17
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
18
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
19
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
20
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
21
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
22
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
23
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
24
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
25
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
26
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
27
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
28
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
29
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
30
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
31
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
32
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
33
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
34
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
35
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
36
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
37
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
10
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_FAILING"] = 7] = "SET_START_CHAT_FAILING";
|
|
11
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_OUTSIDE_OPERATING_HOURS"] = 8] = "SET_OUTSIDE_OPERATING_HOURS";
|
|
12
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRE_CHAT_SURVEY_RESPONSE"] = 9] = "SET_PRE_CHAT_SURVEY_RESPONSE";
|
|
13
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CUSTOM_CONTEXT"] = 10] = "SET_CUSTOM_CONTEXT";
|
|
14
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_CONFIRMATION"] = 11] = "SET_SHOW_CONFIRMATION";
|
|
15
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_EMAIL_TRANSCRIPT_PANE"] = 12] = "SET_SHOW_EMAIL_TRANSCRIPT_PANE";
|
|
16
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRECHAT_RESPONSE_EMAIL"] = 13] = "SET_PRECHAT_RESPONSE_EMAIL";
|
|
17
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 14] = "SET_AUDIO_NOTIFICATION";
|
|
18
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 15] = "SET_E2VV_ENABLED";
|
|
19
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 16] = "SET_POST_CHAT_CONTEXT";
|
|
20
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 17] = "SHOW_CALLING_CONTAINER";
|
|
21
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 18] = "SET_INCOMING_CALL";
|
|
22
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 19] = "DISABLE_VIDEO_CALL";
|
|
23
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 20] = "DISABLE_LOCAL_VIDEO";
|
|
24
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 21] = "DISABLE_REMOTE_VIDEO";
|
|
25
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 22] = "SET_CHAT_TOKEN";
|
|
26
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_BUTTON_DISPLAY"] = 23] = "SET_START_CHAT_BUTTON_DISPLAY";
|
|
27
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 24] = "SET_PROACTIVE_CHAT_PARAMS";
|
|
28
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 25] = "SET_TELEMETRY_DATA";
|
|
29
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 26] = "SET_RECONNECT_ID";
|
|
30
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 27] = "SET_UNREAD_MESSAGE_COUNT";
|
|
31
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 28] = "SET_FOCUS_CHAT_BUTTON";
|
|
32
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT"] = 29] = "SET_CONVERSATION_ENDED_BY_AGENT";
|
|
33
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 30] = "SET_WIDGET_STATE";
|
|
34
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 31] = "SET_LIVE_CHAT_CONTEXT";
|
|
35
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_OAUTH_SIGNIN_ID"] = 32] = "SET_BOT_OAUTH_SIGNIN_ID";
|
|
36
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_SIZE"] = 33] = "SET_WIDGET_SIZE";
|
|
37
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_INSTANCE_ID"] = 34] = "SET_WIDGET_INSTANCE_ID";
|
|
38
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONFIG"] = 35] = "SET_LIVE_CHAT_CONFIG";
|
|
38
39
|
})(LiveChatWidgetActionType || (LiveChatWidgetActionType = {}));
|
|
@@ -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
|
}
|
|
@@ -29,6 +31,7 @@ export const getLiveChatWidgetContextInitialState = props => {
|
|
|
29
31
|
conversationState: ConversationState.Closed,
|
|
30
32
|
isMinimized: false,
|
|
31
33
|
previousElementIdOnFocusBeforeModalOpen: null,
|
|
34
|
+
isStartChatFailing: false,
|
|
32
35
|
outsideOperatingHours: false,
|
|
33
36
|
preChatResponseEmail: "",
|
|
34
37
|
isAudioMuted: null,
|
|
@@ -53,6 +53,14 @@ export const createReducer = () => {
|
|
|
53
53
|
conversationState: action.payload
|
|
54
54
|
}
|
|
55
55
|
};
|
|
56
|
+
case LiveChatWidgetActionType.SET_START_CHAT_FAILING:
|
|
57
|
+
return {
|
|
58
|
+
...state,
|
|
59
|
+
appStates: {
|
|
60
|
+
...state.appStates,
|
|
61
|
+
isStartChatFailing: action.payload
|
|
62
|
+
}
|
|
63
|
+
};
|
|
56
64
|
case LiveChatWidgetActionType.SET_OUTSIDE_OPERATING_HOURS:
|
|
57
65
|
return {
|
|
58
66
|
...state,
|
|
@@ -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
|
}
|
|
@@ -9,3 +9,4 @@ export declare const PowerpointIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0
|
|
|
9
9
|
export declare const VideoIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciDQogICAgdmlld0JveD0iMCAwIDIwNDggMjA0OCINCiAgICB3aWR0aD0iMTJweCINCiAgICBoZWlnaHQ9IjEycHgiPg0KICAgIDxwYXRoIGQ9Ik0wIDI1NmgyMDQ4djE0MDhIMFYyNTZ6bTI1NiAxMjgwdi0xMjhIMTI4djEyOGgxMjh6bTAtMjU2di0xMjhIMTI4djEyOGgxMjh6bTAtMjU2Vjg5NkgxMjh2MTI4aDEyOHptMC0yNTZWNjQwSDEyOHYxMjhoMTI4em0wLTI1NlYzODRIMTI4djEyOGgxMjh6bTE0MDggNzg2VjM4NEgzODR2ODIzbDQxMS01NDkgNzQxIDg3OC0zMjktNTU4IDEzNy0xMzcgMzIwIDQ1N3ptMjU2IDIzOHYtMTI4aC0xMjh2MTI4aDEyOHptMC0yNTZ2LTEyOGgtMTI4djEyOGgxMjh6bTAtMjU2Vjg5NmgtMTI4djEyOGgxMjh6bTAtMjU2VjY0MGgtMTI4djEyOGgxMjh6bTAtMjU2VjM4NGgtMTI4djEyOGgxMjh6IiAvPg0KPC9zdmc+";
|
|
10
10
|
export declare const VisioIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciDQogICAgdmlld0JveD0iMCAwIDIwNDggMjA0OCINCiAgICB3aWR0aD0iMTJweCINCiAgICBoZWlnaHQ9IjEycHgiPg0KICAgIDxwYXRoIGQ9Ik0yMDQ4IDQ3NXYxNDQ1cTAgMjctMTAgNTB0LTI3IDQwLTQxIDI4LTUwIDEwSDY0MHEtMjcgMC01MC0xMHQtNDAtMjctMjgtNDEtMTAtNTB2LTI1NkgxMTVxLTI0IDAtNDQtOXQtMzctMjUtMjUtMzYtOS00NVY2MjdxMC0yNCA5LTQ0dDI1LTM3IDM2LTI1IDQ1LTloMzk3VjEyOHEwLTI3IDEwLTUwdDI3LTQwIDQxLTI4IDUwLTEwaDkzM3EyNiAwIDQ5IDl0NDIgMjhsMzQ3IDM0N3ExOCAxOCAyNyA0MXQxMCA1MHptLTM4NC0yNTZ2MTY1aDE2NWwtMTY1LTE2NXpNNDkzIDE0MjRoMTYzbDI1NS02NzJINzQ1bC0xNDcgNDI3cS01IDE2LTEwIDMxdC0xMSAzMXEtNDEtMTIzLTgyLTI0NHQtODQtMjQ1SDI0MWwyNDggNjYyIDQgMTB6bTE0NyA0OTZoMTI4MFY1MTJoLTI1NnEtMjcgMC01MC0xMHQtNDAtMjctMjgtNDEtMTAtNTBWMTI4SDY0MHYzODRoMzk3cTI0IDAgNDQgOXQzNyAyNSAyNSAzNiA5IDQ1djkyMnEwIDI0LTkgNDR0LTI1IDM3LTM2IDI1LTQ1IDlINjQwdjI1NnptOTYwLTEyODBsMTkyIDE5Mi0xMjggMTI4djQ0OGgtMjU2djEyOGgtMTI4di0zODRoMTI4djEyOGgxMjhWOTYwbC0xMjgtMTI4IDE5Mi0xOTJ6IiAvPg0KPC9zdmc+";
|
|
11
11
|
export declare const WordIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciDQogICAgdmlld0JveD0iMCAwIDIwNDggMjA0OCINCiAgICB3aWR0aD0iMTJweCINCiAgICBoZWlnaHQ9IjEycHgiPg0KICAgIDxwYXRoIGQ9Ik0yMDQ4IDQ3NXYxNDQ1cTAgMjctMTAgNTB0LTI3IDQwLTQxIDI4LTUwIDEwSDY0MHEtMjcgMC01MC0xMHQtNDAtMjctMjgtNDEtMTAtNTB2LTI1NkgxMTVxLTI0IDAtNDQtOXQtMzctMjUtMjUtMzYtOS00NVY2MjdxMC0yNCA5LTQ0dDI1LTM3IDM2LTI1IDQ1LTloMzk3VjEyOHEwLTI3IDEwLTUwdDI3LTQwIDQxLTI4IDUwLTEwaDkzM3EyNiAwIDQ5IDl0NDIgMjhsMzQ3IDM0N3ExOCAxOCAyNyA0MXQxMCA1MHptLTM4NC0yNTZ2MTY1aDE2NWwtMTY1LTE2NXpNMzIwIDE0MjRoMTYxcTItOCA5LTQzdDE4LTgzIDIxLTEwMyAyMi0xMDEgMTYtNzYgOC0zMWw3IDMwcTcgMzAgMTcgNzd0MjMgMTAwIDIzIDEwMyAxOSA4NCAxMCA0M2gxNjBsMTQ4LTY3Mkg4MzRsLTgwIDQzOC0xMDAtNDM4SDUwMmwtOTYgNDQwLTg2LTQ0MEgxNzBsMTUwIDY3MnptMzIwIDQ5NmgxMjgwVjUxMmgtMjU2cS0yNyAwLTUwLTEwdC00MC0yNy0yOC00MS0xMC01MFYxMjhINjQwdjM4NGgzOTdxMjQgMCA0NCA5dDM3IDI1IDI1IDM2IDkgNDV2OTIycTAgMjQtOSA0NHQtMjUgMzctMzYgMjUtNDUgOUg2NDB2MjU2em02NDAtMTAyNFY3NjhoNTEydjEyOGgtNTEyem0wIDI1NnYtMTI4aDUxMnYxMjhoLTUxMnptMCAyNTZ2LTEyOGg1MTJ2MTI4aC01MTJ6IiAvPg0KPC9zdmc+";
|
|
12
|
+
export declare const AlertIcon = "data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/PjwhRE9DVFlQRSBzdmcgIFBVQkxJQyAnLS8vVzNDLy9EVEQgU1ZHIDEuMC8vRU4nICAnaHR0cDovL3d3dy53My5vcmcvVFIvMjAwMS9SRUMtU1ZHLTIwMDEwOTA0L0RURC9zdmcxMC5kdGQnPjxzdmcgZW5hYmxlLWJhY2tncm91bmQ9Im5ldyAwIDAgMjQgMjQiIGlkPSJMYXllcl8xIiB2ZXJzaW9uPSIxLjAiIHZpZXdCb3g9IjAgMCAyNCAyNCIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayI+PHBhdGggZD0iTTEzLDE3aC0ydi0yaDJWMTd6IE0xMywxM2gtMlY3aDJWMTN6Ii8+PGc+PHBhdGggZD0iTTEyLDRjNC40LDAsOCwzLjYsOCw4cy0zLjYsOC04LDhzLTgtMy42LTgtOFM3LjYsNCwxMiw0IE0xMiwyQzYuNSwyLDIsNi41LDIsMTJjMCw1LjUsNC41LDEwLDEwLDEwczEwLTQuNSwxMC0xMCAgIEMyMiw2LjUsMTcuNSwyLDEyLDJMMTIsMnoiLz48L2c+PC9zdmc+";
|
|
@@ -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,12 @@ 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",
|
|
48
|
+
SigninCardReceived = "SignInCardReceived",
|
|
49
|
+
BotAuthConfigRequest = "BotAuthConfigRequest",
|
|
50
|
+
BotAuthConfigResponse = "BotAuthConfigResponse"
|
|
46
51
|
}
|
|
47
52
|
export declare enum TelemetryEvent {
|
|
48
53
|
CallAdded = "CallAdded",
|
|
@@ -102,6 +107,7 @@ export declare enum TelemetryEvent {
|
|
|
102
107
|
DownloadTranscriptResponseNullOrUndefined = "DownloadTranscriptResponseNullOrUndefined",
|
|
103
108
|
EmailTranscriptSent = "EmailTranscriptSent",
|
|
104
109
|
EmailTranscriptFailed = "EmailTranscriptFailed",
|
|
110
|
+
ErrorUIPaneLoaded = "ErrorUIPaneLoaded",
|
|
105
111
|
DownloadTranscriptFailed = "DownloadTranscriptFailed",
|
|
106
112
|
StartChatFailed = "StartChatFailed",
|
|
107
113
|
IC3ThreadUpdateEventReceived = "IC3ThreadUpdateEventReceived",
|
|
@@ -131,6 +137,11 @@ export declare enum TelemetryEvent {
|
|
|
131
137
|
CustomerVoiceResponsePageLoaded = "CustomerVoiceResponsePageLoaded",
|
|
132
138
|
CustomerVoiceFormResponseSubmitted = "CustomerVoiceFormResponseSubmitted",
|
|
133
139
|
CustomerVoiceFormResponseError = "CustomerVoiceFormResponseError",
|
|
140
|
+
BotAuthActivityEmptySasUrl = "BotAuthActivityEmptySasUrl",
|
|
141
|
+
SetBotAuthProviderFetchConfig = "SetBotAuthProviderFetchConfig",
|
|
142
|
+
SetBotAuthProviderHideCard = "SetBotAuthProviderHideCard",
|
|
143
|
+
SetBotAuthProviderDisplayCard = "SetBotAuthProviderDisplayCard",
|
|
144
|
+
SetBotAuthProviderNotFound = "SetBotAuthProviderNotFound",
|
|
134
145
|
ProcessingHTMLTextMiddlewareFailed = "ProcessingHTMLTextMiddlewareFailed",
|
|
135
146
|
ProcessingSanitizationMiddlewareFailed = "ProcessingSanitizationMiddlewareFailed",
|
|
136
147
|
FormatTagsMiddlewareJSONStringifyFailed = "FormatTagsMiddlewareJSONStringifyFailed",
|
|
@@ -157,6 +168,8 @@ export declare enum TelemetryEvent {
|
|
|
157
168
|
ReconnectChatMinimize = "ReconnectChatMinimize",
|
|
158
169
|
MessageSent = "MessageSent",
|
|
159
170
|
MessageReceived = "MessageReceived",
|
|
171
|
+
SystemMessageReceived = "SystemMessageReceived",
|
|
172
|
+
HistoryMessageReceived = "HistoryMessageReceived",
|
|
160
173
|
CustomContextReceived = "CustomContextReceived",
|
|
161
174
|
NetworkDisconnected = "NetworkDisconnected",
|
|
162
175
|
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;
|
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
|
+
}
|
|
@@ -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;
|
|
@@ -23,6 +23,7 @@ export interface ILiveChatWidgetContext {
|
|
|
23
23
|
conversationState: ConversationState;
|
|
24
24
|
isMinimized: boolean;
|
|
25
25
|
previousElementIdOnFocusBeforeModalOpen: string | null;
|
|
26
|
+
isStartChatFailing: boolean;
|
|
26
27
|
outsideOperatingHours: boolean;
|
|
27
28
|
preChatResponseEmail: string;
|
|
28
29
|
isAudioMuted: boolean | null;
|