@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.
Files changed (83) hide show
  1. package/README.md +27 -0
  2. package/lib/cjs/common/Constants.js +2 -0
  3. package/lib/cjs/common/telemetry/AppInsightsEvents.js +11 -5
  4. package/lib/cjs/common/telemetry/TelemetryConstants.js +3 -0
  5. package/lib/cjs/common/telemetry/TelemetryManager.js +10 -7
  6. package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +7 -7
  7. package/lib/cjs/common/utils.js +14 -1
  8. package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +20 -1
  9. package/lib/cjs/components/errorboundary/ErrorBoundary.js +2 -1
  10. package/lib/cjs/components/livechatwidget/common/ChatWidgetEvents.js +1 -1
  11. package/lib/cjs/components/livechatwidget/common/PersistentConversationHandler.js +26 -20
  12. package/lib/cjs/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +1 -2
  13. package/lib/cjs/components/livechatwidget/common/endChat.js +26 -9
  14. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +9 -2
  15. package/lib/cjs/components/livechatwidget/common/liveChatConfigUtils.js +36 -4
  16. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -0
  17. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +113 -26
  18. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +8 -6
  19. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +28 -30
  20. package/lib/cjs/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +8 -2
  21. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
  22. package/lib/cjs/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +1 -3
  23. package/lib/cjs/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.js +1 -0
  24. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +6 -7
  25. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +30 -1
  26. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +21 -1
  27. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +7 -2
  28. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +2 -0
  29. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +6 -1
  30. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +29 -7
  31. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +1 -0
  32. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +7 -1
  33. package/lib/cjs/contexts/createReducer.js +15 -0
  34. package/lib/esm/common/Constants.js +2 -0
  35. package/lib/esm/common/telemetry/AppInsightsEvents.js +11 -5
  36. package/lib/esm/common/telemetry/TelemetryConstants.js +3 -0
  37. package/lib/esm/common/telemetry/TelemetryManager.js +10 -7
  38. package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +7 -7
  39. package/lib/esm/common/utils.js +11 -0
  40. package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +20 -1
  41. package/lib/esm/components/errorboundary/ErrorBoundary.js +4 -2
  42. package/lib/esm/components/livechatwidget/common/ChatWidgetEvents.js +1 -1
  43. package/lib/esm/components/livechatwidget/common/PersistentConversationHandler.js +26 -20
  44. package/lib/esm/components/livechatwidget/common/defaultProps/defaultPersistentChatHistoryProps.js +1 -2
  45. package/lib/esm/components/livechatwidget/common/endChat.js +26 -9
  46. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +9 -2
  47. package/lib/esm/components/livechatwidget/common/liveChatConfigUtils.js +33 -2
  48. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -0
  49. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +113 -26
  50. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +8 -6
  51. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +29 -34
  52. package/lib/esm/components/webchatcontainerstateful/common/activityConverters/convertPersistentChatHistoryMessageToActivity.js +8 -2
  53. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts.js +2 -1
  54. package/lib/esm/components/webchatcontainerstateful/hooks/usePersistentChatHistory.js +1 -3
  55. package/lib/esm/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.js +1 -0
  56. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.js +6 -7
  57. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/ConversationDividerActivity.js +30 -1
  58. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.js +21 -1
  59. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +7 -2
  60. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +2 -0
  61. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware.js +1 -0
  62. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +6 -1
  63. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +29 -7
  64. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +1 -0
  65. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +7 -1
  66. package/lib/esm/contexts/createReducer.js +15 -0
  67. package/lib/types/common/Constants.d.ts +2 -0
  68. package/lib/types/common/telemetry/TelemetryConstants.d.ts +3 -0
  69. package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +1 -0
  70. package/lib/types/common/utils.d.ts +9 -1
  71. package/lib/types/components/errorboundary/ErrorBoundary.d.ts +1 -1
  72. package/lib/types/components/livechatwidget/common/ChatWidgetEvents.d.ts +1 -1
  73. package/lib/types/components/livechatwidget/common/liveChatConfigUtils.d.ts +11 -0
  74. package/lib/types/components/livechatwidget/interfaces/IPersistentChatHistoryProps.d.ts +5 -1
  75. package/lib/types/components/webchatcontainerstateful/interfaces/IExtendedChatConffig.d.ts +15 -0
  76. package/lib/types/components/webchatcontainerstateful/webchatcontroller/WebChatEventSubscribers.d.ts +1 -2
  77. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity.d.ts +1 -1
  78. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +2 -1
  79. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.d.ts +1 -1
  80. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
  81. package/lib/types/contexts/common/ILiveChatWidgetLocalizedTexts.d.ts +5 -0
  82. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +2 -1
  83. 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",
@@ -20,4 +20,5 @@ export interface IInternalTelemetryData {
20
20
  channelId?: string;
21
21
  chatWidgetVersion?: string;
22
22
  chatComponentVersion?: string;
23
+ chatConfigAppInsightsKey?: string;
23
24
  }
@@ -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;
@@ -1,4 +1,4 @@
1
- import React, { Component } from 'react';
1
+ import React, { Component } from "react";
2
2
  interface ErrorBoundaryProps {
3
3
  children: React.ReactNode | (() => React.ReactNode);
4
4
  onError?: (error: Error) => void;
@@ -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
- HIDE_LOADING_BANNER = "CHAT_WIDGET/HIDE_LOADING_BANNER"
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 {};
@@ -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: (props: IPersistentChatHistoryProps) => null;
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
- private static pendingScrollAction;
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.4478bbf",
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",