@microsoft/omnichannel-chat-widget 0.1.0-main.170e416 → 0.1.0-main.18d1166
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 +9 -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 +34 -4
- package/lib/cjs/common/telemetry/TelemetryHelper.js +5 -2
- package/lib/cjs/common/telemetry/TelemetryManager.js +3 -1
- package/lib/cjs/common/utils.js +23 -2
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +12 -19
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +1 -1
- package/lib/cjs/components/headerstateful/HeaderStateful.js +7 -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/agentEndConversationHelper.js +36 -0
- 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 +41 -49
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +11 -49
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +6 -9
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +254 -2
- package/lib/cjs/components/livechatwidget/common/startChat.js +76 -53
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +82 -44
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +22 -2
- package/lib/cjs/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +57 -0
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +3 -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/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/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +7 -3
- package/lib/cjs/contexts/common/ConversationEndEntity.js +12 -0
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +32 -28
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +9 -3
- package/lib/cjs/contexts/createReducer.js +36 -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/assets/Icons.js +2 -1
- package/lib/esm/common/Constants.js +9 -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 +34 -4
- package/lib/esm/common/telemetry/TelemetryHelper.js +5 -2
- package/lib/esm/common/telemetry/TelemetryManager.js +3 -1
- package/lib/esm/common/utils.js +20 -0
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +12 -19
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +1 -1
- package/lib/esm/components/headerstateful/HeaderStateful.js +7 -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/agentEndConversationHelper.js +30 -0
- 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 +43 -51
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +13 -51
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +7 -9
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +254 -3
- package/lib/esm/components/livechatwidget/common/startChat.js +76 -53
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +83 -45
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +22 -2
- package/lib/esm/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +50 -0
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +3 -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/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/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +5 -3
- package/lib/esm/contexts/common/ConversationEndEntity.js +5 -0
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +32 -28
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +9 -3
- package/lib/esm/contexts/createReducer.js +36 -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/assets/Icons.d.ts +1 -0
- package/lib/types/common/Constants.d.ts +4 -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 +30 -6
- 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/common/utils.d.ts +1 -0
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +0 -7
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.d.ts +9 -0
- package/lib/types/components/livechatwidget/common/agentEndConversationHelper.d.ts +6 -0
- package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +6 -1
- 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/ConversationEndEntity.d.ts +4 -0
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +6 -1
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +32 -28
- package/lib/types/hooks/useDebounce.d.ts +3 -0
- package/lib/types/hooks/useWindowDimensions.d.ts +4 -0
- package/package.json +3 -3
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ImageFit } from "@fluentui/react";
|
|
2
|
+
import { AlertIcon } from "../../../../assets/Icons";
|
|
3
|
+
export const errorUILoadingPaneStyleProps = {
|
|
4
|
+
generalStyleProps: {
|
|
5
|
+
position: "initial",
|
|
6
|
+
width: "100%",
|
|
7
|
+
height: "100%",
|
|
8
|
+
left: "0%",
|
|
9
|
+
top: "0%",
|
|
10
|
+
borderRadius: "0 0 4px 4px",
|
|
11
|
+
borderWidth: "0px",
|
|
12
|
+
backgroundColor: "#FFFFFF"
|
|
13
|
+
},
|
|
14
|
+
titleStyleProps: {
|
|
15
|
+
fontFamily: "'Segoe UI',Arial,sans-serif",
|
|
16
|
+
fontWeight: "normal",
|
|
17
|
+
fontSize: "18px",
|
|
18
|
+
color: "#36454F",
|
|
19
|
+
textAlign: "center",
|
|
20
|
+
display: "flex",
|
|
21
|
+
order: 2,
|
|
22
|
+
alignSelf: "auto"
|
|
23
|
+
},
|
|
24
|
+
subtitleStyleProps: {
|
|
25
|
+
fontFamily: "'Segoe UI',Arial,sans-serif",
|
|
26
|
+
fontWeight: "normal",
|
|
27
|
+
fontSize: "18px",
|
|
28
|
+
color: "#36454F",
|
|
29
|
+
textAlign: "center",
|
|
30
|
+
display: "flex",
|
|
31
|
+
order: 3,
|
|
32
|
+
alignSelf: "auto"
|
|
33
|
+
},
|
|
34
|
+
iconStyleProps: {
|
|
35
|
+
display: "flex",
|
|
36
|
+
order: 1,
|
|
37
|
+
alignSelf: "auto",
|
|
38
|
+
backgroundColor: "#FFFFFF",
|
|
39
|
+
boxShadow: "#FFFFFF 0px 0px 0px 0px",
|
|
40
|
+
margin: "0px 0px 0px 0px"
|
|
41
|
+
},
|
|
42
|
+
iconImageProps: {
|
|
43
|
+
src: AlertIcon,
|
|
44
|
+
imageFit: ImageFit.center,
|
|
45
|
+
width: "86px",
|
|
46
|
+
height: "86px",
|
|
47
|
+
shouldFadeIn: false,
|
|
48
|
+
shouldStartVisible: true
|
|
49
|
+
}
|
|
50
|
+
};
|
|
@@ -15,7 +15,9 @@ export const PostChatSurveyPaneStateful = props => {
|
|
|
15
15
|
display: state.appStates.isMinimized ? "none" : ""
|
|
16
16
|
});
|
|
17
17
|
let surveyInviteLink = "";
|
|
18
|
-
if (state.domainStates.postChatContext.
|
|
18
|
+
if (state.appStates.shouldUseBotSurvey && state.domainStates.postChatContext.botSurveyInviteLink) {
|
|
19
|
+
surveyInviteLink = state.domainStates.postChatContext.botSurveyInviteLink + "&embed=" + (postChatSurveyMode === PostChatSurveyMode.Embed).toString() + "&compact=" + (props.isCustomerVoiceSurveyCompact ?? true).toString() + "&lang=" + (state.domainStates.postChatContext.formsProLocale ?? "en") + "&showmultilingual=false";
|
|
20
|
+
} else {
|
|
19
21
|
surveyInviteLink = state.domainStates.postChatContext.surveyInviteLink + "&embed=" + (postChatSurveyMode === PostChatSurveyMode.Embed).toString() + "&compact=" + (props.isCustomerVoiceSurveyCompact ?? true).toString() + "&lang=" + (state.domainStates.postChatContext.formsProLocale ?? "en") + "&showmultilingual=false";
|
|
20
22
|
}
|
|
21
23
|
const styleProps = {
|
|
@@ -112,7 +112,7 @@ export const PreChatSurveyPaneStateful = props => {
|
|
|
112
112
|
}
|
|
113
113
|
if (current && current.tagName.toLowerCase() == HtmlAttributeNames.div && current.childElementCount > 0) {
|
|
114
114
|
const input = current.children[0].children;
|
|
115
|
-
if (input
|
|
115
|
+
if ((input === null || input === void 0 ? void 0 : input.length) > 0 && input[0].className != HtmlAttributeNames.adaptiveCardToggleInputClassName && input[0].className != HtmlAttributeNames.adaptiveCardActionSetClassName) {
|
|
116
116
|
input[0].setAttribute(HtmlAttributeNames.ariaLabel, value);
|
|
117
117
|
}
|
|
118
118
|
}
|
|
@@ -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
|
};
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
/******
|
|
2
2
|
* TypingIndicatorMiddleware
|
|
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
|
|
|
7
|
-
import React from "react";
|
|
7
|
+
import React, { useCallback } from "react";
|
|
8
8
|
import { DirectLineSenderRole } from "../../enums/DirectLineSenderRole";
|
|
9
9
|
import { defaultMiddlewareLocalizedTexts } from "../../../common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
10
10
|
import { defaultTypingIndicatorBubbleStyles } from "./defaultStyles/defaultTypingIndicatorBubbleStyles";
|
|
11
11
|
import { defaultTypingIndicatorContainerStyles } from "./defaultStyles/defaultTypingIndicatorContainerStyles";
|
|
12
12
|
import { defaultTypingIndicatorMessageStyles } from "./defaultStyles/defaultTypingIndicatorMessageStyles";
|
|
13
13
|
import { useChatContextStore } from "../../../../..";
|
|
14
|
+
import { debounceLeading } from "../../../../../common/utils";
|
|
14
15
|
import useChatSDKStore from "../../../../../hooks/useChatSDKStore";
|
|
15
16
|
|
|
16
17
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -23,6 +24,7 @@ const TypingIndicator = _ref => {
|
|
|
23
24
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
24
25
|
const chatSDK = useChatSDKStore();
|
|
25
26
|
const [state] = useChatContextStore();
|
|
27
|
+
const debounceTyping = useCallback(debounceLeading(() => chatSDK === null || chatSDK === void 0 ? void 0 : chatSDK.sendTypingEvent()), []);
|
|
26
28
|
if (!activeTyping || Object.keys(activeTyping).length === 0 || ((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : _state$domainStates$l.LiveChatVersion) === 1 && !visible) {
|
|
27
29
|
return null;
|
|
28
30
|
}
|
|
@@ -32,7 +34,7 @@ const TypingIndicator = _ref => {
|
|
|
32
34
|
var _state$domainStates$l2;
|
|
33
35
|
//visible is set to false if the current user is typing, in which case, we just send typing indicator to OC
|
|
34
36
|
if (((_state$domainStates$l2 = state.domainStates.liveChatConfig) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.LiveChatVersion) === 2 && !visible) {
|
|
35
|
-
|
|
37
|
+
debounceTyping();
|
|
36
38
|
return null;
|
|
37
39
|
}
|
|
38
40
|
activeTyping.splice(i, 1);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export let ConversationEndEntity;
|
|
2
|
+
(function (ConversationEndEntity) {
|
|
3
|
+
ConversationEndEntity[ConversationEndEntity["Customer"] = 0] = "Customer";
|
|
4
|
+
ConversationEndEntity[ConversationEndEntity["Agent"] = 1] = "Agent";
|
|
5
|
+
})(ConversationEndEntity || (ConversationEndEntity = {}));
|
|
@@ -7,32 +7,36 @@ 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_EVENT_RECEIVED"] = 29] = "SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED";
|
|
33
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY"] = 30] = "SET_CONVERSATION_ENDED_BY";
|
|
34
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 31] = "SET_WIDGET_STATE";
|
|
35
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 32] = "SET_LIVE_CHAT_CONTEXT";
|
|
36
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_OAUTH_SIGNIN_ID"] = 33] = "SET_BOT_OAUTH_SIGNIN_ID";
|
|
37
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_SIZE"] = 34] = "SET_WIDGET_SIZE";
|
|
38
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_INSTANCE_ID"] = 35] = "SET_WIDGET_INSTANCE_ID";
|
|
39
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONFIG"] = 36] = "SET_LIVE_CHAT_CONFIG";
|
|
40
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_WORKFLOW_IN_PROGRESS"] = 37] = "SET_POST_CHAT_WORKFLOW_IN_PROGRESS";
|
|
41
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOULD_USE_BOT_SURVEY"] = 38] = "SET_SHOULD_USE_BOT_SURVEY";
|
|
38
42
|
})(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,
|
|
@@ -42,7 +45,10 @@ export const getLiveChatWidgetContextInitialState = props => {
|
|
|
42
45
|
},
|
|
43
46
|
e2vvEnabled: false,
|
|
44
47
|
unreadMessageCount: 0,
|
|
45
|
-
|
|
48
|
+
conversationEndedByAgentEventReceived: false,
|
|
49
|
+
conversationEndedBy: undefined,
|
|
50
|
+
postChatWorkflowInProgress: false,
|
|
51
|
+
shouldUseBotSurvey: false
|
|
46
52
|
},
|
|
47
53
|
uiStates: {
|
|
48
54
|
showConfirmationPane: false,
|
|
@@ -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,
|
|
@@ -250,12 +258,20 @@ export const createReducer = () => {
|
|
|
250
258
|
return {
|
|
251
259
|
...action.payload
|
|
252
260
|
};
|
|
253
|
-
case LiveChatWidgetActionType.
|
|
261
|
+
case LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED:
|
|
254
262
|
return {
|
|
255
263
|
...state,
|
|
256
264
|
appStates: {
|
|
257
265
|
...state.appStates,
|
|
258
|
-
|
|
266
|
+
conversationEndedByAgentEventReceived: action.payload
|
|
267
|
+
}
|
|
268
|
+
};
|
|
269
|
+
case LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY:
|
|
270
|
+
return {
|
|
271
|
+
...state,
|
|
272
|
+
appStates: {
|
|
273
|
+
...state.appStates,
|
|
274
|
+
conversationEndedBy: action.payload
|
|
259
275
|
}
|
|
260
276
|
};
|
|
261
277
|
case LiveChatWidgetActionType.SET_WIDGET_SIZE:
|
|
@@ -285,6 +301,24 @@ export const createReducer = () => {
|
|
|
285
301
|
liveChatConfig: action.payload
|
|
286
302
|
}
|
|
287
303
|
};
|
|
304
|
+
case LiveChatWidgetActionType.SET_POST_CHAT_WORKFLOW_IN_PROGRESS:
|
|
305
|
+
return {
|
|
306
|
+
...state,
|
|
307
|
+
appStates: {
|
|
308
|
+
...state.appStates,
|
|
309
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
310
|
+
postChatWorkflowInProgress: action.payload
|
|
311
|
+
}
|
|
312
|
+
};
|
|
313
|
+
case LiveChatWidgetActionType.SET_SHOULD_USE_BOT_SURVEY:
|
|
314
|
+
return {
|
|
315
|
+
...state,
|
|
316
|
+
appStates: {
|
|
317
|
+
...state.appStates,
|
|
318
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
319
|
+
shouldUseBotSurvey: action.payload
|
|
320
|
+
}
|
|
321
|
+
};
|
|
288
322
|
default:
|
|
289
323
|
return state;
|
|
290
324
|
}
|
|
@@ -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+";
|
|
@@ -17,6 +17,8 @@ export declare class Constants {
|
|
|
17
17
|
static readonly true = "true";
|
|
18
18
|
static readonly false = "false";
|
|
19
19
|
static readonly maximumUnreadMessageCount = 99;
|
|
20
|
+
static readonly userParticipantTypeTag = "User";
|
|
21
|
+
static readonly botParticipantTypeTag = "Bot";
|
|
20
22
|
static readonly channelIdKey = "ChannelId-";
|
|
21
23
|
static readonly ChannelId = "lcw";
|
|
22
24
|
static readonly CustomerTag = "FromCustomer";
|
|
@@ -78,6 +80,7 @@ export declare class Constants {
|
|
|
78
80
|
static readonly ChatWidgetStateChangedPrefix = "ChatWidgetStateChanged";
|
|
79
81
|
static readonly PostChatLoadingDurationInMs = 2000;
|
|
80
82
|
static readonly BrowserUnloadConfirmationMessage = "Do you want to leave chat?";
|
|
83
|
+
static readonly CacheTtlInMinutes = 15;
|
|
81
84
|
}
|
|
82
85
|
export declare const Regex: {
|
|
83
86
|
new (): {};
|
|
@@ -125,6 +128,7 @@ export declare class HtmlAttributeNames {
|
|
|
125
128
|
static readonly adaptiveCardClassName = "ac-adaptiveCard";
|
|
126
129
|
static readonly adaptiveCardTextBlockClassName = "ac-textBlock";
|
|
127
130
|
static readonly adaptiveCardToggleInputClassName = "ac-toggleInput";
|
|
131
|
+
static readonly adaptiveCardActionSetClassName = "ac-actionSet";
|
|
128
132
|
}
|
|
129
133
|
export declare class WebChatMiddlewareConstants {
|
|
130
134
|
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;
|