@microsoft/omnichannel-chat-widget 1.8.4-main.4478bbf → 1.8.4-main.4f09da2
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 +2 -0
- package/lib/cjs/common/telemetry/AppInsightsEvents.js +11 -5
- package/lib/cjs/common/telemetry/TelemetryConstants.js +3 -0
- package/lib/cjs/common/telemetry/TelemetryManager.js +10 -7
- package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +7 -7
- package/lib/cjs/common/utils.js +14 -1
- package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +20 -1
- package/lib/cjs/components/errorboundary/ErrorBoundary.js +2 -1
- package/lib/cjs/components/livechatwidget/common/ChatWidgetEvents.js +1 -1
- package/lib/cjs/components/livechatwidget/common/PersistentConversationHandler.js +26 -20
- package/lib/cjs/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +1 -2
- package/lib/cjs/components/livechatwidget/common/endChat.js +26 -9
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +9 -2
- package/lib/cjs/components/livechatwidget/common/liveChatConfigUtils.js +36 -4
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -0
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +113 -26
- package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +8 -6
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +28 -30
- package/lib/cjs/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +8 -2
- package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
- package/lib/cjs/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +1 -3
- package/lib/cjs/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +6 -7
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +30 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +21 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +7 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +2 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +6 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +29 -7
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +1 -0
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +7 -1
- package/lib/cjs/contexts/createReducer.js +15 -0
- package/lib/esm/common/Constants.js +2 -0
- package/lib/esm/common/telemetry/AppInsightsEvents.js +11 -5
- package/lib/esm/common/telemetry/TelemetryConstants.js +3 -0
- package/lib/esm/common/telemetry/TelemetryManager.js +10 -7
- package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +7 -7
- package/lib/esm/common/utils.js +11 -0
- package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +20 -1
- package/lib/esm/components/errorboundary/ErrorBoundary.js +4 -2
- package/lib/esm/components/livechatwidget/common/ChatWidgetEvents.js +1 -1
- package/lib/esm/components/livechatwidget/common/PersistentConversationHandler.js +26 -20
- package/lib/esm/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +1 -2
- package/lib/esm/components/livechatwidget/common/endChat.js +26 -9
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +9 -2
- package/lib/esm/components/livechatwidget/common/liveChatConfigUtils.js +33 -2
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -0
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +113 -26
- package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +8 -6
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +29 -34
- package/lib/esm/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +8 -2
- package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +1 -3
- package/lib/esm/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +6 -7
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +30 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +21 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +7 -2
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +2 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +6 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +29 -7
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +1 -0
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +7 -1
- package/lib/esm/contexts/createReducer.js +15 -0
- package/lib/types/common/Constants.d.ts +2 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +3 -0
- package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +1 -0
- package/lib/types/common/utils.d.ts +9 -1
- package/lib/types/components/errorboundary/ErrorBoundary.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/ChatWidgetEvents.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/liveChatConfigUtils.d.ts +11 -0
- package/lib/types/components/livechatwidget/interfaces/IPersistentChatHistoryProps.d.ts +5 -1
- package/lib/types/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.d.ts +15 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.d.ts +1 -2
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +2 -1
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.d.ts +1 -1
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
- package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +5 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +2 -1
- package/package.json +2 -2
|
@@ -106,6 +106,7 @@ export declare enum TelemetryEvent {
|
|
|
106
106
|
EndChatFailed = "EndChatFailed",
|
|
107
107
|
SettingCustomContext = "SettingCustomContext",
|
|
108
108
|
WebChatLoaded = "WebChatLoaded",
|
|
109
|
+
PersistentChatHistoryEnabled = "PersistentChatHistoryEnabled",
|
|
109
110
|
LCWChatButtonActionCompleted = "LCWChatButtonActionCompleted",
|
|
110
111
|
LCWChatButtonClicked = "LCWChatButtonClicked",
|
|
111
112
|
LCWChatButtonShow = "LCWChatButtonShow",
|
|
@@ -287,6 +288,7 @@ export declare enum TelemetryEvent {
|
|
|
287
288
|
LCWPersistentConversationHandlerInitialized = "LCWPersistentConversationHandlerInitialized",
|
|
288
289
|
LCWPersistentHistoryPullBlocked = "LCWPersistentHistoryPullBlocked",
|
|
289
290
|
LCWPersistentHistoryPullCompleted = "LCWPersistentHistoryPullCompleted",
|
|
291
|
+
LCWPersistentHistoryReturnedNull = "LCWPersistentHistoryReturnedNull",
|
|
290
292
|
LCWLazyLoadInitializationStarted = "LCWLazyLoadInitializationStarted",
|
|
291
293
|
LCWLazyLoadContainerNotFound = "LCWLazyLoadContainerNotFound",
|
|
292
294
|
LCWLazyLoadInitializationCompleted = "LCWLazyLoadInitializationCompleted",
|
|
@@ -296,6 +298,7 @@ export declare enum TelemetryEvent {
|
|
|
296
298
|
LCWLazyLoadActivityMounted = "LCWLazyLoadActivityMounted",
|
|
297
299
|
LCWLazyLoadReset = "LCWLazyLoadReset",
|
|
298
300
|
LCWLazyLoadNoMoreHistory = "LCWLazyLoadNoMoreHistory",
|
|
301
|
+
LCWLazyLoadHistoryError = "LCWLazyLoadHistoryError",
|
|
299
302
|
LCWLazyLoadDestroyed = "LCWLazyLoadDestroyed",
|
|
300
303
|
SecureEventBusUnauthorizedDispatch = "SecureEventBusUnauthorizedDispatch",
|
|
301
304
|
SecureEventBusListenerError = "SecureEventBusListenerError",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import * as CustomEventType from "../contexts/common/CustomEventType";
|
|
1
2
|
import { FacadeChatSDK } from "./facades/FacadeChatSDK";
|
|
2
3
|
import { ITimer } from "./interfaces/ITimer";
|
|
3
|
-
import * as CustomEventType from "../contexts/common/CustomEventType";
|
|
4
4
|
export declare const setTabIndices: (elements: HTMLElement[] | null, tabIndexMap: Map<string, number>, shouldBeFocusable: boolean) => void;
|
|
5
5
|
export declare const findParentFocusableElementsWithoutChildContainer: (elementId: string) => HTMLElement[] | null;
|
|
6
6
|
export declare const findAllFocusableElement: (parent: string | HTMLElement) => any[] | null;
|
|
@@ -55,3 +55,11 @@ export declare function isEndConversationDueToOverflowActivity(activity: {
|
|
|
55
55
|
tags?: string[];
|
|
56
56
|
};
|
|
57
57
|
}): boolean | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* Parses a value that can be boolean or string ("true"/"false") into a boolean.
|
|
60
|
+
* Handles null/undefined by returning false.
|
|
61
|
+
*
|
|
62
|
+
* @param value - The value to parse (can be boolean, string, null, or undefined)
|
|
63
|
+
* @returns true if value is true or "true" (case-insensitive), false otherwise
|
|
64
|
+
*/
|
|
65
|
+
export declare function parseBooleanFromConfig(value: boolean | string | null | undefined): boolean;
|
|
@@ -2,6 +2,6 @@ declare enum ChatWidgetEvents {
|
|
|
2
2
|
ADD_ACTIVITY = "CHAT_WIDGET/ADD_ACTIVITY",
|
|
3
3
|
FETCH_PERSISTENT_CHAT_HISTORY = "CHAT_WIDGET/FETCH_PERSISTENT_CHAT_HISTORY",
|
|
4
4
|
NO_MORE_HISTORY_AVAILABLE = "CHAT_WIDGET/NO_MORE_HISTORY_AVAILABLE",
|
|
5
|
-
|
|
5
|
+
HISTORY_LOAD_ERROR = "CHAT_WIDGET/HISTORY_LOAD_ERROR"
|
|
6
6
|
}
|
|
7
7
|
export default ChatWidgetEvents;
|
|
@@ -1,4 +1,15 @@
|
|
|
1
|
+
import { ExtendedChatConfig } from "../../webchatcontainerstateful/interfaces/IExtendedChatConffig";
|
|
1
2
|
import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
|
|
2
3
|
export declare const isPostChatSurveyEnabled: (facadeChatSDK: FacadeChatSDK) => Promise<boolean>;
|
|
3
4
|
export declare const getPostChatSurveyConfig: (facadeChatSDK: FacadeChatSDK) => Promise<any>;
|
|
4
5
|
export declare const isPersistentChatEnabled: (conversationMode: string | undefined) => boolean;
|
|
6
|
+
/**
|
|
7
|
+
* Determines if persistent chat history should be loaded based on all required conditions.
|
|
8
|
+
*
|
|
9
|
+
* @param extendedChatConfig - The extended chat configuration object
|
|
10
|
+
* @returns true if ALL conditions are met:
|
|
11
|
+
* 1. Conversation mode must be Persistent ("192350001")
|
|
12
|
+
* 2. History is enabled in admin config (msdyn_enablepersistentchatpreviousconversations)
|
|
13
|
+
* 3. History is enabled via feature flag (lcwPersistentChatHistoryEnabled)
|
|
14
|
+
*/
|
|
15
|
+
export declare const shouldLoadPersistentChatHistory: (extendedChatConfig: ExtendedChatConfig | undefined) => boolean;
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import { IStyle } from "@fluentui/react";
|
|
2
2
|
export interface IPersistentChatHistoryProps {
|
|
3
|
-
persistentChatHistoryEnabled?: boolean;
|
|
4
3
|
pageSize?: number;
|
|
5
4
|
dividerActivityStyle?: IStyle;
|
|
5
|
+
/**
|
|
6
|
+
* Accessible label announced by screen readers for the conversation divider element.
|
|
7
|
+
* If not supplied, a default provided in defaultPersistentChatHistoryProps will be used.
|
|
8
|
+
*/
|
|
9
|
+
dividerActivityAriaLabel?: string;
|
|
6
10
|
bannerStyle?: IStyle;
|
|
7
11
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface ExtendedChatConfig {
|
|
2
|
+
LcwFcbConfiguration?: LcwFcbConfiguration;
|
|
3
|
+
LiveChatConfigAuthSettings?: LiveChatConfigAuthSettings;
|
|
4
|
+
LiveWSAndLiveChatEngJoin?: {
|
|
5
|
+
msdyn_conversationmode?: string;
|
|
6
|
+
msdyn_enablepersistentchatpreviousconversations?: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
interface LcwFcbConfiguration {
|
|
10
|
+
lcwPersistentChatHistoryEnabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
interface LiveChatConfigAuthSettings {
|
|
13
|
+
msdyn_javascriptclientfunction?: string;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { IPersistentChatHistoryProps } from "../../livechatwidget/interfaces/IPersistentChatHistoryProps";
|
|
2
1
|
/**
|
|
3
2
|
* Component to handle persistent chat history events.
|
|
4
3
|
* Uses WebChatStoreLoader instead of hooks to avoid context issues.
|
|
5
4
|
*/
|
|
6
|
-
declare const WebChatEventSubscribers: (
|
|
5
|
+
declare const WebChatEventSubscribers: () => null;
|
|
7
6
|
export default WebChatEventSubscribers;
|
|
@@ -53,7 +53,7 @@ declare class LazyLoadHandler {
|
|
|
53
53
|
static paused: boolean;
|
|
54
54
|
static observer: IntersectionObserver | null;
|
|
55
55
|
private static scrollState;
|
|
56
|
-
|
|
56
|
+
static pendingScrollAction: boolean;
|
|
57
57
|
private static retryTimeouts;
|
|
58
58
|
static resetPending: boolean;
|
|
59
59
|
private static initTimer;
|
|
@@ -6,5 +6,6 @@
|
|
|
6
6
|
* 2. Changes the font size of user messages
|
|
7
7
|
* 3. Decodes certain html characters that came through from chat services
|
|
8
8
|
******/
|
|
9
|
+
import { ILiveChatWidgetLocalizedTexts } from "../../../../../contexts/common/ILiveChatWidgetLocalizedTexts";
|
|
9
10
|
import React from "react";
|
|
10
|
-
export declare const createActivityMiddleware: (renderMarkdown: (text: string) => string, systemMessageStyleProps?: React.CSSProperties, userMessageStyleProps?: React.CSSProperties) => () => (next: any) => (...args: any) => any;
|
|
11
|
+
export declare const createActivityMiddleware: (renderMarkdown: (text: string) => string, systemMessageStyleProps?: React.CSSProperties, userMessageStyleProps?: React.CSSProperties, localizedTexts?: ILiveChatWidgetLocalizedTexts) => () => (next: any) => (...args: any) => any;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IWebChatAction } from "../../../interfaces/IWebChatAction";
|
|
2
|
-
export declare const localizedStringsBotInitialsMiddleware: () => ({ dispatch }: {
|
|
2
|
+
export declare const localizedStringsBotInitialsMiddleware: (onInitialsChange?: (initials: string) => void) => ({ dispatch }: {
|
|
3
3
|
dispatch: any;
|
|
4
4
|
}) => (next: any) => (action: IWebChatAction) => any;
|
|
5
5
|
export declare const getOverriddenLocalizedStrings: (existingOverrides?: any) => (strings: any) => any;
|
|
@@ -26,6 +26,7 @@ export interface ILiveChatWidgetContext {
|
|
|
26
26
|
confirmationPaneConfirmedOptionClicked: boolean;
|
|
27
27
|
confirmationState: ConfirmationState;
|
|
28
28
|
startChatFailureType: StartChatFailureType;
|
|
29
|
+
botAvatarInitials?: string;
|
|
29
30
|
};
|
|
30
31
|
appStates: {
|
|
31
32
|
conversationState: ConversationState;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
export interface ILiveChatWidgetLocalizedTexts {
|
|
2
2
|
PREVIOUS_MESSAGES_LOADING?: string;
|
|
3
|
+
/**
|
|
4
|
+
* Aria label announced by screen readers for the conversation history divider element.
|
|
5
|
+
* e.g. "Conversation history divider" or localized equivalent.
|
|
6
|
+
*/
|
|
7
|
+
CONVERSATION_DIVIDER_ARIA_LABEL?: string;
|
|
3
8
|
MIDDLEWARE_BANNER_FILE_NULL_ERROR?: string;
|
|
4
9
|
MIDDLEWARE_BANNER_FILE_SIZE_WITHOUT_EXTENSION_ERROR?: string;
|
|
5
10
|
MIDDLEWARE_BANNER_FILE_SIZE_EXTENSION_ERROR?: string;
|
|
@@ -47,5 +47,6 @@ export declare enum LiveChatWidgetActionType {
|
|
|
47
47
|
SET_POST_CHAT_PARTICIPANT_TYPE = 45,
|
|
48
48
|
SET_CONVERSATIONAL_SURVEY_ENABLED = 46,
|
|
49
49
|
SET_CONVERSATIONAL_SURVEY_DISPLAY = 47,
|
|
50
|
-
GET_IN_MEMORY_STATE = 48
|
|
50
|
+
GET_IN_MEMORY_STATE = 48,
|
|
51
|
+
SET_BOT_AVATAR_INITIALS = 49
|
|
51
52
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/omnichannel-chat-widget",
|
|
3
|
-
"version": "1.8.4-main.
|
|
3
|
+
"version": "1.8.4-main.4f09da2",
|
|
4
4
|
"description": "Microsoft Omnichannel Chat Widget",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"types": "lib/types/index.d.ts",
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
"compose-storybook": "start-storybook -c stories/.storybook -p 9009",
|
|
109
109
|
"build-composite-storybook": "build-storybook -c stories/.storybook -o storybook-build",
|
|
110
110
|
"build-storybook": "cross-env NODE_OPTIONS=--openssl-legacy-provider build-storybook",
|
|
111
|
-
"build": "yarn clean yarn lint && yarn build:esm && yarn build:cjs && tsc",
|
|
111
|
+
"build": "yarn clean && yarn lint && yarn build:esm && yarn build:cjs && tsc",
|
|
112
112
|
"test:unit": "jest -c jest.config.unit.cjs --env=jsdom --runInBand --force-exit",
|
|
113
113
|
"test:e2e": "cd automation_tests && yarn test",
|
|
114
114
|
"test:e2e:build": "yarn build-sample && cd automation_tests && yarn test",
|