@microsoft/omnichannel-chat-widget 1.8.2 → 1.8.3-main.1381896
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 +2 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +4 -0
- package/lib/cjs/common/telemetry/TelemetryHelper.js +7 -5
- package/lib/cjs/components/citationpanestateful/CitationDim.js +29 -0
- package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +199 -0
- package/lib/cjs/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +70 -0
- package/lib/cjs/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js +1 -0
- package/lib/cjs/components/livechatwidget/LiveChatWidget.js +4 -4
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
- package/lib/cjs/components/livechatwidget/common/endChat.js +33 -4
- package/lib/cjs/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +12 -9
- package/lib/cjs/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
- package/lib/cjs/components/livechatwidget/common/startChat.js +7 -5
- package/lib/cjs/components/livechatwidget/interfaces/IMockProps.js +8 -2
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +41 -11
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +114 -13
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -14
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +36 -2
- package/lib/cjs/components/webchatcontainerstateful/common/utils/fontUtils.js +28 -0
- package/lib/cjs/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +139 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +54 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +2 -2
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +46 -45
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +2 -0
- package/lib/cjs/contexts/createReducer.js +15 -0
- package/lib/cjs/firstresponselatency/util.js +12 -2
- package/lib/cjs/index.js +9 -1
- package/lib/cjs/plugins/newMessageEventHandler.js +2 -2
- package/lib/esm/common/Constants.js +2 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +4 -0
- package/lib/esm/common/telemetry/TelemetryHelper.js +7 -5
- package/lib/esm/components/citationpanestateful/CitationDim.js +20 -0
- package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +188 -0
- package/lib/esm/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +61 -0
- package/lib/esm/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js +1 -0
- package/lib/esm/components/livechatwidget/LiveChatWidget.js +4 -4
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
- package/lib/esm/components/livechatwidget/common/endChat.js +34 -5
- package/lib/esm/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +13 -10
- package/lib/esm/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
- package/lib/esm/components/livechatwidget/common/startChat.js +7 -5
- package/lib/esm/components/livechatwidget/interfaces/IMockProps.js +3 -3
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +41 -11
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +114 -14
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -14
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +32 -0
- package/lib/esm/components/webchatcontainerstateful/common/utils/fontUtils.js +21 -0
- package/lib/esm/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +133 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +46 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +2 -2
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +46 -45
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +2 -0
- package/lib/esm/contexts/createReducer.js +15 -0
- package/lib/esm/firstresponselatency/util.js +9 -0
- package/lib/esm/index.js +1 -0
- package/lib/esm/plugins/newMessageEventHandler.js +3 -3
- package/lib/types/common/Constants.d.ts +2 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +4 -0
- package/lib/types/components/citationpanestateful/CitationDim.d.ts +5 -0
- package/lib/types/components/citationpanestateful/CitationPaneStateful.d.ts +4 -0
- package/lib/types/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.d.ts +11 -0
- package/lib/types/components/citationpanestateful/interfaces/ICitationPaneStatefulProps.d.ts +19 -0
- package/lib/types/components/confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts.d.ts +1 -1
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +2 -1
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +3 -1
- package/lib/types/components/livechatwidget/interfaces/IMockProps.d.ts +5 -3
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatAdapter.d.ts +4 -2
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +5 -0
- package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +6 -1
- package/lib/types/components/webchatcontainerstateful/common/utils/fontUtils.d.ts +10 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/ICitation.d.ts +12 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.d.ts +5 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.d.ts +2 -2
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +46 -45
- package/lib/types/firstresponselatency/util.d.ts +1 -0
- package/lib/types/index.d.ts +1 -0
- package/package.json +4 -3
- /package/lib/cjs/components/{confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.js → citationpanestateful/interfaces/ICitationPaneStatefulProps.js} +0 -0
- /package/lib/esm/components/{confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.js → citationpanestateful/interfaces/ICitationPaneStatefulProps.js} +0 -0
- /package/lib/types/components/confirmationpanestateful/interfaces/{IConfirmationPaneLocalizedText.d.ts → IConfirmationPaneLocalizedTexts.d.ts} +0 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
import { LogLevel, TelemetryEvent } from "../../../../../common/telemetry/TelemetryConstants";
|
|
2
|
+
import { LiveChatWidgetActionType } from "../../../../../contexts/common/LiveChatWidgetActionType";
|
|
3
|
+
import { TelemetryHelper } from "../../../../../common/telemetry/TelemetryHelper";
|
|
4
|
+
import { executeReducer } from "../../../../../contexts/createReducer";
|
|
5
|
+
|
|
6
|
+
// Middleware that extracts citation metadata from incoming ACS activities and
|
|
7
|
+
// updates in-memory app state with a global citation map. Also rewrites
|
|
8
|
+
// per-message citation labels in the activity text to use a stable,
|
|
9
|
+
// message-scoped prefix when the producer provides a message id.
|
|
10
|
+
|
|
11
|
+
export const createCitationsMiddleware = (state, dispatch) => () => next => action => {
|
|
12
|
+
var _action$payload;
|
|
13
|
+
if ((_action$payload = action.payload) !== null && _action$payload !== void 0 && _action$payload.activity) {
|
|
14
|
+
if (isApplicable(action)) {
|
|
15
|
+
try {
|
|
16
|
+
var _action$payload2, _action$payload2$acti, _gptFeedback$summariz, _gptFeedback$summariz2;
|
|
17
|
+
const inMemoryState = executeReducer(state, {
|
|
18
|
+
type: LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
|
|
19
|
+
payload: null
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
// Use the producer-supplied messageid as a stable per-message prefix
|
|
23
|
+
// when present. Do not derive a prefix from activity.id or timestamps.
|
|
24
|
+
const messagePrefix = ((_action$payload2 = action.payload) === null || _action$payload2 === void 0 ? void 0 : (_action$payload2$acti = _action$payload2.activity) === null || _action$payload2$acti === void 0 ? void 0 : _action$payload2$acti.messageid) ?? "";
|
|
25
|
+
const gptFeedback = JSON.parse(action.payload.activity.channelData.metadata["pva:gpt-feedback"]);
|
|
26
|
+
// Extract citation objects from the model response
|
|
27
|
+
const citations = (_gptFeedback$summariz = gptFeedback.summarizationOpenAIResponse) === null || _gptFeedback$summariz === void 0 ? void 0 : (_gptFeedback$summariz2 = _gptFeedback$summariz.result) === null || _gptFeedback$summariz2 === void 0 ? void 0 : _gptFeedback$summariz2.textCitations;
|
|
28
|
+
// Rewrite inline citation labels in activity.text to match the global map keys
|
|
29
|
+
const updatedText = replaceCitations(action.payload.activity.text, citations, messagePrefix);
|
|
30
|
+
action.payload.activity.text = updatedText;
|
|
31
|
+
// Build a global citation map keyed by the prefixed citation id and
|
|
32
|
+
// dispatch it to app state so the UI container can render citations.
|
|
33
|
+
try {
|
|
34
|
+
var _inMemoryState$domain;
|
|
35
|
+
const citationMap = {};
|
|
36
|
+
if (citations && Array.isArray(citations)) {
|
|
37
|
+
citations.forEach(citation => {
|
|
38
|
+
if (citation !== null && citation !== void 0 && citation.id) {
|
|
39
|
+
// Preserve the 'cite:' scheme so renderer click handling remains consistent
|
|
40
|
+
const idWithoutScheme = citation.id.replace(/^cite:/, "");
|
|
41
|
+
const prefixedId = `cite:${messagePrefix}_${idWithoutScheme}`;
|
|
42
|
+
citationMap[prefixedId] = citation.text || citation.title || "";
|
|
43
|
+
}
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// Read current in-memory state to merge with existing citations
|
|
48
|
+
//const inMemoryState = executeReducer(state, { type: LiveChatWidgetActionType.GET_IN_MEMORY_STATE, payload: null });
|
|
49
|
+
const existingCitations = (inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$domain = inMemoryState.domainStates) === null || _inMemoryState$domain === void 0 ? void 0 : _inMemoryState$domain.citations) || {};
|
|
50
|
+
const updatedCitations = {
|
|
51
|
+
...existingCitations,
|
|
52
|
+
...citationMap
|
|
53
|
+
};
|
|
54
|
+
// Always dispatch to app state
|
|
55
|
+
dispatch({
|
|
56
|
+
type: LiveChatWidgetActionType.SET_CITATIONS,
|
|
57
|
+
payload: updatedCitations
|
|
58
|
+
});
|
|
59
|
+
} catch (innerErr) {
|
|
60
|
+
TelemetryHelper.logActionEvent(LogLevel.WARN, {
|
|
61
|
+
Event: TelemetryEvent.CitationMiddlewareFailed,
|
|
62
|
+
ExceptionDetails: {
|
|
63
|
+
ErrorData: "Error while populating citation map",
|
|
64
|
+
Exception: innerErr
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
} catch (error) {
|
|
69
|
+
TelemetryHelper.logActionEvent(LogLevel.ERROR, {
|
|
70
|
+
Event: TelemetryEvent.CitationMiddlewareFailed,
|
|
71
|
+
ExceptionDetails: {
|
|
72
|
+
ErrorData: "Error while converting citation labels",
|
|
73
|
+
Exception: error
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return next(action);
|
|
80
|
+
};
|
|
81
|
+
const isApplicable = action => {
|
|
82
|
+
var _action$payload3, _action$payload3$acti, _action$payload4, _action$payload4$acti;
|
|
83
|
+
if ((action === null || action === void 0 ? void 0 : (_action$payload3 = action.payload) === null || _action$payload3 === void 0 ? void 0 : (_action$payload3$acti = _action$payload3.activity) === null || _action$payload3$acti === void 0 ? void 0 : _action$payload3$acti.actionType) === "DIRECT_LINE/INCOMING_ACTIVITY" && (action === null || action === void 0 ? void 0 : (_action$payload4 = action.payload) === null || _action$payload4 === void 0 ? void 0 : (_action$payload4$acti = _action$payload4.activity) === null || _action$payload4$acti === void 0 ? void 0 : _action$payload4$acti.channelId) === "ACS_CHANNEL") {
|
|
84
|
+
var _action$payload5, _action$payload5$acti, _action$payload5$acti2, _action$payload5$acti3;
|
|
85
|
+
// Only applicable for ACS incoming activities that include pva:gpt-feedback
|
|
86
|
+
if (action !== null && action !== void 0 && (_action$payload5 = action.payload) !== null && _action$payload5 !== void 0 && (_action$payload5$acti = _action$payload5.activity) !== null && _action$payload5$acti !== void 0 && (_action$payload5$acti2 = _action$payload5$acti.channelData) !== null && _action$payload5$acti2 !== void 0 && (_action$payload5$acti3 = _action$payload5$acti2.metadata) !== null && _action$payload5$acti3 !== void 0 && _action$payload5$acti3["pva:gpt-feedback"]) {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return false;
|
|
91
|
+
};
|
|
92
|
+
const replaceCitations = (text, citations, messagePrefix) => {
|
|
93
|
+
if (!citations || !Array.isArray(citations)) {
|
|
94
|
+
return text;
|
|
95
|
+
}
|
|
96
|
+
try {
|
|
97
|
+
let updatedText = text;
|
|
98
|
+
|
|
99
|
+
// First, handle the citation reference definitions at the end (e.g., [1]: cite:1757450535119_1 "index.html")
|
|
100
|
+
// These should NOT be escaped as they are proper citation definitions
|
|
101
|
+
updatedText = updatedText.replace(/\[(\d+)\]:\s(cite:\d+)\s"([^\\"]+)"/g, (match, number, citeId) => {
|
|
102
|
+
// Attempt to find a citation object matching the inline cite id and
|
|
103
|
+
// update the displayed id/title. When a messagePrefix exists we
|
|
104
|
+
// rewrite the id to the prefixed form so it aligns with the
|
|
105
|
+
// global citation map keys.
|
|
106
|
+
const lookupId = citeId;
|
|
107
|
+
const citation = citations.find(c => c.id === lookupId);
|
|
108
|
+
if (citation) {
|
|
109
|
+
const idWithoutScheme = citeId.replace(/^cite:/, "");
|
|
110
|
+
const prefixed = messagePrefix ? `cite:${messagePrefix}_${idWithoutScheme}` : citeId;
|
|
111
|
+
return `[${number}]: ${prefixed} "${citation.title}"`;
|
|
112
|
+
}
|
|
113
|
+
return match;
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
// Second, escape inline citation references that are NOT followed by a colon
|
|
117
|
+
// This handles cases like "[1][2]"" in the middle of text that should be escaped for markdown
|
|
118
|
+
updatedText = updatedText.replace(/\[(\d+)\](?!:)/g, (match, number) => {
|
|
119
|
+
// Escape the brackets to prevent markdown from treating them as incomplete link syntax
|
|
120
|
+
return `[${number}]`;
|
|
121
|
+
});
|
|
122
|
+
return updatedText;
|
|
123
|
+
} catch (error) {
|
|
124
|
+
TelemetryHelper.logActionEvent(LogLevel.ERROR, {
|
|
125
|
+
Event: TelemetryEvent.CitationMiddlewareFailed,
|
|
126
|
+
ExceptionDetails: {
|
|
127
|
+
ErrorData: "Error while finding citations references",
|
|
128
|
+
Exception: error
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
return text;
|
|
132
|
+
}
|
|
133
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
|
|
3
|
+
import { Constants } from "../../../../../common/Constants";
|
|
4
|
+
import { getIconText } from "../../../../../common/utils";
|
|
5
|
+
import { defaultWebChatStyles } from "../../../common/defaultStyles/defaultWebChatStyles";
|
|
6
|
+
import { WebChatActionType } from "../../enums/WebChatActionType";
|
|
7
|
+
let currentAgentInitials = defaultWebChatStyles.botAvatarInitials;
|
|
8
|
+
export const localizedStringsBotInitialsMiddleware = () => _ref => {
|
|
9
|
+
let {
|
|
10
|
+
dispatch
|
|
11
|
+
} = _ref;
|
|
12
|
+
return next => action => {
|
|
13
|
+
if (action.type === WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY) {
|
|
14
|
+
var _action$payload, _activity$from;
|
|
15
|
+
const activity = (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : _action$payload.activity;
|
|
16
|
+
if (activity !== null && activity !== void 0 && (_activity$from = activity.from) !== null && _activity$from !== void 0 && _activity$from.name && activity.from.role !== Constants.userMessageTag && activity.from.name !== Constants.userMessageTag) {
|
|
17
|
+
var _activity$channelData, _activity$channelData2, _activity$tags;
|
|
18
|
+
const agentName = activity.from.name.trim();
|
|
19
|
+
const isSystemMessage = agentName === "__agent__" || agentName.startsWith("__") || ((_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.systemMessageTag)) || ((_activity$tags = activity.tags) === null || _activity$tags === void 0 ? void 0 : _activity$tags.includes(Constants.systemMessageTag));
|
|
20
|
+
if (!isSystemMessage && agentName !== "") {
|
|
21
|
+
// Update initials for valid agent/bot names
|
|
22
|
+
const newInitials = getIconText(agentName) || currentAgentInitials;
|
|
23
|
+
currentAgentInitials = newInitials;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return next(action);
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
export const getOverriddenLocalizedStrings = existingOverrides => {
|
|
31
|
+
return strings => {
|
|
32
|
+
const result = {
|
|
33
|
+
...strings,
|
|
34
|
+
...existingOverrides
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// Apply dynamic bot initials to alt text if not already overridden through props
|
|
38
|
+
if (!(existingOverrides !== null && existingOverrides !== void 0 && existingOverrides.ACTIVITY_BOT_SAID_ALT)) {
|
|
39
|
+
result.ACTIVITY_BOT_SAID_ALT = `${currentAgentInitials} said:`;
|
|
40
|
+
}
|
|
41
|
+
if (!(existingOverrides !== null && existingOverrides !== void 0 && existingOverrides.ACTIVITY_BOT_ATTACHED_ALT)) {
|
|
42
|
+
result.ACTIVITY_BOT_ATTACHED_ALT = `${currentAgentInitials} attached:`;
|
|
43
|
+
}
|
|
44
|
+
return result;
|
|
45
|
+
};
|
|
46
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { WebChatActionType } from "../../enums/WebChatActionType";
|
|
2
1
|
import { LogLevel, TelemetryEvent } from "../../../../../common/telemetry/TelemetryConstants";
|
|
3
|
-
import { TelemetryHelper } from "../../../../../common/telemetry/TelemetryHelper";
|
|
4
2
|
import { LiveChatWidgetActionType } from "../../../../../contexts/common/LiveChatWidgetActionType";
|
|
3
|
+
import { TelemetryHelper } from "../../../../../common/telemetry/TelemetryHelper";
|
|
4
|
+
import { WebChatActionType } from "../../enums/WebChatActionType";
|
|
5
5
|
import { executeReducer } from "../../../../../contexts/createReducer";
|
|
6
6
|
import { isEndConversationDueToOverflowActivity } from "../../../../../common/utils";
|
|
7
7
|
const queueOverflowHandlingHelper = async (state, dispatch) => {
|
|
@@ -3,49 +3,50 @@ export let LiveChatWidgetActionType;
|
|
|
3
3
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_ELEMENT_ID"] = 0] = "SET_WIDGET_ELEMENT_ID";
|
|
4
4
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RENDERING_MIDDLEWARE_PROPS"] = 1] = "SET_RENDERING_MIDDLEWARE_PROPS";
|
|
5
5
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_MIDDLEWARE_LOCALIZED_TEXTS"] = 2] = "SET_MIDDLEWARE_LOCALIZED_TEXTS";
|
|
6
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
7
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
8
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
9
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
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["
|
|
38
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
39
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
40
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
41
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
42
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
43
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
44
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
45
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
46
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
47
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
48
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
49
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
50
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
6
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CITATIONS"] = 3] = "SET_CITATIONS";
|
|
7
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_GLOBAL_DIR"] = 4] = "SET_GLOBAL_DIR";
|
|
8
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_MINIMIZED"] = 5] = "SET_MINIMIZED";
|
|
9
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_STATE"] = 6] = "SET_CONVERSATION_STATE";
|
|
10
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PREVIOUS_FOCUSED_ELEMENT_ID"] = 7] = "SET_PREVIOUS_FOCUSED_ELEMENT_ID";
|
|
11
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_FAILING"] = 8] = "SET_START_CHAT_FAILING";
|
|
12
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_FAILURE_TYPE"] = 9] = "SET_START_CHAT_FAILURE_TYPE";
|
|
13
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_OUTSIDE_OPERATING_HOURS"] = 10] = "SET_OUTSIDE_OPERATING_HOURS";
|
|
14
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRE_CHAT_SURVEY_RESPONSE"] = 11] = "SET_PRE_CHAT_SURVEY_RESPONSE";
|
|
15
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CUSTOM_CONTEXT"] = 12] = "SET_CUSTOM_CONTEXT";
|
|
16
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_CONFIRMATION"] = 13] = "SET_SHOW_CONFIRMATION";
|
|
17
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_EMAIL_TRANSCRIPT_PANE"] = 14] = "SET_SHOW_EMAIL_TRANSCRIPT_PANE";
|
|
18
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRECHAT_RESPONSE_EMAIL"] = 15] = "SET_PRECHAT_RESPONSE_EMAIL";
|
|
19
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 16] = "SET_AUDIO_NOTIFICATION";
|
|
20
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 17] = "SET_E2VV_ENABLED";
|
|
21
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 18] = "SET_POST_CHAT_CONTEXT";
|
|
22
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 19] = "SHOW_CALLING_CONTAINER";
|
|
23
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 20] = "SET_INCOMING_CALL";
|
|
24
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 21] = "DISABLE_VIDEO_CALL";
|
|
25
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 22] = "DISABLE_LOCAL_VIDEO";
|
|
26
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 23] = "DISABLE_REMOTE_VIDEO";
|
|
27
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 24] = "SET_CHAT_TOKEN";
|
|
28
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_BUTTON_DISPLAY"] = 25] = "SET_START_CHAT_BUTTON_DISPLAY";
|
|
29
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 26] = "SET_PROACTIVE_CHAT_PARAMS";
|
|
30
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 27] = "SET_TELEMETRY_DATA";
|
|
31
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 28] = "SET_RECONNECT_ID";
|
|
32
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 29] = "SET_UNREAD_MESSAGE_COUNT";
|
|
33
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 30] = "SET_FOCUS_CHAT_BUTTON";
|
|
34
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED"] = 31] = "SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED";
|
|
35
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY"] = 32] = "SET_CONVERSATION_ENDED_BY";
|
|
36
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 33] = "SET_WIDGET_STATE";
|
|
37
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 34] = "SET_LIVE_CHAT_CONTEXT";
|
|
38
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_OAUTH_SIGNIN_ID"] = 35] = "SET_BOT_OAUTH_SIGNIN_ID";
|
|
39
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_SIZE"] = 36] = "SET_WIDGET_SIZE";
|
|
40
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_INSTANCE_ID"] = 37] = "SET_WIDGET_INSTANCE_ID";
|
|
41
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONFIG"] = 38] = "SET_LIVE_CHAT_CONFIG";
|
|
42
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_WORKFLOW_IN_PROGRESS"] = 39] = "SET_POST_CHAT_WORKFLOW_IN_PROGRESS";
|
|
43
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INITIAL_CHAT_SDK_REQUEST_ID"] = 40] = "SET_INITIAL_CHAT_SDK_REQUEST_ID";
|
|
44
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOULD_USE_BOT_SURVEY"] = 41] = "SET_SHOULD_USE_BOT_SURVEY";
|
|
45
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_DISCONNECT_EVENT_RECEIVED"] = 42] = "SET_CHAT_DISCONNECT_EVENT_RECEIVED";
|
|
46
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SURVEY_MODE"] = 43] = "SET_SURVEY_MODE";
|
|
47
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONFIRMATION_STATE"] = 44] = "SET_CONFIRMATION_STATE";
|
|
48
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_PARTICIPANT_TYPE"] = 45] = "SET_POST_CHAT_PARTICIPANT_TYPE";
|
|
49
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_ENABLED"] = 46] = "SET_CONVERSATIONAL_SURVEY_ENABLED";
|
|
50
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_DISPLAY"] = 47] = "SET_CONVERSATIONAL_SURVEY_DISPLAY";
|
|
51
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["GET_IN_MEMORY_STATE"] = 48] = "GET_IN_MEMORY_STATE";
|
|
51
52
|
})(LiveChatWidgetActionType || (LiveChatWidgetActionType = {}));
|
|
@@ -39,6 +39,8 @@ export const getLiveChatWidgetContextInitialState = props => {
|
|
|
39
39
|
domainStates: {
|
|
40
40
|
liveChatConfig: props.chatConfig,
|
|
41
41
|
widgetElementId: "",
|
|
42
|
+
// Map of citation id => content injected by citations middleware
|
|
43
|
+
citations: {},
|
|
42
44
|
renderingMiddlewareProps: (_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.renderingMiddlewareProps,
|
|
43
45
|
middlewareLocalizedTexts: defaultMiddlewareLocalizedTexts,
|
|
44
46
|
preChatSurveyResponse: "{}",
|
|
@@ -62,6 +62,21 @@ const reducer = (state, action) => {
|
|
|
62
62
|
middlewareLocalizedTexts: action.payload
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
|
+
case LiveChatWidgetActionType.SET_CITATIONS:
|
|
66
|
+
inMemory = {
|
|
67
|
+
...inMemory,
|
|
68
|
+
domainStates: {
|
|
69
|
+
...inMemory.domainStates,
|
|
70
|
+
citations: action.payload
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
return {
|
|
74
|
+
...state,
|
|
75
|
+
domainStates: {
|
|
76
|
+
...state.domainStates,
|
|
77
|
+
citations: action.payload
|
|
78
|
+
}
|
|
79
|
+
};
|
|
65
80
|
case LiveChatWidgetActionType.SET_GLOBAL_DIR:
|
|
66
81
|
inMemory = {
|
|
67
82
|
...inMemory,
|
|
@@ -114,4 +114,13 @@ export const createTrackingMessage = (payload, type) => {
|
|
|
114
114
|
type: type,
|
|
115
115
|
checkTime: new Date().getTime()
|
|
116
116
|
};
|
|
117
|
+
};
|
|
118
|
+
export const maskPayloadText = payload => {
|
|
119
|
+
if (!payload) {
|
|
120
|
+
return payload;
|
|
121
|
+
}
|
|
122
|
+
return {
|
|
123
|
+
...payload,
|
|
124
|
+
text: "*contents hidden*"
|
|
125
|
+
};
|
|
117
126
|
};
|
package/lib/esm/index.js
CHANGED
|
@@ -7,5 +7,6 @@ import useFacadeChatSDKStore from "./hooks/useFacadeChatSDKStore";
|
|
|
7
7
|
export { default as LiveChatWidget } from "./components/livechatwidget/LiveChatWidget";
|
|
8
8
|
export { getMockChatSDKIfApplicable } from "./components/livechatwidget/common/getMockChatSDKIfApplicable";
|
|
9
9
|
export { getWidgetCacheId, getWidgetEndChatEventName, ConversationState };
|
|
10
|
+
export { LiveChatWidgetMockType } from "./components/livechatwidget/interfaces/IMockProps";
|
|
10
11
|
export { encodeComponentString, decodeComponentString, BroadcastService, useChatSDKStore, useChatContextStore, useFacadeChatSDKStore };
|
|
11
12
|
export * from "./components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BroadcastEvent, LogLevel, TelemetryEvent } from "../common/telemetry/TelemetryConstants";
|
|
2
2
|
import { ScenarioType } from "../firstresponselatency/Constants";
|
|
3
|
-
import { buildMessagePayload, getScenarioType, isHistoryMessage, polyfillMessagePayloadForEvent } from "../firstresponselatency/util";
|
|
3
|
+
import { buildMessagePayload, getScenarioType, isHistoryMessage, maskPayloadText, polyfillMessagePayloadForEvent } from "../firstresponselatency/util";
|
|
4
4
|
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
5
5
|
import { Constants } from "../common/Constants";
|
|
6
6
|
import { FirstResponseLatencyTracker } from "../firstresponselatency/FirstResponseLatencyTracker";
|
|
@@ -65,7 +65,7 @@ export const createOnNewAdapterActivityHandler = (chatId, userId, startTime) =>
|
|
|
65
65
|
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
66
66
|
Event: TelemetryEvent.RehydrateMessageReceived,
|
|
67
67
|
Description: "History message received",
|
|
68
|
-
CustomProperties: payload
|
|
68
|
+
CustomProperties: maskPayloadText(payload)
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
};
|
|
@@ -102,7 +102,7 @@ export const createOnNewAdapterActivityHandler = (chatId, userId, startTime) =>
|
|
|
102
102
|
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
103
103
|
Event: TelemetryEvent.MessageReceived,
|
|
104
104
|
Description: "New message received",
|
|
105
|
-
CustomProperties: payload
|
|
105
|
+
CustomProperties: maskPayloadText(payload)
|
|
106
106
|
});
|
|
107
107
|
};
|
|
108
108
|
const raiseMessageEvent = activity => {
|
|
@@ -153,6 +153,8 @@ export declare class HtmlAttributeNames {
|
|
|
153
153
|
static readonly adaptiveCardTextBlockClassName = "ac-textBlock";
|
|
154
154
|
static readonly adaptiveCardToggleInputClassName = "ac-toggleInput";
|
|
155
155
|
static readonly adaptiveCardActionSetClassName = "ac-actionSet";
|
|
156
|
+
static readonly ocwCitationPaneClassName = "ocw-citation-pane";
|
|
157
|
+
static readonly ocwCitationPaneTitle = "Citation";
|
|
156
158
|
}
|
|
157
159
|
export declare class WebChatMiddlewareConstants {
|
|
158
160
|
static readonly nextVisibleActivity = "nextVisibleActivity";
|
|
@@ -136,6 +136,7 @@ export declare enum TelemetryEvent {
|
|
|
136
136
|
EmailTranscriptLoaded = "EmailTranscriptLoaded",
|
|
137
137
|
OutOfOfficePaneLoaded = "OutOfOfficePaneLoaded",
|
|
138
138
|
ConfirmationPaneLoaded = "ConfirmationPaneLoaded",
|
|
139
|
+
CitationPaneLoaded = "CitationPaneLoaded",
|
|
139
140
|
ProactiveChatPaneLoaded = "ProactiveChatPaneLoaded",
|
|
140
141
|
ReconnectChatPaneLoaded = "ReconnectChatPaneLoaded",
|
|
141
142
|
HeaderCloseButtonClicked = "HeaderCloseButtonClicked",
|
|
@@ -177,6 +178,7 @@ export declare enum TelemetryEvent {
|
|
|
177
178
|
ProcessingSanitizationMiddlewareFailed = "ProcessingSanitizationMiddlewareFailed",
|
|
178
179
|
FormatTagsMiddlewareJSONStringifyFailed = "FormatTagsMiddlewareJSONStringifyFailed",
|
|
179
180
|
AttachmentUploadValidatorMiddlewareFailed = "AttachmentUploadValidatorMiddlewareFailed",
|
|
181
|
+
CitationMiddlewareFailed = "CitationMiddlewareFailed",
|
|
180
182
|
QueuePositionMessageRecieved = "QueuePositionMessageRecieved",
|
|
181
183
|
AverageWaitTimeMessageRecieved = "AverageWaitTimeMessageRecieved",
|
|
182
184
|
DataMaskingRuleApplied = "DataMaskingRuleApplied",
|
|
@@ -261,7 +263,9 @@ export declare enum TelemetryEvent {
|
|
|
261
263
|
UXLCWChatButtonLoadingStart = "UXLCWChatButtonLoadingStart",
|
|
262
264
|
UXLCWChatButtonLoadingCompleted = "UXLCWChatButtonLoadingCompleted",
|
|
263
265
|
UXConfirmationPaneStart = "UXConfirmationPaneStart",
|
|
266
|
+
UXCitationPaneStart = "UXCitationPaneStart",
|
|
264
267
|
UXConfirmationPaneCompleted = "UXConfirmationPaneCompleted",
|
|
268
|
+
UXCitationPaneCompleted = "UXCitationPaneCompleted",
|
|
265
269
|
UXLiveChatWidgetStart = "UXLiveChatWidgetStart",
|
|
266
270
|
UXLiveChatWidgetCompleted = "UXLiveChatWidgetCompleted",
|
|
267
271
|
AppInsightsInitialized = "AppInsightsInitialized",
|
package/lib/types/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const defaultCitationPaneStyles: {
|
|
2
|
+
pane: React.CSSProperties;
|
|
3
|
+
};
|
|
4
|
+
export declare const defaultCitationContentCSS: (controlId: string) => string;
|
|
5
|
+
declare const _default: {
|
|
6
|
+
defaultCitationPaneStyles: {
|
|
7
|
+
pane: React.CSSProperties;
|
|
8
|
+
};
|
|
9
|
+
defaultCitationContentCSS: (controlId: string) => string;
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ICitationPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/citationpane/interfaces/ICitationPaneProps";
|
|
2
|
+
export interface ICitationPaneStatefulProps extends ICitationPaneProps {
|
|
3
|
+
/**
|
|
4
|
+
* id: Optional custom ID for the citation pane container
|
|
5
|
+
*/
|
|
6
|
+
id?: string;
|
|
7
|
+
/**
|
|
8
|
+
* title: Optional title for the citation pane
|
|
9
|
+
*/
|
|
10
|
+
title?: string;
|
|
11
|
+
/**
|
|
12
|
+
* onClose: Optional callback function called when the citation pane is closed
|
|
13
|
+
*/
|
|
14
|
+
onClose?: () => void;
|
|
15
|
+
/**
|
|
16
|
+
* contentHtml: Optional HTML content to display in the citation pane
|
|
17
|
+
*/
|
|
18
|
+
contentHtml?: string;
|
|
19
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { IConfirmationPaneLocalizedTexts } from "../../interfaces/
|
|
1
|
+
import { IConfirmationPaneLocalizedTexts } from "../../interfaces/IConfirmationPaneLocalizedTexts";
|
|
2
2
|
export declare const defaultConfirmationPaneLocalizedTexts: IConfirmationPaneLocalizedTexts;
|
package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IConfirmationPaneLocalizedTexts } from "./
|
|
1
|
+
import { IConfirmationPaneLocalizedTexts } from "./IConfirmationPaneLocalizedTexts";
|
|
2
2
|
import { IConfirmationPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/confirmationpane/interfaces/IConfirmationPaneProps";
|
|
3
3
|
export interface IConfirmationPaneStatefulProps extends IConfirmationPaneProps {
|
|
4
4
|
/**
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { IMockProps } from "../interfaces/IMockProps";
|
|
2
|
+
export declare const getMockChatSDKIfApplicable: (chatSDK: any, mockProps?: IMockProps) => any;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
|
|
2
|
+
import { IAppInsightsConfig } from "../../../common/telemetry/interfaces/IAppInsightsConfig";
|
|
2
3
|
import { IAudioNotificationProps } from "../../footerstateful/audionotificationstateful/interfaces/IAudioNotificationProps";
|
|
3
4
|
import { ICallingContainerProps } from "@microsoft/omnichannel-chat-components/lib/types/components/callingcontainer/interfaces/ICallingContainerProps";
|
|
4
5
|
import { IChatButtonProps } from "@microsoft/omnichannel-chat-components/lib/types/components/chatbutton/interfaces/IChatButtonProps";
|
|
6
|
+
import { ICitationPaneStatefulProps } from "../../citationpanestateful/interfaces/ICitationPaneStatefulProps";
|
|
5
7
|
import { IConfirmationPaneStatefulProps } from "../../confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps";
|
|
6
8
|
import { IContextDataStore } from "../../../common/interfaces/IContextDataStore";
|
|
7
9
|
import { IDownloadTranscriptProps } from "../../footerstateful/downloadtranscriptstateful/interfaces/IDownloadTranscriptProps";
|
|
@@ -27,7 +29,6 @@ import { IStartChatErrorPaneProps } from "../../startchaterrorpanestateful/inter
|
|
|
27
29
|
import { ITelemetryConfig } from "../../../common/telemetry/interfaces/ITelemetryConfig";
|
|
28
30
|
import { IWebChatContainerStatefulProps } from "../../webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps";
|
|
29
31
|
import { OmnichannelChatSDK } from "@microsoft/omnichannel-chat-sdk";
|
|
30
|
-
import { IAppInsightsConfig } from "../../../common/telemetry/interfaces/IAppInsightsConfig";
|
|
31
32
|
export interface ILiveChatWidgetProps {
|
|
32
33
|
audioNotificationProps?: IAudioNotificationProps;
|
|
33
34
|
callingContainerProps?: ICallingContainerProps;
|
|
@@ -51,6 +52,7 @@ export interface ILiveChatWidgetProps {
|
|
|
51
52
|
preChatSurveyPaneProps?: IPreChatSurveyPaneProps;
|
|
52
53
|
proactiveChatPaneProps?: IProactiveChatPaneStatefulProps;
|
|
53
54
|
reconnectChatPaneProps?: IReconnectChatPaneStatefulProps;
|
|
55
|
+
citationPaneProps?: ICitationPaneStatefulProps;
|
|
54
56
|
startChatErrorPaneProps?: IStartChatErrorPaneProps;
|
|
55
57
|
styleProps?: ILiveChatWidgetStyleProps;
|
|
56
58
|
telemetryConfig: ITelemetryConfig;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
1
|
+
import { Message } from "botframework-directlinejs";
|
|
2
|
+
export declare enum LiveChatWidgetMockType {
|
|
2
3
|
Test = "Test",
|
|
3
|
-
Demo = "Demo"
|
|
4
|
+
Demo = "Demo",
|
|
5
|
+
Designer = "Designer"
|
|
4
6
|
}
|
|
5
7
|
export interface IMockProps {
|
|
6
8
|
type: LiveChatWidgetMockType;
|
|
9
|
+
mockMessages?: Message[];
|
|
7
10
|
}
|
|
8
|
-
export {};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Message } from "botframework-directlinejs";
|
|
2
|
-
import { Observable } from "rxjs/Observable";
|
|
3
2
|
import MockAdapter from "./mockadapter";
|
|
3
|
+
import { Observable } from "rxjs/Observable";
|
|
4
4
|
export declare class DesignerChatAdapter extends MockAdapter {
|
|
5
|
-
|
|
5
|
+
messages?: Message[];
|
|
6
|
+
constructor(messages?: Message[]);
|
|
7
|
+
private processMessage;
|
|
6
8
|
private postUserActivity;
|
|
7
9
|
postActivity(activity: Message): Observable<string>;
|
|
8
10
|
}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { DesignerChatAdapter } from "./DesignerChatAdapter";
|
|
2
|
+
import { Message } from "botframework-directlinejs";
|
|
2
3
|
import { MockChatSDK } from "./mockchatsdk";
|
|
3
4
|
export declare class DesignerChatSDK extends MockChatSDK {
|
|
4
5
|
constructor();
|
|
6
|
+
/**
|
|
7
|
+
* Create a chat adapter for the designer. Uses this.mockMessages if set.
|
|
8
|
+
*/
|
|
9
|
+
mockMessages?: Message[];
|
|
5
10
|
createChatAdapter(): DesignerChatAdapter;
|
|
6
11
|
localeId: string;
|
|
7
12
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Activity, Attachment, Message, User } from "botframework-directlinejs";
|
|
1
|
+
import { Activity, Attachment, AttachmentLayout, CardAction, Message, User } from "botframework-directlinejs";
|
|
2
2
|
import { Subscriber } from "rxjs/Subscriber";
|
|
3
3
|
export declare const customerUser: User;
|
|
4
4
|
export declare const botUser: User;
|
|
@@ -9,3 +9,8 @@ export declare const postAgentMessageActivity: (activityObserver: Subscriber<Act
|
|
|
9
9
|
export declare const postSystemMessageActivity: (activityObserver: Subscriber<Activity> | undefined, text: string, delay?: number) => void;
|
|
10
10
|
export declare const postBotTypingActivity: (activityObserver: Subscriber<Activity> | undefined, delay?: number) => void;
|
|
11
11
|
export declare const postBotAttachmentActivity: (activityObserver: Subscriber<Activity> | undefined, attachments?: Attachment[], delay?: number) => void;
|
|
12
|
+
export declare const postAgentAttachmentActivity: (activityObserver: Subscriber<Activity> | undefined, attachments?: Attachment[], delay?: number, attachmentLayout?: AttachmentLayout) => void;
|
|
13
|
+
export declare const postAgentSuggestedActionsActivity: (activityObserver: Subscriber<Activity> | undefined, text: string, suggestedActions: {
|
|
14
|
+
actions: CardAction[];
|
|
15
|
+
to?: string[];
|
|
16
|
+
}, delay?: number) => void;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for font handling and emoji support
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Creates a font family optimized for iOS emoji support
|
|
6
|
+
* Uses system-ui as the primary font for better emoji rendering on iOS
|
|
7
|
+
* @param primaryFont - The base font family string (optional, used as fallback)
|
|
8
|
+
* @returns Font family string optimized for iOS emoji support
|
|
9
|
+
*/
|
|
10
|
+
export declare const createIOSOptimizedEmojiFont: (primaryFont?: string) => string;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ILiveChatWidgetAction } from "../../../../../contexts/common/ILiveChatWidgetAction";
|
|
2
|
+
import { ILiveChatWidgetContext } from "../../../../../contexts/common/ILiveChatWidgetContext";
|
|
3
|
+
import { IWebChatAction } from "../../../interfaces/IWebChatAction";
|
|
4
|
+
export declare const createCitationsMiddleware: (state: ILiveChatWidgetContext, dispatch: (action: ILiveChatWidgetAction) => void) => () => (next: (action: IWebChatAction) => void) => (action: IWebChatAction) => void;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { IWebChatAction } from "../../../interfaces/IWebChatAction";
|
|
2
|
+
export declare const localizedStringsBotInitialsMiddleware: () => ({ dispatch }: {
|
|
3
|
+
dispatch: any;
|
|
4
|
+
}) => (next: any) => (action: IWebChatAction) => any;
|
|
5
|
+
export declare const getOverriddenLocalizedStrings: (existingOverrides?: any) => (strings: any) => any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IWebChatAction } from "../../../interfaces/IWebChatAction";
|
|
2
|
-
import { ILiveChatWidgetContext } from "../../../../../contexts/common/ILiveChatWidgetContext";
|
|
3
1
|
import { Dispatch } from "react";
|
|
4
2
|
import { ILiveChatWidgetAction } from "../../../../../contexts/common/ILiveChatWidgetAction";
|
|
3
|
+
import { ILiveChatWidgetContext } from "../../../../../contexts/common/ILiveChatWidgetContext";
|
|
4
|
+
import { IWebChatAction } from "../../../interfaces/IWebChatAction";
|
|
5
5
|
export declare const createQueueOverflowMiddleware: (state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>) => () => (next: (action: IWebChatAction) => void) => (action: IWebChatAction) => void;
|