@microsoft/omnichannel-chat-widget 1.8.3 → 1.8.4-main.7bdb634
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/common/Constants.js +4 -0
- package/lib/cjs/common/facades/FacadeChatSDK.js +6 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +31 -0
- package/lib/cjs/common/utils/SecureEventBus.js +307 -0
- package/lib/cjs/common/utils/dispatchCustomEvent.js +25 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +127 -0
- package/lib/cjs/components/livechatwidget/common/ChatWidgetEvents.js +15 -0
- package/lib/cjs/components/livechatwidget/common/PersistentConversationHandler.js +284 -0
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -0
- package/lib/cjs/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +18 -0
- package/lib/cjs/components/livechatwidget/common/endChat.js +7 -1
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +7 -5
- package/lib/cjs/components/livechatwidget/interfaces/IPersistentChatHistoryProps.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +31 -5
- package/lib/cjs/components/webchatcontainerstateful/common/activities/botActivity.js +14 -0
- package/lib/cjs/components/webchatcontainerstateful/common/activities/conversationDividerActivity.js +17 -0
- package/lib/cjs/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +97 -0
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +59 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +122 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.js +10 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +18 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +1038 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +34 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +44 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +16 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.js +20 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +2 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +59 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +4 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -2
- package/lib/esm/common/Constants.js +4 -0
- package/lib/esm/common/facades/FacadeChatSDK.js +6 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +31 -0
- package/lib/esm/common/utils/SecureEventBus.js +328 -0
- package/lib/esm/common/utils/dispatchCustomEvent.js +18 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +120 -0
- package/lib/esm/components/livechatwidget/common/ChatWidgetEvents.js +8 -0
- package/lib/esm/components/livechatwidget/common/PersistentConversationHandler.js +277 -0
- package/lib/esm/components/livechatwidget/common/createAdapter.js +2 -0
- package/lib/esm/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +11 -0
- package/lib/esm/components/livechatwidget/common/endChat.js +7 -1
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +7 -5
- package/lib/esm/components/livechatwidget/interfaces/IPersistentChatHistoryProps.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +34 -5
- package/lib/esm/components/webchatcontainerstateful/common/activities/botActivity.js +7 -0
- package/lib/esm/components/webchatcontainerstateful/common/activities/conversationDividerActivity.js +9 -0
- package/lib/esm/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +90 -0
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -2
- package/lib/esm/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +51 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +115 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.js +3 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +10 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +1060 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +25 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +42 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +13 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.js +13 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +52 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +2 -2
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +1 -1
- package/lib/types/common/Constants.d.ts +3 -0
- package/lib/types/common/facades/FacadeChatSDK.d.ts +3 -1
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +30 -2
- package/lib/types/common/utils/SecureEventBus.d.ts +159 -0
- package/lib/types/common/utils/dispatchCustomEvent.d.ts +2 -0
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.d.ts +45 -0
- package/lib/types/components/livechatwidget/common/ChatWidgetEvents.d.ts +7 -0
- package/lib/types/components/livechatwidget/common/PersistentConversationHandler.d.ts +28 -0
- package/lib/types/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.d.ts +2 -0
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -0
- package/lib/types/components/livechatwidget/interfaces/IPersistentChatHistoryProps.d.ts +7 -0
- package/lib/types/components/webchatcontainerstateful/common/activities/botActivity.d.ts +7 -0
- package/lib/types/components/webchatcontainerstateful/common/activities/conversationDividerActivity.d.ts +10 -0
- package/lib/types/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/hooks/usePersistentChatHistory.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.d.ts +7 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.d.ts +3 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.d.ts +326 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.d.ts +8 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.d.ts +2 -0
- package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React, { useMemo } from "react";
|
|
2
|
+
import { defaultInlineBannerStyle } from "../defaultStyles/defaultInLineBannerStyle";
|
|
3
|
+
import { defaultMiddlewareLocalizedTexts } from "../../../../common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
4
|
+
import { mergeStyles } from "@fluentui/merge-styles";
|
|
5
|
+
const LoadInlineBannerActivity = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
webChatContainerProps,
|
|
8
|
+
persistentChatHistory,
|
|
9
|
+
id
|
|
10
|
+
} = _ref;
|
|
11
|
+
const localizedTexts = useMemo(() => ({
|
|
12
|
+
...defaultMiddlewareLocalizedTexts,
|
|
13
|
+
...(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.localizedTexts)
|
|
14
|
+
}), [webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.localizedTexts]);
|
|
15
|
+
const bannerStyle = mergeStyles(persistentChatHistory === null || persistentChatHistory === void 0 ? void 0 : persistentChatHistory.bannerStyle, defaultInlineBannerStyle);
|
|
16
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
17
|
+
id: id,
|
|
18
|
+
className: bannerStyle,
|
|
19
|
+
role: "status",
|
|
20
|
+
"aria-live": "polite",
|
|
21
|
+
"aria-label": localizedTexts.PREVIOUS_MESSAGES_LOADING,
|
|
22
|
+
"aria-busy": "true"
|
|
23
|
+
}, localizedTexts.PREVIOUS_MESSAGES_LOADING));
|
|
24
|
+
};
|
|
25
|
+
export default LoadInlineBannerActivity;
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
/* eslint-disable react/display-name */
|
|
1
3
|
/******
|
|
2
4
|
* ActivityMiddleware
|
|
3
5
|
*
|
|
@@ -7,8 +9,10 @@
|
|
|
7
9
|
* 3. Decodes certain html characters that came through from chat services
|
|
8
10
|
******/
|
|
9
11
|
|
|
12
|
+
import LazyLoadActivity, { LazyLoadHandler } from "./activities/LazyLoadActivity";
|
|
10
13
|
import { LogLevel, TelemetryEvent } from "../../../../../common/telemetry/TelemetryConstants";
|
|
11
14
|
import { Constants } from "../../../../../common/Constants";
|
|
15
|
+
import ConversationDividerActivity from "./activities/ConversationDividerActivity";
|
|
12
16
|
import { DirectLineActivityType } from "../../enums/DirectLineActivityType";
|
|
13
17
|
import { DirectLineSenderRole } from "../../enums/DirectLineSenderRole";
|
|
14
18
|
import React from "react";
|
|
@@ -17,6 +21,7 @@ import { defaultSystemMessageStyles } from "./defaultStyles/defaultSystemMessage
|
|
|
17
21
|
import { defaultUserMessageStyles } from "./defaultStyles/defaultUserMessageStyles";
|
|
18
22
|
import { escapeHtml } from "../../../../../common/utils";
|
|
19
23
|
const loggedSystemMessages = new Array();
|
|
24
|
+
let lastRenderedAt = 0; // Track last rendered receivedAt timestamp for deduplication
|
|
20
25
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
21
26
|
const handleSystemMessage = (next, args, card, renderMarkdown, systemMessageStyleProps) => {
|
|
22
27
|
var _card$activity, _card$activity$channe, _card$activity$channe2, _card$activity2, _card$activity2$chann, _card$activity3, _card$activity3$chann, _card$activity3$chann2, _card$activity4, _card$activity4$chann, _card$activity5, _card$activity5$chann, _card$nextVisibleActi, _card$nextVisibleActi2, _card$activity6, _card$activity6$chann, _card$activity7, _card$nextVisibleActi3, _card$activity8;
|
|
@@ -81,6 +86,43 @@ export const createActivityMiddleware = (renderMarkdown, systemMessageStyleProps
|
|
|
81
86
|
if (isTagIncluded(card, Constants.systemMessageTag)) {
|
|
82
87
|
return handleSystemMessage(next, args, card, renderMarkdown, systemMessageStyleProps);
|
|
83
88
|
}
|
|
89
|
+
if (isTagIncluded(card, Constants.persistentChatHistoryMessagePullTriggerTag)) {
|
|
90
|
+
var _card$activity9, _card$activity9$chann, _card$activity9$chann2;
|
|
91
|
+
// Safety check: if this is a new chat session and flag is false, auto-correct it
|
|
92
|
+
if (!LazyLoadHandler.hasMoreHistoryAvailable) {
|
|
93
|
+
LazyLoadHandler.setHasMoreHistoryAvailable(true);
|
|
94
|
+
}
|
|
95
|
+
const receivedAt = card === null || card === void 0 ? void 0 : (_card$activity9 = card.activity) === null || _card$activity9 === void 0 ? void 0 : (_card$activity9$chann = _card$activity9.channelData) === null || _card$activity9$chann === void 0 ? void 0 : (_card$activity9$chann2 = _card$activity9$chann.webChat) === null || _card$activity9$chann2 === void 0 ? void 0 : _card$activity9$chann2.receivedAt;
|
|
96
|
+
if (receivedAt < lastRenderedAt) {
|
|
97
|
+
card.activity = null;
|
|
98
|
+
return () => false;
|
|
99
|
+
}
|
|
100
|
+
lastRenderedAt = receivedAt;
|
|
101
|
+
|
|
102
|
+
// Return a function that checks availability at render time
|
|
103
|
+
return () => {
|
|
104
|
+
// Double-check at render time in case history availability changed
|
|
105
|
+
if (!LazyLoadHandler.hasMoreHistoryAvailable) {
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
return /*#__PURE__*/React.createElement(LazyLoadActivity, null);
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
if (isTagIncluded(card, Constants.persistentChatHistoryMessageTag)) {
|
|
112
|
+
const userMessageStyles = {
|
|
113
|
+
...defaultUserMessageStyles,
|
|
114
|
+
...userMessageStyleProps
|
|
115
|
+
};
|
|
116
|
+
return function () {
|
|
117
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
118
|
+
className: card.activity.from.role === DirectLineSenderRole.User ? Constants.sentMessageClassName : Constants.receivedMessageClassName,
|
|
119
|
+
style: userMessageStyles
|
|
120
|
+
}, next(...args)(...arguments));
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
if (isTagIncluded(card, Constants.conversationDividerTag)) {
|
|
124
|
+
return /*#__PURE__*/React.createElement(ConversationDividerActivity, null);
|
|
125
|
+
}
|
|
84
126
|
if (card.activity.text && card.activity.type === DirectLineActivityType.Message) {
|
|
85
127
|
if (!card.activity.channelData.isHtmlEncoded && card.activity.channelId === Constants.webchatChannelId) {
|
|
86
128
|
card.activity.text = escapeHtml(card.activity.text);
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Constants, WebChatMiddlewareConstants } from "../../../../../common/Constants";
|
|
2
2
|
import { DeliveredTimestamp } from "./timestamps/DeliveredTimestamp";
|
|
3
|
+
import { HistoryMessageTimestamp } from "./timestamps/HistoryMessageTimestamp";
|
|
3
4
|
import { NotDeliveredTimestamp } from "./timestamps/NotDeliveredTimestamp";
|
|
4
5
|
import React from "react";
|
|
5
6
|
import { SendStatus } from "../../enums/SendStatus";
|
|
@@ -26,6 +27,11 @@ export const activityStatusMiddleware = () => next => args => {
|
|
|
26
27
|
current_role = role,
|
|
27
28
|
current_timestamp = timestamp;
|
|
28
29
|
let sameTimestampGroupTemp = sameTimestampGroup;
|
|
30
|
+
if (tags !== null && tags !== void 0 && tags.includes(Constants.persistentChatHistoryMessageTag)) {
|
|
31
|
+
return /*#__PURE__*/React.createElement(HistoryMessageTimestamp, {
|
|
32
|
+
args: args
|
|
33
|
+
});
|
|
34
|
+
}
|
|
29
35
|
if (args[WebChatMiddlewareConstants.nextVisibleActivity]) {
|
|
30
36
|
const {
|
|
31
37
|
nextVisibleActivity: {
|
|
@@ -35,6 +41,7 @@ export const activityStatusMiddleware = () => next => args => {
|
|
|
35
41
|
timestamp
|
|
36
42
|
}
|
|
37
43
|
} = args;
|
|
44
|
+
|
|
38
45
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
39
46
|
const next_name = name,
|
|
40
47
|
next_timestamp = timestamp;
|
|
@@ -61,4 +68,10 @@ export const activityStatusMiddleware = () => next => args => {
|
|
|
61
68
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
62
69
|
;
|
|
63
70
|
}
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
74
|
+
export const createActivityStatusMiddleware = function () {
|
|
75
|
+
let locale = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : "en-us";
|
|
76
|
+
return activityStatusMiddleware;
|
|
64
77
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defaultSystemMessageStyles } from "./defaultSystemMessageStyles";
|
|
2
|
+
// Adjust the import path if necessary
|
|
3
|
+
|
|
4
|
+
export const defaultInlineBannerStyle = {
|
|
5
|
+
...defaultSystemMessageStyles,
|
|
6
|
+
visibility: "visible",
|
|
7
|
+
height: "20px",
|
|
8
|
+
display: "flex",
|
|
9
|
+
justifyContent: "center",
|
|
10
|
+
alignItems: "center",
|
|
11
|
+
margin: "5px 10px",
|
|
12
|
+
cursor: "pointer"
|
|
13
|
+
};
|
|
@@ -4,7 +4,7 @@ import { Stack } from "@fluentui/react";
|
|
|
4
4
|
import { defaultMiddlewareLocalizedTexts } from "../../../../common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
5
5
|
import { defaultTimestampContentStyles } from "../defaultStyles/defaultTimestampContentStyles";
|
|
6
6
|
import { getTimestampHourMinute } from "../../../../../../common/utils";
|
|
7
|
-
import
|
|
7
|
+
import useChatContextStore from "../../../../../../hooks/useChatContextStore";
|
|
8
8
|
|
|
9
9
|
/* eslint @typescript-eslint/no-explicit-any: "off" */
|
|
10
10
|
export const DeliveredTimestamp = _ref => {
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { Stack } from "@fluentui/react";
|
|
3
|
+
import { defaultMiddlewareLocalizedTexts } from "../../../../common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
4
|
+
import { defaultTimestampContentStyles } from "../defaultStyles/defaultTimestampContentStyles";
|
|
5
|
+
import { getTimestampHourMinute } from "../../../../../../common/utils";
|
|
6
|
+
import useChatContextStore from "../../../../../../hooks/useChatContextStore";
|
|
7
|
+
|
|
8
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
|
+
export const HistoryMessageTimestamp = _ref => {
|
|
10
|
+
var _state$domainStates$r, _state$domainStates$r2, _state$domainStates$m;
|
|
11
|
+
let {
|
|
12
|
+
args
|
|
13
|
+
} = _ref;
|
|
14
|
+
const [state] = useChatContextStore();
|
|
15
|
+
const dir = ((_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.timestampDir) ?? state.domainStates.globalDir;
|
|
16
|
+
const {
|
|
17
|
+
activity: {
|
|
18
|
+
timestamp,
|
|
19
|
+
from: {
|
|
20
|
+
name,
|
|
21
|
+
role
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
} = args;
|
|
25
|
+
const contentStyles = {
|
|
26
|
+
...defaultTimestampContentStyles,
|
|
27
|
+
...((_state$domainStates$r2 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.timestampContentStyleProps)
|
|
28
|
+
};
|
|
29
|
+
const getTimeElement = timestamp => {
|
|
30
|
+
const timeString = getTimestampHourMinute(timestamp);
|
|
31
|
+
const isAmPmFormat = timeString.toLowerCase().includes("am") || timeString.toLowerCase().includes("pm");
|
|
32
|
+
if (dir === "rtl" && isAmPmFormat) {
|
|
33
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
34
|
+
dir: "ltr"
|
|
35
|
+
}, timeString);
|
|
36
|
+
} else {
|
|
37
|
+
return /*#__PURE__*/React.createElement("span", {
|
|
38
|
+
dir: dir
|
|
39
|
+
}, timeString);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
return /*#__PURE__*/React.createElement(Stack, {
|
|
43
|
+
style: contentStyles,
|
|
44
|
+
dir: dir
|
|
45
|
+
}, role === "bot" && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
46
|
+
dir: dir,
|
|
47
|
+
"aria-hidden": "false"
|
|
48
|
+
}, name, " : ", getTimeElement(timestamp))), role === "user" && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("span", {
|
|
49
|
+
"aria-hidden": "false",
|
|
50
|
+
dir: dir
|
|
51
|
+
}, " ", getTimeElement(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), " "));
|
|
52
|
+
};
|
|
@@ -7,9 +7,9 @@ import { defaultTimestampFailedStyles } from "../defaultStyles/defaultTimestampF
|
|
|
7
7
|
import { defaultTimestampRetryStyles } from "../defaultStyles/defaultTimestampRetryStyles";
|
|
8
8
|
import { getTimestampHourMinute } from "../../../../../../common/utils";
|
|
9
9
|
import { hooks } from "botframework-webchat";
|
|
10
|
-
import
|
|
10
|
+
import useChatContextStore from "../../../../../../hooks/useChatContextStore";
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
13
13
|
export const NotDeliveredTimestamp = _ref => {
|
|
14
14
|
var _state$domainStates$r, _state$domainStates$r2, _state$domainStates$r3, _state$domainStates$r4, _state$domainStates$m, _state$domainStates$m2;
|
|
15
15
|
let {
|
|
@@ -2,7 +2,7 @@ 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
|
|
5
|
+
import useChatContextStore from "../../../../../../hooks/useChatContextStore";
|
|
6
6
|
|
|
7
7
|
/* eslint @typescript-eslint/no-explicit-any: "off" */
|
|
8
8
|
export const SendingTimestamp = () => {
|
|
@@ -28,6 +28,9 @@ export declare class Constants {
|
|
|
28
28
|
static readonly channelIdKey = "ChannelId-";
|
|
29
29
|
static readonly ChannelId = "lcw";
|
|
30
30
|
static readonly CustomerTag = "FromCustomer";
|
|
31
|
+
static persistentChatHistoryMessageTag: string;
|
|
32
|
+
static persistentChatHistoryMessagePullTriggerTag: string;
|
|
33
|
+
static conversationDividerTag: string;
|
|
31
34
|
static readonly GifContentType = "image/gif";
|
|
32
35
|
static readonly video = "video";
|
|
33
36
|
static readonly audio = "audio";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChatAdapter, ChatSDKMessage, GetAgentAvailabilityResponse, GetLiveChatTranscriptResponse, GetVoiceVideoCallingResponse, IFileInfo, IRawMessage, MaskingRules, OmnichannelChatSDK, VoiceVideoCallingOptionalParams } from "@microsoft/omnichannel-chat-sdk";
|
|
1
|
+
import { ChatAdapter, ChatSDKMessage, GetAgentAvailabilityResponse, GetLiveChatTranscriptResponse, GetPersistentChatHistoryResponse, GetVoiceVideoCallingResponse, IFileInfo, IRawMessage, MaskingRules, OmnichannelChatSDK, VoiceVideoCallingOptionalParams } from "@microsoft/omnichannel-chat-sdk";
|
|
2
2
|
import { IFacadeChatSDKInput } from "./types/IFacadeChatSDKInput";
|
|
3
3
|
import ChatAdapterOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/messaging/ChatAdapterOptionalParams";
|
|
4
4
|
import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
|
|
@@ -13,6 +13,7 @@ import GetChatTokenOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core
|
|
|
13
13
|
import GetConversationDetailsOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetConversationDetailsOptionalParams";
|
|
14
14
|
import GetLiveChatConfigOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetLiveChatConfigOptionalParams";
|
|
15
15
|
import GetLiveChatTranscriptOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetLiveChatTranscriptOptionalParams";
|
|
16
|
+
import GetPersistentChatHistoryOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/GetPersistentChatHistoryOptionalParams";
|
|
16
17
|
import IChatToken from "@microsoft/omnichannel-chat-sdk/lib/external/IC3Adapter/IChatToken";
|
|
17
18
|
import IFileMetadata from "@microsoft/omnichannel-ic3core/lib/model/IFileMetadata";
|
|
18
19
|
import IMessage from "@microsoft/omnichannel-ic3core/lib/model/IMessage";
|
|
@@ -73,4 +74,5 @@ export declare class FacadeChatSDK {
|
|
|
73
74
|
getPostChatSurveyContext(): Promise<PostChatContext>;
|
|
74
75
|
getAgentAvailability(optionalParams?: GetAgentAvailabilityOptionalParams): Promise<GetAgentAvailabilityResponse>;
|
|
75
76
|
getReconnectableChats(reconnectableChatsParams?: any): Promise<any>;
|
|
77
|
+
fetchPersistentConversationHistory(getPersistentChatHistoryOptionalParams?: GetPersistentChatHistoryOptionalParams): Promise<GetPersistentChatHistoryResponse>;
|
|
76
78
|
}
|
|
@@ -56,9 +56,11 @@ export declare enum BroadcastEvent {
|
|
|
56
56
|
SyncMinimize = "SyncMinimize",
|
|
57
57
|
OnWidgetError = "OnWidgetError",
|
|
58
58
|
FMLTrackingCompletedAck = "FMLTrackingCompletedAck",
|
|
59
|
-
FMLTrackingCompleted = "FMLTrackingCompleted"
|
|
59
|
+
FMLTrackingCompleted = "FMLTrackingCompleted",
|
|
60
|
+
PersistentConversationReset = "PersistentConversationReset"
|
|
60
61
|
}
|
|
61
62
|
export declare enum TelemetryEvent {
|
|
63
|
+
FetchPersistentChatHistoryFailed = "FetchPersistentChatHistoryFailed",
|
|
62
64
|
CallAdded = "CallAdded",
|
|
63
65
|
LocalVideoStreamAdded = "LocalVideoStreamAdded",
|
|
64
66
|
LocalVideoStreamRemoved = "LocalVideoStreamRemoved",
|
|
@@ -269,7 +271,33 @@ export declare enum TelemetryEvent {
|
|
|
269
271
|
UXLiveChatWidgetStart = "UXLiveChatWidgetStart",
|
|
270
272
|
UXLiveChatWidgetCompleted = "UXLiveChatWidgetCompleted",
|
|
271
273
|
AppInsightsInitialized = "AppInsightsInitialized",
|
|
272
|
-
AppInsightsInitFailed = "AppInsightsInitFailed"
|
|
274
|
+
AppInsightsInitFailed = "AppInsightsInitFailed",
|
|
275
|
+
ConvertPersistentChatHistoryMessageToActivityFailed = "ConvertPersistentChatHistoryMessageToActivityFailed",
|
|
276
|
+
UXLCWPersistentChatHistoryInitialized = "UXLCWPersistentChatHistoryInitialized",
|
|
277
|
+
LCWPersistentChatHistoryFetchStarted = "LCWPersistentChatHistoryFetchStarted",
|
|
278
|
+
LCWPersistentChatHistoryFetchCompleted = "LCWPersistentChatHistoryFetchCompleted",
|
|
279
|
+
LCWPersistentChatHistoryFetchFailed = "LCWPersistentChatHistoryFetchFailed",
|
|
280
|
+
LCWWebChatStorePollingStarted = "LCWWebChatStorePollingStarted",
|
|
281
|
+
LCWWebChatStoreReady = "LCWWebChatStoreReady",
|
|
282
|
+
LCWWebChatConnected = "LCWWebChatConnected",
|
|
283
|
+
LCWWebChatDisconnected = "LCWWebChatDisconnected",
|
|
284
|
+
LCWWebChatConnectionCheckFailed = "LCWWebChatConnectionCheckFailed",
|
|
285
|
+
LCWPersistentConversationHandlerInitialized = "LCWPersistentConversationHandlerInitialized",
|
|
286
|
+
LCWPersistentHistoryPullBlocked = "LCWPersistentHistoryPullBlocked",
|
|
287
|
+
LCWPersistentHistoryPullCompleted = "LCWPersistentHistoryPullCompleted",
|
|
288
|
+
LCWLazyLoadInitializationStarted = "LCWLazyLoadInitializationStarted",
|
|
289
|
+
LCWLazyLoadContainerNotFound = "LCWLazyLoadContainerNotFound",
|
|
290
|
+
LCWLazyLoadInitializationCompleted = "LCWLazyLoadInitializationCompleted",
|
|
291
|
+
LCWLazyLoadSessionMetrics = "LCWLazyLoadSessionMetrics",
|
|
292
|
+
LCWLazyLoadTargetElementNotFound = "LCWLazyLoadTargetElementNotFound",
|
|
293
|
+
LCWLazyLoadScrollFailed = "LCWLazyLoadScrollFailed",
|
|
294
|
+
LCWLazyLoadActivityMounted = "LCWLazyLoadActivityMounted",
|
|
295
|
+
LCWLazyLoadReset = "LCWLazyLoadReset",
|
|
296
|
+
LCWLazyLoadNoMoreHistory = "LCWLazyLoadNoMoreHistory",
|
|
297
|
+
LCWLazyLoadDestroyed = "LCWLazyLoadDestroyed",
|
|
298
|
+
SecureEventBusUnauthorizedDispatch = "SecureEventBusUnauthorizedDispatch",
|
|
299
|
+
SecureEventBusListenerError = "SecureEventBusListenerError",
|
|
300
|
+
SecureEventBusDispatchError = "SecureEventBusDispatchError"
|
|
273
301
|
}
|
|
274
302
|
export interface TelemetryInput {
|
|
275
303
|
scenarioType: ScenarioType;
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SecureEventBus class implementing the singleton pattern for secure event communication.
|
|
3
|
+
* Provides authentication-based event dispatching to prevent unauthorized external access.
|
|
4
|
+
*/
|
|
5
|
+
declare class SecureEventBus {
|
|
6
|
+
private static instance;
|
|
7
|
+
private listeners;
|
|
8
|
+
private readonly authToken;
|
|
9
|
+
private eventCounter;
|
|
10
|
+
/**
|
|
11
|
+
* Private constructor to enforce singleton pattern.
|
|
12
|
+
* Generates a unique authentication token for this session.
|
|
13
|
+
*/
|
|
14
|
+
private constructor();
|
|
15
|
+
/**
|
|
16
|
+
* Get the singleton instance of SecureEventBus.
|
|
17
|
+
* Creates a new instance if one doesn't exist.
|
|
18
|
+
*
|
|
19
|
+
* @returns The singleton instance of SecureEventBus
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const eventBus = SecureEventBus.getInstance();
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
static getInstance(): SecureEventBus;
|
|
27
|
+
/**
|
|
28
|
+
* Generate a cryptographically secure authentication token.
|
|
29
|
+
* Uses crypto.getRandomValues when available, falls back to Math.random.
|
|
30
|
+
*
|
|
31
|
+
* @private
|
|
32
|
+
* @returns A 64-character hexadecimal string representing the authentication token
|
|
33
|
+
*/
|
|
34
|
+
private generateAuthToken;
|
|
35
|
+
/**
|
|
36
|
+
* Get the authentication token for this SecureEventBus instance.
|
|
37
|
+
* This token is required for dispatching events and should only be used internally.
|
|
38
|
+
*
|
|
39
|
+
* @returns The authentication token string
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```typescript
|
|
43
|
+
* const eventBus = SecureEventBus.getInstance();
|
|
44
|
+
* const token = eventBus.getAuthToken();
|
|
45
|
+
* eventBus.dispatch('myEvent', { data: 'value' }, token);
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
48
|
+
getAuthToken(): string;
|
|
49
|
+
/**
|
|
50
|
+
* Dispatch an event with authentication to all registered listeners.
|
|
51
|
+
* Verifies the authentication token before dispatching to prevent unauthorized access.
|
|
52
|
+
*
|
|
53
|
+
* @param eventName - The name of the event to dispatch
|
|
54
|
+
* @param payload - The data to send with the event (optional)
|
|
55
|
+
* @param token - Authentication token (must match the internal token)
|
|
56
|
+
* @returns true if event was successfully dispatched, false if unauthorized or error occurred
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* const eventBus = SecureEventBus.getInstance();
|
|
61
|
+
* const token = eventBus.getAuthToken();
|
|
62
|
+
*
|
|
63
|
+
* // Dispatch with payload
|
|
64
|
+
* const success = eventBus.dispatch('userAction', { action: 'click', target: 'button' }, token);
|
|
65
|
+
*
|
|
66
|
+
* // Dispatch without payload
|
|
67
|
+
* eventBus.dispatch('windowClosed', undefined, token);
|
|
68
|
+
* ```
|
|
69
|
+
*/
|
|
70
|
+
dispatch(eventName: string, payload?: any, token?: string): boolean;
|
|
71
|
+
/**
|
|
72
|
+
* Subscribe to an event with a callback function.
|
|
73
|
+
* The callback will be executed whenever the specified event is dispatched.
|
|
74
|
+
*
|
|
75
|
+
* @param eventName - The name of the event to listen for
|
|
76
|
+
* @param callback - The function to execute when the event is fired
|
|
77
|
+
* @returns A function that can be called to unsubscribe from the event
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* ```typescript
|
|
81
|
+
* const eventBus = SecureEventBus.getInstance();
|
|
82
|
+
*
|
|
83
|
+
* // Subscribe to an event
|
|
84
|
+
* const unsubscribe = eventBus.subscribe('chatMessage', (message) => {
|
|
85
|
+
* console.log('New message:', message.text);
|
|
86
|
+
* console.log('From user:', message.userId);
|
|
87
|
+
* });
|
|
88
|
+
*
|
|
89
|
+
* // Later, unsubscribe
|
|
90
|
+
* unsubscribe();
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
subscribe(eventName: string, callback: (payload: any) => void): () => void;
|
|
94
|
+
/**
|
|
95
|
+
* Remove all listeners for a specific event.
|
|
96
|
+
* This completely removes the event from the internal listeners map.
|
|
97
|
+
*
|
|
98
|
+
* @param eventName - The name of the event to remove all listeners for
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```typescript
|
|
102
|
+
* const eventBus = SecureEventBus.getInstance();
|
|
103
|
+
*
|
|
104
|
+
* // Remove all listeners for 'chatClosed' event
|
|
105
|
+
* eventBus.removeAllListeners('chatClosed');
|
|
106
|
+
* ```
|
|
107
|
+
*/
|
|
108
|
+
removeAllListeners(eventName: string): void;
|
|
109
|
+
/**
|
|
110
|
+
* Clear all listeners for all events.
|
|
111
|
+
* This resets the entire event bus to its initial state.
|
|
112
|
+
* Useful for cleanup during application shutdown or testing.
|
|
113
|
+
*
|
|
114
|
+
* @example
|
|
115
|
+
* ```typescript
|
|
116
|
+
* const eventBus = SecureEventBus.getInstance();
|
|
117
|
+
*
|
|
118
|
+
* // Clear all event listeners
|
|
119
|
+
* eventBus.clear();
|
|
120
|
+
* ```
|
|
121
|
+
*/
|
|
122
|
+
clear(): void;
|
|
123
|
+
/**
|
|
124
|
+
* Get the number of listeners for a specific event.
|
|
125
|
+
* Useful for debugging and monitoring purposes.
|
|
126
|
+
*
|
|
127
|
+
* @param eventName - The name of the event to count listeners for
|
|
128
|
+
* @returns The number of listeners registered for the event
|
|
129
|
+
*
|
|
130
|
+
* @example
|
|
131
|
+
* ```typescript
|
|
132
|
+
* const eventBus = SecureEventBus.getInstance();
|
|
133
|
+
*
|
|
134
|
+
* // Check how many listeners are registered for 'userAction'
|
|
135
|
+
* const count = eventBus.getListenerCount('userAction');
|
|
136
|
+
* console.log(`${count} listeners registered for userAction`);
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
getListenerCount(eventName: string): number;
|
|
140
|
+
/**
|
|
141
|
+
* Get all registered event names.
|
|
142
|
+
* Returns an array of event names that currently have listeners.
|
|
143
|
+
* Useful for debugging and monitoring purposes.
|
|
144
|
+
*
|
|
145
|
+
* @returns An array of event names that have registered listeners
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```typescript
|
|
149
|
+
* const eventBus = SecureEventBus.getInstance();
|
|
150
|
+
*
|
|
151
|
+
* // Get all registered events
|
|
152
|
+
* const events = eventBus.getRegisteredEvents();
|
|
153
|
+
* console.log('Active events:', events);
|
|
154
|
+
* // Output: ['userAction', 'chatMessage', 'windowResize']
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
getRegisteredEvents(): string[];
|
|
158
|
+
}
|
|
159
|
+
export default SecureEventBus;
|
package/lib/types/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.d.ts
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IActivitySubscriber } from "./IActivitySubscriber";
|
|
2
|
+
/**
|
|
3
|
+
* The `AddActivitySubscriber` class is responsible for subscribing to the `ADD_ACTIVITY` event
|
|
4
|
+
* from the `ChatWidgetEvents` and notifying an observer when a new activity is added.
|
|
5
|
+
*
|
|
6
|
+
* This class implements the `IActivitySubscriber` interface and acts as a bridge between
|
|
7
|
+
* the event system and the observer pattern.
|
|
8
|
+
*/
|
|
9
|
+
export declare class AddActivitySubscriber implements IActivitySubscriber {
|
|
10
|
+
/**
|
|
11
|
+
* The observer that will be notified when a new activity is added.
|
|
12
|
+
* This is expected to be an object with a `next` method, such as an RxJS `Observer`.
|
|
13
|
+
*/
|
|
14
|
+
observer: any;
|
|
15
|
+
/**
|
|
16
|
+
* Set to track processed activity IDs to prevent duplicate processing.
|
|
17
|
+
*/
|
|
18
|
+
private processedActivityIds;
|
|
19
|
+
/**
|
|
20
|
+
* Unsubscribe function for the secure event listener
|
|
21
|
+
*/
|
|
22
|
+
private unsubscribeFromSecureEvent;
|
|
23
|
+
/**
|
|
24
|
+
* Subscription for PersistentConversationReset event
|
|
25
|
+
*/
|
|
26
|
+
private resetEventListener;
|
|
27
|
+
/**
|
|
28
|
+
* Constructor initializes the `AddActivitySubscriber` and sets up a secure event listener
|
|
29
|
+
* for the `ChatWidgetEvents.ADD_ACTIVITY` event. When the event is triggered, it checks
|
|
30
|
+
* if the event payload contains an `activity` and notifies the observer.
|
|
31
|
+
*/
|
|
32
|
+
constructor();
|
|
33
|
+
/**
|
|
34
|
+
* The `next` method is a placeholder for processing the activity.
|
|
35
|
+
* This method can be overridden or extended as needed.
|
|
36
|
+
*
|
|
37
|
+
* @param activity - The activity object to process.
|
|
38
|
+
* @returns The activity object (asynchronously).
|
|
39
|
+
*/
|
|
40
|
+
next(activity: any): Promise<any>;
|
|
41
|
+
/**
|
|
42
|
+
* Reset the processed activity IDs when a conversation resets
|
|
43
|
+
*/
|
|
44
|
+
reset(): void;
|
|
45
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare enum ChatWidgetEvents {
|
|
2
|
+
ADD_ACTIVITY = "CHAT_WIDGET/ADD_ACTIVITY",
|
|
3
|
+
FETCH_PERSISTENT_CHAT_HISTORY = "CHAT_WIDGET/FETCH_PERSISTENT_CHAT_HISTORY",
|
|
4
|
+
NO_MORE_HISTORY_AVAILABLE = "CHAT_WIDGET/NO_MORE_HISTORY_AVAILABLE",
|
|
5
|
+
HIDE_LOADING_BANNER = "CHAT_WIDGET/HIDE_LOADING_BANNER"
|
|
6
|
+
}
|
|
7
|
+
export default ChatWidgetEvents;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
|
|
2
|
+
import { IPersistentChatHistoryProps } from "../interfaces/IPersistentChatHistoryProps";
|
|
3
|
+
/**
|
|
4
|
+
* Class responsible for handling persistent conversation history
|
|
5
|
+
*/
|
|
6
|
+
declare class PersistentConversationHandler {
|
|
7
|
+
private appliedProps;
|
|
8
|
+
private isLastPull;
|
|
9
|
+
private pageToken;
|
|
10
|
+
private facadeChatSDK;
|
|
11
|
+
private lastMessage;
|
|
12
|
+
private count;
|
|
13
|
+
private pageSize;
|
|
14
|
+
private isCurrentlyPulling;
|
|
15
|
+
private pageTokenInTransitSet;
|
|
16
|
+
constructor(facadeChatSDK: FacadeChatSDK, props: IPersistentChatHistoryProps);
|
|
17
|
+
private appliedPropsHandler;
|
|
18
|
+
private resetEventListener;
|
|
19
|
+
reset(): void;
|
|
20
|
+
destroy(): void;
|
|
21
|
+
pullHistory(): Promise<void>;
|
|
22
|
+
private processHistoryMessages;
|
|
23
|
+
private fetchHistoryMessages;
|
|
24
|
+
private shouldPull;
|
|
25
|
+
private processMessageToActivity;
|
|
26
|
+
private createDividerActivity;
|
|
27
|
+
}
|
|
28
|
+
export default PersistentConversationHandler;
|
|
@@ -20,6 +20,7 @@ import { ILoadingPaneProps } from "@microsoft/omnichannel-chat-components/lib/ty
|
|
|
20
20
|
import { IMockProps } from "./IMockProps";
|
|
21
21
|
import { INotificationPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/notificationpane/interfaces/INotificationPaneProps";
|
|
22
22
|
import { IOOOHPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/outofofficehourspane/interfaces/IOOOHPaneProps";
|
|
23
|
+
import { IPersistentChatHistoryProps } from "./IPersistentChatHistoryProps";
|
|
23
24
|
import { IPostChatSurveyPaneStatefulProps } from "../../postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps";
|
|
24
25
|
import { IPreChatSurveyPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneProps";
|
|
25
26
|
import { IProactiveChatPaneStatefulProps } from "../../proactivechatpanestateful/interfaces/IProactiveChatPaneStatefulProps";
|
|
@@ -69,4 +70,5 @@ export interface ILiveChatWidgetProps {
|
|
|
69
70
|
mock?: IMockProps;
|
|
70
71
|
featureConfigProps?: IFeatureConfigProps;
|
|
71
72
|
appInsightsConfig?: IAppInsightsConfig;
|
|
73
|
+
persistentChatHistoryProps?: IPersistentChatHistoryProps;
|
|
72
74
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
|
|
2
|
+
import { IPersistentChatHistoryProps } from "../../livechatwidget/interfaces/IPersistentChatHistoryProps";
|
|
3
|
+
declare const usePersistentChatHistory: (facadeChatSDK: FacadeChatSDK | undefined, props: IPersistentChatHistoryProps) => void;
|
|
4
|
+
export default usePersistentChatHistory;
|
package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { IPersistentChatHistoryProps } from "../../livechatwidget/interfaces/IPersistentChatHistoryProps";
|
|
2
|
+
/**
|
|
3
|
+
* Component to handle persistent chat history events.
|
|
4
|
+
* Uses WebChatStoreLoader instead of hooks to avoid context issues.
|
|
5
|
+
*/
|
|
6
|
+
declare const WebChatEventSubscribers: (props: IPersistentChatHistoryProps) => null;
|
|
7
|
+
export default WebChatEventSubscribers;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { IPersistentChatHistoryProps } from "../../../../../livechatwidget/interfaces/IPersistentChatHistoryProps";
|
|
2
|
+
import React from "react";
|
|
3
|
+
declare const ConversationDividerActivity: (props: IPersistentChatHistoryProps) => React.JSX.Element;
|
|
4
|
+
export default ConversationDividerActivity;
|