@microsoft/omnichannel-chat-widget 1.8.3-main.ec1328d → 1.8.4-main.1bfa518
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 +9 -0
- package/lib/cjs/common/facades/FacadeChatSDK.js +6 -0
- package/lib/cjs/common/telemetry/AppInsightsEvents.js +14 -9
- package/lib/cjs/common/telemetry/TelemetryConstants.js +49 -2
- package/lib/cjs/common/telemetry/TelemetryManager.js +10 -7
- package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +29 -13
- package/lib/cjs/common/utils/SecureEventBus.js +307 -0
- package/lib/cjs/common/utils/dispatchCustomEvent.js +25 -0
- package/lib/cjs/common/utils.js +14 -1
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +16 -4
- package/lib/cjs/components/citationpanestateful/CitationDim.js +29 -0
- package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +218 -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/headerstateful/HeaderStateful.js +8 -2
- 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 +290 -0
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -0
- package/lib/cjs/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +17 -0
- package/lib/cjs/components/livechatwidget/common/endChat.js +54 -12
- package/lib/cjs/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +16 -7
- package/lib/cjs/components/livechatwidget/common/liveChatConfigUtils.js +36 -4
- package/lib/cjs/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
- 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 +10 -5
- package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +24 -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 +152 -33
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +37 -8
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +12 -3
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +135 -26
- 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 +103 -0
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +3 -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 +57 -0
- package/lib/cjs/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +121 -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 +47 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +1058 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +34 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +50 -1
- 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 +5 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +102 -30
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +29 -7
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +2 -2
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +47 -45
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +9 -1
- package/lib/cjs/contexts/createReducer.js +30 -0
- package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +3 -2
- package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +6 -2
- package/lib/cjs/index.js +9 -1
- package/lib/cjs/plugins/newMessageEventHandler.js +4 -1
- package/lib/esm/common/Constants.js +9 -0
- package/lib/esm/common/facades/FacadeChatSDK.js +6 -0
- package/lib/esm/common/telemetry/AppInsightsEvents.js +14 -9
- package/lib/esm/common/telemetry/TelemetryConstants.js +47 -1
- package/lib/esm/common/telemetry/TelemetryManager.js +10 -7
- package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +30 -14
- package/lib/esm/common/utils/SecureEventBus.js +328 -0
- package/lib/esm/common/utils/dispatchCustomEvent.js +18 -0
- package/lib/esm/common/utils.js +11 -0
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +17 -5
- package/lib/esm/components/citationpanestateful/CitationDim.js +20 -0
- package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +207 -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/headerstateful/HeaderStateful.js +9 -3
- 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 +283 -0
- package/lib/esm/components/livechatwidget/common/createAdapter.js +2 -0
- package/lib/esm/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +10 -0
- package/lib/esm/components/livechatwidget/common/endChat.js +55 -13
- package/lib/esm/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +16 -7
- package/lib/esm/components/livechatwidget/common/liveChatConfigUtils.js +33 -2
- package/lib/esm/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
- 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 +12 -7
- package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +23 -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 +153 -34
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +39 -10
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +13 -4
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +135 -27
- 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 +96 -0
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +3 -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 +49 -0
- package/lib/esm/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +114 -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 +39 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +1080 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LoadInlineBannerActivity.js +25 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +48 -1
- 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 +3 -2
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +103 -30
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +29 -7
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +2 -2
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +47 -45
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +9 -1
- package/lib/esm/contexts/createReducer.js +30 -0
- package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +3 -2
- package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +6 -2
- package/lib/esm/index.js +1 -0
- package/lib/esm/plugins/newMessageEventHandler.js +4 -1
- package/lib/types/common/Constants.d.ts +8 -0
- package/lib/types/common/facades/FacadeChatSDK.d.ts +3 -1
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +44 -2
- package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +1 -0
- package/lib/types/common/utils/SecureEventBus.d.ts +159 -0
- package/lib/types/common/utils/dispatchCustomEvent.d.ts +2 -0
- package/lib/types/common/utils.d.ts +9 -1
- 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/common/liveChatConfigUtils.d.ts +11 -0
- package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +1 -0
- 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 +11 -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/interfaces/IExtendedChatConffig.d.ts +15 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.d.ts +6 -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/activityMiddleware.d.ts +2 -1
- 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/localizedStringsBotInitialsMiddleware.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.d.ts +2 -2
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +2 -0
- package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +6 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +47 -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
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
|
|
3
1
|
import { Constants, HtmlAttributeNames, HtmlClassNames } from "../../common/Constants";
|
|
4
2
|
import { Stack } from "@fluentui/react";
|
|
5
3
|
import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
6
|
-
import React, { useEffect } from "react";
|
|
4
|
+
import React, { useEffect, useRef, useState } from "react";
|
|
7
5
|
import { createTimer, getDeviceType, setFocusOnSendBox } from "../../common/utils";
|
|
8
6
|
import { BotMagicCodeStore } from "./webchatcontroller/BotMagicCodeStore";
|
|
7
|
+
import CitationPaneStateful from "../citationpanestateful/CitationPaneStateful";
|
|
9
8
|
import { Components } from "botframework-webchat";
|
|
10
9
|
import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
|
|
11
10
|
import { NotificationHandler } from "./webchatcontroller/notification/NotificationHandler";
|
|
12
11
|
import { NotificationScenarios } from "./webchatcontroller/enums/NotificationScenarios";
|
|
13
12
|
import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
14
13
|
import { WebChatActionType } from "./webchatcontroller/enums/WebChatActionType";
|
|
14
|
+
import WebChatEventSubscribers from "./webchatcontroller/WebChatEventSubscribers";
|
|
15
15
|
import { WebChatStoreLoader } from "./webchatcontroller/WebChatStoreLoader";
|
|
16
|
+
import { createIOSOptimizedEmojiFont } from "./common/utils/fontUtils";
|
|
16
17
|
import { defaultAdaptiveCardStyles } from "./common/defaultStyles/defaultAdaptiveCardStyles";
|
|
17
18
|
import { defaultMiddlewareLocalizedTexts } from "./common/defaultProps/defaultMiddlewareLocalizedTexts";
|
|
18
19
|
import { defaultReceivedMessageAnchorStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles";
|
|
@@ -20,9 +21,13 @@ import { defaultSentMessageAnchorStyles } from "./webchatcontroller/middlewares/
|
|
|
20
21
|
import { defaultSystemMessageBoxStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles";
|
|
21
22
|
import { defaultUserMessageBoxStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles";
|
|
22
23
|
import { defaultWebChatContainerStatefulProps } from "./common/defaultProps/defaultWebChatContainerStatefulProps";
|
|
24
|
+
import { shouldLoadPersistentChatHistory } from "../livechatwidget/common/liveChatConfigUtils";
|
|
23
25
|
import { useChatContextStore } from "../..";
|
|
26
|
+
import useFacadeSDKStore from "../../hooks/useFacadeChatSDKStore";
|
|
27
|
+
import usePersistentChatHistory from "./hooks/usePersistentChatHistory";
|
|
24
28
|
let uiTimer;
|
|
25
29
|
const broadcastChannelMessageEvent = "message";
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
26
31
|
const postActivity = activity => {
|
|
27
32
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
28
33
|
return {
|
|
@@ -48,13 +53,29 @@ const createMagicCodeSuccessResponse = signin => {
|
|
|
48
53
|
};
|
|
49
54
|
};
|
|
50
55
|
export const WebChatContainerStateful = props => {
|
|
51
|
-
var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8,
|
|
56
|
+
var _props$webChatContain, _defaultWebChatContai, _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;
|
|
57
|
+
const [facadeChatSDK] = useFacadeSDKStore();
|
|
58
|
+
|
|
59
|
+
// Create a font family that includes emoji support, based on the primary font or default
|
|
60
|
+
const webChatStyles = ((_props$webChatContain = props.webChatContainerProps) === null || _props$webChatContain === void 0 ? void 0 : _props$webChatContain.webChatStyles) ?? defaultWebChatContainerStatefulProps.webChatStyles;
|
|
61
|
+
const primaryFont = (webChatStyles === null || webChatStyles === void 0 ? void 0 : webChatStyles.primaryFont) ?? ((_defaultWebChatContai = defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai === void 0 ? void 0 : _defaultWebChatContai.primaryFont);
|
|
62
|
+
|
|
63
|
+
// Use iOS-optimized emoji font that prioritizes system-ui for proper emoji rendering
|
|
64
|
+
const fontFamilyWithEmojis = createIOSOptimizedEmojiFont(primaryFont);
|
|
52
65
|
useEffect(() => {
|
|
53
66
|
uiTimer = createTimer();
|
|
54
67
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
55
68
|
Event: TelemetryEvent.UXWebchatContainerCompleted
|
|
56
69
|
});
|
|
57
70
|
}, []);
|
|
71
|
+
|
|
72
|
+
// Citation pane state
|
|
73
|
+
const [citationPaneOpen, setCitationPaneOpen] = useState(false);
|
|
74
|
+
const [citationPaneText, setCitationPaneText] = useState("");
|
|
75
|
+
|
|
76
|
+
// Guard to prevent handling multiple rapid clicks which could cause
|
|
77
|
+
// the dim layer and pane to re-render out of sync and create a flicker.
|
|
78
|
+
const citationOpeningRef = useRef(false);
|
|
58
79
|
const {
|
|
59
80
|
BasicWebChat
|
|
60
81
|
} = Components;
|
|
@@ -63,6 +84,64 @@ export const WebChatContainerStateful = props => {
|
|
|
63
84
|
webChatContainerProps,
|
|
64
85
|
contextDataStore
|
|
65
86
|
} = props;
|
|
87
|
+
|
|
88
|
+
// Type the chatConfig properly to avoid 'any' usage
|
|
89
|
+
const extendedChatConfig = props.chatConfig;
|
|
90
|
+
|
|
91
|
+
// Determine if persistent chat history should be loaded based on all conditions
|
|
92
|
+
const shouldLoadPersistentHistoryMessages = shouldLoadPersistentChatHistory(extendedChatConfig);
|
|
93
|
+
if (shouldLoadPersistentHistoryMessages) {
|
|
94
|
+
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
95
|
+
Event: TelemetryEvent.PersistentChatHistoryEnabled
|
|
96
|
+
});
|
|
97
|
+
usePersistentChatHistory(facadeChatSDK, (props === null || props === void 0 ? void 0 : props.persistentChatHistoryProps) ?? {});
|
|
98
|
+
}
|
|
99
|
+
// Delegated click handler for citation anchors. Placed after state is
|
|
100
|
+
// available so we can prefer reading citations from app state and fall
|
|
101
|
+
// back to the legacy window map for backward-compatibility in tests.
|
|
102
|
+
useEffect(() => {
|
|
103
|
+
const clickHandler = ev => {
|
|
104
|
+
try {
|
|
105
|
+
if (citationOpeningRef.current) {
|
|
106
|
+
return;
|
|
107
|
+
}
|
|
108
|
+
const target = ev.target;
|
|
109
|
+
// Only consider anchors whose href starts with the citation scheme
|
|
110
|
+
const anchor = target.closest && target.closest("a[href^=\"cite:\"]");
|
|
111
|
+
if (anchor) {
|
|
112
|
+
ev.preventDefault();
|
|
113
|
+
citationOpeningRef.current = true;
|
|
114
|
+
// Rely only on the href to identify the citation key
|
|
115
|
+
let text = "";
|
|
116
|
+
try {
|
|
117
|
+
var _state$domainStates;
|
|
118
|
+
const cid = anchor.getAttribute("href");
|
|
119
|
+
// Prefer state-based citations injected by middleware
|
|
120
|
+
if (state !== null && state !== void 0 && (_state$domainStates = state.domainStates) !== null && _state$domainStates !== void 0 && _state$domainStates.citations && cid) {
|
|
121
|
+
text = state.domainStates.citations[cid] ?? "";
|
|
122
|
+
}
|
|
123
|
+
// If state lookup failed, fall back to the anchor's title or innerText
|
|
124
|
+
if (!text) {
|
|
125
|
+
text = anchor.getAttribute("title") || anchor.innerText || "";
|
|
126
|
+
}
|
|
127
|
+
} catch (e) {
|
|
128
|
+
// ignore
|
|
129
|
+
}
|
|
130
|
+
setCitationPaneOpen(true);
|
|
131
|
+
setCitationPaneText(text);
|
|
132
|
+
|
|
133
|
+
// Simple debounce - reset guard after a short delay
|
|
134
|
+
setTimeout(() => {
|
|
135
|
+
citationOpeningRef.current = false;
|
|
136
|
+
}, 100);
|
|
137
|
+
}
|
|
138
|
+
} catch (e) {
|
|
139
|
+
citationOpeningRef.current = false;
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
document.addEventListener("click", clickHandler);
|
|
143
|
+
return () => document.removeEventListener("click", clickHandler);
|
|
144
|
+
}, [state]);
|
|
66
145
|
const containerStyles = {
|
|
67
146
|
root: Object.assign({}, defaultWebChatContainerStatefulProps.containerStyles, webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.containerStyles, {
|
|
68
147
|
display: state.appStates.isMinimized ? "none" : ""
|
|
@@ -74,7 +153,7 @@ export const WebChatContainerStateful = props => {
|
|
|
74
153
|
...(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.localizedTexts)
|
|
75
154
|
};
|
|
76
155
|
useEffect(() => {
|
|
77
|
-
var _props$
|
|
156
|
+
var _props$webChatContain2, _props$webChatContain3;
|
|
78
157
|
if (getDeviceType() !== "standard" && (webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.webChatHistoryMobileAccessibilityLabel) !== undefined) {
|
|
79
158
|
const chatHistoryElement = document.querySelector(`.${HtmlClassNames.webChatHistoryContainer}`);
|
|
80
159
|
if (chatHistoryElement) {
|
|
@@ -92,21 +171,23 @@ export const WebChatContainerStateful = props => {
|
|
|
92
171
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
93
172
|
Event: TelemetryEvent.WebChatLoaded
|
|
94
173
|
});
|
|
95
|
-
if (((_props$
|
|
174
|
+
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) {
|
|
96
175
|
try {
|
|
97
176
|
localStorage;
|
|
98
177
|
sessionStorage;
|
|
99
178
|
} catch (error) {
|
|
179
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
100
180
|
if (!window.TPCWarningShown) {
|
|
101
181
|
NotificationHandler.notifyWarning(NotificationScenarios.TPC, (localizedTexts === null || localizedTexts === void 0 ? void 0 : localizedTexts.THIRD_PARTY_COOKIES_BLOCKED_ALERT_MESSAGE) ?? "");
|
|
182
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
102
183
|
window.TPCWarningShown = true;
|
|
103
184
|
}
|
|
104
185
|
}
|
|
105
186
|
}
|
|
106
187
|
}, []);
|
|
107
188
|
useEffect(() => {
|
|
108
|
-
var _props$
|
|
109
|
-
if (!((_props$
|
|
189
|
+
var _props$webChatContain4, _props$webChatContain5;
|
|
190
|
+
if (!((_props$webChatContain4 = props.webChatContainerProps) !== null && _props$webChatContain4 !== void 0 && (_props$webChatContain5 = _props$webChatContain4.botMagicCode) !== null && _props$webChatContain5 !== void 0 && _props$webChatContain5.disabled)) {
|
|
110
191
|
return;
|
|
111
192
|
}
|
|
112
193
|
if (!window.BroadcastChannel) {
|
|
@@ -177,44 +258,48 @@ export const WebChatContainerStateful = props => {
|
|
|
177
258
|
background: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp === void 0 ? void 0 : _webChatContainerProp.background) ?? defaultAdaptiveCardStyles.background};
|
|
178
259
|
}
|
|
179
260
|
|
|
180
|
-
.webchat__bubble__content>div#ms_lcw_webchat_adaptive_card .ac-textBlock {
|
|
181
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp2 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp2 === void 0 ? void 0 : _webChatContainerProp2.color) ?? defaultAdaptiveCardStyles.color};
|
|
261
|
+
.webchat__bubble__content>div#ms_lcw_webchat_adaptive_card .ac-textBlock[role=heading] {
|
|
262
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp2 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp2 === void 0 ? void 0 : _webChatContainerProp2.color) ?? defaultAdaptiveCardStyles.color} !important;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
.webchat__bubble__content>div#ms_lcw_webchat_adaptive_card label .ac-textRun:first-child {
|
|
266
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp3 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp3 === void 0 ? void 0 : _webChatContainerProp3.color) ?? defaultAdaptiveCardStyles.color} !important;
|
|
182
267
|
}
|
|
183
268
|
|
|
184
269
|
.webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__bubble--from-user {
|
|
185
|
-
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
270
|
+
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)}
|
|
186
271
|
}
|
|
187
272
|
|
|
188
273
|
.webchat__stacked-layout--show-avatar div.webchat__stacked-layout__content div.webchat__stacked-layout__message-row div.webchat__stacked-layout__message {
|
|
189
|
-
max-width: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
274
|
+
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)}
|
|
190
275
|
}
|
|
191
276
|
|
|
192
277
|
div[class="ac-textBlock"] *,
|
|
193
|
-
div[class="ac-input-container"] * {white-space:${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
278
|
+
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}}
|
|
194
279
|
|
|
195
280
|
div[class="ac-input-container"] input.ac-multichoiceInput,
|
|
196
281
|
div[class="ac-input-container"] select.ac-multichoiceInput {
|
|
197
|
-
${webChatContainerProps !== null && webChatContainerProps !== void 0 && (
|
|
282
|
+
${webChatContainerProps !== null && webChatContainerProps !== void 0 && (_webChatContainerProp9 = webChatContainerProps.adaptiveCardStyles) !== null && _webChatContainerProp9 !== void 0 && _webChatContainerProp9.choiceInputPadding ? `padding: ${webChatContainerProps.adaptiveCardStyles.choiceInputPadding} !important;` : ""}
|
|
198
283
|
}
|
|
199
284
|
|
|
200
285
|
.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 {
|
|
201
|
-
background-color: ${((_props$
|
|
202
|
-
color:${((_props$
|
|
286
|
+
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.webChatStyles) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.bubbleBackground)};
|
|
287
|
+
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.webChatStyles) === null || _defaultWebChatContai3 === void 0 ? void 0 : _defaultWebChatContai3.bubbleTextColor)};
|
|
203
288
|
}
|
|
204
289
|
|
|
205
290
|
div[class="ac-textBlock"] a:link,
|
|
206
291
|
div[class="ac-textBlock"] a:visited,
|
|
207
292
|
div[class="ac-textBlock"] a:hover,
|
|
208
293
|
div[class="ac-textBlock"] a:active {
|
|
209
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
294
|
+
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp10 = webChatContainerProps.adaptiveCardStyles) === null || _webChatContainerProp10 === void 0 ? void 0 : _webChatContainerProp10.anchorColor) ?? defaultAdaptiveCardStyles.anchorColor};
|
|
210
295
|
}
|
|
211
296
|
|
|
212
|
-
.webchat__stacked-layout__content .ac-actionSet > .ac-pushButton > div {white-space: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
297
|
+
.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;}
|
|
213
298
|
|
|
214
299
|
.ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon {
|
|
215
300
|
/* Fallback for browsers that don't support mask */
|
|
216
301
|
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg5MjNMMTcuOTk4NyAxNi43Mzg0VjEzLjIzMjFDMTcuOTk4NyAxMi44MTc5IDE4LjMzNDUgMTIuNDgyMSAxOC43NDg3IDEyLjQ4MjFDMTkuMTI4NCAxMi40ODIxIDE5LjQ0MjIgMTIuNzY0MyAxOS40OTE4IDEzLjEzMDNMMTkuNDk4NyAxMy4yMzIxVjE2LjczODRDMTkuNDk4NyAxOC43NDA3IDE3LjkyOTMgMjAuMzc2OSAxNS45NTI4IDIwLjQ4MjlMMTUuNzUzOCAyMC40ODg0TDcuMjU4MjcgMjAuNTAwMUw3LjA1NDk1IDIwLjQ5NDlDNS4xNDIzOSAyMC4zOTU0IDMuNjA4OTUgMTguODYyNyAzLjUwODM3IDE2Ljk1MDJMMy41MDMxMiAxNi43NTExTDMuNTAwODkgOC4yNTI3TDMuNTA1MjkgOC4wNTAyQzMuNjA1MzkgNi4xMzc0OSA1LjEzODY3IDQuNjA0NDkgNy4wNTA5NiA0LjUwNTI3TDcuMjUwMSA0LjUwMDE3SDEwLjc0OTVINy4yNTAxWk0xMy43NDgxIDMuMDAxNDZMMjAuMzAxOCAzLjAwMTk3TDIwLjQwMTQgMy4wMTU3NUwyMC41MDIyIDMuMDQzOTNMMjAuNTU5IDMuMDY4MDNDMjAuNjEyMiAzLjA5MTIyIDIwLjY2MzQgMy4xMjE2MyAyMC43MTExIDMuMTU4ODVMMjAuNzgwNCAzLjIyMTU2TDIwLjg2NDEgMy4zMjAxNEwyMC45MTgzIDMuNDEwMjVMMjAuOTU3IDMuNTAwNTdMMjAuOTc2MiAzLjU2NDc2TDIwLjk4OTggMy42Mjg2MkwyMC45OTkyIDMuNzIyODJMMjAuOTk5NyAxMC4yNTU0QzIwLjk5OTcgMTAuNjY5NiAyMC42NjM5IDExLjAwNTQgMjAuMjQ5NyAxMS4wMDU0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjRkZGRkZGIiAvPjwvc3ZnPg==);
|
|
217
|
-
filter: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
302
|
+
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)};
|
|
218
303
|
height: .75em;
|
|
219
304
|
width: .75em;
|
|
220
305
|
margin-left: .25em;
|
|
@@ -224,7 +309,7 @@ export const WebChatContainerStateful = props => {
|
|
|
224
309
|
.ms_lcw_webchat_sent_message img.webchat__render-markdown__external-link-icon {
|
|
225
310
|
/* Fallback for browsers that don't support mask */
|
|
226
311
|
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg5MjNMMTcuOTk4NyAxNi43Mzg0VjEzLjIzMjFDMTcuOTk4NyAxMi44MTc5IDE4LjMzNDUgMTIuNDgyMSAxOC43NDg3IDEyLjQ4MjFDMTkuMTI4NCAxMi40ODIxIDE5LjQ0MjIgMTIuNzY0MyAxOS40OTE4IDEzLjEzMDNMMTkuNDk4NyAxMy4yMzIxVjE2LjczODRDMTkuNDk4NyAxOC43NDA3IDE3LjkyOTMgMjAuMzc2OSAxNS45NTI4IDIwLjQ4MjlMMTUuNzUzOCAyMC40ODg0TDcuMjU4MjcgMjAuNTAwMUw3LjA1NDk1IDIwLjQ5NDlDNS4xNDIzOSAyMC4zOTU0IDMuNjA4OTUgMTguODYyNyAzLjUwODM3IDE2Ljk1MDJMMy41MDMxMiAxNi43NTExTDMuNTAwODkgOC4yNTI3TDMuNTA1MjkgOC4wNTAyQzMuNjA1MzkgNi4xMzc0OSA1LjEzODY3IDQuNjA0NDkgNy4wNTA5NiA0LjUwNTI3TDcuMjUwMSA0LjUwMDE3SDEwLjc0OTVINy4yNTAxWk0xMy43NDgxIDMuMDAxNDZMMjAuMzAxOCAzLjAwMTk3TDIwLjQwMTQgMy4wMTU3NUwyMC41MDIyIDMuMDQzOTNMMjAuNTU5IDMuMDY4MDNDMjAuNjEyMiAzLjA5MTIyIDIwLjY2MzQgMy4xMjE2MyAyMC43MTExIDMuMTU4ODVMMjAuNzgwNCAzLjIyMTU2TDIwLjg2NDEgMy4zMjAxNEwyMC45MTgzIDMuNDEwMjVMMjAuOTU3IDMuNTAwNTdMMjAuOTc2MiAzLjU2NDc2TDIwLjk4OTggMy42Mjg2MkwyMC45OTkyIDMuNzIyODJMMjAuOTk5NyAxMC4yNTU0QzIwLjk5OTcgMTAuNjY5NiAyMC42NjM5IDExLjAwNTQgMjAuMjQ5NyAxMS4wMDU0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjRkZGRkZGIiAvPjwvc3ZnPg==);
|
|
227
|
-
filter: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
312
|
+
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)};
|
|
228
313
|
height: .75em;
|
|
229
314
|
width: .75em;
|
|
230
315
|
margin-left: .25em;
|
|
@@ -234,7 +319,7 @@ export const WebChatContainerStateful = props => {
|
|
|
234
319
|
/* Modern browsers with mask support */
|
|
235
320
|
@supports (mask: url()) or (-webkit-mask: url()) {
|
|
236
321
|
.ms_lcw_webchat_received_message img.webchat__render-markdown__external-link-icon {
|
|
237
|
-
background-color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
322
|
+
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;
|
|
238
323
|
background-image: none !important;
|
|
239
324
|
filter: none !important;
|
|
240
325
|
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;
|
|
@@ -244,7 +329,7 @@ export const WebChatContainerStateful = props => {
|
|
|
244
329
|
}
|
|
245
330
|
|
|
246
331
|
.ms_lcw_webchat_sent_message img.webchat__render-markdown__external-link-icon {
|
|
247
|
-
background-color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
332
|
+
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;
|
|
248
333
|
background-image: none !important;
|
|
249
334
|
filter: none !important;
|
|
250
335
|
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;
|
|
@@ -262,22 +347,22 @@ export const WebChatContainerStateful = props => {
|
|
|
262
347
|
.ms_lcw_webchat_received_message a:visited,
|
|
263
348
|
.ms_lcw_webchat_received_message a:hover,
|
|
264
349
|
.ms_lcw_webchat_received_message a:active {
|
|
265
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
350
|
+
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)};
|
|
266
351
|
}
|
|
267
352
|
.ms_lcw_webchat_sent_message a:link,
|
|
268
353
|
.ms_lcw_webchat_sent_message a:visited,
|
|
269
354
|
.ms_lcw_webchat_sent_message a:hover,
|
|
270
355
|
.ms_lcw_webchat_sent_message a:active {
|
|
271
|
-
color: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
356
|
+
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)};
|
|
272
357
|
}
|
|
273
358
|
|
|
274
359
|
// 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
|
|
275
360
|
.webchat__bubble:not(.webchat__bubble--from-user) .webchat__bubble__content {
|
|
276
|
-
border-radius: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (
|
|
361
|
+
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 */
|
|
277
362
|
}
|
|
278
363
|
|
|
279
364
|
.webchat__stacked-layout_container>div {
|
|
280
|
-
background: ${(props === null || props === void 0 ? void 0 : (_props$
|
|
365
|
+
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) ?? ""}
|
|
281
366
|
}
|
|
282
367
|
.webchat__toast_text {
|
|
283
368
|
display: flex;
|
|
@@ -304,9 +389,32 @@ export const WebChatContainerStateful = props => {
|
|
|
304
389
|
height: 100% !important;
|
|
305
390
|
}
|
|
306
391
|
|
|
392
|
+
.webchat__auto-resize-textarea__textarea.webchat__send-box-text-box__html-text-area {
|
|
393
|
+
font-family: ${fontFamilyWithEmojis} !important;
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/* Suggested actions carousel previous/next navigation focus */
|
|
397
|
+
.webchat__suggested-actions .webchat__suggested-actions__carousel .react-film__flipper:focus-visible .react-film__flipper__body {
|
|
398
|
+
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;
|
|
399
|
+
outline-offset: ${(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : (_webChatContainerProp28 = webChatContainerProps.webChatStyles) === null || _webChatContainerProp28 === void 0 ? void 0 : _webChatContainerProp28.suggestedActionKeyboardFocusIndicatorInset) ?? "2px"} !important;
|
|
400
|
+
|
|
307
401
|
`), /*#__PURE__*/React.createElement(Stack, {
|
|
308
402
|
styles: containerStyles,
|
|
309
403
|
className: "webchat__stacked-layout_container"
|
|
310
|
-
}, /*#__PURE__*/React.createElement(
|
|
404
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
405
|
+
id: "ms_lcw_webchat_root",
|
|
406
|
+
style: {
|
|
407
|
+
height: "100%",
|
|
408
|
+
width: "100%"
|
|
409
|
+
}
|
|
410
|
+
}, shouldLoadPersistentHistoryMessages && /*#__PURE__*/React.createElement(WebChatEventSubscribers, null), /*#__PURE__*/React.createElement(BasicWebChat, null))), citationPaneOpen && /*#__PURE__*/React.createElement(CitationPaneStateful, {
|
|
411
|
+
id: ((_props$citationPanePr = props.citationPaneProps) === null || _props$citationPanePr === void 0 ? void 0 : _props$citationPanePr.id) || HtmlAttributeNames.ocwCitationPaneClassName,
|
|
412
|
+
title: ((_props$citationPanePr2 = props.citationPaneProps) === null || _props$citationPanePr2 === void 0 ? void 0 : _props$citationPanePr2.title) || HtmlAttributeNames.ocwCitationPaneTitle,
|
|
413
|
+
contentHtml: citationPaneText,
|
|
414
|
+
onClose: () => setCitationPaneOpen(false),
|
|
415
|
+
componentOverrides: (_props$citationPanePr3 = props.citationPaneProps) === null || _props$citationPanePr3 === void 0 ? void 0 : _props$citationPanePr3.componentOverrides,
|
|
416
|
+
controlProps: (_props$citationPanePr4 = props.citationPaneProps) === null || _props$citationPanePr4 === void 0 ? void 0 : _props$citationPanePr4.controlProps,
|
|
417
|
+
styleProps: (_props$citationPanePr5 = props.citationPaneProps) === null || _props$citationPanePr5 === void 0 ? void 0 : _props$citationPanePr5.styleProps
|
|
418
|
+
}));
|
|
311
419
|
};
|
|
312
420
|
export default WebChatContainerStateful;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
2
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
3
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
5
|
-
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
6
4
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
7
5
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
8
6
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
@@ -10,28 +8,59 @@ function _possibleConstructorReturn(self, call) { if (call && (typeof call === "
|
|
|
10
8
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
11
9
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
10
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
13
|
-
|
|
11
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
12
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
13
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
14
|
+
import { customerUser, postAgentAttachmentActivity, postAgentMessageActivity, postAgentSuggestedActionsActivity, postBotMessageActivity, postEchoActivity, postSystemMessageActivity } from "./utils/chatAdapterUtils";
|
|
14
15
|
import MockAdapter from "./mockadapter";
|
|
15
|
-
import {
|
|
16
|
+
import { Observable } from "rxjs/Observable";
|
|
16
17
|
export let DesignerChatAdapter = /*#__PURE__*/function (_MockAdapter) {
|
|
17
18
|
_inherits(DesignerChatAdapter, _MockAdapter);
|
|
18
19
|
var _super = _createSuper(DesignerChatAdapter);
|
|
19
|
-
function DesignerChatAdapter() {
|
|
20
|
+
function DesignerChatAdapter(messages) {
|
|
20
21
|
var _this;
|
|
21
22
|
_classCallCheck(this, DesignerChatAdapter);
|
|
22
23
|
_this = _super.call(this);
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
_this.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
_defineProperty(_assertThisInitialized(_this), "messages", void 0);
|
|
25
|
+
_this.messages = messages;
|
|
26
|
+
if (_this.messages) {
|
|
27
|
+
if (_this.messages.length > 0) {
|
|
28
|
+
setTimeout(() => {
|
|
29
|
+
var _this$messages;
|
|
30
|
+
(_this$messages = _this.messages) === null || _this$messages === void 0 ? void 0 : _this$messages.forEach((msg, index) => {
|
|
31
|
+
_this.processMessage(msg, index);
|
|
32
|
+
});
|
|
33
|
+
}, 1000); // Initial 1 second delay to ensure activityObserver is ready
|
|
34
|
+
}
|
|
35
|
+
} else {
|
|
36
|
+
// Default hardcoded flow
|
|
37
|
+
setTimeout(() => {
|
|
38
|
+
postBotMessageActivity(_this.activityObserver, "Thank you for contacting us! How can I help you today?", undefined, 0);
|
|
39
|
+
postBotMessageActivity(_this.activityObserver, "Please accept terms and conditions to proceed. Visit the link for terms and conditions <a href=\"\">here</a>.", undefined, 0);
|
|
40
|
+
_this.postUserActivity("I need to change my address.", 0);
|
|
41
|
+
postBotMessageActivity(_this.activityObserver, "Okay, let me connect you with a live agent.", undefined, 100);
|
|
42
|
+
postSystemMessageActivity(_this.activityObserver, "John has joined the chat", 100);
|
|
43
|
+
postAgentMessageActivity(_this.activityObserver, "I'd be happy to help you update your account.", undefined, 100);
|
|
44
|
+
_this.postUserActivity("I have trouble visiting the signin page <a href=\"\">signin</a>.", 0);
|
|
45
|
+
}, 1000);
|
|
46
|
+
}
|
|
32
47
|
return _this;
|
|
33
48
|
}
|
|
34
49
|
_createClass(DesignerChatAdapter, [{
|
|
50
|
+
key: "processMessage",
|
|
51
|
+
value: function processMessage(msg, index) {
|
|
52
|
+
if (msg.text) {
|
|
53
|
+
if (msg.suggestedActions) {
|
|
54
|
+
postAgentSuggestedActionsActivity(this.activityObserver, msg.text, msg.suggestedActions, index * 100);
|
|
55
|
+
} else {
|
|
56
|
+
postBotMessageActivity(this.activityObserver, msg.text, undefined, index * 100);
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
if (msg.attachments && msg.attachments.length > 0) {
|
|
60
|
+
postAgentAttachmentActivity(this.activityObserver, msg.attachments, index * 100, msg.attachmentLayout);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}, {
|
|
35
64
|
key: "postUserActivity",
|
|
36
65
|
value: function postUserActivity(text) {
|
|
37
66
|
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
|
@@ -20,13 +20,18 @@ export let DesignerChatSDK = /*#__PURE__*/function (_MockChatSDK) {
|
|
|
20
20
|
var _this;
|
|
21
21
|
_classCallCheck(this, DesignerChatSDK);
|
|
22
22
|
_this = _super.call(this);
|
|
23
|
+
/**
|
|
24
|
+
* Create a chat adapter for the designer. Uses this.mockMessages if set.
|
|
25
|
+
*/
|
|
26
|
+
_defineProperty(_assertThisInitialized(_this), "mockMessages", void 0);
|
|
23
27
|
_defineProperty(_assertThisInitialized(_this), "localeId", _this.getLiveChatConfig().ChatWidgetLanguage.msdyn_localeid);
|
|
24
28
|
return _this;
|
|
25
29
|
}
|
|
26
30
|
_createClass(DesignerChatSDK, [{
|
|
27
31
|
key: "createChatAdapter",
|
|
28
32
|
value: function createChatAdapter() {
|
|
29
|
-
|
|
33
|
+
const adapter = new DesignerChatAdapter(this.mockMessages);
|
|
34
|
+
return adapter;
|
|
30
35
|
}
|
|
31
36
|
}, {
|
|
32
37
|
key: "getLiveChatConfig",
|
package/lib/esm/components/webchatcontainerstateful/common/activities/conversationDividerActivity.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Constants } from "../../../../common/Constants";
|
|
2
|
+
import botActivity from "./botActivity";
|
|
3
|
+
const conversationDividerActivity = {
|
|
4
|
+
...botActivity,
|
|
5
|
+
channelData: {
|
|
6
|
+
tags: [Constants.conversationDividerTag]
|
|
7
|
+
}
|
|
8
|
+
};
|
|
9
|
+
export default conversationDividerActivity;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { Constants } from "../../../../common/Constants";
|
|
2
|
+
import botActivity from "../activities/botActivity";
|
|
3
|
+
|
|
4
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5
|
+
const convertStringValueToInt = value => {
|
|
6
|
+
if (typeof value !== "string" || value === "") {
|
|
7
|
+
return undefined;
|
|
8
|
+
}
|
|
9
|
+
let result;
|
|
10
|
+
try {
|
|
11
|
+
result = parseInt(value);
|
|
12
|
+
} catch (e) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
return isNaN(result) ? undefined : result;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
19
|
+
const convertPersistentChatHistoryMessageToActivity = message => {
|
|
20
|
+
var _from$user, _from$application;
|
|
21
|
+
const {
|
|
22
|
+
additionalData,
|
|
23
|
+
attachments,
|
|
24
|
+
content,
|
|
25
|
+
created,
|
|
26
|
+
from,
|
|
27
|
+
transcriptOriginalMessageId
|
|
28
|
+
} = message;
|
|
29
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
30
|
+
const activity = {
|
|
31
|
+
...botActivity,
|
|
32
|
+
channelData: {
|
|
33
|
+
tags: [Constants.persistentChatHistoryMessageTag]
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
let webchatSequenceId;
|
|
37
|
+
let timestamp;
|
|
38
|
+
if (transcriptOriginalMessageId) {
|
|
39
|
+
const id = convertStringValueToInt(transcriptOriginalMessageId); // Id used to determine the sequence of messages which is the same as the 'live' messages
|
|
40
|
+
if (id) {
|
|
41
|
+
webchatSequenceId = id;
|
|
42
|
+
timestamp = new Date(id) || created;
|
|
43
|
+
activity.channelData = {
|
|
44
|
+
...activity.channelData,
|
|
45
|
+
"webchat:sequence-id": webchatSequenceId
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (additionalData !== null && additionalData !== void 0 && additionalData.tags) {
|
|
50
|
+
const {
|
|
51
|
+
tags,
|
|
52
|
+
ConversationId
|
|
53
|
+
} = additionalData;
|
|
54
|
+
if (ConversationId) {
|
|
55
|
+
activity.channelData.conversationId = ConversationId;
|
|
56
|
+
}
|
|
57
|
+
if (tags) {
|
|
58
|
+
const formattedTags = additionalData.tags.split(",");
|
|
59
|
+
activity.channelData = {
|
|
60
|
+
...activity.channelData,
|
|
61
|
+
tags: [...activity.channelData.tags, ...formattedTags]
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (from !== null && from !== void 0 && (_from$user = from.user) !== null && _from$user !== void 0 && _from$user.displayName) {
|
|
66
|
+
activity.from = {
|
|
67
|
+
...activity.from,
|
|
68
|
+
name: from.user.displayName
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
if ((from === null || from === void 0 ? void 0 : (_from$application = from.application) === null || _from$application === void 0 ? void 0 : _from$application.displayName) === "Customer") {
|
|
72
|
+
activity.from = {
|
|
73
|
+
role: "user",
|
|
74
|
+
name: from.application.displayName
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
if (content) {
|
|
78
|
+
return {
|
|
79
|
+
...activity,
|
|
80
|
+
text: content,
|
|
81
|
+
timestamp
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
if (attachments && attachments.length > 0) {
|
|
85
|
+
const fileName = attachments[0].name || "Unknown";
|
|
86
|
+
const text = `The following attachment was uploaded during the conversation: ${fileName}`;
|
|
87
|
+
return {
|
|
88
|
+
...activity,
|
|
89
|
+
text,
|
|
90
|
+
timestamp
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
// If neither content nor attachments are present, return null to indicate no activity could be created.
|
|
94
|
+
return null;
|
|
95
|
+
};
|
|
96
|
+
export default convertPersistentChatHistoryMessageToActivity;
|
|
@@ -28,5 +28,7 @@ export const defaultMiddlewareLocalizedTexts = {
|
|
|
28
28
|
THIRD_PARTY_COOKIES_BLOCKED_ALERT_MESSAGE: "Allow sites to save/read cookies in browser settings. Reloading page starts a new chat.",
|
|
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
|
-
MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_ERROR: "Email {0} could not be saved, try again later."
|
|
31
|
+
MIDDLEWARE_BANNER_FILE_EMAIL_ADDRESS_RECORDED_ERROR: "Email {0} could not be saved, try again later.",
|
|
32
|
+
PREVIOUS_MESSAGES_LOADING: "Loading previous messages...",
|
|
33
|
+
CONVERSATION_DIVIDER_ARIA_LABEL: "Conversation history divider"
|
|
32
34
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createActivityStatusMiddleware } from "../../webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware";
|
|
2
2
|
import { groupActivitiesMiddleware } from "../../webchatcontroller/middlewares/renderingmiddlewares/groupActivitiesMiddleware";
|
|
3
3
|
import { typingIndicatorMiddleware } from "../../webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware";
|
|
4
4
|
export const defaultWebChatStatefulProps = {
|
|
5
5
|
// activityMiddleware: activityMiddleware, - this is implemented elsewhere and can be customized
|
|
6
|
-
activityStatusMiddleware:
|
|
6
|
+
activityStatusMiddleware: createActivityStatusMiddleware(),
|
|
7
7
|
// avatarMiddleware: avatarMiddleware, - this is implemented elsewhere and can be customized
|
|
8
8
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
9
9
|
groupActivitiesMiddleware: groupActivitiesMiddleware,
|
package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js
CHANGED
|
@@ -17,7 +17,7 @@ export const defaultWebChatStyles = {
|
|
|
17
17
|
bubbleTextColor: "White",
|
|
18
18
|
hideSendBox: false,
|
|
19
19
|
hideUploadButton: true,
|
|
20
|
-
primaryFont: "Segoe UI, Arial, sans-serif",
|
|
20
|
+
primaryFont: "Segoe UI, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Noto Color Emoji\"",
|
|
21
21
|
rootHeight: "100%",
|
|
22
22
|
rootWidth: "100%",
|
|
23
23
|
sendBoxTextWrap: true,
|