@microsoft/omnichannel-chat-widget 1.8.3-main.38c88a7 → 1.8.3-main.5668947
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 +198 -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/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
- package/lib/cjs/components/livechatwidget/common/endChat.js +37 -4
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +12 -9
- package/lib/cjs/components/livechatwidget/common/startChat.js +4 -3
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +35 -6
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +89 -5
- package/lib/cjs/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
- 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/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 +187 -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/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
- package/lib/esm/components/livechatwidget/common/endChat.js +38 -5
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +13 -10
- package/lib/esm/components/livechatwidget/common/startChat.js +4 -3
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +35 -6
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +89 -6
- package/lib/esm/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
- 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/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 +10 -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/interfaces/ILiveChatWidgetProps.d.ts +5 -1
- 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/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
|
@@ -184,6 +184,8 @@ _defineProperty(HtmlAttributeNames, "adaptiveCardClassName", "ac-adaptiveCard");
|
|
|
184
184
|
_defineProperty(HtmlAttributeNames, "adaptiveCardTextBlockClassName", "ac-textBlock");
|
|
185
185
|
_defineProperty(HtmlAttributeNames, "adaptiveCardToggleInputClassName", "ac-toggleInput");
|
|
186
186
|
_defineProperty(HtmlAttributeNames, "adaptiveCardActionSetClassName", "ac-actionSet");
|
|
187
|
+
_defineProperty(HtmlAttributeNames, "ocwCitationPaneClassName", "ocw-citation-pane");
|
|
188
|
+
_defineProperty(HtmlAttributeNames, "ocwCitationPaneTitle", "Citation");
|
|
187
189
|
export let WebChatMiddlewareConstants = /*#__PURE__*/_createClass(function WebChatMiddlewareConstants() {
|
|
188
190
|
_classCallCheck(this, WebChatMiddlewareConstants);
|
|
189
191
|
});
|
|
@@ -148,6 +148,7 @@ export let TelemetryEvent;
|
|
|
148
148
|
TelemetryEvent["EmailTranscriptLoaded"] = "EmailTranscriptLoaded";
|
|
149
149
|
TelemetryEvent["OutOfOfficePaneLoaded"] = "OutOfOfficePaneLoaded";
|
|
150
150
|
TelemetryEvent["ConfirmationPaneLoaded"] = "ConfirmationPaneLoaded";
|
|
151
|
+
TelemetryEvent["CitationPaneLoaded"] = "CitationPaneLoaded";
|
|
151
152
|
TelemetryEvent["ProactiveChatPaneLoaded"] = "ProactiveChatPaneLoaded";
|
|
152
153
|
TelemetryEvent["ReconnectChatPaneLoaded"] = "ReconnectChatPaneLoaded";
|
|
153
154
|
TelemetryEvent["HeaderCloseButtonClicked"] = "HeaderCloseButtonClicked";
|
|
@@ -189,6 +190,7 @@ export let TelemetryEvent;
|
|
|
189
190
|
TelemetryEvent["ProcessingSanitizationMiddlewareFailed"] = "ProcessingSanitizationMiddlewareFailed";
|
|
190
191
|
TelemetryEvent["FormatTagsMiddlewareJSONStringifyFailed"] = "FormatTagsMiddlewareJSONStringifyFailed";
|
|
191
192
|
TelemetryEvent["AttachmentUploadValidatorMiddlewareFailed"] = "AttachmentUploadValidatorMiddlewareFailed";
|
|
193
|
+
TelemetryEvent["CitationMiddlewareFailed"] = "CitationMiddlewareFailed";
|
|
192
194
|
TelemetryEvent["QueuePositionMessageRecieved"] = "QueuePositionMessageRecieved";
|
|
193
195
|
TelemetryEvent["AverageWaitTimeMessageRecieved"] = "AverageWaitTimeMessageRecieved";
|
|
194
196
|
TelemetryEvent["DataMaskingRuleApplied"] = "DataMaskingRuleApplied";
|
|
@@ -273,7 +275,9 @@ export let TelemetryEvent;
|
|
|
273
275
|
TelemetryEvent["UXLCWChatButtonLoadingStart"] = "UXLCWChatButtonLoadingStart";
|
|
274
276
|
TelemetryEvent["UXLCWChatButtonLoadingCompleted"] = "UXLCWChatButtonLoadingCompleted";
|
|
275
277
|
TelemetryEvent["UXConfirmationPaneStart"] = "UXConfirmationPaneStart";
|
|
278
|
+
TelemetryEvent["UXCitationPaneStart"] = "UXCitationPaneStart";
|
|
276
279
|
TelemetryEvent["UXConfirmationPaneCompleted"] = "UXConfirmationPaneCompleted";
|
|
280
|
+
TelemetryEvent["UXCitationPaneCompleted"] = "UXCitationPaneCompleted";
|
|
277
281
|
TelemetryEvent["UXLiveChatWidgetStart"] = "UXLiveChatWidgetStart";
|
|
278
282
|
TelemetryEvent["UXLiveChatWidgetCompleted"] = "UXLiveChatWidgetCompleted";
|
|
279
283
|
TelemetryEvent["AppInsightsInitialized"] = "AppInsightsInitialized";
|
|
@@ -230,11 +230,13 @@ export let TelemetryHelper = /*#__PURE__*/function () {
|
|
|
230
230
|
}, {
|
|
231
231
|
key: "postTelemetryEvent",
|
|
232
232
|
value: function postTelemetryEvent(eventName, logLevel, payload) {
|
|
233
|
+
var _TelemetryManager$Int16;
|
|
233
234
|
const telemetryEvent = {
|
|
234
235
|
eventName,
|
|
235
236
|
logLevel,
|
|
236
237
|
payload: {
|
|
237
|
-
...payload
|
|
238
|
+
...payload,
|
|
239
|
+
runtimeId: (_TelemetryManager$Int16 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int16 === void 0 ? void 0 : _TelemetryManager$Int16.lcwRuntimeId
|
|
238
240
|
}
|
|
239
241
|
};
|
|
240
242
|
BroadcastService.postMessage(telemetryEvent);
|
|
@@ -260,11 +262,11 @@ _defineProperty(TelemetryHelper, "logActionEvent", (logLevel, payload) => {
|
|
|
260
262
|
TelemetryHelper.postTelemetryEvent((payload === null || payload === void 0 ? void 0 : payload.Event) ?? "", logLevel, payload);
|
|
261
263
|
});
|
|
262
264
|
_defineProperty(TelemetryHelper, "logSDKEvent", (logLevel, payload) => {
|
|
263
|
-
var _TelemetryManager$
|
|
265
|
+
var _TelemetryManager$Int17;
|
|
264
266
|
TelemetryHelper.postTelemetryEvent((payload === null || payload === void 0 ? void 0 : payload.Event) ?? "", logLevel, {
|
|
265
267
|
...payload,
|
|
266
268
|
TransactionId: newGuid(),
|
|
267
|
-
RequestId: (_TelemetryManager$
|
|
269
|
+
RequestId: (_TelemetryManager$Int17 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int17 === void 0 ? void 0 : _TelemetryManager$Int17.currentRequestId
|
|
268
270
|
});
|
|
269
271
|
});
|
|
270
272
|
_defineProperty(TelemetryHelper, "logConfigDataEvent", (logLevel, payload) => {
|
|
@@ -299,12 +301,12 @@ _defineProperty(TelemetryHelper, "logFacadeChatSDKEventToAllTelemetry", (logLeve
|
|
|
299
301
|
});
|
|
300
302
|
});
|
|
301
303
|
_defineProperty(TelemetryHelper, "logSDKEventToAllTelemetry", (logLevel, payload) => {
|
|
302
|
-
var _TelemetryManager$
|
|
304
|
+
var _TelemetryManager$Int18;
|
|
303
305
|
TelemetryHelper.postTelemetryEvent((payload === null || payload === void 0 ? void 0 : payload.Event) ?? "", logLevel, {
|
|
304
306
|
...{
|
|
305
307
|
...payload,
|
|
306
308
|
TransactionId: newGuid(),
|
|
307
|
-
RequestId: (_TelemetryManager$
|
|
309
|
+
RequestId: (_TelemetryManager$Int18 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int18 === void 0 ? void 0 : _TelemetryManager$Int18.currentRequestId
|
|
308
310
|
},
|
|
309
311
|
LogToAll: true
|
|
310
312
|
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import ReactDOM from "react-dom";
|
|
3
|
+
import { DimLayer } from "../dimlayer/DimLayer";
|
|
4
|
+
const CONTAINER_SELECTOR = ".webchat__stacked-layout_container";
|
|
5
|
+
export const CitationDim = _ref => {
|
|
6
|
+
let {
|
|
7
|
+
brightness = "0.2"
|
|
8
|
+
} = _ref;
|
|
9
|
+
const container = document.querySelector(CONTAINER_SELECTOR);
|
|
10
|
+
if (!container) return null;
|
|
11
|
+
return /*#__PURE__*/ReactDOM.createPortal( /*#__PURE__*/React.createElement("div", {
|
|
12
|
+
style: {
|
|
13
|
+
position: "absolute",
|
|
14
|
+
inset: 0
|
|
15
|
+
}
|
|
16
|
+
}, /*#__PURE__*/React.createElement(DimLayer, {
|
|
17
|
+
brightness: brightness
|
|
18
|
+
})), container);
|
|
19
|
+
};
|
|
20
|
+
export default CitationDim;
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
2
|
+
import React, { useEffect, useState } from "react";
|
|
3
|
+
import { createTimer, findAllFocusableElement, findParentFocusableElementsWithoutChildContainer, preventFocusToMoveOutOfElement, setTabIndices } from "../../common/utils";
|
|
4
|
+
import CitationDim from "./CitationDim";
|
|
5
|
+
import { CitationPane } from "@microsoft/omnichannel-chat-components";
|
|
6
|
+
import { HtmlAttributeNames } from "../../common/Constants";
|
|
7
|
+
import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
|
|
8
|
+
import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
9
|
+
import { defaultCitationPaneStyles } from "./common/defaultProps/defaultCitationPaneProps";
|
|
10
|
+
import useChatContextStore from "../../hooks/useChatContextStore";
|
|
11
|
+
let uiTimer;
|
|
12
|
+
export const CitationPaneStateful = props => {
|
|
13
|
+
var _props$styleProps3;
|
|
14
|
+
useEffect(() => {
|
|
15
|
+
uiTimer = createTimer();
|
|
16
|
+
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
17
|
+
Event: TelemetryEvent.UXCitationPaneStart
|
|
18
|
+
});
|
|
19
|
+
}, []);
|
|
20
|
+
const initialTabIndexMap = new Map();
|
|
21
|
+
let elements = [];
|
|
22
|
+
|
|
23
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
24
|
+
const [state, dispatch] = useChatContextStore();
|
|
25
|
+
|
|
26
|
+
// Use props.id if provided, otherwise fall back to default
|
|
27
|
+
const controlId = props.id || HtmlAttributeNames.ocwCitationPaneClassName;
|
|
28
|
+
|
|
29
|
+
// Pane style computed to match the webchat widget container bounds so the pane
|
|
30
|
+
// stays within the widget and scrolls only vertically. We also track an
|
|
31
|
+
// "isReady" flag so we don't render the pane contents until the style is
|
|
32
|
+
// computed — this prevents a transient render that can appear as a flicker.
|
|
33
|
+
const [paneStyle, setPaneStyle] = useState(null);
|
|
34
|
+
const [isReady, setIsReady] = useState(false);
|
|
35
|
+
|
|
36
|
+
// Move focus to the container
|
|
37
|
+
useEffect(() => {
|
|
38
|
+
preventFocusToMoveOutOfElement(controlId);
|
|
39
|
+
const focusableElements = findAllFocusableElement(`#${controlId}`);
|
|
40
|
+
requestAnimationFrame(() => {
|
|
41
|
+
if (focusableElements && focusableElements.length > 0 && focusableElements[0]) {
|
|
42
|
+
focusableElements[0].focus({
|
|
43
|
+
preventScroll: true
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
elements = findParentFocusableElementsWithoutChildContainer(controlId);
|
|
48
|
+
setTabIndices(elements, initialTabIndexMap, false);
|
|
49
|
+
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
50
|
+
Event: TelemetryEvent.CitationPaneLoaded
|
|
51
|
+
});
|
|
52
|
+
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
53
|
+
Event: TelemetryEvent.UXCitationPaneCompleted,
|
|
54
|
+
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
55
|
+
});
|
|
56
|
+
}, []);
|
|
57
|
+
|
|
58
|
+
// Compute the widget bounds and set pane style accordingly (95% of widget size
|
|
59
|
+
// and centered inside the widget). If the widget container can't be found,
|
|
60
|
+
// fall back to the default pane styles from defaultCitationPaneProps.
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
const compute = () => {
|
|
63
|
+
var _props$styleProps2;
|
|
64
|
+
try {
|
|
65
|
+
const container = document.querySelector(".webchat__stacked-layout_container");
|
|
66
|
+
if (container) {
|
|
67
|
+
var _props$styleProps;
|
|
68
|
+
const rect = container.getBoundingClientRect();
|
|
69
|
+
const widthPx = Math.round(rect.width * 0.95);
|
|
70
|
+
const heightPx = Math.round(rect.height * 0.95);
|
|
71
|
+
const leftPx = Math.round(rect.left + (rect.width - widthPx) / 2);
|
|
72
|
+
const topPx = Math.round(rect.top + (rect.height - heightPx) / 2);
|
|
73
|
+
// Clone defaults and remove transform so explicit left/top pixel
|
|
74
|
+
// coordinates are respected and the pane stays within the
|
|
75
|
+
// widget bounds.
|
|
76
|
+
const base = Object.assign({}, defaultCitationPaneStyles.pane);
|
|
77
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
78
|
+
if (base && base.transform) {
|
|
79
|
+
// remove centering transform when we compute exact pixel coords
|
|
80
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
81
|
+
delete base.transform;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Merge user styles first, then computed positioning to ensure proper positioning
|
|
85
|
+
const computedStyle = {
|
|
86
|
+
left: `${leftPx}px`,
|
|
87
|
+
top: `${topPx}px`,
|
|
88
|
+
width: `${widthPx}px`,
|
|
89
|
+
height: `${heightPx}px`
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// Apply user styles first, then override with computed positioning
|
|
93
|
+
const generalProps = (_props$styleProps = props.styleProps) === null || _props$styleProps === void 0 ? void 0 : _props$styleProps.generalStyleProps;
|
|
94
|
+
const userStyles = generalProps && typeof generalProps === "object" ? Object.assign({}, generalProps) : {};
|
|
95
|
+
// Remove positioning properties from user styles that would interfere
|
|
96
|
+
delete userStyles.position;
|
|
97
|
+
delete userStyles.left;
|
|
98
|
+
delete userStyles.top;
|
|
99
|
+
delete userStyles.width;
|
|
100
|
+
delete userStyles.height;
|
|
101
|
+
setPaneStyle(Object.assign({}, base, userStyles, computedStyle));
|
|
102
|
+
// Make the pane visible after the next paint to avoid layout
|
|
103
|
+
// flashes on initial mount.
|
|
104
|
+
requestAnimationFrame(() => setIsReady(true));
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
} catch (e) {
|
|
108
|
+
// ignore
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// fallback - merge defaults with user-provided styles but preserve positioning
|
|
112
|
+
const generalProps = (_props$styleProps2 = props.styleProps) === null || _props$styleProps2 === void 0 ? void 0 : _props$styleProps2.generalStyleProps;
|
|
113
|
+
const userStyles = generalProps && typeof generalProps === "object" ? Object.assign({}, generalProps) : {};
|
|
114
|
+
// Remove positioning properties from user styles for fallback
|
|
115
|
+
delete userStyles.position;
|
|
116
|
+
delete userStyles.left;
|
|
117
|
+
delete userStyles.top;
|
|
118
|
+
delete userStyles.width;
|
|
119
|
+
delete userStyles.height;
|
|
120
|
+
const fallbackStyle = Object.assign({}, defaultCitationPaneStyles.pane, userStyles);
|
|
121
|
+
setPaneStyle(fallbackStyle);
|
|
122
|
+
requestAnimationFrame(() => setIsReady(true));
|
|
123
|
+
};
|
|
124
|
+
compute();
|
|
125
|
+
window.addEventListener("resize", compute);
|
|
126
|
+
return () => window.removeEventListener("resize", compute);
|
|
127
|
+
}, [(_props$styleProps3 = props.styleProps) === null || _props$styleProps3 === void 0 ? void 0 : _props$styleProps3.generalStyleProps]);
|
|
128
|
+
const handleClose = () => {
|
|
129
|
+
if (props.onClose) props.onClose();
|
|
130
|
+
dispatch({
|
|
131
|
+
type: LiveChatWidgetActionType.SET_PREVIOUS_FOCUSED_ELEMENT_ID,
|
|
132
|
+
payload: null
|
|
133
|
+
});
|
|
134
|
+
setTabIndices(elements, initialTabIndexMap, true);
|
|
135
|
+
};
|
|
136
|
+
|
|
137
|
+
// Merge a safe style object for the container and cast to CSSProperties to satisfy TS
|
|
138
|
+
const baseStyle = Object.assign({
|
|
139
|
+
position: "relative"
|
|
140
|
+
}, paneStyle ?? {
|
|
141
|
+
position: "fixed"
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
// If paneStyle hasn't been computed yet, render the DimLayer so clicks
|
|
145
|
+
// still close overlays but hide the pane itself to avoid flashes.
|
|
146
|
+
const hiddenStyle = {
|
|
147
|
+
visibility: isReady ? "visible" : "hidden",
|
|
148
|
+
pointerEvents: isReady ? "auto" : "none"
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
// Default wrapper styles - these control the positioning container
|
|
152
|
+
const defaultWrapperStyles = {
|
|
153
|
+
display: "flex",
|
|
154
|
+
flexDirection: "column",
|
|
155
|
+
zIndex: 10001
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// Wrapper styles for the positioning container
|
|
159
|
+
const wrapperStyles = Object.assign({}, baseStyle, hiddenStyle, defaultWrapperStyles);
|
|
160
|
+
|
|
161
|
+
// Merge the computed positioning styles with user's generalStyleProps for the CitationPane
|
|
162
|
+
const mergedStyleProps = props.styleProps ? {
|
|
163
|
+
...props.styleProps,
|
|
164
|
+
generalStyleProps: Object.assign({}, props.styleProps.generalStyleProps)
|
|
165
|
+
} : undefined;
|
|
166
|
+
const controlProps = {
|
|
167
|
+
id: controlId,
|
|
168
|
+
dir: state.domainStates.globalDir,
|
|
169
|
+
titleText: props.title,
|
|
170
|
+
contentHtml: props.contentHtml,
|
|
171
|
+
brightnessValueOnDim: "0.2",
|
|
172
|
+
// Default brightness
|
|
173
|
+
onClose: handleClose,
|
|
174
|
+
...(props === null || props === void 0 ? void 0 : props.controlProps) // User props override defaults
|
|
175
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(CitationDim, {
|
|
179
|
+
brightness: controlProps.brightnessValueOnDim
|
|
180
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
181
|
+
style: wrapperStyles
|
|
182
|
+
}, /*#__PURE__*/React.createElement(CitationPane, {
|
|
183
|
+
controlProps: controlProps,
|
|
184
|
+
styleProps: mergedStyleProps
|
|
185
|
+
})));
|
|
186
|
+
};
|
|
187
|
+
export default CitationPaneStateful;
|
package/lib/esm/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
export const defaultCitationPaneStyles = {
|
|
2
|
+
pane: {
|
|
3
|
+
position: "fixed",
|
|
4
|
+
left: "50%",
|
|
5
|
+
top: "18%",
|
|
6
|
+
transform: "translateX(-50%)",
|
|
7
|
+
background: "#fff",
|
|
8
|
+
width: "85%",
|
|
9
|
+
height: "85%",
|
|
10
|
+
overflowY: "auto",
|
|
11
|
+
overflowX: "hidden",
|
|
12
|
+
padding: 16,
|
|
13
|
+
borderRadius: 6,
|
|
14
|
+
zIndex: 10001,
|
|
15
|
+
boxSizing: "border-box"
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
export const defaultCitationContentCSS = controlId => `
|
|
19
|
+
#${controlId} .citation-content {
|
|
20
|
+
flex: 1;
|
|
21
|
+
min-height: 0; /* allow flex child to scroll */
|
|
22
|
+
overflow-y: auto;
|
|
23
|
+
overflow-x: auto;
|
|
24
|
+
margin-bottom: 12px;
|
|
25
|
+
white-space: normal; /* wrap normal text */
|
|
26
|
+
word-break: break-word;
|
|
27
|
+
-webkit-overflow-scrolling: touch;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
#${controlId} .citation-content pre,
|
|
31
|
+
#${controlId} .citation-content code {
|
|
32
|
+
white-space: pre; /* preserve formatting */
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
#${controlId} .citation-content table {
|
|
36
|
+
width: 100%;
|
|
37
|
+
border-collapse: collapse;
|
|
38
|
+
margin-bottom: 12px;
|
|
39
|
+
table-layout: auto;
|
|
40
|
+
overflow-x: auto;
|
|
41
|
+
display: block;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
#${controlId} .citation-content table th,
|
|
45
|
+
#${controlId} .citation-content table td {
|
|
46
|
+
padding: 8px 12px;
|
|
47
|
+
border: 1px solid rgba(0,0,0,0.08);
|
|
48
|
+
text-align: left;
|
|
49
|
+
vertical-align: top;
|
|
50
|
+
word-break: break-word;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
#${controlId} .citation-content img {
|
|
54
|
+
max-width: 100%;
|
|
55
|
+
height: auto;
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
export default {
|
|
59
|
+
defaultCitationPaneStyles,
|
|
60
|
+
defaultCitationContentCSS
|
|
61
|
+
};
|
package/lib/esm/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js
CHANGED
|
@@ -13,7 +13,6 @@ import { TelemetryManager } from "../../../../common/telemetry/TelemetryManager"
|
|
|
13
13
|
const supportedSignInCardContentTypes = ["application/vnd.microsoft.card.signin", "application/vnd.microsoft.card.oauth"];
|
|
14
14
|
const botOauthUrlRegex = /[\S]+.botframework.com\/api\/oauth\/signin\?signin=([\S]+)/;
|
|
15
15
|
const delay = t => new Promise(resolve => setTimeout(resolve, t));
|
|
16
|
-
let response;
|
|
17
16
|
const extractSignInId = signInUrl => {
|
|
18
17
|
const result = botOauthUrlRegex.exec(signInUrl);
|
|
19
18
|
if (result && result[1]) {
|
|
@@ -49,20 +48,20 @@ const fetchBotAuthConfig = async (retries, interval) => {
|
|
|
49
48
|
eventName: BroadcastEvent.BotAuthConfigRequest
|
|
50
49
|
};
|
|
51
50
|
BroadcastService.postMessage(botAuthConfigRequestEvent);
|
|
51
|
+
let response;
|
|
52
52
|
const listener = BroadcastService.getMessageByEventName(BroadcastEvent.BotAuthConfigResponse).subscribe(data => {
|
|
53
53
|
var _data$payload, _data$payload2;
|
|
54
54
|
response = ((_data$payload = data.payload) === null || _data$payload === void 0 ? void 0 : _data$payload.response) !== undefined ? (_data$payload2 = data.payload) === null || _data$payload2 === void 0 ? void 0 : _data$payload2.response : response;
|
|
55
55
|
listener.unsubscribe();
|
|
56
56
|
});
|
|
57
|
-
if (response !== undefined) {
|
|
58
|
-
//return response;
|
|
59
|
-
return response;
|
|
60
|
-
}
|
|
61
57
|
if (retries === 1) {
|
|
62
58
|
// Base Case
|
|
63
59
|
throw new Error();
|
|
64
60
|
}
|
|
65
61
|
await delay(interval);
|
|
62
|
+
if (response !== undefined) {
|
|
63
|
+
return response;
|
|
64
|
+
}
|
|
66
65
|
return await fetchBotAuthConfig(--retries, interval);
|
|
67
66
|
};
|
|
68
67
|
export let BotAuthActivitySubscriber = /*#__PURE__*/function () {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BroadcastEvent, LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
2
|
-
import { ConfirmationState, Constants, ConversationEndEntity, ParticipantType, PrepareEndChatDescriptionConstants } from "../../../common/Constants";
|
|
2
|
+
import { ConfirmationState, Constants, ConversationEndEntity, LiveWorkItemState, ParticipantType, PrepareEndChatDescriptionConstants } from "../../../common/Constants";
|
|
3
3
|
import { getConversationDetailsCall, getWidgetEndChatEventName } from "../../../common/utils";
|
|
4
4
|
import { getPostChatContext, initiatePostChat } from "./renderSurveyHelpers";
|
|
5
5
|
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
@@ -39,7 +39,7 @@ const prepareEndChat = async (props, facadeChatSDK, state, dispatch, setAdapter,
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
// Use Case: If ended by Agent, stay chat in InActive state
|
|
42
|
-
|
|
42
|
+
const isConversationalSurveyEnabled = state.appStates.isConversationalSurveyEnabled;
|
|
43
43
|
if (isConversationalSurveyEnabled && ((state === null || state === void 0 ? void 0 : (_state$appStates2 = state.appStates) === null || _state$appStates2 === void 0 ? void 0 : _state$appStates2.conversationEndedBy) === ConversationEndEntity.Agent || (state === null || state === void 0 ? void 0 : (_state$appStates3 = state.appStates) === null || _state$appStates3 === void 0 ? void 0 : _state$appStates3.conversationEndedBy) === ConversationEndEntity.Bot)) {
|
|
44
44
|
dispatch({
|
|
45
45
|
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
@@ -147,8 +147,27 @@ const endChat = async (props, facadeChatSDK, state, dispatch, setAdapter, setWeb
|
|
|
147
147
|
type: LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
|
|
148
148
|
payload: null
|
|
149
149
|
});
|
|
150
|
+
let isSessionEnded = inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta = inMemoryState.appStates) === null || _inMemoryState$appSta === void 0 ? void 0 : _inMemoryState$appSta.chatDisconnectEventReceived;
|
|
151
|
+
if (!isSessionEnded) {
|
|
152
|
+
// double check by fetching the latest conversation details
|
|
153
|
+
const conversationDetails = await getConversationDetailsCall(facadeChatSDK);
|
|
154
|
+
if ((conversationDetails === null || conversationDetails === void 0 ? void 0 : conversationDetails.state) === LiveWorkItemState.WrapUp || (conversationDetails === null || conversationDetails === void 0 ? void 0 : conversationDetails.state) === LiveWorkItemState.Closed) {
|
|
155
|
+
dispatch({
|
|
156
|
+
type: LiveChatWidgetActionType.SET_CHAT_DISCONNECT_EVENT_RECEIVED,
|
|
157
|
+
payload: true
|
|
158
|
+
});
|
|
159
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
160
|
+
Event: TelemetryEvent.ChatDisconnectThreadEventReceived,
|
|
161
|
+
Description: "Checking conversation details upon endChat. Chat disconnected.",
|
|
162
|
+
CustomProperties: {
|
|
163
|
+
conversationDetails
|
|
164
|
+
}
|
|
165
|
+
});
|
|
166
|
+
isSessionEnded = true;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
150
169
|
const endChatOptionalParameters = {
|
|
151
|
-
isSessionEnded
|
|
170
|
+
isSessionEnded
|
|
152
171
|
};
|
|
153
172
|
try {
|
|
154
173
|
TelemetryHelper.logSDKEvent(LogLevel.INFO, {
|
|
@@ -211,7 +230,7 @@ const endChat = async (props, facadeChatSDK, state, dispatch, setAdapter, setWeb
|
|
|
211
230
|
payload: undefined
|
|
212
231
|
});
|
|
213
232
|
// Always allow to close the chat for embedded mode irrespective of end chat errors
|
|
214
|
-
closeChatWidget(dispatch);
|
|
233
|
+
closeChatWidget(dispatch, setWebChatStyles, props);
|
|
215
234
|
facadeChatSDK.destroy();
|
|
216
235
|
}
|
|
217
236
|
}
|
|
@@ -296,6 +315,10 @@ export const closeChatStateCleanUp = dispatch => {
|
|
|
296
315
|
proactiveChatInNewWindow: false
|
|
297
316
|
}
|
|
298
317
|
});
|
|
318
|
+
dispatch({
|
|
319
|
+
type: LiveChatWidgetActionType.SET_CITATIONS,
|
|
320
|
+
payload: {}
|
|
321
|
+
});
|
|
299
322
|
|
|
300
323
|
// Clear live chat context only if chat widget is fully closed to support transcript calls after sessionclose is called
|
|
301
324
|
dispatch({
|
|
@@ -339,12 +362,22 @@ export const endVoiceVideoCallIfOngoing = async (facadeChatSDK, dispatch) => {
|
|
|
339
362
|
}, callId);
|
|
340
363
|
}
|
|
341
364
|
};
|
|
342
|
-
|
|
365
|
+
|
|
366
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
367
|
+
const closeChatWidget = (dispatch, setWebChatStyles, props) => {
|
|
368
|
+
var _props$webChatContain2, _props$webChatContain3;
|
|
343
369
|
// Embedded chat
|
|
344
370
|
dispatch({
|
|
345
371
|
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
346
372
|
payload: ConversationState.Closed
|
|
347
373
|
});
|
|
374
|
+
|
|
375
|
+
// if customer is setting the hideSendbox, we should not alter its value
|
|
376
|
+
if ((props === null || props === void 0 ? void 0 : (_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 ? void 0 : (_props$webChatContain3 = _props$webChatContain2.webChatStyles) === null || _props$webChatContain3 === void 0 ? void 0 : _props$webChatContain3.hideSendBox) === true) return;
|
|
377
|
+
setWebChatStyles(styles => ({
|
|
378
|
+
...styles,
|
|
379
|
+
hideSendBox: false
|
|
380
|
+
}));
|
|
348
381
|
};
|
|
349
382
|
|
|
350
383
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ConversationEndEntity, ParticipantType } from "../../../common/Constants";
|
|
2
2
|
import { LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
3
3
|
import { changeLanguageCodeFormatForWebChat, getConversationDetailsCall } from "../../../common/utils";
|
|
4
|
+
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
5
|
+
import { Constants } from "../../../common/Constants";
|
|
6
|
+
import { ConversationState } from "../../../contexts/common/ConversationState";
|
|
4
7
|
import DOMPurify from "dompurify";
|
|
5
8
|
import HyperlinkTextOverrideRenderer from "../../webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer";
|
|
6
9
|
import { LiveChatWidgetActionType } from "../../../contexts/common/LiveChatWidgetActionType";
|
|
@@ -12,36 +15,35 @@ import { createActivityMiddleware } from "../../webchatcontainerstateful/webchat
|
|
|
12
15
|
import { createAttachmentMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware";
|
|
13
16
|
import createAttachmentUploadValidatorMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware";
|
|
14
17
|
import { createAvatarMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware";
|
|
18
|
+
import createCallActionMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/callActionMiddleware";
|
|
15
19
|
import { createCardActionMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware";
|
|
20
|
+
import { createCitationsMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware";
|
|
16
21
|
import createConversationEndMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware";
|
|
22
|
+
import createCustomEventMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware";
|
|
17
23
|
import createDataMaskingMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware";
|
|
18
24
|
import { createMarkdown } from "./createMarkdown";
|
|
19
25
|
import createMaxMessageSizeValidator from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator";
|
|
20
26
|
import { createMessageSequenceIdOverrideMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware";
|
|
21
27
|
import { createMessageTimeStampMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware";
|
|
28
|
+
import { createQueueOverflowMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware";
|
|
22
29
|
import { createStore } from "botframework-webchat";
|
|
23
30
|
import { createToastMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware";
|
|
24
31
|
import { createWebChatTelemetry } from "../../webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger";
|
|
25
32
|
import { defaultAttachmentProps } from "../../webchatcontainerstateful/common/defaultProps/defaultAttachmentProps";
|
|
26
33
|
import { defaultMiddlewareLocalizedTexts } from "../../webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
27
34
|
import { defaultWebChatContainerStatefulProps } from "../../webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps";
|
|
35
|
+
import { executeReducer } from "../../../contexts/createReducer";
|
|
28
36
|
import { getLocaleStringFromId } from "@microsoft/omnichannel-chat-sdk";
|
|
29
37
|
import gifUploadMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware";
|
|
30
38
|
import htmlPlayerMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware";
|
|
31
39
|
import htmlTextMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware";
|
|
32
40
|
import preProcessingMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware";
|
|
33
41
|
import sanitizationMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware";
|
|
34
|
-
import {
|
|
35
|
-
import createCallActionMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/callActionMiddleware";
|
|
36
|
-
import createCustomEventMiddleware from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware";
|
|
37
|
-
import { ConversationState } from "../../../contexts/common/ConversationState";
|
|
38
|
-
import { executeReducer } from "../../../contexts/createReducer";
|
|
39
|
-
import { createQueueOverflowMiddleware } from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware";
|
|
40
|
-
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
42
|
+
import { localizedStringsBotInitialsMiddleware, getOverriddenLocalizedStrings } from "../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware";
|
|
41
43
|
|
|
42
44
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
43
45
|
export const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endChat) => {
|
|
44
|
-
var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _props$webChatContain4, _props$webChatContain5, _props$webChatContain6, _state$domainStates$l4, _state$domainStates$l5, _props$webChatContain11, _props$webChatContain12, _state$domainStates$r, _state$domainStates$r2, _props$webChatContain13, _props$webChatContain14, _state$domainStates$r3, _state$domainStates$r4, _props$webChatContain15, _props$webChatContain16, _defaultWebChatContai, _props$webChatContain17, _props$webChatContain18, _props$webChatContain19, _props$webChatContain20, _state$domainStates$r5, _state$domainStates$r6, _props$webChatContain21, _props$webChatContain22, _defaultWebChatContai2, _props$webChatContain23, _props$webChatContain24, _defaultWebChatContai3, _props$webChatContain25, _props$webChatContain26;
|
|
46
|
+
var _props$webChatContain, _props$webChatContain2, _props$webChatContain3, _props$webChatContain4, _props$webChatContain5, _props$webChatContain6, _state$domainStates$l4, _state$domainStates$l5, _props$webChatContain11, _props$webChatContain12, _state$domainStates$r, _state$domainStates$r2, _props$webChatContain13, _props$webChatContain14, _state$domainStates$r3, _state$domainStates$r4, _props$webChatContain15, _props$webChatContain16, _defaultWebChatContai, _props$webChatContain17, _props$webChatContain18, _props$webChatContain19, _props$webChatContain20, _state$domainStates$r5, _state$domainStates$r6, _props$webChatContain21, _props$webChatContain22, _defaultWebChatContai2, _props$webChatContain23, _props$webChatContain24, _defaultWebChatContai3, _props$webChatContain25, _props$webChatContain26, _props$webChatContain27, _props$webChatContain28;
|
|
45
47
|
// Add a hook to make all links open a new window
|
|
46
48
|
postDomPurifyActivities();
|
|
47
49
|
const localizedTexts = {
|
|
@@ -116,7 +118,7 @@ export const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endCh
|
|
|
116
118
|
};
|
|
117
119
|
webChatStore = createStore({},
|
|
118
120
|
//initial state
|
|
119
|
-
preProcessingMiddleware, attachmentProcessingMiddleware, createAttachmentUploadValidatorMiddleware((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : _state$domainStates$l.allowedFileExtensions, (_state$domainStates$l2 = state.domainStates.liveChatConfig) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.maxUploadFileSize, localizedTexts), createCustomEventMiddleware(BroadcastService), createQueueOverflowMiddleware(state, dispatch), channelDataMiddleware(addConversationalSurveyTagsCallback), createConversationEndMiddleware(conversationEndCallback, startConversationalSurveyCallback, endConversationalSurveyCallback), createDataMaskingMiddleware((_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : _state$domainStates$l3.DataMaskingInfo), createMessageTimeStampMiddleware, createMessageSequenceIdOverrideMiddleware, gifUploadMiddleware, htmlPlayerMiddleware, htmlTextMiddleware(honorsTargetInHTMLLinks), createMaxMessageSizeValidator(localizedTexts), sanitizationMiddleware, createCallActionMiddleware(),
|
|
121
|
+
preProcessingMiddleware, attachmentProcessingMiddleware, createAttachmentUploadValidatorMiddleware((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : _state$domainStates$l.allowedFileExtensions, (_state$domainStates$l2 = state.domainStates.liveChatConfig) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.maxUploadFileSize, localizedTexts), createCustomEventMiddleware(BroadcastService), createQueueOverflowMiddleware(state, dispatch), channelDataMiddleware(addConversationalSurveyTagsCallback), createConversationEndMiddleware(conversationEndCallback, startConversationalSurveyCallback, endConversationalSurveyCallback), createDataMaskingMiddleware((_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : _state$domainStates$l3.DataMaskingInfo), createMessageTimeStampMiddleware, createMessageSequenceIdOverrideMiddleware, createCitationsMiddleware(state, dispatch), gifUploadMiddleware, htmlPlayerMiddleware, htmlTextMiddleware(honorsTargetInHTMLLinks), createMaxMessageSizeValidator(localizedTexts), sanitizationMiddleware, createCallActionMiddleware(), localizedStringsBotInitialsMiddleware(),
|
|
120
122
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
121
123
|
...(((_props$webChatContain7 = props.webChatContainerProps) === null || _props$webChatContain7 === void 0 ? void 0 : _props$webChatContain7.storeMiddlewares) ?? []));
|
|
122
124
|
WebChatStoreLoader.store = webChatStore;
|
|
@@ -170,7 +172,8 @@ export const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endCh
|
|
|
170
172
|
onTelemetry: createWebChatTelemetry(),
|
|
171
173
|
cardActionMiddleware: createCardActionMiddleware(((_props$webChatContain25 = props.webChatContainerProps) === null || _props$webChatContain25 === void 0 ? void 0 : _props$webChatContain25.botMagicCode) || undefined),
|
|
172
174
|
sendTypingIndicator: true,
|
|
173
|
-
|
|
175
|
+
overrideLocalizedStrings: getOverriddenLocalizedStrings((_props$webChatContain26 = props.webChatContainerProps) === null || _props$webChatContain26 === void 0 ? void 0 : (_props$webChatContain27 = _props$webChatContain26.webChatProps) === null || _props$webChatContain27 === void 0 ? void 0 : _props$webChatContain27.overrideLocalizedStrings),
|
|
176
|
+
...((_props$webChatContain28 = props.webChatContainerProps) === null || _props$webChatContain28 === void 0 ? void 0 : _props$webChatContain28.webChatProps)
|
|
174
177
|
};
|
|
175
178
|
return webChatProps;
|
|
176
179
|
};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BroadcastEvent, LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryConstants";
|
|
2
2
|
import { Constants, LiveWorkItemState, WidgetLoadTelemetryMessage } from "../../../common/Constants";
|
|
3
|
+
import { TelemetryManager, TelemetryTimers } from "../../../common/telemetry/TelemetryManager";
|
|
3
4
|
import { checkContactIdError, createTimer, getConversationDetailsCall, getStateFromCache, getWidgetCacheIdfromProps, isNullOrEmptyString, isNullOrUndefined, isUndefinedOrEmpty } from "../../../common/utils";
|
|
4
5
|
import { handleChatReconnect, isPersistentEnabled, isReconnectEnabled } from "./reconnectChatHelper";
|
|
5
6
|
import { handleStartChatError, logWidgetLoadComplete } from "./startChatErrorHandler";
|
|
@@ -8,7 +9,6 @@ import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
|
8
9
|
import { ConversationState } from "../../../contexts/common/ConversationState";
|
|
9
10
|
import { LiveChatWidgetActionType } from "../../../contexts/common/LiveChatWidgetActionType";
|
|
10
11
|
import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
|
|
11
|
-
import { TelemetryTimers } from "../../../common/telemetry/TelemetryManager";
|
|
12
12
|
import { chatSDKStateCleanUp } from "./endChat";
|
|
13
13
|
import { createAdapter } from "./createAdapter";
|
|
14
14
|
import { createOnNewAdapterActivityHandler } from "../../../plugins/newMessageEventHandler";
|
|
@@ -131,7 +131,7 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
|
|
|
131
131
|
* This is because a new change to control OOH as closed event when a widget is coming from chat.
|
|
132
132
|
*/
|
|
133
133
|
if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized) === undefined || (state === null || state === void 0 ? void 0 : (_state$appStates2 = state.appStates) === null || _state$appStates2 === void 0 ? void 0 : _state$appStates2.isMinimized) === true) {
|
|
134
|
-
var _state$domainStates5, _state$domainStates5$, _state$domainStates6, _state$domainStates6
|
|
134
|
+
var _state$domainStates5, _state$domainStates5$, _state$domainStates6, _state$domainStates6$, _TelemetryManager$Int;
|
|
135
135
|
dispatch({
|
|
136
136
|
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
137
137
|
payload: false
|
|
@@ -141,7 +141,8 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
|
|
|
141
141
|
eventName: BroadcastEvent.MaximizeChat,
|
|
142
142
|
payload: {
|
|
143
143
|
height: state === null || state === void 0 ? void 0 : (_state$domainStates5 = state.domainStates) === null || _state$domainStates5 === void 0 ? void 0 : (_state$domainStates5$ = _state$domainStates5.widgetSize) === null || _state$domainStates5$ === void 0 ? void 0 : _state$domainStates5$.height,
|
|
144
|
-
width: state === null || state === void 0 ? void 0 : (_state$domainStates6 = state.domainStates) === null || _state$domainStates6 === void 0 ? void 0 : (_state$domainStates6$ = _state$domainStates6.widgetSize) === null || _state$domainStates6$ === void 0 ? void 0 : _state$domainStates6$.width
|
|
144
|
+
width: state === null || state === void 0 ? void 0 : (_state$domainStates6 = state.domainStates) === null || _state$domainStates6 === void 0 ? void 0 : (_state$domainStates6$ = _state$domainStates6.widgetSize) === null || _state$domainStates6$ === void 0 ? void 0 : _state$domainStates6$.width,
|
|
145
|
+
runtimeId: TelemetryManager === null || TelemetryManager === void 0 ? void 0 : (_TelemetryManager$Int = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.lcwRuntimeId
|
|
145
146
|
}
|
|
146
147
|
});
|
|
147
148
|
}
|