@microsoft/omnichannel-chat-widget 1.8.3-main.38c88a7 → 1.8.3-main.4743fdc
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 +158 -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/endChat.js +17 -3
- 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 +12 -6
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +86 -4
- 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 +147 -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/endChat.js +17 -3
- 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 +12 -6
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +86 -5
- 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 +3 -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
|
@@ -196,6 +196,8 @@ _defineProperty(HtmlAttributeNames, "adaptiveCardClassName", "ac-adaptiveCard");
|
|
|
196
196
|
_defineProperty(HtmlAttributeNames, "adaptiveCardTextBlockClassName", "ac-textBlock");
|
|
197
197
|
_defineProperty(HtmlAttributeNames, "adaptiveCardToggleInputClassName", "ac-toggleInput");
|
|
198
198
|
_defineProperty(HtmlAttributeNames, "adaptiveCardActionSetClassName", "ac-actionSet");
|
|
199
|
+
_defineProperty(HtmlAttributeNames, "ocwCitationPaneClassName", "ocw-citation-pane");
|
|
200
|
+
_defineProperty(HtmlAttributeNames, "ocwCitationPaneTitle", "Citation");
|
|
199
201
|
let WebChatMiddlewareConstants = /*#__PURE__*/_createClass(function WebChatMiddlewareConstants() {
|
|
200
202
|
_classCallCheck(this, WebChatMiddlewareConstants);
|
|
201
203
|
});
|
|
@@ -154,6 +154,7 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
154
154
|
TelemetryEvent["EmailTranscriptLoaded"] = "EmailTranscriptLoaded";
|
|
155
155
|
TelemetryEvent["OutOfOfficePaneLoaded"] = "OutOfOfficePaneLoaded";
|
|
156
156
|
TelemetryEvent["ConfirmationPaneLoaded"] = "ConfirmationPaneLoaded";
|
|
157
|
+
TelemetryEvent["CitationPaneLoaded"] = "CitationPaneLoaded";
|
|
157
158
|
TelemetryEvent["ProactiveChatPaneLoaded"] = "ProactiveChatPaneLoaded";
|
|
158
159
|
TelemetryEvent["ReconnectChatPaneLoaded"] = "ReconnectChatPaneLoaded";
|
|
159
160
|
TelemetryEvent["HeaderCloseButtonClicked"] = "HeaderCloseButtonClicked";
|
|
@@ -195,6 +196,7 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
195
196
|
TelemetryEvent["ProcessingSanitizationMiddlewareFailed"] = "ProcessingSanitizationMiddlewareFailed";
|
|
196
197
|
TelemetryEvent["FormatTagsMiddlewareJSONStringifyFailed"] = "FormatTagsMiddlewareJSONStringifyFailed";
|
|
197
198
|
TelemetryEvent["AttachmentUploadValidatorMiddlewareFailed"] = "AttachmentUploadValidatorMiddlewareFailed";
|
|
199
|
+
TelemetryEvent["CitationMiddlewareFailed"] = "CitationMiddlewareFailed";
|
|
198
200
|
TelemetryEvent["QueuePositionMessageRecieved"] = "QueuePositionMessageRecieved";
|
|
199
201
|
TelemetryEvent["AverageWaitTimeMessageRecieved"] = "AverageWaitTimeMessageRecieved";
|
|
200
202
|
TelemetryEvent["DataMaskingRuleApplied"] = "DataMaskingRuleApplied";
|
|
@@ -279,7 +281,9 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
279
281
|
TelemetryEvent["UXLCWChatButtonLoadingStart"] = "UXLCWChatButtonLoadingStart";
|
|
280
282
|
TelemetryEvent["UXLCWChatButtonLoadingCompleted"] = "UXLCWChatButtonLoadingCompleted";
|
|
281
283
|
TelemetryEvent["UXConfirmationPaneStart"] = "UXConfirmationPaneStart";
|
|
284
|
+
TelemetryEvent["UXCitationPaneStart"] = "UXCitationPaneStart";
|
|
282
285
|
TelemetryEvent["UXConfirmationPaneCompleted"] = "UXConfirmationPaneCompleted";
|
|
286
|
+
TelemetryEvent["UXCitationPaneCompleted"] = "UXCitationPaneCompleted";
|
|
283
287
|
TelemetryEvent["UXLiveChatWidgetStart"] = "UXLiveChatWidgetStart";
|
|
284
288
|
TelemetryEvent["UXLiveChatWidgetCompleted"] = "UXLiveChatWidgetCompleted";
|
|
285
289
|
TelemetryEvent["AppInsightsInitialized"] = "AppInsightsInitialized";
|
|
@@ -236,11 +236,13 @@ let TelemetryHelper = /*#__PURE__*/function () {
|
|
|
236
236
|
}, {
|
|
237
237
|
key: "postTelemetryEvent",
|
|
238
238
|
value: function postTelemetryEvent(eventName, logLevel, payload) {
|
|
239
|
+
var _TelemetryManager$Int16;
|
|
239
240
|
const telemetryEvent = {
|
|
240
241
|
eventName,
|
|
241
242
|
logLevel,
|
|
242
243
|
payload: {
|
|
243
|
-
...payload
|
|
244
|
+
...payload,
|
|
245
|
+
runtimeId: (_TelemetryManager$Int16 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int16 === void 0 ? void 0 : _TelemetryManager$Int16.lcwRuntimeId
|
|
244
246
|
}
|
|
245
247
|
};
|
|
246
248
|
_omnichannelChatComponents.BroadcastService.postMessage(telemetryEvent);
|
|
@@ -267,11 +269,11 @@ _defineProperty(TelemetryHelper, "logActionEvent", (logLevel, payload) => {
|
|
|
267
269
|
TelemetryHelper.postTelemetryEvent((payload === null || payload === void 0 ? void 0 : payload.Event) ?? "", logLevel, payload);
|
|
268
270
|
});
|
|
269
271
|
_defineProperty(TelemetryHelper, "logSDKEvent", (logLevel, payload) => {
|
|
270
|
-
var _TelemetryManager$
|
|
272
|
+
var _TelemetryManager$Int17;
|
|
271
273
|
TelemetryHelper.postTelemetryEvent((payload === null || payload === void 0 ? void 0 : payload.Event) ?? "", logLevel, {
|
|
272
274
|
...payload,
|
|
273
275
|
TransactionId: (0, _utils.newGuid)(),
|
|
274
|
-
RequestId: (_TelemetryManager$
|
|
276
|
+
RequestId: (_TelemetryManager$Int17 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int17 === void 0 ? void 0 : _TelemetryManager$Int17.currentRequestId
|
|
275
277
|
});
|
|
276
278
|
});
|
|
277
279
|
_defineProperty(TelemetryHelper, "logConfigDataEvent", (logLevel, payload) => {
|
|
@@ -306,12 +308,12 @@ _defineProperty(TelemetryHelper, "logFacadeChatSDKEventToAllTelemetry", (logLeve
|
|
|
306
308
|
});
|
|
307
309
|
});
|
|
308
310
|
_defineProperty(TelemetryHelper, "logSDKEventToAllTelemetry", (logLevel, payload) => {
|
|
309
|
-
var _TelemetryManager$
|
|
311
|
+
var _TelemetryManager$Int18;
|
|
310
312
|
TelemetryHelper.postTelemetryEvent((payload === null || payload === void 0 ? void 0 : payload.Event) ?? "", logLevel, {
|
|
311
313
|
...{
|
|
312
314
|
...payload,
|
|
313
315
|
TransactionId: (0, _utils.newGuid)(),
|
|
314
|
-
RequestId: (_TelemetryManager$
|
|
316
|
+
RequestId: (_TelemetryManager$Int18 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int18 === void 0 ? void 0 : _TelemetryManager$Int18.currentRequestId
|
|
315
317
|
},
|
|
316
318
|
LogToAll: true
|
|
317
319
|
});
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.CitationDim = void 0;
|
|
7
|
+
var _react = _interopRequireDefault(require("react"));
|
|
8
|
+
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
9
|
+
var _DimLayer = require("../dimlayer/DimLayer");
|
|
10
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
|
+
const CONTAINER_SELECTOR = ".webchat__stacked-layout_container";
|
|
12
|
+
const CitationDim = _ref => {
|
|
13
|
+
let {
|
|
14
|
+
brightness = "0.2"
|
|
15
|
+
} = _ref;
|
|
16
|
+
const container = document.querySelector(CONTAINER_SELECTOR);
|
|
17
|
+
if (!container) return null;
|
|
18
|
+
return /*#__PURE__*/_reactDom.default.createPortal( /*#__PURE__*/_react.default.createElement("div", {
|
|
19
|
+
style: {
|
|
20
|
+
position: "absolute",
|
|
21
|
+
inset: 0
|
|
22
|
+
}
|
|
23
|
+
}, /*#__PURE__*/_react.default.createElement(_DimLayer.DimLayer, {
|
|
24
|
+
brightness: brightness
|
|
25
|
+
})), container);
|
|
26
|
+
};
|
|
27
|
+
exports.CitationDim = CitationDim;
|
|
28
|
+
var _default = CitationDim;
|
|
29
|
+
exports.default = _default;
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.CitationPaneStateful = void 0;
|
|
7
|
+
var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
|
+
var _utils = require("../../common/utils");
|
|
10
|
+
var _CitationDim = _interopRequireDefault(require("./CitationDim"));
|
|
11
|
+
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
12
|
+
var _Constants = require("../../common/Constants");
|
|
13
|
+
var _LiveChatWidgetActionType = require("../../contexts/common/LiveChatWidgetActionType");
|
|
14
|
+
var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
15
|
+
var _defaultCitationPaneProps = require("./common/defaultProps/defaultCitationPaneProps");
|
|
16
|
+
var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
|
|
17
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
18
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
19
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
20
|
+
let uiTimer;
|
|
21
|
+
const CitationPaneStateful = props => {
|
|
22
|
+
(0, _react.useEffect)(() => {
|
|
23
|
+
uiTimer = (0, _utils.createTimer)();
|
|
24
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
25
|
+
Event: _TelemetryConstants.TelemetryEvent.UXCitationPaneStart
|
|
26
|
+
});
|
|
27
|
+
}, []);
|
|
28
|
+
const initialTabIndexMap = new Map();
|
|
29
|
+
let elements = [];
|
|
30
|
+
|
|
31
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
32
|
+
const [state, dispatch] = (0, _useChatContextStore.default)();
|
|
33
|
+
const controlId = _Constants.HtmlAttributeNames.ocwCitationPaneClassName;
|
|
34
|
+
|
|
35
|
+
// Pane style computed to match the webchat widget container bounds so the pane
|
|
36
|
+
// stays within the widget and scrolls only vertically. We also track an
|
|
37
|
+
// "isReady" flag so we don't render the pane contents until the style is
|
|
38
|
+
// computed — this prevents a transient render that can appear as a flicker.
|
|
39
|
+
const [paneStyle, setPaneStyle] = (0, _react.useState)(null);
|
|
40
|
+
const [isReady, setIsReady] = (0, _react.useState)(false);
|
|
41
|
+
|
|
42
|
+
// Move focus to the container
|
|
43
|
+
(0, _react.useEffect)(() => {
|
|
44
|
+
(0, _utils.preventFocusToMoveOutOfElement)(controlId);
|
|
45
|
+
const focusableElements = (0, _utils.findAllFocusableElement)(`#${controlId}`);
|
|
46
|
+
requestAnimationFrame(() => {
|
|
47
|
+
if (focusableElements && focusableElements.length > 0 && focusableElements[0]) {
|
|
48
|
+
focusableElements[0].focus({
|
|
49
|
+
preventScroll: true
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
elements = (0, _utils.findParentFocusableElementsWithoutChildContainer)(controlId);
|
|
54
|
+
(0, _utils.setTabIndices)(elements, initialTabIndexMap, false);
|
|
55
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
56
|
+
Event: _TelemetryConstants.TelemetryEvent.CitationPaneLoaded
|
|
57
|
+
});
|
|
58
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
59
|
+
Event: _TelemetryConstants.TelemetryEvent.UXCitationPaneCompleted,
|
|
60
|
+
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
61
|
+
});
|
|
62
|
+
}, []);
|
|
63
|
+
|
|
64
|
+
// Compute the widget bounds and set pane style accordingly (95% of widget size
|
|
65
|
+
// and centered inside the widget). If the widget container can't be found,
|
|
66
|
+
// fall back to the default pane styles from defaultCitationPaneProps.
|
|
67
|
+
(0, _react.useEffect)(() => {
|
|
68
|
+
const compute = () => {
|
|
69
|
+
try {
|
|
70
|
+
const container = document.querySelector(".webchat__stacked-layout_container");
|
|
71
|
+
if (container) {
|
|
72
|
+
const rect = container.getBoundingClientRect();
|
|
73
|
+
const widthPx = Math.round(rect.width * 0.95);
|
|
74
|
+
const heightPx = Math.round(rect.height * 0.95);
|
|
75
|
+
const leftPx = Math.round(rect.left + (rect.width - widthPx) / 2);
|
|
76
|
+
const topPx = Math.round(rect.top + (rect.height - heightPx) / 2);
|
|
77
|
+
// Clone defaults and remove transform so explicit left/top pixel
|
|
78
|
+
// coordinates are respected and the pane stays within the
|
|
79
|
+
// widget bounds.
|
|
80
|
+
const base = Object.assign({}, _defaultCitationPaneProps.defaultCitationPaneStyles.pane);
|
|
81
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
82
|
+
if (base && base.transform) {
|
|
83
|
+
// remove centering transform when we compute exact pixel coords
|
|
84
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
85
|
+
delete base.transform;
|
|
86
|
+
}
|
|
87
|
+
setPaneStyle(Object.assign({}, base, {
|
|
88
|
+
left: `${leftPx}px`,
|
|
89
|
+
top: `${topPx}px`,
|
|
90
|
+
width: `${widthPx}px`,
|
|
91
|
+
height: `${heightPx}px`
|
|
92
|
+
}));
|
|
93
|
+
// Make the pane visible after the next paint to avoid layout
|
|
94
|
+
// flashes on initial mount.
|
|
95
|
+
requestAnimationFrame(() => setIsReady(true));
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
} catch (e) {
|
|
99
|
+
// ignore
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// fallback
|
|
103
|
+
setPaneStyle(_defaultCitationPaneProps.defaultCitationPaneStyles.pane);
|
|
104
|
+
requestAnimationFrame(() => setIsReady(true));
|
|
105
|
+
};
|
|
106
|
+
compute();
|
|
107
|
+
window.addEventListener("resize", compute);
|
|
108
|
+
return () => window.removeEventListener("resize", compute);
|
|
109
|
+
}, []);
|
|
110
|
+
const handleClose = () => {
|
|
111
|
+
if (props.onClose) props.onClose();
|
|
112
|
+
dispatch({
|
|
113
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_PREVIOUS_FOCUSED_ELEMENT_ID,
|
|
114
|
+
payload: null
|
|
115
|
+
});
|
|
116
|
+
(0, _utils.setTabIndices)(elements, initialTabIndexMap, true);
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
// Merge a safe style object for the container and cast to CSSProperties to satisfy TS
|
|
120
|
+
const mergedStyle = Object.assign({
|
|
121
|
+
position: "relative"
|
|
122
|
+
}, paneStyle ?? {
|
|
123
|
+
position: "fixed"
|
|
124
|
+
});
|
|
125
|
+
|
|
126
|
+
// If paneStyle hasn't been computed yet, render the DimLayer so clicks
|
|
127
|
+
// still close overlays but hide the pane itself to avoid flashes.
|
|
128
|
+
const hiddenStyle = {
|
|
129
|
+
visibility: isReady ? "visible" : "hidden",
|
|
130
|
+
pointerEvents: isReady ? "auto" : "none"
|
|
131
|
+
};
|
|
132
|
+
const controlProps = {
|
|
133
|
+
id: controlId,
|
|
134
|
+
dir: state.domainStates.globalDir,
|
|
135
|
+
titleText: props.title,
|
|
136
|
+
contentHtml: props.contentHtml,
|
|
137
|
+
brightnessValueOnDim: "0.2",
|
|
138
|
+
onClose: handleClose,
|
|
139
|
+
...(props === null || props === void 0 ? void 0 : props.controlProps)
|
|
140
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_CitationDim.default, {
|
|
144
|
+
brightness: "0.2"
|
|
145
|
+
}), /*#__PURE__*/_react.default.createElement("div", {
|
|
146
|
+
style: Object.assign({}, mergedStyle, hiddenStyle, {
|
|
147
|
+
display: "flex",
|
|
148
|
+
flexDirection: "column",
|
|
149
|
+
zIndex: 10001
|
|
150
|
+
})
|
|
151
|
+
}, /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.CitationPane, {
|
|
152
|
+
controlProps: controlProps,
|
|
153
|
+
styleProps: props === null || props === void 0 ? void 0 : props.styleProps
|
|
154
|
+
})));
|
|
155
|
+
};
|
|
156
|
+
exports.CitationPaneStateful = CitationPaneStateful;
|
|
157
|
+
var _default = CitationPaneStateful;
|
|
158
|
+
exports.default = _default;
|
package/lib/cjs/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultCitationPaneStyles = exports.defaultCitationContentCSS = exports.default = void 0;
|
|
7
|
+
const defaultCitationPaneStyles = {
|
|
8
|
+
pane: {
|
|
9
|
+
position: "fixed",
|
|
10
|
+
left: "50%",
|
|
11
|
+
top: "18%",
|
|
12
|
+
transform: "translateX(-50%)",
|
|
13
|
+
background: "#fff",
|
|
14
|
+
width: "85%",
|
|
15
|
+
height: "85%",
|
|
16
|
+
overflowY: "auto",
|
|
17
|
+
overflowX: "hidden",
|
|
18
|
+
padding: 16,
|
|
19
|
+
borderRadius: 6,
|
|
20
|
+
zIndex: 10001,
|
|
21
|
+
boxSizing: "border-box"
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
exports.defaultCitationPaneStyles = defaultCitationPaneStyles;
|
|
25
|
+
const defaultCitationContentCSS = controlId => `
|
|
26
|
+
#${controlId} .citation-content {
|
|
27
|
+
flex: 1;
|
|
28
|
+
min-height: 0; /* allow flex child to scroll */
|
|
29
|
+
overflow-y: auto;
|
|
30
|
+
overflow-x: auto;
|
|
31
|
+
margin-bottom: 12px;
|
|
32
|
+
white-space: normal; /* wrap normal text */
|
|
33
|
+
word-break: break-word;
|
|
34
|
+
-webkit-overflow-scrolling: touch;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
#${controlId} .citation-content pre,
|
|
38
|
+
#${controlId} .citation-content code {
|
|
39
|
+
white-space: pre; /* preserve formatting */
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
#${controlId} .citation-content table {
|
|
43
|
+
width: 100%;
|
|
44
|
+
border-collapse: collapse;
|
|
45
|
+
margin-bottom: 12px;
|
|
46
|
+
table-layout: auto;
|
|
47
|
+
overflow-x: auto;
|
|
48
|
+
display: block;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
#${controlId} .citation-content table th,
|
|
52
|
+
#${controlId} .citation-content table td {
|
|
53
|
+
padding: 8px 12px;
|
|
54
|
+
border: 1px solid rgba(0,0,0,0.08);
|
|
55
|
+
text-align: left;
|
|
56
|
+
vertical-align: top;
|
|
57
|
+
word-break: break-word;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
#${controlId} .citation-content img {
|
|
61
|
+
max-width: 100%;
|
|
62
|
+
height: auto;
|
|
63
|
+
}
|
|
64
|
+
`;
|
|
65
|
+
exports.defaultCitationContentCSS = defaultCitationContentCSS;
|
|
66
|
+
var _default = {
|
|
67
|
+
defaultCitationPaneStyles,
|
|
68
|
+
defaultCitationContentCSS
|
|
69
|
+
};
|
|
70
|
+
exports.default = _default;
|
package/lib/cjs/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -44,7 +44,7 @@ const prepareEndChat = async (props, facadeChatSDK, state, dispatch, setAdapter,
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
// Use Case: If ended by Agent, stay chat in InActive state
|
|
47
|
-
|
|
47
|
+
const isConversationalSurveyEnabled = state.appStates.isConversationalSurveyEnabled;
|
|
48
48
|
if (isConversationalSurveyEnabled && ((state === null || state === void 0 ? void 0 : (_state$appStates2 = state.appStates) === null || _state$appStates2 === void 0 ? void 0 : _state$appStates2.conversationEndedBy) === _Constants.ConversationEndEntity.Agent || (state === null || state === void 0 ? void 0 : (_state$appStates3 = state.appStates) === null || _state$appStates3 === void 0 ? void 0 : _state$appStates3.conversationEndedBy) === _Constants.ConversationEndEntity.Bot)) {
|
|
49
49
|
dispatch({
|
|
50
50
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
@@ -217,7 +217,7 @@ const endChat = async (props, facadeChatSDK, state, dispatch, setAdapter, setWeb
|
|
|
217
217
|
payload: undefined
|
|
218
218
|
});
|
|
219
219
|
// Always allow to close the chat for embedded mode irrespective of end chat errors
|
|
220
|
-
closeChatWidget(dispatch);
|
|
220
|
+
closeChatWidget(dispatch, setWebChatStyles, props);
|
|
221
221
|
facadeChatSDK.destroy();
|
|
222
222
|
}
|
|
223
223
|
}
|
|
@@ -305,6 +305,10 @@ const closeChatStateCleanUp = dispatch => {
|
|
|
305
305
|
proactiveChatInNewWindow: false
|
|
306
306
|
}
|
|
307
307
|
});
|
|
308
|
+
dispatch({
|
|
309
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CITATIONS,
|
|
310
|
+
payload: {}
|
|
311
|
+
});
|
|
308
312
|
|
|
309
313
|
// Clear live chat context only if chat widget is fully closed to support transcript calls after sessionclose is called
|
|
310
314
|
dispatch({
|
|
@@ -350,13 +354,23 @@ const endVoiceVideoCallIfOngoing = async (facadeChatSDK, dispatch) => {
|
|
|
350
354
|
}, callId);
|
|
351
355
|
}
|
|
352
356
|
};
|
|
357
|
+
|
|
358
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
353
359
|
exports.endVoiceVideoCallIfOngoing = endVoiceVideoCallIfOngoing;
|
|
354
|
-
const closeChatWidget = dispatch => {
|
|
360
|
+
const closeChatWidget = (dispatch, setWebChatStyles, props) => {
|
|
361
|
+
var _props$webChatContain2, _props$webChatContain3;
|
|
355
362
|
// Embedded chat
|
|
356
363
|
dispatch({
|
|
357
364
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
358
365
|
payload: _ConversationState.ConversationState.Closed
|
|
359
366
|
});
|
|
367
|
+
|
|
368
|
+
// if customer is setting the hideSendbox, we should not alter its value
|
|
369
|
+
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;
|
|
370
|
+
setWebChatStyles(styles => ({
|
|
371
|
+
...styles,
|
|
372
|
+
hideSendBox: false
|
|
373
|
+
}));
|
|
360
374
|
};
|
|
361
375
|
|
|
362
376
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -7,6 +7,8 @@ exports.initWebChatComposer = void 0;
|
|
|
7
7
|
var _Constants = require("../../../common/Constants");
|
|
8
8
|
var _TelemetryConstants = require("../../../common/telemetry/TelemetryConstants");
|
|
9
9
|
var _utils = require("../../../common/utils");
|
|
10
|
+
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
11
|
+
var _ConversationState = require("../../../contexts/common/ConversationState");
|
|
10
12
|
var _dompurify = _interopRequireDefault(require("dompurify"));
|
|
11
13
|
var _HyperlinkTextOverrideRenderer = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/markdownrenderers/HyperlinkTextOverrideRenderer"));
|
|
12
14
|
var _LiveChatWidgetActionType = require("../../../contexts/common/LiveChatWidgetActionType");
|
|
@@ -18,35 +20,35 @@ var _activityMiddleware = require("../../webchatcontainerstateful/webchatcontrol
|
|
|
18
20
|
var _attachmentMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware");
|
|
19
21
|
var _attachmentUploadValidatorMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware"));
|
|
20
22
|
var _avatarMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware");
|
|
23
|
+
var _callActionMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/callActionMiddleware"));
|
|
21
24
|
var _cardActionMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware");
|
|
25
|
+
var _citationsMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware");
|
|
22
26
|
var _conversationEndMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/conversationEndMiddleware"));
|
|
27
|
+
var _customEventMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware"));
|
|
23
28
|
var _dataMaskingMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/dataMaskingMiddleware"));
|
|
24
29
|
var _createMarkdown = require("./createMarkdown");
|
|
25
30
|
var _maxMessageSizeValidator = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/maxMessageSizeValidator"));
|
|
26
31
|
var _messageSequenceIdOverrideMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageSequenceIdOverrideMiddleware");
|
|
27
32
|
var _messageTimestampMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware");
|
|
33
|
+
var _queueOverflowHandlerMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware");
|
|
28
34
|
var _botframeworkWebchat = require("botframework-webchat");
|
|
29
35
|
var _toastMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/toastMiddleware");
|
|
30
36
|
var _WebChatLogger = require("../../webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger");
|
|
31
37
|
var _defaultAttachmentProps = require("../../webchatcontainerstateful/common/defaultProps/defaultAttachmentProps");
|
|
32
38
|
var _defaultMiddlewareLocalizedTexts = require("../../webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
33
39
|
var _defaultWebChatContainerStatefulProps = require("../../webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps");
|
|
40
|
+
var _createReducer = require("../../../contexts/createReducer");
|
|
34
41
|
var _omnichannelChatSdk = require("@microsoft/omnichannel-chat-sdk");
|
|
35
42
|
var _gifUploadMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/gifUploadMiddleware"));
|
|
36
43
|
var _htmlPlayerMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlPlayerMiddleware"));
|
|
37
44
|
var _htmlTextMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware"));
|
|
38
45
|
var _preProcessingMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware"));
|
|
39
46
|
var _sanitizationMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware"));
|
|
40
|
-
var
|
|
41
|
-
var _customEventMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware"));
|
|
42
|
-
var _ConversationState = require("../../../contexts/common/ConversationState");
|
|
43
|
-
var _createReducer = require("../../../contexts/createReducer");
|
|
44
|
-
var _queueOverflowHandlerMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware");
|
|
45
|
-
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
47
|
+
var _localizedStringsBotInitialsMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware");
|
|
46
48
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
47
49
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
50
|
const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endChat) => {
|
|
49
|
-
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;
|
|
51
|
+
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;
|
|
50
52
|
// Add a hook to make all links open a new window
|
|
51
53
|
postDomPurifyActivities();
|
|
52
54
|
const localizedTexts = {
|
|
@@ -121,7 +123,7 @@ const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endChat) =>
|
|
|
121
123
|
};
|
|
122
124
|
webChatStore = (0, _botframeworkWebchat.createStore)({},
|
|
123
125
|
//initial state
|
|
124
|
-
_preProcessingMiddleware.default, _attachmentProcessingMiddleware.default, (0, _attachmentUploadValidatorMiddleware.default)((_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), (0, _customEventMiddleware.default)(_omnichannelChatComponents.BroadcastService), (0, _queueOverflowHandlerMiddleware.createQueueOverflowMiddleware)(state, dispatch), (0, _channelDataMiddleware.default)(addConversationalSurveyTagsCallback), (0, _conversationEndMiddleware.default)(conversationEndCallback, startConversationalSurveyCallback, endConversationalSurveyCallback), (0, _dataMaskingMiddleware.default)((_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : _state$domainStates$l3.DataMaskingInfo), _messageTimestampMiddleware.createMessageTimeStampMiddleware, _messageSequenceIdOverrideMiddleware.createMessageSequenceIdOverrideMiddleware, _gifUploadMiddleware.default, _htmlPlayerMiddleware.default, (0, _htmlTextMiddleware.default)(honorsTargetInHTMLLinks), (0, _maxMessageSizeValidator.default)(localizedTexts), _sanitizationMiddleware.default, (0, _callActionMiddleware.default)(),
|
|
126
|
+
_preProcessingMiddleware.default, _attachmentProcessingMiddleware.default, (0, _attachmentUploadValidatorMiddleware.default)((_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), (0, _customEventMiddleware.default)(_omnichannelChatComponents.BroadcastService), (0, _queueOverflowHandlerMiddleware.createQueueOverflowMiddleware)(state, dispatch), (0, _channelDataMiddleware.default)(addConversationalSurveyTagsCallback), (0, _conversationEndMiddleware.default)(conversationEndCallback, startConversationalSurveyCallback, endConversationalSurveyCallback), (0, _dataMaskingMiddleware.default)((_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : _state$domainStates$l3.DataMaskingInfo), _messageTimestampMiddleware.createMessageTimeStampMiddleware, _messageSequenceIdOverrideMiddleware.createMessageSequenceIdOverrideMiddleware, (0, _citationsMiddleware.createCitationsMiddleware)(state, dispatch), _gifUploadMiddleware.default, _htmlPlayerMiddleware.default, (0, _htmlTextMiddleware.default)(honorsTargetInHTMLLinks), (0, _maxMessageSizeValidator.default)(localizedTexts), _sanitizationMiddleware.default, (0, _callActionMiddleware.default)(), (0, _localizedStringsBotInitialsMiddleware.localizedStringsBotInitialsMiddleware)(),
|
|
125
127
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
126
128
|
...(((_props$webChatContain7 = props.webChatContainerProps) === null || _props$webChatContain7 === void 0 ? void 0 : _props$webChatContain7.storeMiddlewares) ?? []));
|
|
127
129
|
_WebChatStoreLoader.WebChatStoreLoader.store = webChatStore;
|
|
@@ -175,7 +177,8 @@ const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endChat) =>
|
|
|
175
177
|
onTelemetry: (0, _WebChatLogger.createWebChatTelemetry)(),
|
|
176
178
|
cardActionMiddleware: (0, _cardActionMiddleware.createCardActionMiddleware)(((_props$webChatContain25 = props.webChatContainerProps) === null || _props$webChatContain25 === void 0 ? void 0 : _props$webChatContain25.botMagicCode) || undefined),
|
|
177
179
|
sendTypingIndicator: true,
|
|
178
|
-
|
|
180
|
+
overrideLocalizedStrings: (0, _localizedStringsBotInitialsMiddleware.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),
|
|
181
|
+
...((_props$webChatContain28 = props.webChatContainerProps) === null || _props$webChatContain28 === void 0 ? void 0 : _props$webChatContain28.webChatProps)
|
|
179
182
|
};
|
|
180
183
|
return webChatProps;
|
|
181
184
|
};
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.setPreChatAndInitiateChat = exports.prepareStartChat = exports.initStartChat = exports.checkIfConversationStillValid = void 0;
|
|
7
7
|
var _TelemetryConstants = require("../../../common/telemetry/TelemetryConstants");
|
|
8
8
|
var _Constants = require("../../../common/Constants");
|
|
9
|
+
var _TelemetryManager = require("../../../common/telemetry/TelemetryManager");
|
|
9
10
|
var _utils = require("../../../common/utils");
|
|
10
11
|
var _reconnectChatHelper = require("./reconnectChatHelper");
|
|
11
12
|
var _startChatErrorHandler = require("./startChatErrorHandler");
|
|
@@ -14,7 +15,6 @@ var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components
|
|
|
14
15
|
var _ConversationState = require("../../../contexts/common/ConversationState");
|
|
15
16
|
var _LiveChatWidgetActionType = require("../../../contexts/common/LiveChatWidgetActionType");
|
|
16
17
|
var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
17
|
-
var _TelemetryManager = require("../../../common/telemetry/TelemetryManager");
|
|
18
18
|
var _endChat = require("./endChat");
|
|
19
19
|
var _createAdapter = require("./createAdapter");
|
|
20
20
|
var _newMessageEventHandler = require("../../../plugins/newMessageEventHandler");
|
|
@@ -137,7 +137,7 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
|
|
|
137
137
|
* This is because a new change to control OOH as closed event when a widget is coming from chat.
|
|
138
138
|
*/
|
|
139
139
|
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) {
|
|
140
|
-
var _state$domainStates5, _state$domainStates5$, _state$domainStates6, _state$domainStates6
|
|
140
|
+
var _state$domainStates5, _state$domainStates5$, _state$domainStates6, _state$domainStates6$, _TelemetryManager$Int;
|
|
141
141
|
dispatch({
|
|
142
142
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MINIMIZED,
|
|
143
143
|
payload: false
|
|
@@ -147,7 +147,8 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
|
|
|
147
147
|
eventName: _TelemetryConstants.BroadcastEvent.MaximizeChat,
|
|
148
148
|
payload: {
|
|
149
149
|
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,
|
|
150
|
-
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
|
|
150
|
+
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,
|
|
151
|
+
runtimeId: _TelemetryManager.TelemetryManager === null || _TelemetryManager.TelemetryManager === void 0 ? void 0 : (_TelemetryManager$Int = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int === void 0 ? void 0 : _TelemetryManager$Int.lcwRuntimeId
|
|
151
152
|
}
|
|
152
153
|
});
|
|
153
154
|
}
|
|
@@ -14,6 +14,7 @@ var _TelemetryManager = require("../../../common/telemetry/TelemetryManager");
|
|
|
14
14
|
var _endChat = require("../common/endChat");
|
|
15
15
|
var _startChat = require("../common/startChat");
|
|
16
16
|
var _utils = require("../../../common/utils");
|
|
17
|
+
var _customEventHandler = require("../common/customEventHandler");
|
|
17
18
|
var _defaultClientDataStoreProvider = require("../../../common/storage/default/defaultClientDataStoreProvider");
|
|
18
19
|
var _reconnectChatHelper = require("../common/reconnectChatHelper");
|
|
19
20
|
var _componentController = require("../../../controller/componentController");
|
|
@@ -57,7 +58,6 @@ var _startProactiveChat = require("../common/startProactiveChat");
|
|
|
57
58
|
var _useChatAdapterStore = _interopRequireDefault(require("../../../hooks/useChatAdapterStore"));
|
|
58
59
|
var _useChatContextStore = _interopRequireDefault(require("../../../hooks/useChatContextStore"));
|
|
59
60
|
var _useFacadeChatSDKStore = _interopRequireDefault(require("../../../hooks/useFacadeChatSDKStore"));
|
|
60
|
-
var _customEventHandler = require("../common/customEventHandler");
|
|
61
61
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
62
62
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
63
63
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -727,11 +727,7 @@ const LiveChatWidgetStateful = props => {
|
|
|
727
727
|
(0, _endChat.endChat)(props, facadeChatSDK, state, dispatch, setAdapter, setWebChatStyles, adapter, false, false, true);
|
|
728
728
|
return;
|
|
729
729
|
}
|
|
730
|
-
const
|
|
731
|
-
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
|
|
732
|
-
payload: null
|
|
733
|
-
});
|
|
734
|
-
let isConversationalSurveyEnabled = state.appStates.isConversationalSurveyEnabled;
|
|
730
|
+
const isConversationalSurveyEnabled = state.appStates.isConversationalSurveyEnabled;
|
|
735
731
|
|
|
736
732
|
// In conversational survey, we need to check post chat survey logics before we set ConversationState to InActive
|
|
737
733
|
// Hence setting ConversationState to InActive will be done later in the post chat flows
|
|
@@ -904,11 +900,21 @@ const LiveChatWidgetStateful = props => {
|
|
|
904
900
|
.webchat__basic-transcript__activity-markdown-body > :first-child {
|
|
905
901
|
margin-top: 0px;
|
|
906
902
|
}
|
|
903
|
+
|
|
907
904
|
.webchat__basic-transcript__activity-markdown-body img.webchat__render-markdown__external-link-icon {
|
|
908
905
|
background-image : url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg5MjNMMTcuOTk4NyAxNi43Mzg0VjEzLjIzMjFDMTcuOTk4NyAxMi44MTc5IDE4LjMzNDUgMTIuNDgyMSAxOC43NDg3IDEyLjQ4MjFDMTkuMTI4NCAxMi40ODIxIDE5LjQ0MjIgMTIuNzY0MyAxOS40OTE4IDEzLjEzMDNMMTkuNDk4NyAxMy4yMzIxVjE2LjczODRDMTkuNDk4NyAxOC43NDA3IDE3LjkyOTMgMjAuMzc2OSAxNS45NTI4IDIwLjQ4MjlMMTUuNzUzOCAyMC40ODg0TDcuMjU4MjcgMjAuNTAwMUw3LjA1NDk1IDIwLjQ5NDlDNS4xNDIzOSAyMC4zOTU0IDMuNjA4OTUgMTguODYyNyAzLjUwODM3IDE2Ljk1MDJMMy41MDMxMiAxNi43NTExTDMuNTAwODkgOC4yNTI3TDMuNTA1MjkgOC4wNTAyQzMuNjA1MzkgNi4xMzc0OSA1LjEzODY3IDQuNjA0NDkgNy4wNTA5NiA0LjUwNTI3TDcuMjUwMSA0LjUwMDE3SDEwLjc0OTVINy4yNTAxWk0xMy43NDgxIDMuMDAxNDZMMjAuMzAxOCAzLjAwMTk3TDIwLjQwMTQgMy4wMTU3NUwyMC41MDIyIDMuMDQzOTNMMjAuNTU5IDMuMDY4MDNDMjAuNjEyMiAzLjA5MTIyIDIwLjY2MzQgMy4xMjE2MyAyMC43MTExIDMuMTU4ODVMMjAuNzgwNCAzLjIyMTU2TDIwLjg2NDEgMy4zMjAxNEwyMC45MTgzIDMuNDEwMjVMMjAuOTU3IDMuNTAwNTdMMjAuOTc2MiAzLjU2NDc2TDIwLjk4OTggMy42Mjg2MkwyMC45OTkyIDMuNzIyODJMMjAuOTk5NyAxMC4yNTU0QzIwLjk5OTcgMTAuNjY5NiAyMC42NjM5IDExLjAwNTQgMjAuMjQ5NyAxMS4wMDU0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjMjEyMTIxIiAvPjwvc3ZnPg==) !important;
|
|
909
906
|
height: .75em;
|
|
910
907
|
margin-left: .25em;
|
|
911
908
|
}
|
|
909
|
+
|
|
910
|
+
.webchat__link-definitions__header-text {
|
|
911
|
+
color: ${bubbleBackground}
|
|
912
|
+
}
|
|
913
|
+
|
|
914
|
+
.webchat__link-definitions__header-chevron {
|
|
915
|
+
color: ${bubbleBackground}
|
|
916
|
+
}
|
|
917
|
+
|
|
912
918
|
${(sendBoxTextArea === null || sendBoxTextArea === void 0 ? void 0 : sendBoxTextArea.minHeight) && `
|
|
913
919
|
.webchat__auto-resize-textarea.webchat__send-box-text-box__text-area {
|
|
914
920
|
min-height: ${sendBoxTextArea === null || sendBoxTextArea === void 0 ? void 0 : sendBoxTextArea.minHeight} !important;
|