@microsoft/omnichannel-chat-widget 1.8.3-main.717ca8d → 1.8.3-main.b5b8289
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/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 +33 -4
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +12 -9
- package/lib/cjs/components/livechatwidget/common/startChat.js +5 -4
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +35 -1
- 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/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 +34 -5
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +13 -10
- package/lib/esm/components/livechatwidget/common/startChat.js +5 -4
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +35 -1
- 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
|
@@ -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,23 @@ 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
|
+
TelemetryHelper.logActionEvent(LogLevel.INFO, {
|
|
156
|
+
Event: TelemetryEvent.ChatDisconnectThreadEventReceived,
|
|
157
|
+
Description: "Checking conversation details upon endChat. Chat disconnected.",
|
|
158
|
+
CustomProperties: {
|
|
159
|
+
conversationDetails
|
|
160
|
+
}
|
|
161
|
+
});
|
|
162
|
+
isSessionEnded = true;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
150
165
|
const endChatOptionalParameters = {
|
|
151
|
-
isSessionEnded
|
|
166
|
+
isSessionEnded
|
|
152
167
|
};
|
|
153
168
|
try {
|
|
154
169
|
TelemetryHelper.logSDKEvent(LogLevel.INFO, {
|
|
@@ -211,7 +226,7 @@ const endChat = async (props, facadeChatSDK, state, dispatch, setAdapter, setWeb
|
|
|
211
226
|
payload: undefined
|
|
212
227
|
});
|
|
213
228
|
// Always allow to close the chat for embedded mode irrespective of end chat errors
|
|
214
|
-
closeChatWidget(dispatch);
|
|
229
|
+
closeChatWidget(dispatch, setWebChatStyles, props);
|
|
215
230
|
facadeChatSDK.destroy();
|
|
216
231
|
}
|
|
217
232
|
}
|
|
@@ -296,6 +311,10 @@ export const closeChatStateCleanUp = dispatch => {
|
|
|
296
311
|
proactiveChatInNewWindow: false
|
|
297
312
|
}
|
|
298
313
|
});
|
|
314
|
+
dispatch({
|
|
315
|
+
type: LiveChatWidgetActionType.SET_CITATIONS,
|
|
316
|
+
payload: {}
|
|
317
|
+
});
|
|
299
318
|
|
|
300
319
|
// Clear live chat context only if chat widget is fully closed to support transcript calls after sessionclose is called
|
|
301
320
|
dispatch({
|
|
@@ -339,12 +358,22 @@ export const endVoiceVideoCallIfOngoing = async (facadeChatSDK, dispatch) => {
|
|
|
339
358
|
}, callId);
|
|
340
359
|
}
|
|
341
360
|
};
|
|
342
|
-
|
|
361
|
+
|
|
362
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
363
|
+
const closeChatWidget = (dispatch, setWebChatStyles, props) => {
|
|
364
|
+
var _props$webChatContain2, _props$webChatContain3;
|
|
343
365
|
// Embedded chat
|
|
344
366
|
dispatch({
|
|
345
367
|
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
346
368
|
payload: ConversationState.Closed
|
|
347
369
|
});
|
|
370
|
+
|
|
371
|
+
// if customer is setting the hideSendbox, we should not alter its value
|
|
372
|
+
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;
|
|
373
|
+
setWebChatStyles(styles => ({
|
|
374
|
+
...styles,
|
|
375
|
+
hideSendBox: false
|
|
376
|
+
}));
|
|
348
377
|
};
|
|
349
378
|
|
|
350
379
|
// 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
|
};
|
|
@@ -99,7 +99,7 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
|
|
|
99
99
|
|
|
100
100
|
// If minimized, maximize the chat, if the state is missing, consider it as minimized
|
|
101
101
|
if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized) === undefined || (state === null || state === void 0 ? void 0 : (_state$appStates = state.appStates) === null || _state$appStates === void 0 ? void 0 : _state$appStates.isMinimized) === true) {
|
|
102
|
-
var _state$domainStates3, _state$domainStates3$, _state$domainStates4, _state$domainStates4
|
|
102
|
+
var _state$domainStates3, _state$domainStates3$, _state$domainStates4, _state$domainStates4$, _TelemetryManager$Int;
|
|
103
103
|
dispatch({
|
|
104
104
|
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
105
105
|
payload: false
|
|
@@ -110,7 +110,8 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
|
|
|
110
110
|
eventName: BroadcastEvent.MaximizeChat,
|
|
111
111
|
payload: {
|
|
112
112
|
height: state === null || state === void 0 ? void 0 : (_state$domainStates3 = state.domainStates) === null || _state$domainStates3 === void 0 ? void 0 : (_state$domainStates3$ = _state$domainStates3.widgetSize) === null || _state$domainStates3$ === void 0 ? void 0 : _state$domainStates3$.height,
|
|
113
|
-
width: state === null || state === void 0 ? void 0 : (_state$domainStates4 = state.domainStates) === null || _state$domainStates4 === void 0 ? void 0 : (_state$domainStates4$ = _state$domainStates4.widgetSize) === null || _state$domainStates4$ === void 0 ? void 0 : _state$domainStates4$.width
|
|
113
|
+
width: state === null || state === void 0 ? void 0 : (_state$domainStates4 = state.domainStates) === null || _state$domainStates4 === void 0 ? void 0 : (_state$domainStates4$ = _state$domainStates4.widgetSize) === null || _state$domainStates4$ === void 0 ? void 0 : _state$domainStates4$.width,
|
|
114
|
+
runtimeId: TelemetryManager === null || TelemetryManager === void 0 ? void 0 : (_TelemetryManager$Int = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.lcwRuntimeId
|
|
114
115
|
}
|
|
115
116
|
});
|
|
116
117
|
}
|
|
@@ -131,7 +132,7 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
|
|
|
131
132
|
* This is because a new change to control OOH as closed event when a widget is coming from chat.
|
|
132
133
|
*/
|
|
133
134
|
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$, _TelemetryManager$
|
|
135
|
+
var _state$domainStates5, _state$domainStates5$, _state$domainStates6, _state$domainStates6$, _TelemetryManager$Int2;
|
|
135
136
|
dispatch({
|
|
136
137
|
type: LiveChatWidgetActionType.SET_MINIMIZED,
|
|
137
138
|
payload: false
|
|
@@ -142,7 +143,7 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
|
|
|
142
143
|
payload: {
|
|
143
144
|
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
145
|
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$
|
|
146
|
+
runtimeId: TelemetryManager === null || TelemetryManager === void 0 ? void 0 : (_TelemetryManager$Int2 = TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int2 === void 0 ? void 0 : _TelemetryManager$Int2.lcwRuntimeId
|
|
146
147
|
}
|
|
147
148
|
});
|
|
148
149
|
}
|
|
@@ -480,7 +480,8 @@ export const LiveChatWidgetStateful = props => {
|
|
|
480
480
|
eventName: BroadcastEvent.MaximizeChat,
|
|
481
481
|
payload: {
|
|
482
482
|
height: inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$domain = inMemoryState.domainStates) === null || _inMemoryState$domain === void 0 ? void 0 : (_inMemoryState$domain2 = _inMemoryState$domain.widgetSize) === null || _inMemoryState$domain2 === void 0 ? void 0 : _inMemoryState$domain2.height,
|
|
483
|
-
width: inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$domain3 = inMemoryState.domainStates) === null || _inMemoryState$domain3 === void 0 ? void 0 : (_inMemoryState$domain4 = _inMemoryState$domain3.widgetSize) === null || _inMemoryState$domain4 === void 0 ? void 0 : _inMemoryState$domain4.width
|
|
483
|
+
width: inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$domain3 = inMemoryState.domainStates) === null || _inMemoryState$domain3 === void 0 ? void 0 : (_inMemoryState$domain4 = _inMemoryState$domain3.widgetSize) === null || _inMemoryState$domain4 === void 0 ? void 0 : _inMemoryState$domain4.width,
|
|
484
|
+
lcwRuntimeId: TelemetryManager.InternalTelemetryData.lcwRuntimeId
|
|
484
485
|
}
|
|
485
486
|
});
|
|
486
487
|
return;
|
|
@@ -885,6 +886,29 @@ export const LiveChatWidgetStateful = props => {
|
|
|
885
886
|
background: ${scrollbarProps.thumbHoverColor};
|
|
886
887
|
}
|
|
887
888
|
|
|
889
|
+
/* High Contrast mode support - optimized for all variants */
|
|
890
|
+
@media (prefers-contrast: high), (-ms-high-contrast: active), (forced-colors: active) {
|
|
891
|
+
::-webkit-scrollbar-track {
|
|
892
|
+
background: Canvas !important;
|
|
893
|
+
border: 1px solid CanvasText !important;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
::-webkit-scrollbar-thumb {
|
|
897
|
+
background: CanvasText !important;
|
|
898
|
+
border: 1px solid Canvas !important;
|
|
899
|
+
min-height: 20px !important;
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
::-webkit-scrollbar-thumb:hover {
|
|
903
|
+
background: Highlight !important;
|
|
904
|
+
border: 1px solid CanvasText !important;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
::-webkit-scrollbar-corner {
|
|
908
|
+
background: Canvas !important;
|
|
909
|
+
}
|
|
910
|
+
}
|
|
911
|
+
|
|
888
912
|
.webchat__basic-transcript__activity-markdown-body > :last-child {
|
|
889
913
|
margin-bottom: 0px;
|
|
890
914
|
}
|
|
@@ -892,11 +916,21 @@ export const LiveChatWidgetStateful = props => {
|
|
|
892
916
|
.webchat__basic-transcript__activity-markdown-body > :first-child {
|
|
893
917
|
margin-top: 0px;
|
|
894
918
|
}
|
|
919
|
+
|
|
895
920
|
.webchat__basic-transcript__activity-markdown-body img.webchat__render-markdown__external-link-icon {
|
|
896
921
|
background-image : url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg5MjNMMTcuOTk4NyAxNi43Mzg0VjEzLjIzMjFDMTcuOTk4NyAxMi44MTc5IDE4LjMzNDUgMTIuNDgyMSAxOC43NDg3IDEyLjQ4MjFDMTkuMTI4NCAxMi40ODIxIDE5LjQ0MjIgMTIuNzY0MyAxOS40OTE4IDEzLjEzMDNMMTkuNDk4NyAxMy4yMzIxVjE2LjczODRDMTkuNDk4NyAxOC43NDA3IDE3LjkyOTMgMjAuMzc2OSAxNS45NTI4IDIwLjQ4MjlMMTUuNzUzOCAyMC40ODg0TDcuMjU4MjcgMjAuNTAwMUw3LjA1NDk1IDIwLjQ5NDlDNS4xNDIzOSAyMC4zOTU0IDMuNjA4OTUgMTguODYyNyAzLjUwODM3IDE2Ljk1MDJMMy41MDMxMiAxNi43NTExTDMuNTAwODkgOC4yNTI3TDMuNTA1MjkgOC4wNTAyQzMuNjA1MzkgNi4xMzc0OSA1LjEzODY3IDQuNjA0NDkgNy4wNTA5NiA0LjUwNTI3TDcuMjUwMSA0LjUwMDE3SDEwLjc0OTVINy4yNTAxWk0xMy43NDgxIDMuMDAxNDZMMjAuMzAxOCAzLjAwMTk3TDIwLjQwMTQgMy4wMTU3NUwyMC41MDIyIDMuMDQzOTNMMjAuNTU5IDMuMDY4MDNDMjAuNjEyMiAzLjA5MTIyIDIwLjY2MzQgMy4xMjE2MyAyMC43MTExIDMuMTU4ODVMMjAuNzgwNCAzLjIyMTU2TDIwLjg2NDEgMy4zMjAxNEwyMC45MTgzIDMuNDEwMjVMMjAuOTU3IDMuNTAwNTdMMjAuOTc2MiAzLjU2NDc2TDIwLjk4OTggMy42Mjg2MkwyMC45OTkyIDMuNzIyODJMMjAuOTk5NyAxMC4yNTU0QzIwLjk5OTcgMTAuNjY5NiAyMC42NjM5IDExLjAwNTQgMjAuMjQ5NyAxMS4wMDU0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjMjEyMTIxIiAvPjwvc3ZnPg==) !important;
|
|
897
922
|
height: .75em;
|
|
898
923
|
margin-left: .25em;
|
|
899
924
|
}
|
|
925
|
+
|
|
926
|
+
.webchat__link-definitions__header-text {
|
|
927
|
+
color: ${bubbleBackground}
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
.webchat__link-definitions__header-chevron {
|
|
931
|
+
color: ${bubbleBackground}
|
|
932
|
+
}
|
|
933
|
+
|
|
900
934
|
${(sendBoxTextArea === null || sendBoxTextArea === void 0 ? void 0 : sendBoxTextArea.minHeight) && `
|
|
901
935
|
.webchat__auto-resize-textarea.webchat__send-box-text-box__text-area {
|
|
902
936
|
min-height: ${sendBoxTextArea === null || sendBoxTextArea === void 0 ? void 0 : sendBoxTextArea.minHeight} !important;
|