@microsoft/omnichannel-chat-widget 1.8.3-main.ec1328d → 1.8.4-main.7bdb634
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 +6 -0
- package/lib/cjs/common/facades/FacadeChatSDK.js +6 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +34 -0
- package/lib/cjs/common/utils/SecureEventBus.js +307 -0
- package/lib/cjs/common/utils/dispatchCustomEvent.js +25 -0
- package/lib/cjs/components/citationpanestateful/CitationDim.js +29 -0
- package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +199 -0
- package/lib/cjs/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +70 -0
- package/lib/cjs/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js +1 -0
- package/lib/cjs/components/livechatwidget/LiveChatWidget.js +4 -4
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +127 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
- package/lib/cjs/components/livechatwidget/common/ChatWidgetEvents.js +15 -0
- package/lib/cjs/components/livechatwidget/common/PersistentConversationHandler.js +284 -0
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -0
- package/lib/cjs/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +18 -0
- package/lib/cjs/components/livechatwidget/common/endChat.js +28 -3
- package/lib/cjs/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +8 -6
- package/lib/cjs/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
- package/lib/cjs/components/livechatwidget/common/startChat.js +5 -4
- package/lib/cjs/components/livechatwidget/interfaces/IMockProps.js +8 -2
- package/lib/cjs/components/livechatwidget/interfaces/IPersistentChatHistoryProps.js +1 -0
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +29 -5
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +122 -11
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -14
- package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/common/activities/botActivity.js +14 -0
- package/lib/cjs/components/webchatcontainerstateful/common/activities/conversationDividerActivity.js +17 -0
- package/lib/cjs/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +97 -0
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +36 -2
- package/lib/cjs/components/webchatcontainerstateful/common/utils/fontUtils.js +28 -0
- package/lib/cjs/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +59 -0
- package/lib/cjs/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +122 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.js +10 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +18 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +1038 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +34 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +44 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +16 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.js +20 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +2 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +59 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +4 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +97 -30
- 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/index.js +9 -1
- package/lib/esm/common/Constants.js +6 -0
- package/lib/esm/common/facades/FacadeChatSDK.js +6 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +34 -0
- package/lib/esm/common/utils/SecureEventBus.js +328 -0
- package/lib/esm/common/utils/dispatchCustomEvent.js +18 -0
- package/lib/esm/components/citationpanestateful/CitationDim.js +20 -0
- package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +188 -0
- package/lib/esm/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +61 -0
- package/lib/esm/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js +1 -0
- package/lib/esm/components/livechatwidget/LiveChatWidget.js +4 -4
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.js +120 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
- package/lib/esm/components/livechatwidget/common/ChatWidgetEvents.js +8 -0
- package/lib/esm/components/livechatwidget/common/PersistentConversationHandler.js +277 -0
- package/lib/esm/components/livechatwidget/common/createAdapter.js +2 -0
- package/lib/esm/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +11 -0
- package/lib/esm/components/livechatwidget/common/endChat.js +29 -4
- package/lib/esm/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +8 -6
- package/lib/esm/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
- package/lib/esm/components/livechatwidget/common/startChat.js +5 -4
- package/lib/esm/components/livechatwidget/interfaces/IMockProps.js +3 -3
- package/lib/esm/components/livechatwidget/interfaces/IPersistentChatHistoryProps.js +1 -0
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +29 -5
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +125 -12
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -14
- package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/common/activities/botActivity.js +7 -0
- package/lib/esm/components/webchatcontainerstateful/common/activities/conversationDividerActivity.js +9 -0
- package/lib/esm/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +90 -0
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatStatefulProps.js +2 -2
- package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +32 -0
- package/lib/esm/components/webchatcontainerstateful/common/utils/fontUtils.js +21 -0
- package/lib/esm/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +51 -0
- package/lib/esm/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +115 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.js +3 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +10 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +1060 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +25 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +42 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +13 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.js +13 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.js +52 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +2 -2
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +98 -30
- 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/index.js +1 -0
- package/lib/types/common/Constants.d.ts +5 -0
- package/lib/types/common/facades/FacadeChatSDK.d.ts +3 -1
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +33 -2
- package/lib/types/common/utils/SecureEventBus.d.ts +159 -0
- package/lib/types/common/utils/dispatchCustomEvent.d.ts +2 -0
- package/lib/types/components/citationpanestateful/CitationDim.d.ts +5 -0
- package/lib/types/components/citationpanestateful/CitationPaneStateful.d.ts +4 -0
- package/lib/types/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.d.ts +11 -0
- package/lib/types/components/citationpanestateful/interfaces/ICitationPaneStatefulProps.d.ts +19 -0
- package/lib/types/components/confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts.d.ts +1 -1
- package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/AddActivitySubscriber.d.ts +45 -0
- package/lib/types/components/livechatwidget/common/ChatWidgetEvents.d.ts +7 -0
- package/lib/types/components/livechatwidget/common/PersistentConversationHandler.d.ts +28 -0
- package/lib/types/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.d.ts +2 -0
- package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +2 -1
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +5 -1
- package/lib/types/components/livechatwidget/interfaces/IMockProps.d.ts +5 -3
- package/lib/types/components/livechatwidget/interfaces/IPersistentChatHistoryProps.d.ts +7 -0
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatAdapter.d.ts +4 -2
- package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +5 -0
- package/lib/types/components/webchatcontainerstateful/common/activities/botActivity.d.ts +7 -0
- package/lib/types/components/webchatcontainerstateful/common/activities/conversationDividerActivity.d.ts +10 -0
- package/lib/types/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +6 -1
- package/lib/types/components/webchatcontainerstateful/common/utils/fontUtils.d.ts +10 -0
- package/lib/types/components/webchatcontainerstateful/hooks/usePersistentChatHistory.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/interfaces/ICitation.d.ts +12 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.d.ts +7 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/Constants.d.ts +3 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.d.ts +4 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.d.ts +326 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.d.ts +8 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultInLineBannerStyle.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/HistoryMessageTimestamp.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.d.ts +3 -4
- 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/ILiveChatWidgetLocalizedTexts.d.ts +1 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +46 -45
- package/lib/types/index.d.ts +1 -0
- package/package.json +3 -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
|
@@ -10,6 +10,7 @@ var _utils = require("../../../common/utils");
|
|
|
10
10
|
var _renderSurveyHelpers = require("./renderSurveyHelpers");
|
|
11
11
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
12
12
|
var _ConversationState = require("../../../contexts/common/ConversationState");
|
|
13
|
+
var _LazyLoadActivity = require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity");
|
|
13
14
|
var _LiveChatWidgetActionType = require("../../../contexts/common/LiveChatWidgetActionType");
|
|
14
15
|
var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
15
16
|
var _TelemetryManager = require("../../../common/telemetry/TelemetryManager");
|
|
@@ -44,7 +45,7 @@ const prepareEndChat = async (props, facadeChatSDK, state, dispatch, setAdapter,
|
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
// Use Case: If ended by Agent, stay chat in InActive state
|
|
47
|
-
|
|
48
|
+
const isConversationalSurveyEnabled = state.appStates.isConversationalSurveyEnabled;
|
|
48
49
|
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
50
|
dispatch({
|
|
50
51
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
@@ -153,8 +154,23 @@ const endChat = async (props, facadeChatSDK, state, dispatch, setAdapter, setWeb
|
|
|
153
154
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.GET_IN_MEMORY_STATE,
|
|
154
155
|
payload: null
|
|
155
156
|
});
|
|
157
|
+
let isSessionEnded = inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$appSta = inMemoryState.appStates) === null || _inMemoryState$appSta === void 0 ? void 0 : _inMemoryState$appSta.chatDisconnectEventReceived;
|
|
158
|
+
if (!isSessionEnded) {
|
|
159
|
+
// double check by fetching the latest conversation details
|
|
160
|
+
const conversationDetails = await (0, _utils.getConversationDetailsCall)(facadeChatSDK);
|
|
161
|
+
if ((conversationDetails === null || conversationDetails === void 0 ? void 0 : conversationDetails.state) === _Constants.LiveWorkItemState.WrapUp || (conversationDetails === null || conversationDetails === void 0 ? void 0 : conversationDetails.state) === _Constants.LiveWorkItemState.Closed) {
|
|
162
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
163
|
+
Event: _TelemetryConstants.TelemetryEvent.ChatDisconnectThreadEventReceived,
|
|
164
|
+
Description: "Checking conversation details upon endChat. Chat disconnected.",
|
|
165
|
+
CustomProperties: {
|
|
166
|
+
conversationDetails
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
isSessionEnded = true;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
156
172
|
const endChatOptionalParameters = {
|
|
157
|
-
isSessionEnded
|
|
173
|
+
isSessionEnded
|
|
158
174
|
};
|
|
159
175
|
try {
|
|
160
176
|
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
@@ -216,7 +232,12 @@ const endChat = async (props, facadeChatSDK, state, dispatch, setAdapter, setWeb
|
|
|
216
232
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_POST_CHAT_CONTEXT,
|
|
217
233
|
payload: undefined
|
|
218
234
|
});
|
|
219
|
-
|
|
235
|
+
|
|
236
|
+
// Call direct reset to ensure LazyLoadHandler gets reset regardless of broadcast timing
|
|
237
|
+
_LazyLoadActivity.LazyLoadHandler.directReset();
|
|
238
|
+
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
239
|
+
eventName: _TelemetryConstants.BroadcastEvent.PersistentConversationReset
|
|
240
|
+
});
|
|
220
241
|
closeChatWidget(dispatch, setWebChatStyles, props);
|
|
221
242
|
facadeChatSDK.destroy();
|
|
222
243
|
}
|
|
@@ -305,6 +326,10 @@ const closeChatStateCleanUp = dispatch => {
|
|
|
305
326
|
proactiveChatInNewWindow: false
|
|
306
327
|
}
|
|
307
328
|
});
|
|
329
|
+
dispatch({
|
|
330
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CITATIONS,
|
|
331
|
+
payload: {}
|
|
332
|
+
});
|
|
308
333
|
|
|
309
334
|
// Clear live chat context only if chat widget is fully closed to support transcript calls after sessionclose is called
|
|
310
335
|
dispatch({
|
|
@@ -8,14 +8,15 @@ var _DemoChatSDK = require("../../webchatcontainerstateful/common/DemoChatSDK");
|
|
|
8
8
|
var _DesignerChatSDK = require("../../webchatcontainerstateful/common/DesignerChatSDK");
|
|
9
9
|
var _mockchatsdk = require("../../webchatcontainerstateful/common/mockchatsdk");
|
|
10
10
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
11
|
-
const getMockChatSDKIfApplicable = (chatSDK,
|
|
12
|
-
if (type) {
|
|
13
|
-
switch (type.toLowerCase()) {
|
|
11
|
+
const getMockChatSDKIfApplicable = (chatSDK, mockProps) => {
|
|
12
|
+
if (mockProps !== null && mockProps !== void 0 && mockProps.type) {
|
|
13
|
+
switch (mockProps.type.toLowerCase()) {
|
|
14
14
|
case "demo":
|
|
15
15
|
chatSDK = new _DemoChatSDK.DemoChatSDK();
|
|
16
16
|
break;
|
|
17
17
|
case "designer":
|
|
18
18
|
chatSDK = new _DesignerChatSDK.DesignerChatSDK();
|
|
19
|
+
chatSDK.mockMessages = mockProps === null || mockProps === void 0 ? void 0 : mockProps.mockMessages;
|
|
19
20
|
break;
|
|
20
21
|
default:
|
|
21
22
|
chatSDK = new _mockchatsdk.MockChatSDK();
|
|
@@ -7,6 +7,7 @@ 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 _localizedStringsBotInitialsMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware");
|
|
10
11
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
11
12
|
var _ConversationState = require("../../../contexts/common/ConversationState");
|
|
12
13
|
var _dompurify = _interopRequireDefault(require("dompurify"));
|
|
@@ -17,6 +18,7 @@ var _WebChatStoreLoader = require("../../webchatcontainerstateful/webchatcontrol
|
|
|
17
18
|
var _attachmentProcessingMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware"));
|
|
18
19
|
var _channelDataMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware"));
|
|
19
20
|
var _activityMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware");
|
|
21
|
+
var _activityStatusMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware");
|
|
20
22
|
var _attachmentMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware");
|
|
21
23
|
var _attachmentUploadValidatorMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware"));
|
|
22
24
|
var _avatarMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware");
|
|
@@ -44,11 +46,10 @@ var _htmlPlayerMiddleware = _interopRequireDefault(require("../../webchatcontain
|
|
|
44
46
|
var _htmlTextMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/htmlTextMiddleware"));
|
|
45
47
|
var _preProcessingMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/preProcessingMiddleware"));
|
|
46
48
|
var _sanitizationMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware"));
|
|
47
|
-
var _localizedStringsBotInitialsMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware");
|
|
48
49
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
49
50
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
50
51
|
const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endChat) => {
|
|
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,
|
|
52
|
+
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, _state$domainStates$l6, _state$domainStates$l7, _props$webChatContain17, _props$webChatContain18, _props$webChatContain19, _props$webChatContain20, _state$domainStates$r5, _state$domainStates$r6, _props$webChatContain21, _props$webChatContain22, _defaultWebChatContai, _props$webChatContain23, _props$webChatContain24, _defaultWebChatContai2, _props$webChatContain25, _props$webChatContain26, _props$webChatContain27, _props$webChatContain28;
|
|
52
53
|
// Add a hook to make all links open a new window
|
|
53
54
|
postDomPurifyActivities();
|
|
54
55
|
const localizedTexts = {
|
|
@@ -66,6 +67,7 @@ const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endChat) =>
|
|
|
66
67
|
let webChatStore = _WebChatStoreLoader.WebChatStoreLoader.store;
|
|
67
68
|
if (!webChatStore) {
|
|
68
69
|
var _state$domainStates$l, _state$domainStates$l2, _state$domainStates$l3, _props$webChatContain7;
|
|
70
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
69
71
|
const addConversationalSurveyTagsCallback = action => {
|
|
70
72
|
var _inMemoryState$appSta;
|
|
71
73
|
const inMemoryState = (0, _createReducer.executeReducer)(state, {
|
|
@@ -123,7 +125,7 @@ const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endChat) =>
|
|
|
123
125
|
};
|
|
124
126
|
webChatStore = (0, _botframeworkWebchat.createStore)({},
|
|
125
127
|
//initial state
|
|
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, _citationsMiddleware.createCitationsMiddleware, _gifUploadMiddleware.default, _htmlPlayerMiddleware.default, (0, _htmlTextMiddleware.default)(honorsTargetInHTMLLinks), (0, _maxMessageSizeValidator.default)(localizedTexts), _sanitizationMiddleware.default, (0, _callActionMiddleware.default)(), (0, _localizedStringsBotInitialsMiddleware.localizedStringsBotInitialsMiddleware)(),
|
|
128
|
+
_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)(),
|
|
127
129
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
128
130
|
...(((_props$webChatContain7 = props.webChatContainerProps) === null || _props$webChatContain7 === void 0 ? void 0 : _props$webChatContain7.storeMiddlewares) ?? []));
|
|
129
131
|
_WebChatStoreLoader.WebChatStoreLoader.store = webChatStore;
|
|
@@ -168,12 +170,12 @@ const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endChat) =>
|
|
|
168
170
|
store: webChatStore,
|
|
169
171
|
activityMiddleware: (_props$webChatContain11 = props.webChatContainerProps) !== null && _props$webChatContain11 !== void 0 && (_props$webChatContain12 = _props$webChatContain11.renderingMiddlewareProps) !== null && _props$webChatContain12 !== void 0 && _props$webChatContain12.disableActivityMiddleware ? undefined : (0, _activityMiddleware.createActivityMiddleware)(renderMarkdown, (_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.systemMessageStyleProps, (_state$domainStates$r2 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.userMessageStyleProps),
|
|
170
172
|
attachmentMiddleware: (_props$webChatContain13 = props.webChatContainerProps) !== null && _props$webChatContain13 !== void 0 && (_props$webChatContain14 = _props$webChatContain13.renderingMiddlewareProps) !== null && _props$webChatContain14 !== void 0 && _props$webChatContain14.disableAttachmentMiddleware ? undefined : (0, _attachmentMiddleware.createAttachmentMiddleware)(((_state$domainStates$r3 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r3 === void 0 ? void 0 : (_state$domainStates$r4 = _state$domainStates$r3.attachmentProps) === null || _state$domainStates$r4 === void 0 ? void 0 : _state$domainStates$r4.enableInlinePlaying) ?? _defaultAttachmentProps.defaultAttachmentProps.enableInlinePlaying),
|
|
171
|
-
activityStatusMiddleware: (_props$webChatContain15 = props.webChatContainerProps) !== null && _props$webChatContain15 !== void 0 && (_props$webChatContain16 = _props$webChatContain15.renderingMiddlewareProps) !== null && _props$webChatContain16 !== void 0 && _props$webChatContain16.disableActivityStatusMiddleware ? undefined : (
|
|
173
|
+
activityStatusMiddleware: (_props$webChatContain15 = props.webChatContainerProps) !== null && _props$webChatContain15 !== void 0 && (_props$webChatContain16 = _props$webChatContain15.renderingMiddlewareProps) !== null && _props$webChatContain16 !== void 0 && _props$webChatContain16.disableActivityStatusMiddleware ? undefined : (0, _activityStatusMiddleware.createActivityStatusMiddleware)((0, _omnichannelChatSdk.getLocaleStringFromId)((_state$domainStates$l6 = state.domainStates.liveChatConfig) === null || _state$domainStates$l6 === void 0 ? void 0 : (_state$domainStates$l7 = _state$domainStates$l6.ChatWidgetLanguage) === null || _state$domainStates$l7 === void 0 ? void 0 : _state$domainStates$l7.msdyn_localeid)),
|
|
172
174
|
toastMiddleware: (_props$webChatContain17 = props.webChatContainerProps) !== null && _props$webChatContain17 !== void 0 && (_props$webChatContain18 = _props$webChatContain17.renderingMiddlewareProps) !== null && _props$webChatContain18 !== void 0 && _props$webChatContain18.disableToastMiddleware ? undefined : (0, _toastMiddleware.createToastMiddleware)(props.notificationPaneProps, endChat),
|
|
173
175
|
renderMarkdown,
|
|
174
176
|
avatarMiddleware: (_props$webChatContain19 = props.webChatContainerProps) !== null && _props$webChatContain19 !== void 0 && (_props$webChatContain20 = _props$webChatContain19.renderingMiddlewareProps) !== null && _props$webChatContain20 !== void 0 && _props$webChatContain20.disableAvatarMiddleware ? undefined : (0, _avatarMiddleware.createAvatarMiddleware)((_state$domainStates$r5 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r5 === void 0 ? void 0 : _state$domainStates$r5.avatarStyleProps, (_state$domainStates$r6 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r6 === void 0 ? void 0 : _state$domainStates$r6.avatarTextStyleProps),
|
|
175
|
-
groupActivitiesMiddleware: (_props$webChatContain21 = props.webChatContainerProps) !== null && _props$webChatContain21 !== void 0 && (_props$webChatContain22 = _props$webChatContain21.renderingMiddlewareProps) !== null && _props$webChatContain22 !== void 0 && _props$webChatContain22.disableGroupActivitiesMiddleware ? undefined : (
|
|
176
|
-
typingIndicatorMiddleware: (_props$webChatContain23 = props.webChatContainerProps) !== null && _props$webChatContain23 !== void 0 && (_props$webChatContain24 = _props$webChatContain23.renderingMiddlewareProps) !== null && _props$webChatContain24 !== void 0 && _props$webChatContain24.disableTypingIndicatorMiddleware ? undefined : (
|
|
177
|
+
groupActivitiesMiddleware: (_props$webChatContain21 = props.webChatContainerProps) !== null && _props$webChatContain21 !== void 0 && (_props$webChatContain22 = _props$webChatContain21.renderingMiddlewareProps) !== null && _props$webChatContain22 !== void 0 && _props$webChatContain22.disableGroupActivitiesMiddleware ? undefined : (_defaultWebChatContai = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai === void 0 ? void 0 : _defaultWebChatContai.groupActivitiesMiddleware,
|
|
178
|
+
typingIndicatorMiddleware: (_props$webChatContain23 = props.webChatContainerProps) !== null && _props$webChatContain23 !== void 0 && (_props$webChatContain24 = _props$webChatContain23.renderingMiddlewareProps) !== null && _props$webChatContain24 !== void 0 && _props$webChatContain24.disableTypingIndicatorMiddleware ? undefined : (_defaultWebChatContai2 = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatProps) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.typingIndicatorMiddleware,
|
|
177
179
|
onTelemetry: (0, _WebChatLogger.createWebChatTelemetry)(),
|
|
178
180
|
cardActionMiddleware: (0, _cardActionMiddleware.createCardActionMiddleware)(((_props$webChatContain25 = props.webChatContainerProps) === null || _props$webChatContain25 === void 0 ? void 0 : _props$webChatContain25.botMagicCode) || undefined),
|
|
179
181
|
sendTypingIndicator: true,
|
|
@@ -7,6 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
const overridePropsOnMockIfApplicable = props => {
|
|
8
8
|
var _props$mock, _props$mock2;
|
|
9
9
|
if (props !== null && props !== void 0 && (_props$mock = props.mock) !== null && _props$mock !== void 0 && _props$mock.type && (props === null || props === void 0 ? void 0 : (_props$mock2 = props.mock) === null || _props$mock2 === void 0 ? void 0 : _props$mock2.type.toLowerCase()) === "designer") {
|
|
10
|
+
var _props$mock3, _props$mock3$mockMess;
|
|
10
11
|
if (!props.webChatContainerProps) {
|
|
11
12
|
props.webChatContainerProps = {};
|
|
12
13
|
}
|
|
@@ -22,7 +23,7 @@ const overridePropsOnMockIfApplicable = props => {
|
|
|
22
23
|
props.webChatContainerProps = {
|
|
23
24
|
...props.webChatContainerProps,
|
|
24
25
|
webChatProps: {
|
|
25
|
-
disabled:
|
|
26
|
+
disabled: !(props !== null && props !== void 0 && (_props$mock3 = props.mock) !== null && _props$mock3 !== void 0 && (_props$mock3$mockMess = _props$mock3.mockMessages) !== null && _props$mock3$mockMess !== void 0 && _props$mock3$mockMess.length),
|
|
26
27
|
...props.webChatContainerProps.webChatProps,
|
|
27
28
|
overrideLocalizedStrings: {
|
|
28
29
|
TEXT_INPUT_PLACEHOLDER: "Send a message . . .",
|
|
@@ -105,7 +105,7 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
|
|
|
105
105
|
|
|
106
106
|
// If minimized, maximize the chat, if the state is missing, consider it as minimized
|
|
107
107
|
if ((state === null || state === void 0 ? void 0 : state.appStates.isMinimized) === undefined || (state === null || state === void 0 ? void 0 : (_state$appStates = state.appStates) === null || _state$appStates === void 0 ? void 0 : _state$appStates.isMinimized) === true) {
|
|
108
|
-
var _state$domainStates3, _state$domainStates3$, _state$domainStates4, _state$domainStates4
|
|
108
|
+
var _state$domainStates3, _state$domainStates3$, _state$domainStates4, _state$domainStates4$, _TelemetryManager$Int;
|
|
109
109
|
dispatch({
|
|
110
110
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MINIMIZED,
|
|
111
111
|
payload: false
|
|
@@ -116,7 +116,8 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
|
|
|
116
116
|
eventName: _TelemetryConstants.BroadcastEvent.MaximizeChat,
|
|
117
117
|
payload: {
|
|
118
118
|
height: state === null || state === void 0 ? void 0 : (_state$domainStates3 = state.domainStates) === null || _state$domainStates3 === void 0 ? void 0 : (_state$domainStates3$ = _state$domainStates3.widgetSize) === null || _state$domainStates3$ === void 0 ? void 0 : _state$domainStates3$.height,
|
|
119
|
-
width: state === null || state === void 0 ? void 0 : (_state$domainStates4 = state.domainStates) === null || _state$domainStates4 === void 0 ? void 0 : (_state$domainStates4$ = _state$domainStates4.widgetSize) === null || _state$domainStates4$ === void 0 ? void 0 : _state$domainStates4$.width
|
|
119
|
+
width: state === null || state === void 0 ? void 0 : (_state$domainStates4 = state.domainStates) === null || _state$domainStates4 === void 0 ? void 0 : (_state$domainStates4$ = _state$domainStates4.widgetSize) === null || _state$domainStates4$ === void 0 ? void 0 : _state$domainStates4$.width,
|
|
120
|
+
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
|
|
120
121
|
}
|
|
121
122
|
});
|
|
122
123
|
}
|
|
@@ -137,7 +138,7 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
|
|
|
137
138
|
* This is because a new change to control OOH as closed event when a widget is coming from chat.
|
|
138
139
|
*/
|
|
139
140
|
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$, _TelemetryManager$
|
|
141
|
+
var _state$domainStates5, _state$domainStates5$, _state$domainStates6, _state$domainStates6$, _TelemetryManager$Int2;
|
|
141
142
|
dispatch({
|
|
142
143
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_MINIMIZED,
|
|
143
144
|
payload: false
|
|
@@ -148,7 +149,7 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
|
|
|
148
149
|
payload: {
|
|
149
150
|
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
151
|
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$
|
|
152
|
+
runtimeId: _TelemetryManager.TelemetryManager === null || _TelemetryManager.TelemetryManager === void 0 ? void 0 : (_TelemetryManager$Int2 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int2 === void 0 ? void 0 : _TelemetryManager$Int2.lcwRuntimeId
|
|
152
153
|
}
|
|
153
154
|
});
|
|
154
155
|
}
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.LiveChatWidgetMockType = void 0;
|
|
7
|
+
let LiveChatWidgetMockType;
|
|
8
|
+
exports.LiveChatWidgetMockType = LiveChatWidgetMockType;
|
|
4
9
|
(function (LiveChatWidgetMockType) {
|
|
5
10
|
LiveChatWidgetMockType["Test"] = "Test";
|
|
6
11
|
LiveChatWidgetMockType["Demo"] = "Demo";
|
|
7
|
-
|
|
12
|
+
LiveChatWidgetMockType["Designer"] = "Designer";
|
|
13
|
+
})(LiveChatWidgetMockType || (exports.LiveChatWidgetMockType = LiveChatWidgetMockType = {}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -488,7 +488,8 @@ const LiveChatWidgetStateful = props => {
|
|
|
488
488
|
eventName: _TelemetryConstants.BroadcastEvent.MaximizeChat,
|
|
489
489
|
payload: {
|
|
490
490
|
height: inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$domain = inMemoryState.domainStates) === null || _inMemoryState$domain === void 0 ? void 0 : (_inMemoryState$domain2 = _inMemoryState$domain.widgetSize) === null || _inMemoryState$domain2 === void 0 ? void 0 : _inMemoryState$domain2.height,
|
|
491
|
-
width: inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$domain3 = inMemoryState.domainStates) === null || _inMemoryState$domain3 === void 0 ? void 0 : (_inMemoryState$domain4 = _inMemoryState$domain3.widgetSize) === null || _inMemoryState$domain4 === void 0 ? void 0 : _inMemoryState$domain4.width
|
|
491
|
+
width: inMemoryState === null || inMemoryState === void 0 ? void 0 : (_inMemoryState$domain3 = inMemoryState.domainStates) === null || _inMemoryState$domain3 === void 0 ? void 0 : (_inMemoryState$domain4 = _inMemoryState$domain3.widgetSize) === null || _inMemoryState$domain4 === void 0 ? void 0 : _inMemoryState$domain4.width,
|
|
492
|
+
lcwRuntimeId: _TelemetryManager.TelemetryManager.InternalTelemetryData.lcwRuntimeId
|
|
492
493
|
}
|
|
493
494
|
});
|
|
494
495
|
return;
|
|
@@ -876,23 +877,46 @@ const LiveChatWidgetStateful = props => {
|
|
|
876
877
|
|
|
877
878
|
// WebChat's Composer can only be rendered if a directLine object is defined
|
|
878
879
|
return directLine && /*#__PURE__*/_react2.default.createElement(_react2.default.Fragment, null, /*#__PURE__*/_react2.default.createElement("style", null, `
|
|
879
|
-
::-webkit-scrollbar {
|
|
880
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar {
|
|
880
881
|
width: ${scrollbarProps.width};
|
|
881
882
|
}
|
|
882
883
|
|
|
883
|
-
::-webkit-scrollbar-track {
|
|
884
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-track {
|
|
884
885
|
background: ${scrollbarProps.trackBackgroundColor};
|
|
885
886
|
}
|
|
886
887
|
|
|
887
|
-
::-webkit-scrollbar-thumb {
|
|
888
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb {
|
|
888
889
|
background: ${scrollbarProps.thumbBackgroundColor};
|
|
889
890
|
border-radius: ${scrollbarProps.thumbBorderRadius};
|
|
890
891
|
}
|
|
891
892
|
|
|
892
|
-
::-webkit-scrollbar-thumb:hover {
|
|
893
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb:hover {
|
|
893
894
|
background: ${scrollbarProps.thumbHoverColor};
|
|
894
895
|
}
|
|
895
896
|
|
|
897
|
+
/* High Contrast mode support - optimized for all variants */
|
|
898
|
+
@media (prefers-contrast: high), (-ms-high-contrast: active), (forced-colors: active) {
|
|
899
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-track {
|
|
900
|
+
background: Canvas !important;
|
|
901
|
+
border: 1px solid CanvasText !important;
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb {
|
|
905
|
+
background: CanvasText !important;
|
|
906
|
+
border: 1px solid Canvas !important;
|
|
907
|
+
min-height: 20px !important;
|
|
908
|
+
}
|
|
909
|
+
|
|
910
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-thumb:hover {
|
|
911
|
+
background: Highlight !important;
|
|
912
|
+
border: 1px solid CanvasText !important;
|
|
913
|
+
}
|
|
914
|
+
|
|
915
|
+
#oc-lcw .webchat__basic-transcript__scrollable::-webkit-scrollbar-corner {
|
|
916
|
+
background: Canvas !important;
|
|
917
|
+
}
|
|
918
|
+
}
|
|
919
|
+
|
|
896
920
|
.webchat__basic-transcript__activity-markdown-body > :last-child {
|
|
897
921
|
margin-bottom: 0px;
|
|
898
922
|
}
|
|
@@ -10,13 +10,16 @@ var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
|
|
|
10
10
|
var _react2 = _interopRequireWildcard(require("react"));
|
|
11
11
|
var _utils = require("../../common/utils");
|
|
12
12
|
var _BotMagicCodeStore = require("./webchatcontroller/BotMagicCodeStore");
|
|
13
|
+
var _CitationPaneStateful = _interopRequireDefault(require("../citationpanestateful/CitationPaneStateful"));
|
|
13
14
|
var _botframeworkWebchat = require("botframework-webchat");
|
|
14
15
|
var _LiveChatWidgetActionType = require("../../contexts/common/LiveChatWidgetActionType");
|
|
15
16
|
var _NotificationHandler = require("./webchatcontroller/notification/NotificationHandler");
|
|
16
17
|
var _NotificationScenarios = require("./webchatcontroller/enums/NotificationScenarios");
|
|
17
18
|
var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
18
19
|
var _WebChatActionType = require("./webchatcontroller/enums/WebChatActionType");
|
|
20
|
+
var _WebChatEventSubscribers = _interopRequireDefault(require("./webchatcontroller/WebChatEventSubscribers"));
|
|
19
21
|
var _WebChatStoreLoader = require("./webchatcontroller/WebChatStoreLoader");
|
|
22
|
+
var _fontUtils = require("./common/utils/fontUtils");
|
|
20
23
|
var _defaultAdaptiveCardStyles = require("./common/defaultStyles/defaultAdaptiveCardStyles");
|
|
21
24
|
var _defaultMiddlewareLocalizedTexts = require("./common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
22
25
|
var _defaultReceivedMessageAnchorStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles");
|
|
@@ -24,13 +27,16 @@ var _defaultSentMessageAnchorStyles = require("./webchatcontroller/middlewares/r
|
|
|
24
27
|
var _defaultSystemMessageBoxStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles");
|
|
25
28
|
var _defaultUserMessageBoxStyles = require("./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles");
|
|
26
29
|
var _defaultWebChatContainerStatefulProps = require("./common/defaultProps/defaultWebChatContainerStatefulProps");
|
|
30
|
+
var _liveChatConfigUtils = require("../livechatwidget/common/liveChatConfigUtils");
|
|
27
31
|
var _ = require("../..");
|
|
32
|
+
var _useFacadeChatSDKStore = _interopRequireDefault(require("../../hooks/useFacadeChatSDKStore"));
|
|
33
|
+
var _usePersistentChatHistory = _interopRequireDefault(require("./hooks/usePersistentChatHistory"));
|
|
34
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
28
35
|
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); }
|
|
29
36
|
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; }
|
|
30
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
31
|
-
|
|
32
37
|
let uiTimer;
|
|
33
38
|
const broadcastChannelMessageEvent = "message";
|
|
39
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
34
40
|
const postActivity = activity => {
|
|
35
41
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
36
42
|
return {
|
|
@@ -56,13 +62,29 @@ const createMagicCodeSuccessResponse = signin => {
|
|
|
56
62
|
};
|
|
57
63
|
};
|
|
58
64
|
const WebChatContainerStateful = props => {
|
|
59
|
-
var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _props$
|
|
65
|
+
var _props$webChatContain, _defaultWebChatContai, _extendedChatConfig$L, _props$persistentChat, _extendedChatConfig$L2, _extendedChatConfig$L3, _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _props$webChatContain6, _props$webChatContain7, _defaultWebChatContai2, _props$webChatContain8, _props$webChatContain9, _defaultWebChatContai3, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15, _webChatContainerProp16, _webChatContainerProp17, _webChatContainerProp18, _webChatContainerProp19, _webChatContainerProp20, _webChatContainerProp21, _webChatContainerProp22, _webChatContainerProp23, _props$webChatContain10, _props$webChatContain11, _webChatContainerProp24, _webChatContainerProp25, _webChatContainerProp26, _webChatContainerProp27, _props$persistentChat2, _props$citationPanePr, _props$citationPanePr2, _props$citationPanePr3, _props$citationPanePr4, _props$citationPanePr5;
|
|
66
|
+
const [facadeChatSDK] = (0, _useFacadeChatSDKStore.default)();
|
|
67
|
+
|
|
68
|
+
// Create a font family that includes emoji support, based on the primary font or default
|
|
69
|
+
const webChatStyles = ((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.webChatStyles) ?? _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles;
|
|
70
|
+
const primaryFont = (webChatStyles === null || webChatStyles === void 0 ? void 0 : webChatStyles.primaryFont) ?? ((_defaultWebChatContai = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai === void 0 ? void 0 : _defaultWebChatContai.primaryFont);
|
|
71
|
+
|
|
72
|
+
// Use iOS-optimized emoji font that prioritizes system-ui for proper emoji rendering
|
|
73
|
+
const fontFamilyWithEmojis = (0, _fontUtils.createIOSOptimizedEmojiFont)(primaryFont);
|
|
60
74
|
(0, _react2.useEffect)(() => {
|
|
61
75
|
uiTimer = (0, _utils.createTimer)();
|
|
62
76
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
63
77
|
Event: _TelemetryConstants.TelemetryEvent.UXWebchatContainerCompleted
|
|
64
78
|
});
|
|
65
79
|
}, []);
|
|
80
|
+
|
|
81
|
+
// Citation pane state
|
|
82
|
+
const [citationPaneOpen, setCitationPaneOpen] = (0, _react2.useState)(false);
|
|
83
|
+
const [citationPaneText, setCitationPaneText] = (0, _react2.useState)("");
|
|
84
|
+
|
|
85
|
+
// Guard to prevent handling multiple rapid clicks which could cause
|
|
86
|
+
// the dim layer and pane to re-render out of sync and create a flicker.
|
|
87
|
+
const citationOpeningRef = (0, _react2.useRef)(false);
|
|
66
88
|
const {
|
|
67
89
|
BasicWebChat
|
|
68
90
|
} = _botframeworkWebchat.Components;
|
|
@@ -71,6 +93,68 @@ const WebChatContainerStateful = props => {
|
|
|
71
93
|
webChatContainerProps,
|
|
72
94
|
contextDataStore
|
|
73
95
|
} = props;
|
|
96
|
+
|
|
97
|
+
// Type the chatConfig properly to avoid 'any' usage
|
|
98
|
+
const extendedChatConfig = props.chatConfig;
|
|
99
|
+
const isHistoryEnabledInConfig = extendedChatConfig === null || extendedChatConfig === void 0 ? void 0 : (_extendedChatConfig$L = extendedChatConfig.LcwFcbConfiguration) === null || _extendedChatConfig$L === void 0 ? void 0 : _extendedChatConfig$L.lcwPersistentChatHistoryEnabled;
|
|
100
|
+
const isHistoryEnabledViaProps = props === null || props === void 0 ? void 0 : (_props$persistentChat = props.persistentChatHistoryProps) === null || _props$persistentChat === void 0 ? void 0 : _props$persistentChat.persistentChatHistoryEnabled;
|
|
101
|
+
const isPersistentChatEnabledForWidget = !!(extendedChatConfig !== null && extendedChatConfig !== void 0 && (_extendedChatConfig$L2 = extendedChatConfig.LiveChatConfigAuthSettings) !== null && _extendedChatConfig$L2 !== void 0 && _extendedChatConfig$L2.msdyn_javascriptclientfunction) || (0, _liveChatConfigUtils.isPersistentChatEnabled)(extendedChatConfig === null || extendedChatConfig === void 0 ? void 0 : (_extendedChatConfig$L3 = extendedChatConfig.LiveWSAndLiveChatEngJoin) === null || _extendedChatConfig$L3 === void 0 ? void 0 : _extendedChatConfig$L3.msdyn_conversationmode);
|
|
102
|
+
|
|
103
|
+
// Persistent chat history is enabled if explicitly set via props, or if enabled in config
|
|
104
|
+
// Props take precedence over config settings
|
|
105
|
+
const isPersistentHistoryEnabled = isHistoryEnabledViaProps || isHistoryEnabledInConfig;
|
|
106
|
+
|
|
107
|
+
// Check if both persistent chat and widget support are enabled
|
|
108
|
+
const shouldLoadPersistentHistoryMessages = isPersistentHistoryEnabled && isPersistentChatEnabledForWidget;
|
|
109
|
+
if (shouldLoadPersistentHistoryMessages) {
|
|
110
|
+
(0, _usePersistentChatHistory.default)(facadeChatSDK, (props === null || props === void 0 ? void 0 : props.persistentChatHistoryProps) ?? {});
|
|
111
|
+
}
|
|
112
|
+
// Delegated click handler for citation anchors. Placed after state is
|
|
113
|
+
// available so we can prefer reading citations from app state and fall
|
|
114
|
+
// back to the legacy window map for backward-compatibility in tests.
|
|
115
|
+
(0, _react2.useEffect)(() => {
|
|
116
|
+
const clickHandler = ev => {
|
|
117
|
+
try {
|
|
118
|
+
if (citationOpeningRef.current) {
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
const target = ev.target;
|
|
122
|
+
// Only consider anchors whose href starts with the citation scheme
|
|
123
|
+
const anchor = target.closest && target.closest("a[href^=\"cite:\"]");
|
|
124
|
+
if (anchor) {
|
|
125
|
+
ev.preventDefault();
|
|
126
|
+
citationOpeningRef.current = true;
|
|
127
|
+
// Rely only on the href to identify the citation key
|
|
128
|
+
let text = "";
|
|
129
|
+
try {
|
|
130
|
+
var _state$domainStates;
|
|
131
|
+
const cid = anchor.getAttribute("href");
|
|
132
|
+
// Prefer state-based citations injected by middleware
|
|
133
|
+
if (state !== null && state !== void 0 && (_state$domainStates = state.domainStates) !== null && _state$domainStates !== void 0 && _state$domainStates.citations && cid) {
|
|
134
|
+
text = state.domainStates.citations[cid] ?? "";
|
|
135
|
+
}
|
|
136
|
+
// If state lookup failed, fall back to the anchor's title or innerText
|
|
137
|
+
if (!text) {
|
|
138
|
+
text = anchor.getAttribute("title") || anchor.innerText || "";
|
|
139
|
+
}
|
|
140
|
+
} catch (e) {
|
|
141
|
+
// ignore
|
|
142
|
+
}
|
|
143
|
+
setCitationPaneOpen(true);
|
|
144
|
+
setCitationPaneText(text);
|
|
145
|
+
|
|
146
|
+
// Simple debounce - reset guard after a short delay
|
|
147
|
+
setTimeout(() => {
|
|
148
|
+
citationOpeningRef.current = false;
|
|
149
|
+
}, 100);
|
|
150
|
+
}
|
|
151
|
+
} catch (e) {
|
|
152
|
+
citationOpeningRef.current = false;
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
document.addEventListener("click", clickHandler);
|
|
156
|
+
return () => document.removeEventListener("click", clickHandler);
|
|
157
|
+
}, [state]);
|
|
74
158
|
const containerStyles = {
|
|
75
159
|
root: Object.assign({}, _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.containerStyles, webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.containerStyles, {
|
|
76
160
|
display: state.appStates.isMinimized ? "none" : ""
|
|
@@ -82,7 +166,7 @@ const WebChatContainerStateful = props => {
|
|
|
82
166
|
...(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.localizedTexts)
|
|
83
167
|
};
|
|
84
168
|
(0, _react2.useEffect)(() => {
|
|
85
|
-
var _props$
|
|
169
|
+
var _props$webChatContain2, _props$webChatContain3;
|
|
86
170
|
if ((0, _utils.getDeviceType)() !== "standard" && (webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.webChatHistoryMobileAccessibilityLabel) !== undefined) {
|
|
87
171
|
const chatHistoryElement = document.querySelector(`.${_Constants.HtmlClassNames.webChatHistoryContainer}`);
|
|
88
172
|
if (chatHistoryElement) {
|
|
@@ -100,21 +184,23 @@ const WebChatContainerStateful = props => {
|
|
|
100
184
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
101
185
|
Event: _TelemetryConstants.TelemetryEvent.WebChatLoaded
|
|
102
186
|
});
|
|
103
|
-
if (((_props$
|
|
187
|
+
if (((_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 ? void 0 : (_props$webChatContain3 = _props$webChatContain2.renderingMiddlewareProps) === null || _props$webChatContain3 === void 0 ? void 0 : _props$webChatContain3.disableThirdPartyCookiesAlert) !== true && !contextDataStore) {
|
|
104
188
|
try {
|
|
105
189
|
localStorage;
|
|
106
190
|
sessionStorage;
|
|
107
191
|
} catch (error) {
|
|
192
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
108
193
|
if (!window.TPCWarningShown) {
|
|
109
194
|
_NotificationHandler.NotificationHandler.notifyWarning(_NotificationScenarios.NotificationScenarios.TPC, (localizedTexts === null || localizedTexts === void 0 ? void 0 : localizedTexts.THIRD_PARTY_COOKIES_BLOCKED_ALERT_MESSAGE) ?? "");
|
|
195
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
110
196
|
window.TPCWarningShown = true;
|
|
111
197
|
}
|
|
112
198
|
}
|
|
113
199
|
}
|
|
114
200
|
}, []);
|
|
115
201
|
(0, _react2.useEffect)(() => {
|
|
116
|
-
var _props$
|
|
117
|
-
if (!((_props$
|
|
202
|
+
var _props$webChatContain4, _props$webChatContain5;
|
|
203
|
+
if (!((_props$webChatContain4 = props.webChatContainerProps) !== null && _props$webChatContain4 !== void 0 && (_props$webChatContain5 = _props$webChatContain4.botMagicCode) !== null && _props$webChatContain5 !== void 0 && _props$webChatContain5.disabled)) {
|
|
118
204
|
return;
|
|
119
205
|
}
|
|
120
206
|
if (!window.BroadcastChannel) {
|
|
@@ -206,8 +292,8 @@ const WebChatContainerStateful = props => {
|
|
|
206
292
|
}
|
|
207
293
|
|
|
208
294
|
.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 {
|
|
209
|
-
background-color: ${((_props$
|
|
210
|
-
color:${((_props$
|
|
295
|
+
background-color: ${((_props$webChatContain6 = props.webChatContainerProps) === null || _props$webChatContain6 === void 0 ? void 0 : (_props$webChatContain7 = _props$webChatContain6.webChatStyles) === null || _props$webChatContain7 === void 0 ? void 0 : _props$webChatContain7.bubbleBackground) ?? ((_defaultWebChatContai2 = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.bubbleBackground)};
|
|
296
|
+
color:${((_props$webChatContain8 = props.webChatContainerProps) === null || _props$webChatContain8 === void 0 ? void 0 : (_props$webChatContain9 = _props$webChatContain8.webChatStyles) === null || _props$webChatContain9 === void 0 ? void 0 : _props$webChatContain9.bubbleTextColor) ?? ((_defaultWebChatContai3 = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai3 === void 0 ? void 0 : _defaultWebChatContai3.bubbleTextColor)};
|
|
211
297
|
}
|
|
212
298
|
|
|
213
299
|
div[class="ac-textBlock"] a:link,
|
|
@@ -285,7 +371,7 @@ const WebChatContainerStateful = props => {
|
|
|
285
371
|
}
|
|
286
372
|
|
|
287
373
|
.webchat__stacked-layout_container>div {
|
|
288
|
-
background: ${(props === null || props === void 0 ? void 0 : (_props$
|
|
374
|
+
background: ${(props === null || props === void 0 ? void 0 : (_props$webChatContain10 = props.webChatContainerProps) === null || _props$webChatContain10 === void 0 ? void 0 : (_props$webChatContain11 = _props$webChatContain10.containerStyles) === null || _props$webChatContain11 === void 0 ? void 0 : _props$webChatContain11.background) ?? ""}
|
|
289
375
|
}
|
|
290
376
|
.webchat__toast_text {
|
|
291
377
|
display: flex;
|
|
@@ -312,10 +398,35 @@ const WebChatContainerStateful = props => {
|
|
|
312
398
|
height: 100% !important;
|
|
313
399
|
}
|
|
314
400
|
|
|
401
|
+
.webchat__auto-resize-textarea__textarea.webchat__send-box-text-box__html-text-area {
|
|
402
|
+
font-family: ${fontFamilyWithEmojis} !important;
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
/* Suggested actions carousel previous/next navigation focus */
|
|
406
|
+
.webchat__suggested-actions .webchat__suggested-actions__carousel .react-film__flipper:focus-visible .react-film__flipper__body {
|
|
407
|
+
outline: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp24 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp24 === void 0 ? void 0 : _webChatContainerProp24.suggestedActionKeyboardFocusIndicatorBorderStyle) ?? "dashed"} ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp25 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp25 === void 0 ? void 0 : _webChatContainerProp25.suggestedActionKeyboardFocusIndicatorBorderWidth) ?? "1px"} ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp26 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp26 === void 0 ? void 0 : _webChatContainerProp26.suggestedActionKeyboardFocusIndicatorBorderColor) ?? "#605E5C"} !important;
|
|
408
|
+
outline-offset: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp27 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp27 === void 0 ? void 0 : _webChatContainerProp27.suggestedActionKeyboardFocusIndicatorInset) ?? "2px"} !important;
|
|
409
|
+
|
|
315
410
|
`), /*#__PURE__*/_react2.default.createElement(_react.Stack, {
|
|
316
411
|
styles: containerStyles,
|
|
317
412
|
className: "webchat__stacked-layout_container"
|
|
318
|
-
}, /*#__PURE__*/_react2.default.createElement(
|
|
413
|
+
}, /*#__PURE__*/_react2.default.createElement("div", {
|
|
414
|
+
id: "ms_lcw_webchat_root",
|
|
415
|
+
style: {
|
|
416
|
+
height: "100%",
|
|
417
|
+
width: "100%"
|
|
418
|
+
}
|
|
419
|
+
}, shouldLoadPersistentHistoryMessages && /*#__PURE__*/_react2.default.createElement(_WebChatEventSubscribers.default, {
|
|
420
|
+
persistentChatHistoryEnabled: props === null || props === void 0 ? void 0 : (_props$persistentChat2 = props.persistentChatHistoryProps) === null || _props$persistentChat2 === void 0 ? void 0 : _props$persistentChat2.persistentChatHistoryEnabled
|
|
421
|
+
}), /*#__PURE__*/_react2.default.createElement(BasicWebChat, null))), citationPaneOpen && /*#__PURE__*/_react2.default.createElement(_CitationPaneStateful.default, {
|
|
422
|
+
id: ((_props$citationPanePr = props.citationPaneProps) === null || _props$citationPanePr === void 0 ? void 0 : _props$citationPanePr.id) || _Constants.HtmlAttributeNames.ocwCitationPaneClassName,
|
|
423
|
+
title: ((_props$citationPanePr2 = props.citationPaneProps) === null || _props$citationPanePr2 === void 0 ? void 0 : _props$citationPanePr2.title) || _Constants.HtmlAttributeNames.ocwCitationPaneTitle,
|
|
424
|
+
contentHtml: citationPaneText,
|
|
425
|
+
onClose: () => setCitationPaneOpen(false),
|
|
426
|
+
componentOverrides: (_props$citationPanePr3 = props.citationPaneProps) === null || _props$citationPanePr3 === void 0 ? void 0 : _props$citationPanePr3.componentOverrides,
|
|
427
|
+
controlProps: (_props$citationPanePr4 = props.citationPaneProps) === null || _props$citationPanePr4 === void 0 ? void 0 : _props$citationPanePr4.controlProps,
|
|
428
|
+
styleProps: (_props$citationPanePr5 = props.citationPaneProps) === null || _props$citationPanePr5 === void 0 ? void 0 : _props$citationPanePr5.styleProps
|
|
429
|
+
}));
|
|
319
430
|
};
|
|
320
431
|
exports.WebChatContainerStateful = WebChatContainerStateful;
|
|
321
432
|
var _default = WebChatContainerStateful;
|