@microsoft/omnichannel-chat-widget 1.8.4-main.7bdb634 → 1.8.4-main.cbab5fc
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/README.md +27 -0
- package/lib/cjs/common/Constants.js +3 -0
- package/lib/cjs/common/telemetry/AppInsightsEvents.js +14 -9
- package/lib/cjs/common/telemetry/TelemetryConstants.js +15 -2
- package/lib/cjs/common/telemetry/TelemetryManager.js +10 -7
- package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +26 -10
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +16 -4
- package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +20 -1
- package/lib/cjs/components/headerstateful/HeaderStateful.js +8 -2
- package/lib/cjs/components/livechatwidget/common/ChatWidgetEvents.js +1 -1
- package/lib/cjs/components/livechatwidget/common/PersistentConversationHandler.js +26 -20
- package/lib/cjs/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +1 -2
- package/lib/cjs/components/livechatwidget/common/endChat.js +26 -9
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +9 -2
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -0
- package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +2 -2
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -3
- package/lib/cjs/components/livechatwidget/common/startChat.js +5 -1
- package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +24 -4
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +123 -28
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +31 -4
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +12 -3
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +30 -29
- package/lib/cjs/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +8 -2
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
- package/lib/cjs/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +1 -3
- package/lib/cjs/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +6 -7
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +30 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +21 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +7 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +29 -7
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +1 -0
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +7 -1
- package/lib/cjs/contexts/createReducer.js +15 -0
- package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +3 -2
- package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +6 -2
- package/lib/cjs/plugins/newMessageEventHandler.js +4 -1
- package/lib/esm/common/Constants.js +3 -0
- package/lib/esm/common/telemetry/AppInsightsEvents.js +14 -9
- package/lib/esm/common/telemetry/TelemetryConstants.js +13 -1
- package/lib/esm/common/telemetry/TelemetryManager.js +10 -7
- package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +27 -11
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +17 -5
- package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +20 -1
- package/lib/esm/components/headerstateful/HeaderStateful.js +9 -3
- package/lib/esm/components/livechatwidget/common/ChatWidgetEvents.js +1 -1
- package/lib/esm/components/livechatwidget/common/PersistentConversationHandler.js +26 -20
- package/lib/esm/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +1 -2
- package/lib/esm/components/livechatwidget/common/endChat.js +26 -9
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +9 -2
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -0
- package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +2 -2
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +3 -3
- package/lib/esm/components/livechatwidget/common/startChat.js +7 -3
- package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +23 -4
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +124 -29
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +33 -6
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +13 -4
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +30 -32
- package/lib/esm/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +8 -2
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +1 -3
- package/lib/esm/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +6 -7
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +30 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +21 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +7 -2
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +29 -7
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +1 -0
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +7 -1
- package/lib/esm/contexts/createReducer.js +15 -0
- package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +3 -2
- package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +6 -2
- package/lib/esm/plugins/newMessageEventHandler.js +4 -1
- package/lib/types/common/Constants.d.ts +3 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +12 -1
- package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +1 -0
- package/lib/types/components/livechatwidget/common/ChatWidgetEvents.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +1 -0
- package/lib/types/components/livechatwidget/interfaces/IPersistentChatHistoryProps.d.ts +5 -1
- package/lib/types/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.d.ts +15 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.d.ts +1 -1
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
- package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +5 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +2 -1
- package/package.json +2 -2
|
@@ -25,9 +25,6 @@ import { isPersistentChatEnabled } from "../livechatwidget/common/liveChatConfig
|
|
|
25
25
|
import { useChatContextStore } from "../..";
|
|
26
26
|
import useFacadeSDKStore from "../../hooks/useFacadeChatSDKStore";
|
|
27
27
|
import usePersistentChatHistory from "./hooks/usePersistentChatHistory";
|
|
28
|
-
|
|
29
|
-
// Types for better type safety
|
|
30
|
-
|
|
31
28
|
let uiTimer;
|
|
32
29
|
const broadcastChannelMessageEvent = "message";
|
|
33
30
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -56,7 +53,7 @@ const createMagicCodeSuccessResponse = signin => {
|
|
|
56
53
|
};
|
|
57
54
|
};
|
|
58
55
|
export const WebChatContainerStateful = props => {
|
|
59
|
-
var _props$webChatContain, _defaultWebChatContai, _extendedChatConfig$L,
|
|
56
|
+
var _props$webChatContain, _defaultWebChatContai, _extendedChatConfig$L, _extendedChatConfig$L2, _extendedChatConfig$L3, _extendedChatConfig$L4, _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _webChatContainerProp9, _props$webChatContain6, _props$webChatContain7, _defaultWebChatContai2, _props$webChatContain8, _props$webChatContain9, _defaultWebChatContai3, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15, _webChatContainerProp16, _webChatContainerProp17, _webChatContainerProp18, _webChatContainerProp19, _webChatContainerProp20, _webChatContainerProp21, _webChatContainerProp22, _webChatContainerProp23, _webChatContainerProp24, _props$webChatContain10, _props$webChatContain11, _webChatContainerProp25, _webChatContainerProp26, _webChatContainerProp27, _webChatContainerProp28, _props$citationPanePr, _props$citationPanePr2, _props$citationPanePr3, _props$citationPanePr4, _props$citationPanePr5;
|
|
60
57
|
const [facadeChatSDK] = useFacadeSDKStore();
|
|
61
58
|
|
|
62
59
|
// Create a font family that includes emoji support, based on the primary font or default
|
|
@@ -90,17 +87,16 @@ export const WebChatContainerStateful = props => {
|
|
|
90
87
|
|
|
91
88
|
// Type the chatConfig properly to avoid 'any' usage
|
|
92
89
|
const extendedChatConfig = props.chatConfig;
|
|
93
|
-
const isHistoryEnabledInConfig = extendedChatConfig === null || extendedChatConfig === void 0 ? void 0 : (_extendedChatConfig$L = extendedChatConfig.
|
|
94
|
-
const
|
|
95
|
-
const isPersistentChatEnabledForWidget = !!(extendedChatConfig !== null && extendedChatConfig !== void 0 && (_extendedChatConfig$
|
|
96
|
-
|
|
97
|
-
// Persistent chat history is enabled if explicitly set via props, or if enabled in config
|
|
98
|
-
// Props take precedence over config settings
|
|
99
|
-
const isPersistentHistoryEnabled = isHistoryEnabledViaProps || isHistoryEnabledInConfig;
|
|
90
|
+
const isHistoryEnabledInConfig = extendedChatConfig === null || extendedChatConfig === void 0 ? void 0 : (_extendedChatConfig$L = extendedChatConfig.LiveWSAndLiveChatEngJoin) === null || _extendedChatConfig$L === void 0 ? void 0 : _extendedChatConfig$L.msdyn_enablepersistentchatpreviousconversations;
|
|
91
|
+
const isHistoryEnabledViaFCB = extendedChatConfig === null || extendedChatConfig === void 0 ? void 0 : (_extendedChatConfig$L2 = extendedChatConfig.LcwFcbConfiguration) === null || _extendedChatConfig$L2 === void 0 ? void 0 : _extendedChatConfig$L2.lcwPersistentChatHistoryEnabled;
|
|
92
|
+
const isPersistentChatEnabledForWidget = !!(extendedChatConfig !== null && extendedChatConfig !== void 0 && (_extendedChatConfig$L3 = extendedChatConfig.LiveChatConfigAuthSettings) !== null && _extendedChatConfig$L3 !== void 0 && _extendedChatConfig$L3.msdyn_javascriptclientfunction) || isPersistentChatEnabled(extendedChatConfig === null || extendedChatConfig === void 0 ? void 0 : (_extendedChatConfig$L4 = extendedChatConfig.LiveWSAndLiveChatEngJoin) === null || _extendedChatConfig$L4 === void 0 ? void 0 : _extendedChatConfig$L4.msdyn_conversationmode);
|
|
100
93
|
|
|
101
94
|
// Check if both persistent chat and widget support are enabled
|
|
102
|
-
const shouldLoadPersistentHistoryMessages =
|
|
95
|
+
const shouldLoadPersistentHistoryMessages = isHistoryEnabledInConfig && isHistoryEnabledViaFCB && isPersistentChatEnabledForWidget;
|
|
103
96
|
if (shouldLoadPersistentHistoryMessages) {
|
|
97
|
+
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
98
|
+
Event: TelemetryEvent.PersistentChatHistoryEnabled
|
|
99
|
+
});
|
|
104
100
|
usePersistentChatHistory(facadeChatSDK, (props === null || props === void 0 ? void 0 : props.persistentChatHistoryProps) ?? {});
|
|
105
101
|
}
|
|
106
102
|
// Delegated click handler for citation anchors. Placed after state is
|
|
@@ -265,24 +261,28 @@ export const WebChatContainerStateful = props => {
|
|
|
265
261
|
background: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp === void 0 ? void 0 : _webChatContainerProp.background) ?? defaultAdaptiveCardStyles.background};
|
|
266
262
|
}
|
|
267
263
|
|
|
268
|
-
.webchat__bubble__content>div#ms_lcw_webchat_adaptive_card .ac-textBlock {
|
|
269
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp2 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp2 === void 0 ? void 0 : _webChatContainerProp2.color) ?? defaultAdaptiveCardStyles.color};
|
|
264
|
+
.webchat__bubble__content>div#ms_lcw_webchat_adaptive_card .ac-textBlock[role=heading] {
|
|
265
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp2 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp2 === void 0 ? void 0 : _webChatContainerProp2.color) ?? defaultAdaptiveCardStyles.color} !important;
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.webchat__bubble__content>div#ms_lcw_webchat_adaptive_card label .ac-textRun:first-child {
|
|
269
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp3 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp3 === void 0 ? void 0 : _webChatContainerProp3.color) ?? defaultAdaptiveCardStyles.color} !important;
|
|
270
270
|
}
|
|
271
271
|
|
|
272
272
|
.webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__bubble--from-user {
|
|
273
|
-
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
273
|
+
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp4 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp4 === void 0 ? void 0 : (_webChatContainerProp5 = _webChatContainerProp4.userMessageBoxStyles) === null || _webChatContainerProp5 === void 0 ? void 0 : _webChatContainerProp5.maxWidth) ?? (defaultUserMessageBoxStyles === null || defaultUserMessageBoxStyles === void 0 ? void 0 : defaultUserMessageBoxStyles.maxWidth)}
|
|
274
274
|
}
|
|
275
275
|
|
|
276
276
|
.webchat__stacked-layout--show-avatar div.webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__stacked-layout__message {
|
|
277
|
-
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
277
|
+
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp6 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp6 === void 0 ? void 0 : (_webChatContainerProp7 = _webChatContainerProp6.systemMessageBoxStyles) === null || _webChatContainerProp7 === void 0 ? void 0 : _webChatContainerProp7.maxWidth) ?? (defaultSystemMessageBoxStyles === null || defaultSystemMessageBoxStyles === void 0 ? void 0 : defaultSystemMessageBoxStyles.maxWidth)}
|
|
278
278
|
}
|
|
279
279
|
|
|
280
280
|
div[class="ac-textBlock"] *,
|
|
281
|
-
div[class="ac-input-container"] * {white-space:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
281
|
+
div[class="ac-input-container"] * {white-space:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp8 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp8 === void 0 ? void 0 : _webChatContainerProp8.textWhiteSpace) ?? defaultAdaptiveCardStyles.textWhiteSpace}}
|
|
282
282
|
|
|
283
283
|
div[class="ac-input-container"] input.ac-multichoiceInput,
|
|
284
284
|
div[class="ac-input-container"] select.ac-multichoiceInput {
|
|
285
|
-
${webChatContainerProps !== null && webChatContainerProps !== void 0 && (
|
|
285
|
+
${webChatContainerProps !== null && webChatContainerProps !== void 0 && (_webChatContainerProp9 = webChatContainerProps.adaptiveCardStyles) !== null && _webChatContainerProp9 !== void 0 && _webChatContainerProp9.choiceInputPadding ? `padding: ${webChatContainerProps.adaptiveCardStyles.choiceInputPadding} !important;` : ""}
|
|
286
286
|
}
|
|
287
287
|
|
|
288
288
|
.ms_lcw_webchat_received_message>div.webchat__stacked-layout>div.webchat__stacked-layout__main>div.webchat__stacked-layout__content>div.webchat__stacked-layout__message-row>[class^=webchat]:not(.webchat__bubble--from-user)>.webchat__bubble__content {
|
|
@@ -294,15 +294,15 @@ export const WebChatContainerStateful = props => {
|
|
|
294
294
|
div[class="ac-textBlock"] a:visited,
|
|
295
295
|
div[class="ac-textBlock"] a:hover,
|
|
296
296
|
div[class="ac-textBlock"] a:active {
|
|
297
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
297
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp10 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp10 === void 0 ? void 0 : _webChatContainerProp10.anchorColor) ?? defaultAdaptiveCardStyles.anchorColor};
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
300
|
+
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp11 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp11 === void 0 ? void 0 : _webChatContainerProp11.buttonWhiteSpace) ?? defaultAdaptiveCardStyles.buttonWhiteSpace} !important;}
|
|
301
301
|
|
|
302
302
|
.ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon {
|
|
303
303
|
/* Fallback for browsers that don't support mask */
|
|
304
304
|
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg5MjNMMTcuOTk4NyAxNi43Mzg0VjEzLjIzMjFDMTcuOTk4NyAxMi44MTc5IDE4LjMzNDUgMTIuNDgyMSAxOC43NDg3IDEyLjQ4MjFDMTkuMTI4NCAxMi40ODIxIDE5LjQ0MjIgMTIuNzY0MyAxOS40OTE4IDEzLjEzMDNMMTkuNDk4NyAxMy4yMzIxVjE2LjczODRDMTkuNDk4NyAxOC43NDA3IDE3LjkyOTMgMjAuMzc2OSAxNS45NTI4IDIwLjQ4MjlMMTUuNzUzOCAyMC40ODg0TDcuMjU4MjcgMjAuNTAwMUw3LjA1NDk1IDIwLjQ5NDlDNS4xNDIzOSAyMC4zOTU0IDMuNjA4OTUgMTguODYyNyAzLjUwODM3IDE2Ljk1MDJMMy41MDMxMiAxNi43NTExTDMuNTAwODkgOC4yNTI3TDMuNTA1MjkgOC4wNTAyQzMuNjA1MzkgNi4xMzc0OSA1LjEzODY3IDQuNjA0NDkgNy4wNTA5NiA0LjUwNTI3TDcuMjUwMSA0LjUwMDE3SDEwLjc0OTVINy4yNTAxWk0xMy43NDgxIDMuMDAxNDZMMjAuMzAxOCAzLjAwMTk3TDIwLjQwMTQgMy4wMTU3NUwyMC41MDIyIDMuMDQzOTNMMjAuNTU5IDMuMDY4MDNDMjAuNjEyMiAzLjA5MTIyIDIwLjY2MzQgMy4xMjE2MyAyMC43MTExIDMuMTU4ODVMMjAuNzgwNCAzLjIyMTU2TDIwLjg2NDEgMy4zMjAxNEwyMC45MTgzIDMuNDEwMjVMMjAuOTU3IDMuNTAwNTdMMjAuOTc2MiAzLjU2NDc2TDIwLjk4OTggMy42Mjg2MkwyMC45OTkyIDMuNzIyODJMMjAuOTk5NyAxMC4yNTU0QzIwLjk5OTcgMTAuNjY5NiAyMC42NjM5IDExLjAwNTQgMjAuMjQ5NyAxMS4wMDU0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjRkZGRkZGIiAvPjwvc3ZnPg==);
|
|
305
|
-
filter: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
305
|
+
filter: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp12 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp12 === void 0 ? void 0 : (_webChatContainerProp13 = _webChatContainerProp12.receivedMessageAnchorStyles) === null || _webChatContainerProp13 === void 0 ? void 0 : _webChatContainerProp13.filter) ?? (defaultReceivedMessageAnchorStyles === null || defaultReceivedMessageAnchorStyles === void 0 ? void 0 : defaultReceivedMessageAnchorStyles.filter)};
|
|
306
306
|
height: .75em;
|
|
307
307
|
width: .75em;
|
|
308
308
|
margin-left: .25em;
|
|
@@ -312,7 +312,7 @@ export const WebChatContainerStateful = props => {
|
|
|
312
312
|
.ms_lcw_webchat_sent_message img.webchat__render-markdown__external-link-icon {
|
|
313
313
|
/* Fallback for browsers that don't support mask */
|
|
314
314
|
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg5MjNMMTcuOTk4NyAxNi43Mzg0VjEzLjIzMjFDMTcuOTk4NyAxMi44MTc5IDE4LjMzNDUgMTIuNDgyMSAxOC43NDg3IDEyLjQ4MjFDMTkuMTI4NCAxMi40ODIxIDE5LjQ0MjIgMTIuNzY0MyAxOS40OTE4IDEzLjEzMDNMMTkuNDk4NyAxMy4yMzIxVjE2LjczODRDMTkuNDk4NyAxOC43NDA3IDE3LjkyOTMgMjAuMzc2OSAxNS45NTI4IDIwLjQ4MjlMMTUuNzUzOCAyMC40ODg0TDcuMjU4MjcgMjAuNTAwMUw3LjA1NDk1IDIwLjQ5NDlDNS4xNDIzOSAyMC4zOTU0IDMuNjA4OTUgMTguODYyNyAzLjUwODM3IDE2Ljk1MDJMMy41MDMxMiAxNi43NTExTDMuNTAwODkgOC4yNTI3TDMuNTA1MjkgOC4wNTAyQzMuNjA1MzkgNi4xMzc0OSA1LjEzODY3IDQuNjA0NDkgNy4wNTA5NiA0LjUwNTI3TDcuMjUwMSA0LjUwMDE3SDEwLjc0OTVINy4yNTAxWk0xMy43NDgxIDMuMDAxNDZMMjAuMzAxOCAzLjAwMTk3TDIwLjQwMTQgMy4wMTU3NUwyMC41MDIyIDMuMDQzOTNMMjAuNTU5IDMuMDY4MDNDMjAuNjEyMiAzLjA5MTIyIDIwLjY2MzQgMy4xMjE2MyAyMC43MTExIDMuMTU4ODVMMjAuNzgwNCAzLjIyMTU2TDIwLjg2NDEgMy4zMjAxNEwyMC45MTgzIDMuNDEwMjVMMjAuOTU3IDMuNTAwNTdMMjAuOTc2MiAzLjU2NDc2TDIwLjk4OTggMy42Mjg2MkwyMC45OTkyIDMuNzIyODJMMjAuOTk5NyAxMC4yNTU0QzIwLjk5OTcgMTAuNjY5NiAyMC42NjM5IDExLjAwNTQgMjAuMjQ5NyAxMS4wMDU0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjRkZGRkZGIiAvPjwvc3ZnPg==);
|
|
315
|
-
filter: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
315
|
+
filter: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp14 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp14 === void 0 ? void 0 : (_webChatContainerProp15 = _webChatContainerProp14.sentMessageAnchorStyles) === null || _webChatContainerProp15 === void 0 ? void 0 : _webChatContainerProp15.filter) ?? (defaultSentMessageAnchorStyles === null || defaultSentMessageAnchorStyles === void 0 ? void 0 : defaultSentMessageAnchorStyles.filter)};
|
|
316
316
|
height: .75em;
|
|
317
317
|
width: .75em;
|
|
318
318
|
margin-left: .25em;
|
|
@@ -322,7 +322,7 @@ export const WebChatContainerStateful = props => {
|
|
|
322
322
|
/* Modern browsers with mask support */
|
|
323
323
|
@supports (mask: url()) or (-webkit-mask: url()) {
|
|
324
324
|
.ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon {
|
|
325
|
-
background-color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
325
|
+
background-color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp16 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp16 === void 0 ? void 0 : (_webChatContainerProp17 = _webChatContainerProp16.receivedMessageAnchorStyles) === null || _webChatContainerProp17 === void 0 ? void 0 : _webChatContainerProp17.color) ?? (defaultReceivedMessageAnchorStyles === null || defaultReceivedMessageAnchorStyles === void 0 ? void 0 : defaultReceivedMessageAnchorStyles.color)} !important;
|
|
326
326
|
background-image: none !important;
|
|
327
327
|
filter: none !important;
|
|
328
328
|
mask: url("data:image/svg+xml,%3Csvg viewBox='3 3 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.2501 4.50017H10.7495C11.1637 4.50017 11.4995 4.83596 11.4995 5.25017C11.4995 5.62986 11.2173 5.94366 10.8513 5.99332L10.7495 6.00017H7.24974C6.07079 5.99961 5.10349 6.90656 5.00786 8.06112L5.00028 8.22003L5.00312 16.7507C5.00343 17.9415 5.92885 18.9161 7.09966 18.9949L7.25371 19.0001L15.7518 18.9884C16.9415 18.9868 17.9145 18.062 17.9935 16.8923L17.9987 16.7384V13.2321C17.9987 12.8179 18.3345 12.4821 18.7487 12.4821C19.1284 12.4821 19.4422 12.7643 19.4918 13.1303L19.4987 13.2321V16.7384C19.4987 18.7407 17.9293 20.3769 15.9528 20.4829L15.7538 20.4884L7.25827 20.5001L7.05495 20.4949C5.14239 20.3954 3.60895 18.8627 3.50837 16.9502L3.50312 16.7511L3.50089 8.2527L3.50529 8.0502C3.60539 6.13749 5.13867 4.60449 7.05096 4.50527L7.2501 4.50017H10.7495H7.2501ZM13.7481 3.00146L20.3018 3.00197L20.4014 3.01575L20.5022 3.04393L20.559 3.06803C20.6122 3.09122 20.6634 3.12163 20.7111 3.15885L20.7804 3.22156L20.8641 3.32014L20.9183 3.41025L20.957 3.50057L20.9762 3.56476L20.9898 3.62862L20.9992 3.72282L20.9997 10.2554C20.9997 10.6696 20.6639 11.0054 20.2497 11.0054C19.87 11.0054 19.5562 10.7232 19.5065 10.3571L19.4997 10.2554L19.4989 5.56147L12.2797 12.7847C12.0134 13.051 11.5968 13.0753 11.3031 12.8575L11.219 12.7849C10.9527 12.5187 10.9284 12.1021 11.1462 11.8084L11.2188 11.7243L18.4369 4.50146H13.7481C13.3684 4.50146 13.0546 4.21931 13.005 3.85324L12.9981 3.75146C12.9981 3.37177 13.2803 3.05797 13.6464 3.00831L13.7481 3.00146Z' fill='currentColor' /%3E%3C/svg%3E") no-repeat center;
|
|
@@ -332,7 +332,7 @@ export const WebChatContainerStateful = props => {
|
|
|
332
332
|
}
|
|
333
333
|
|
|
334
334
|
.ms_lcw_webchat_sent_message img.webchat__render-markdown__external-link-icon {
|
|
335
|
-
background-color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
335
|
+
background-color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp18 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp18 === void 0 ? void 0 : (_webChatContainerProp19 = _webChatContainerProp18.sentMessageAnchorStyles) === null || _webChatContainerProp19 === void 0 ? void 0 : _webChatContainerProp19.color) ?? (defaultSentMessageAnchorStyles === null || defaultSentMessageAnchorStyles === void 0 ? void 0 : defaultSentMessageAnchorStyles.color)} !important;
|
|
336
336
|
background-image: none !important;
|
|
337
337
|
filter: none !important;
|
|
338
338
|
mask: url("data:image/svg+xml,%3Csvg viewBox='3 3 18 18' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7.2501 4.50017H10.7495C11.1637 4.50017 11.4995 4.83596 11.4995 5.25017C11.4995 5.62986 11.2173 5.94366 10.8513 5.99332L10.7495 6.00017H7.24974C6.07079 5.99961 5.10349 6.90656 5.00786 8.06112L5.00028 8.22003L5.00312 16.7507C5.00343 17.9415 5.92885 18.9161 7.09966 18.9949L7.25371 19.0001L15.7518 18.9884C16.9415 18.9868 17.9145 18.062 17.9935 16.8923L17.9987 16.7384V13.2321C17.9987 12.8179 18.3345 12.4821 18.7487 12.4821C19.1284 12.4821 19.4422 12.7643 19.4918 13.1303L19.4987 13.2321V16.7384C19.4987 18.7407 17.9293 20.3769 15.9528 20.4829L15.7538 20.4884L7.25827 20.5001L7.05495 20.4949C5.14239 20.3954 3.60895 18.8627 3.50837 16.9502L3.50312 16.7511L3.50089 8.2527L3.50529 8.0502C3.60539 6.13749 5.13867 4.60449 7.05096 4.50527L7.2501 4.50017H10.7495H7.2501ZM13.7481 3.00146L20.3018 3.00197L20.4014 3.01575L20.5022 3.04393L20.559 3.06803C20.6122 3.09122 20.6634 3.12163 20.7111 3.15885L20.7804 3.22156L20.8641 3.32014L20.9183 3.41025L20.957 3.50057L20.9762 3.56476L20.9898 3.62862L20.9992 3.72282L20.9997 10.2554C20.9997 10.6696 20.6639 11.0054 20.2497 11.0054C19.87 11.0054 19.5562 10.7232 19.5065 10.3571L19.4997 10.2554L19.4989 5.56147L12.2797 12.7847C12.0134 13.051 11.5968 13.0753 11.3031 12.8575L11.219 12.7849C10.9527 12.5187 10.9284 12.1021 11.1462 11.8084L11.2188 11.7243L18.4369 4.50146H13.7481C13.3684 4.50146 13.0546 4.21931 13.005 3.85324L12.9981 3.75146C12.9981 3.37177 13.2803 3.05797 13.6464 3.00831L13.7481 3.00146Z' fill='currentColor' /%3E%3C/svg%3E") no-repeat center;
|
|
@@ -350,18 +350,18 @@ export const WebChatContainerStateful = props => {
|
|
|
350
350
|
.ms_lcw_webchat_received_message a:visited,
|
|
351
351
|
.ms_lcw_webchat_received_message a:hover,
|
|
352
352
|
.ms_lcw_webchat_received_message a:active {
|
|
353
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
353
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp20 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp20 === void 0 ? void 0 : (_webChatContainerProp21 = _webChatContainerProp20.receivedMessageAnchorStyles) === null || _webChatContainerProp21 === void 0 ? void 0 : _webChatContainerProp21.color) ?? (defaultReceivedMessageAnchorStyles === null || defaultReceivedMessageAnchorStyles === void 0 ? void 0 : defaultReceivedMessageAnchorStyles.color)};
|
|
354
354
|
}
|
|
355
355
|
.ms_lcw_webchat_sent_message a:link,
|
|
356
356
|
.ms_lcw_webchat_sent_message a:visited,
|
|
357
357
|
.ms_lcw_webchat_sent_message a:hover,
|
|
358
358
|
.ms_lcw_webchat_sent_message a:active {
|
|
359
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
359
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp22 = webChatContainerProps.renderingMiddlewareProps) === null || _webChatContainerProp22 === void 0 ? void 0 : (_webChatContainerProp23 = _webChatContainerProp22.sentMessageAnchorStyles) === null || _webChatContainerProp23 === void 0 ? void 0 : _webChatContainerProp23.color) ?? (defaultSentMessageAnchorStyles === null || defaultSentMessageAnchorStyles === void 0 ? void 0 : defaultSentMessageAnchorStyles.color)};
|
|
360
360
|
}
|
|
361
361
|
|
|
362
362
|
// we had a nasty bug long time ago with crashing borders messing with the sendbox, so if customer adds this value, they need to deal with that
|
|
363
363
|
.webchat__bubble:not(.webchat__bubble--from-user) .webchat__bubble__content {
|
|
364
|
-
border-radius: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
364
|
+
border-radius: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp24 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp24 === void 0 ? void 0 : _webChatContainerProp24.bubbleBorderRadius) ?? 0} !important; /* Override border-radius */
|
|
365
365
|
}
|
|
366
366
|
|
|
367
367
|
.webchat__stacked-layout_container>div {
|
|
@@ -398,8 +398,8 @@ export const WebChatContainerStateful = props => {
|
|
|
398
398
|
|
|
399
399
|
/* Suggested actions carousel previous/next navigation focus */
|
|
400
400
|
.webchat__suggested-actions .webchat__suggested-actions__carousel .react-film__flipper:focus-visible .react-film__flipper__body {
|
|
401
|
-
outline: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
402
|
-
outline-offset: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
401
|
+
outline: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp25 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp25 === void 0 ? void 0 : _webChatContainerProp25.suggestedActionKeyboardFocusIndicatorBorderStyle) ?? "dashed"} ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp26 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp26 === void 0 ? void 0 : _webChatContainerProp26.suggestedActionKeyboardFocusIndicatorBorderWidth) ?? "1px"} ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp27 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp27 === void 0 ? void 0 : _webChatContainerProp27.suggestedActionKeyboardFocusIndicatorBorderColor) ?? "#605E5C"} !important;
|
|
402
|
+
outline-offset: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp28 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp28 === void 0 ? void 0 : _webChatContainerProp28.suggestedActionKeyboardFocusIndicatorInset) ?? "2px"} !important;
|
|
403
403
|
|
|
404
404
|
`), /*#__PURE__*/React.createElement(Stack, {
|
|
405
405
|
styles: containerStyles,
|
|
@@ -410,9 +410,7 @@ export const WebChatContainerStateful = props => {
|
|
|
410
410
|
height: "100%",
|
|
411
411
|
width: "100%"
|
|
412
412
|
}
|
|
413
|
-
}, shouldLoadPersistentHistoryMessages && /*#__PURE__*/React.createElement(WebChatEventSubscribers, {
|
|
414
|
-
persistentChatHistoryEnabled: props === null || props === void 0 ? void 0 : (_props$persistentChat2 = props.persistentChatHistoryProps) === null || _props$persistentChat2 === void 0 ? void 0 : _props$persistentChat2.persistentChatHistoryEnabled
|
|
415
|
-
}), /*#__PURE__*/React.createElement(BasicWebChat, null))), citationPaneOpen && /*#__PURE__*/React.createElement(CitationPaneStateful, {
|
|
413
|
+
}, shouldLoadPersistentHistoryMessages && /*#__PURE__*/React.createElement(WebChatEventSubscribers, null), /*#__PURE__*/React.createElement(BasicWebChat, null))), citationPaneOpen && /*#__PURE__*/React.createElement(CitationPaneStateful, {
|
|
416
414
|
id: ((_props$citationPanePr = props.citationPaneProps) === null || _props$citationPanePr === void 0 ? void 0 : _props$citationPanePr.id) || HtmlAttributeNames.ocwCitationPaneClassName,
|
|
417
415
|
title: ((_props$citationPanePr2 = props.citationPaneProps) === null || _props$citationPanePr2 === void 0 ? void 0 : _props$citationPanePr2.title) || HtmlAttributeNames.ocwCitationPaneTitle,
|
|
418
416
|
contentHtml: citationPaneText,
|
|
@@ -56,11 +56,17 @@ const convertPersistentChatHistoryMessageToActivity = message => {
|
|
|
56
56
|
}
|
|
57
57
|
if (tags) {
|
|
58
58
|
const formattedTags = additionalData.tags.split(",");
|
|
59
|
-
activity.channelData
|
|
59
|
+
activity.channelData = {
|
|
60
|
+
...activity.channelData,
|
|
61
|
+
tags: [...activity.channelData.tags, ...formattedTags]
|
|
62
|
+
};
|
|
60
63
|
}
|
|
61
64
|
}
|
|
62
65
|
if (from !== null && from !== void 0 && (_from$user = from.user) !== null && _from$user !== void 0 && _from$user.displayName) {
|
|
63
|
-
activity.from
|
|
66
|
+
activity.from = {
|
|
67
|
+
...activity.from,
|
|
68
|
+
name: from.user.displayName
|
|
69
|
+
};
|
|
64
70
|
}
|
|
65
71
|
if ((from === null || from === void 0 ? void 0 : (_from$application = from.application) === null || _from$application === void 0 ? void 0 : _from$application.displayName) === "Customer") {
|
|
66
72
|
activity.from = {
|
|
@@ -29,5 +29,6 @@ export const defaultMiddlewareLocalizedTexts = {
|
|
|
29
29
|
MIDDLEWARE_BANNER_FILE_IS_MALICIOUS: "{0} has been blocked because the file may contain a malware.",
|
|
30
30
|
MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_SUCCESS: "Email will be sent after chat ends!",
|
|
31
31
|
MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_ERROR: "Email {0} could not be saved, try again later.",
|
|
32
|
-
PREVIOUS_MESSAGES_LOADING: "Loading previous messages..."
|
|
32
|
+
PREVIOUS_MESSAGES_LOADING: "Loading previous messages...",
|
|
33
|
+
CONVERSATION_DIVIDER_ARIA_LABEL: "Conversation history divider"
|
|
33
34
|
};
|
|
@@ -2,9 +2,8 @@ import { LogLevel, TelemetryEvent } from "../../../common/telemetry/TelemetryCon
|
|
|
2
2
|
import { useEffect, useRef } from "react";
|
|
3
3
|
import ChatWidgetEvents from "../../livechatwidget/common/ChatWidgetEvents";
|
|
4
4
|
import PersistentConversationHandler from "../../livechatwidget/common/PersistentConversationHandler";
|
|
5
|
-
import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
|
|
6
|
-
import dispatchCustomEvent from "../../../common/utils/dispatchCustomEvent";
|
|
7
5
|
import SecureEventBus from "../../../common/utils/SecureEventBus";
|
|
6
|
+
import { TelemetryHelper } from "../../../common/telemetry/TelemetryHelper";
|
|
8
7
|
const usePersistentChatHistory = (facadeChatSDK, props) => {
|
|
9
8
|
const handlerRef = useRef(null);
|
|
10
9
|
useEffect(() => {
|
|
@@ -24,7 +23,6 @@ const usePersistentChatHistory = (facadeChatSDK, props) => {
|
|
|
24
23
|
try {
|
|
25
24
|
var _handlerRef$current;
|
|
26
25
|
await ((_handlerRef$current = handlerRef.current) === null || _handlerRef$current === void 0 ? void 0 : _handlerRef$current.pullHistory());
|
|
27
|
-
dispatchCustomEvent(ChatWidgetEvents.HIDE_LOADING_BANNER);
|
|
28
26
|
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
29
27
|
Event: TelemetryEvent.LCWPersistentChatHistoryFetchCompleted,
|
|
30
28
|
Description: "Persistent chat history fetch completed successfully"
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js
CHANGED
|
@@ -11,14 +11,13 @@ import dispatchCustomEvent from "../../../common/utils/dispatchCustomEvent";
|
|
|
11
11
|
* Component to handle persistent chat history events.
|
|
12
12
|
* Uses WebChatStoreLoader instead of hooks to avoid context issues.
|
|
13
13
|
*/
|
|
14
|
-
const WebChatEventSubscribers =
|
|
14
|
+
const WebChatEventSubscribers = () => {
|
|
15
15
|
const [isConnected, setIsConnected] = useState(false);
|
|
16
16
|
const [storeReady, setStoreReady] = useState(false);
|
|
17
17
|
const storeWaitTimer = createTimer();
|
|
18
|
+
// Type the chatConfig properly to avoid 'any' usage
|
|
19
|
+
|
|
18
20
|
useEffect(() => {
|
|
19
|
-
if (!props.persistentChatHistoryEnabled) {
|
|
20
|
-
return;
|
|
21
|
-
}
|
|
22
21
|
TelemetryHelper.logActionEventToAllTelemetry(LogLevel.INFO, {
|
|
23
22
|
Event: TelemetryEvent.LCWWebChatStorePollingStarted,
|
|
24
23
|
Description: "WebChat store polling started"
|
|
@@ -50,9 +49,9 @@ const WebChatEventSubscribers = props => {
|
|
|
50
49
|
clearInterval(storeCheckInterval);
|
|
51
50
|
};
|
|
52
51
|
}
|
|
53
|
-
}, [
|
|
52
|
+
}, []);
|
|
54
53
|
useEffect(() => {
|
|
55
|
-
if (!
|
|
54
|
+
if (!storeReady) {
|
|
56
55
|
return;
|
|
57
56
|
}
|
|
58
57
|
const checkConnectionStatus = () => {
|
|
@@ -109,7 +108,7 @@ const WebChatEventSubscribers = props => {
|
|
|
109
108
|
return () => {
|
|
110
109
|
clearInterval(interval);
|
|
111
110
|
};
|
|
112
|
-
}, [isConnected,
|
|
111
|
+
}, [isConnected, storeReady]);
|
|
113
112
|
return null;
|
|
114
113
|
};
|
|
115
114
|
export default WebChatEventSubscribers;
|
|
@@ -1,10 +1,39 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { defaultMiddlewareLocalizedTexts } from "../../../../common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
2
3
|
import { defaultPersistentChatHistoryProps } from "../../../../../livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps";
|
|
3
4
|
import { mergeStyles } from "@fluentui/react";
|
|
4
5
|
const ConversationDividerActivity = props => {
|
|
5
6
|
const styleApplied = mergeStyles(defaultPersistentChatHistoryProps.dividerActivityStyle, props.dividerActivityStyle);
|
|
7
|
+
const ariaLabel = props.dividerActivityAriaLabel || defaultMiddlewareLocalizedTexts.CONVERSATION_DIVIDER_ARIA_LABEL;
|
|
8
|
+
|
|
9
|
+
// Create a simple separator that screen readers can detect without being interactive
|
|
10
|
+
// Preserve the visual divider styling while making it accessible
|
|
11
|
+
// Use a ref to programmatically remove only the "EL said:" prefix from the label
|
|
12
|
+
const dividerRef = React.useRef(null);
|
|
13
|
+
React.useEffect(() => {
|
|
14
|
+
if (dividerRef.current) {
|
|
15
|
+
// Find and hardcode the text in the label div to just show the divider label
|
|
16
|
+
const article = dividerRef.current.closest(".webchat__basic-transcript__activity");
|
|
17
|
+
if (article) {
|
|
18
|
+
const labelDiv = article.querySelector("div[id*=\"webchat__basic-transcript__active-descendant-label--\"]");
|
|
19
|
+
if (labelDiv) {
|
|
20
|
+
// Hardcode the text to just the aria label
|
|
21
|
+
labelDiv.textContent = ariaLabel || "";
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}, [ariaLabel]);
|
|
6
26
|
return /*#__PURE__*/React.createElement("div", {
|
|
7
|
-
|
|
27
|
+
ref: dividerRef,
|
|
28
|
+
role: "separator",
|
|
29
|
+
"aria-label": ariaLabel,
|
|
30
|
+
"aria-hidden": false,
|
|
31
|
+
className: styleApplied,
|
|
32
|
+
"data-accessibility-divider": "true",
|
|
33
|
+
style: {
|
|
34
|
+
// Add accessibility enhancements
|
|
35
|
+
position: "relative"
|
|
36
|
+
}
|
|
8
37
|
});
|
|
9
38
|
};
|
|
10
39
|
export default ConversationDividerActivity;
|
|
@@ -85,7 +85,7 @@ let LazyLoadHandler = /*#__PURE__*/function () {
|
|
|
85
85
|
|
|
86
86
|
// Scroll operation state
|
|
87
87
|
// Current scroll operation tracking
|
|
88
|
-
// Prevents concurrent scroll operations
|
|
88
|
+
// Prevents concurrent scroll operations (public for event handlers)
|
|
89
89
|
|
|
90
90
|
// Timeout and queue management
|
|
91
91
|
// Tracks all setTimeout IDs for cleanup
|
|
@@ -956,6 +956,21 @@ const LazyLoadActivity = props => {
|
|
|
956
956
|
setHasMoreHistory(false);
|
|
957
957
|
};
|
|
958
958
|
|
|
959
|
+
// Event listener for HISTORY_LOAD_ERROR - hides banner temporarily without disabling future loads
|
|
960
|
+
const handleHistoryLoadError = () => {
|
|
961
|
+
// Temporarily hide the banner by pausing, but keep hasMoreHistory true to allow retry
|
|
962
|
+
LazyLoadHandler.paused = true;
|
|
963
|
+
LazyLoadHandler.pendingScrollAction = false;
|
|
964
|
+
|
|
965
|
+
// Re-enable after a delay to allow retry on next scroll
|
|
966
|
+
// Note: This timeout is intentionally not tracked as it's scoped to the component lifecycle
|
|
967
|
+
window.setTimeout(() => {
|
|
968
|
+
LazyLoadHandler.paused = false;
|
|
969
|
+
}, 2000); // 2 second delay before allowing retry
|
|
970
|
+
|
|
971
|
+
LazyLoadHandler.logLifecycleEvent(TelemetryEvent.LCWLazyLoadHistoryError, "History load error - will retry on next scroll");
|
|
972
|
+
};
|
|
973
|
+
|
|
959
974
|
// Event listener for PersistentConversationReset to sync React state
|
|
960
975
|
// This fixes the issue where banner doesn't appear in start chat + close chat + start chat sequence
|
|
961
976
|
// by ensuring React state (hasMoreHistory) is synchronized with handler state when reset occurs
|
|
@@ -968,6 +983,9 @@ const LazyLoadActivity = props => {
|
|
|
968
983
|
const eventBus = SecureEventBus.getInstance();
|
|
969
984
|
const unsubscribeNoMoreHistory = eventBus.subscribe(ChatWidgetEvents.NO_MORE_HISTORY_AVAILABLE, handleNoMoreHistory);
|
|
970
985
|
|
|
986
|
+
// Add event listener for history load errors
|
|
987
|
+
const unsubscribeHistoryError = eventBus.subscribe(ChatWidgetEvents.HISTORY_LOAD_ERROR, handleHistoryLoadError);
|
|
988
|
+
|
|
971
989
|
// Add event listener for persistent conversation reset
|
|
972
990
|
const resetSubscription = BroadcastService.getMessageByEventName(BroadcastEvent.PersistentConversationReset).subscribe(handlePersistentConversationReset);
|
|
973
991
|
|
|
@@ -984,6 +1002,7 @@ const LazyLoadActivity = props => {
|
|
|
984
1002
|
// Still need to return cleanup function even after reset
|
|
985
1003
|
return () => {
|
|
986
1004
|
unsubscribeNoMoreHistory();
|
|
1005
|
+
unsubscribeHistoryError();
|
|
987
1006
|
resetSubscription.unsubscribe();
|
|
988
1007
|
};
|
|
989
1008
|
}
|
|
@@ -1036,6 +1055,7 @@ const LazyLoadActivity = props => {
|
|
|
1036
1055
|
|
|
1037
1056
|
// Remove event listeners
|
|
1038
1057
|
unsubscribeNoMoreHistory();
|
|
1058
|
+
unsubscribeHistoryError();
|
|
1039
1059
|
resetSubscription.unsubscribe();
|
|
1040
1060
|
if (container) {
|
|
1041
1061
|
container.removeEventListener("scroll", handleScroll);
|
|
@@ -17,6 +17,7 @@ import { DirectLineActivityType } from "../../enums/DirectLineActivityType";
|
|
|
17
17
|
import { DirectLineSenderRole } from "../../enums/DirectLineSenderRole";
|
|
18
18
|
import React from "react";
|
|
19
19
|
import { TelemetryHelper } from "../../../../../common/telemetry/TelemetryHelper";
|
|
20
|
+
import { defaultMiddlewareLocalizedTexts } from "../../../common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
20
21
|
import { defaultSystemMessageStyles } from "./defaultStyles/defaultSystemMessageStyles";
|
|
21
22
|
import { defaultUserMessageStyles } from "./defaultStyles/defaultUserMessageStyles";
|
|
22
23
|
import { escapeHtml } from "../../../../../common/utils";
|
|
@@ -70,7 +71,7 @@ const isDataTagsPresent = card => {
|
|
|
70
71
|
};
|
|
71
72
|
|
|
72
73
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
73
|
-
export const createActivityMiddleware = (renderMarkdown, systemMessageStyleProps, userMessageStyleProps) => () => next => function () {
|
|
74
|
+
export const createActivityMiddleware = (renderMarkdown, systemMessageStyleProps, userMessageStyleProps, localizedTexts) => () => next => function () {
|
|
74
75
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
75
76
|
args[_key] = arguments[_key];
|
|
76
77
|
}
|
|
@@ -121,7 +122,11 @@ export const createActivityMiddleware = (renderMarkdown, systemMessageStyleProps
|
|
|
121
122
|
};
|
|
122
123
|
}
|
|
123
124
|
if (isTagIncluded(card, Constants.conversationDividerTag)) {
|
|
124
|
-
|
|
125
|
+
const conversationDividerLabel = (localizedTexts === null || localizedTexts === void 0 ? void 0 : localizedTexts.CONVERSATION_DIVIDER_ARIA_LABEL) || defaultMiddlewareLocalizedTexts.CONVERSATION_DIVIDER_ARIA_LABEL;
|
|
126
|
+
// Pass the computed localized text to the divider component
|
|
127
|
+
return /*#__PURE__*/React.createElement(ConversationDividerActivity, {
|
|
128
|
+
dividerActivityAriaLabel: conversationDividerLabel
|
|
129
|
+
});
|
|
125
130
|
}
|
|
126
131
|
if (card.activity.text && card.activity.type === DirectLineActivityType.Message) {
|
|
127
132
|
if (!card.activity.channelData.isHtmlEncoded && card.activity.channelId === Constants.webchatChannelId) {
|
|
@@ -69,6 +69,7 @@ export const NotDeliveredTimestamp = _ref => {
|
|
|
69
69
|
style: failedTextStyles
|
|
70
70
|
}, " ", ((_state$domainStates$m = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m === void 0 ? void 0 : _state$domainStates$m.MIDDLEWARE_MESSAGE_NOT_DELIVERED) ?? defaultMiddlewareLocalizedTexts.MIDDLEWARE_MESSAGE_NOT_DELIVERED, " "), /*#__PURE__*/React.createElement("span", null, " \xA0-\xA0 "), /*#__PURE__*/React.createElement("span", {
|
|
71
71
|
style: retryTextStyles,
|
|
72
|
+
role: "button",
|
|
72
73
|
onClick: onRetryClick,
|
|
73
74
|
onKeyDown: onRetryKeyEnter,
|
|
74
75
|
tabIndex: 0
|
|
@@ -27,7 +27,12 @@ export const createCitationsMiddleware = (state, dispatch) => () => next => acti
|
|
|
27
27
|
const citations = (_gptFeedback$summariz = gptFeedback.summarizationOpenAIResponse) === null || _gptFeedback$summariz === void 0 ? void 0 : (_gptFeedback$summariz2 = _gptFeedback$summariz.result) === null || _gptFeedback$summariz2 === void 0 ? void 0 : _gptFeedback$summariz2.textCitations;
|
|
28
28
|
// Rewrite inline citation labels in activity.text to match the global map keys
|
|
29
29
|
const updatedText = replaceCitations(action.payload.activity.text, citations, messagePrefix);
|
|
30
|
-
|
|
30
|
+
|
|
31
|
+
// Create new activity object to avoid mutation
|
|
32
|
+
action.payload.activity = {
|
|
33
|
+
...action.payload.activity,
|
|
34
|
+
text: updatedText
|
|
35
|
+
};
|
|
31
36
|
// Build a global citation map keyed by the prefixed citation id and
|
|
32
37
|
// dispatch it to app state so the UI container can render citations.
|
|
33
38
|
try {
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
|
|
3
|
+
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
3
4
|
import { Constants } from "../../../../../common/Constants";
|
|
4
|
-
import { getIconText } from "../../../../../common/utils";
|
|
5
|
-
import { defaultWebChatStyles } from "../../../common/defaultStyles/defaultWebChatStyles";
|
|
6
5
|
import { WebChatActionType } from "../../enums/WebChatActionType";
|
|
6
|
+
import { defaultWebChatStyles } from "../../../common/defaultStyles/defaultWebChatStyles";
|
|
7
|
+
import { getIconText } from "../../../../../common/utils";
|
|
7
8
|
let currentAgentInitials = defaultWebChatStyles.botAvatarInitials;
|
|
8
|
-
|
|
9
|
+
|
|
10
|
+
// Optional external updater (React context dispatch wrapper) set at runtime
|
|
11
|
+
let externalInitialsUpdater;
|
|
12
|
+
export const localizedStringsBotInitialsMiddleware = onInitialsChange => _ref => {
|
|
9
13
|
let {
|
|
10
14
|
dispatch
|
|
11
15
|
} = _ref;
|
|
12
16
|
return next => action => {
|
|
17
|
+
if (onInitialsChange && !externalInitialsUpdater) {
|
|
18
|
+
externalInitialsUpdater = onInitialsChange; // capture once
|
|
19
|
+
}
|
|
20
|
+
|
|
13
21
|
if (action.type === WebChatActionType.DIRECT_LINE_INCOMING_ACTIVITY) {
|
|
14
22
|
var _action$payload, _activity$from;
|
|
15
23
|
const activity = (_action$payload = action.payload) === null || _action$payload === void 0 ? void 0 : _action$payload.activity;
|
|
@@ -17,10 +25,25 @@ export const localizedStringsBotInitialsMiddleware = () => _ref => {
|
|
|
17
25
|
var _activity$channelData, _activity$channelData2, _activity$tags;
|
|
18
26
|
const agentName = activity.from.name.trim();
|
|
19
27
|
const isSystemMessage = agentName === "__agent__" || agentName.startsWith("__") || ((_activity$channelData = activity.channelData) === null || _activity$channelData === void 0 ? void 0 : (_activity$channelData2 = _activity$channelData.tags) === null || _activity$channelData2 === void 0 ? void 0 : _activity$channelData2.includes(Constants.systemMessageTag)) || ((_activity$tags = activity.tags) === null || _activity$tags === void 0 ? void 0 : _activity$tags.includes(Constants.systemMessageTag));
|
|
20
|
-
if (!isSystemMessage && agentName
|
|
21
|
-
// Update initials for valid agent/bot names
|
|
28
|
+
if (!isSystemMessage && agentName) {
|
|
22
29
|
const newInitials = getIconText(agentName) || currentAgentInitials;
|
|
23
|
-
currentAgentInitials
|
|
30
|
+
if (newInitials !== currentAgentInitials) {
|
|
31
|
+
var _externalInitialsUpda;
|
|
32
|
+
currentAgentInitials = newInitials;
|
|
33
|
+
// Notify external React context if provided
|
|
34
|
+
(_externalInitialsUpda = externalInitialsUpdater) === null || _externalInitialsUpda === void 0 ? void 0 : _externalInitialsUpda(currentAgentInitials || "");
|
|
35
|
+
// Broadcast (optional) for multi-tab sync without forcing consumers
|
|
36
|
+
BroadcastService.postMessage({
|
|
37
|
+
eventName: "BotAvatarInitialsUpdated",
|
|
38
|
+
payload: {
|
|
39
|
+
initials: currentAgentInitials
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
// Also dispatch a no-op action into WebChat store to encourage re-render (cheap)
|
|
43
|
+
dispatch({
|
|
44
|
+
type: "__BOT_INITIALS_UPDATED__"
|
|
45
|
+
});
|
|
46
|
+
}
|
|
24
47
|
}
|
|
25
48
|
}
|
|
26
49
|
}
|
|
@@ -33,7 +56,6 @@ export const getOverriddenLocalizedStrings = existingOverrides => {
|
|
|
33
56
|
...strings,
|
|
34
57
|
...existingOverrides
|
|
35
58
|
};
|
|
36
|
-
|
|
37
59
|
// Apply dynamic bot initials to alt text if not already overridden through props
|
|
38
60
|
if (!(existingOverrides !== null && existingOverrides !== void 0 && existingOverrides.ACTIVITY_BOT_SAID_ALT)) {
|
|
39
61
|
result.ACTIVITY_BOT_SAID_ALT = `${currentAgentInitials} said:`;
|
|
@@ -49,4 +49,5 @@ export let LiveChatWidgetActionType;
|
|
|
49
49
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_ENABLED"] = 46] = "SET_CONVERSATIONAL_SURVEY_ENABLED";
|
|
50
50
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATIONAL_SURVEY_DISPLAY"] = 47] = "SET_CONVERSATIONAL_SURVEY_DISPLAY";
|
|
51
51
|
LiveChatWidgetActionType[LiveChatWidgetActionType["GET_IN_MEMORY_STATE"] = 48] = "GET_IN_MEMORY_STATE";
|
|
52
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_AVATAR_INITIALS"] = 49] = "SET_BOT_AVATAR_INITIALS";
|
|
52
53
|
})(LiveChatWidgetActionType || (LiveChatWidgetActionType = {}));
|
|
@@ -4,6 +4,7 @@ import { ConversationState } from "./ConversationState";
|
|
|
4
4
|
import { StartChatFailureType } from "./StartChatFailureType";
|
|
5
5
|
import { defaultClientDataStoreProvider } from "../../common/storage/default/defaultClientDataStoreProvider";
|
|
6
6
|
import { defaultMiddlewareLocalizedTexts } from "../../components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
7
|
+
import { defaultWebChatStyles } from "../../components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles";
|
|
7
8
|
export const getLiveChatWidgetContextInitialState = props => {
|
|
8
9
|
var _props$controlProps, _props$webChatContain;
|
|
9
10
|
const isOutsideOperatingHours = () => {
|
|
@@ -33,6 +34,10 @@ export const getLiveChatWidgetContextInitialState = props => {
|
|
|
33
34
|
initialStateFromCache.domainStates.liveChatConfig = props.chatConfig;
|
|
34
35
|
// Cache the result of isOutsideOperatingHours() to ensure consistency
|
|
35
36
|
initialStateFromCache.appStates.outsideOperatingHours = outsideOperatingHours;
|
|
37
|
+
// Backward compatibility: if botAvatarInitials not cached (older sessions), seed with default
|
|
38
|
+
if (!initialStateFromCache.domainStates.botAvatarInitials) {
|
|
39
|
+
initialStateFromCache.domainStates.botAvatarInitials = defaultWebChatStyles.botAvatarInitials;
|
|
40
|
+
}
|
|
36
41
|
return initialStateFromCache;
|
|
37
42
|
}
|
|
38
43
|
const LiveChatWidgetContextInitialState = {
|
|
@@ -56,7 +61,8 @@ export const getLiveChatWidgetContextInitialState = props => {
|
|
|
56
61
|
transcriptRequestId: "",
|
|
57
62
|
confirmationPaneConfirmedOptionClicked: false,
|
|
58
63
|
confirmationState: ConfirmationState.NotSet,
|
|
59
|
-
startChatFailureType: StartChatFailureType.Generic
|
|
64
|
+
startChatFailureType: StartChatFailureType.Generic,
|
|
65
|
+
botAvatarInitials: defaultWebChatStyles.botAvatarInitials
|
|
60
66
|
},
|
|
61
67
|
appStates: {
|
|
62
68
|
conversationState: ConversationState.Closed,
|
|
@@ -554,6 +554,21 @@ const reducer = (state, action) => {
|
|
|
554
554
|
widgetSize: action.payload
|
|
555
555
|
}
|
|
556
556
|
};
|
|
557
|
+
case LiveChatWidgetActionType.SET_BOT_AVATAR_INITIALS:
|
|
558
|
+
inMemory = {
|
|
559
|
+
...inMemory,
|
|
560
|
+
domainStates: {
|
|
561
|
+
...inMemory.domainStates,
|
|
562
|
+
botAvatarInitials: action.payload
|
|
563
|
+
}
|
|
564
|
+
};
|
|
565
|
+
return {
|
|
566
|
+
...state,
|
|
567
|
+
domainStates: {
|
|
568
|
+
...state.domainStates,
|
|
569
|
+
botAvatarInitials: action.payload
|
|
570
|
+
}
|
|
571
|
+
};
|
|
557
572
|
case LiveChatWidgetActionType.SET_WIDGET_INSTANCE_ID:
|
|
558
573
|
inMemory = {
|
|
559
574
|
...inMemory,
|
|
@@ -31,7 +31,7 @@ export const createTrackingForFirstMessage = () => {
|
|
|
31
31
|
* Starts tracking the time for the first bot message after widget loads.
|
|
32
32
|
* Sets a 5-second timeout to auto-reset if no bot message is received.
|
|
33
33
|
*/
|
|
34
|
-
const widgetLoadListener = BroadcastService.getMessageByEventName(TelemetryEvent.
|
|
34
|
+
const widgetLoadListener = BroadcastService.getMessageByEventName(TelemetryEvent.StartChatComplete).subscribe(() => {
|
|
35
35
|
if (isTracking) return;
|
|
36
36
|
isTracking = true;
|
|
37
37
|
startTime = new Date().getTime();
|
|
@@ -86,7 +86,8 @@ export const createTrackingForFirstMessage = () => {
|
|
|
86
86
|
CustomProperties: {
|
|
87
87
|
elapsedTime,
|
|
88
88
|
widgetLoadedAt: startTime,
|
|
89
|
-
botMessage: stopTrackingMessage
|
|
89
|
+
botMessage: stopTrackingMessage,
|
|
90
|
+
type: payload === null || payload === void 0 ? void 0 : payload.type
|
|
90
91
|
}
|
|
91
92
|
});
|
|
92
93
|
disconnectListener();
|