@microsoft/omnichannel-chat-widget 1.8.2-main.fc93d3d → 1.8.3-main.1381896

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 (126) hide show
  1. package/README.md +46 -1
  2. package/lib/cjs/common/Constants.js +10 -2
  3. package/lib/cjs/common/telemetry/TelemetryConstants.js +6 -0
  4. package/lib/cjs/common/telemetry/TelemetryHelper.js +7 -5
  5. package/lib/cjs/common/utils.js +27 -2
  6. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +4 -4
  7. package/lib/cjs/components/citationpanestateful/CitationDim.js +29 -0
  8. package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +199 -0
  9. package/lib/cjs/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +70 -0
  10. package/lib/cjs/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js +1 -0
  11. package/lib/cjs/components/livechatwidget/LiveChatWidget.js +4 -4
  12. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
  13. package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +22 -9
  14. package/lib/cjs/components/livechatwidget/common/createMarkdown.js +54 -1
  15. package/lib/cjs/components/livechatwidget/common/customEventHandler.js +53 -0
  16. package/lib/cjs/components/livechatwidget/common/endChat.js +34 -4
  17. package/lib/cjs/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
  18. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +12 -5
  19. package/lib/cjs/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
  20. package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +23 -0
  21. package/lib/cjs/components/livechatwidget/common/startChat.js +8 -6
  22. package/lib/cjs/components/livechatwidget/interfaces/IMockProps.js +8 -2
  23. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +45 -11
  24. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +114 -13
  25. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -12
  26. package/lib/cjs/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
  27. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
  28. package/lib/cjs/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +62 -3
  29. package/lib/cjs/components/webchatcontainerstateful/common/utils/fontUtils.js +28 -0
  30. package/lib/cjs/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
  31. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
  32. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
  33. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/callActionMiddleware.js +42 -0
  34. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +139 -0
  35. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware.js +41 -0
  36. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +54 -0
  37. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +45 -0
  38. package/lib/cjs/contexts/common/CustomEventType.js +1 -0
  39. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +46 -45
  40. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +2 -0
  41. package/lib/cjs/contexts/createReducer.js +15 -0
  42. package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +101 -36
  43. package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +39 -21
  44. package/lib/cjs/firstresponselatency/util.js +24 -10
  45. package/lib/cjs/index.js +9 -1
  46. package/lib/cjs/plugins/createChatTranscript.js +13 -0
  47. package/lib/cjs/plugins/newMessageEventHandler.js +2 -2
  48. package/lib/esm/common/Constants.js +10 -2
  49. package/lib/esm/common/telemetry/TelemetryConstants.js +6 -0
  50. package/lib/esm/common/telemetry/TelemetryHelper.js +7 -5
  51. package/lib/esm/common/utils.js +21 -0
  52. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +4 -4
  53. package/lib/esm/components/citationpanestateful/CitationDim.js +20 -0
  54. package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +188 -0
  55. package/lib/esm/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.js +61 -0
  56. package/lib/esm/components/confirmationpanestateful/interfaces/IConfirmationPaneLocalizedTexts.js +1 -0
  57. package/lib/esm/components/livechatwidget/LiveChatWidget.js +4 -4
  58. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +4 -5
  59. package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +22 -9
  60. package/lib/esm/components/livechatwidget/common/createMarkdown.js +54 -1
  61. package/lib/esm/components/livechatwidget/common/customEventHandler.js +45 -0
  62. package/lib/esm/components/livechatwidget/common/endChat.js +35 -5
  63. package/lib/esm/components/livechatwidget/common/getMockChatSDKIfApplicable.js +4 -3
  64. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +13 -6
  65. package/lib/esm/components/livechatwidget/common/overridePropsOnMockIfApplicable.js +2 -1
  66. package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +23 -0
  67. package/lib/esm/components/livechatwidget/common/startChat.js +8 -6
  68. package/lib/esm/components/livechatwidget/interfaces/IMockProps.js +3 -3
  69. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +45 -11
  70. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +114 -14
  71. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatAdapter.js +43 -12
  72. package/lib/esm/components/webchatcontainerstateful/common/DesignerChatSDK.js +6 -1
  73. package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
  74. package/lib/esm/components/webchatcontainerstateful/common/utils/chatAdapterUtils.js +55 -0
  75. package/lib/esm/components/webchatcontainerstateful/common/utils/fontUtils.js +21 -0
  76. package/lib/esm/components/webchatcontainerstateful/interfaces/ICitation.js +1 -0
  77. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultAvatarTextStyles.js +1 -1
  78. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +1 -1
  79. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/callActionMiddleware.js +36 -0
  80. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.js +133 -0
  81. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware.js +33 -0
  82. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +46 -0
  83. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.js +38 -0
  84. package/lib/esm/contexts/common/CustomEventType.js +1 -0
  85. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +46 -45
  86. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +2 -0
  87. package/lib/esm/contexts/createReducer.js +15 -0
  88. package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +101 -36
  89. package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +39 -21
  90. package/lib/esm/firstresponselatency/util.js +21 -8
  91. package/lib/esm/index.js +1 -0
  92. package/lib/esm/plugins/createChatTranscript.js +13 -0
  93. package/lib/esm/plugins/newMessageEventHandler.js +3 -3
  94. package/lib/types/common/Constants.d.ts +10 -2
  95. package/lib/types/common/telemetry/TelemetryConstants.d.ts +6 -0
  96. package/lib/types/common/utils.d.ts +8 -0
  97. package/lib/types/components/citationpanestateful/CitationDim.d.ts +5 -0
  98. package/lib/types/components/citationpanestateful/CitationPaneStateful.d.ts +4 -0
  99. package/lib/types/components/citationpanestateful/common/defaultProps/defaultCitationPaneProps.d.ts +11 -0
  100. package/lib/types/components/citationpanestateful/interfaces/ICitationPaneStatefulProps.d.ts +19 -0
  101. package/lib/types/components/confirmationpanestateful/common/defaultProps/defaultConfirmationPaneLocalizedTexts.d.ts +1 -1
  102. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps.d.ts +1 -1
  103. package/lib/types/components/livechatwidget/common/customEventHandler.d.ts +4 -0
  104. package/lib/types/components/livechatwidget/common/getMockChatSDKIfApplicable.d.ts +2 -1
  105. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +3 -1
  106. package/lib/types/components/livechatwidget/interfaces/IMockProps.d.ts +5 -3
  107. package/lib/types/components/webchatcontainerstateful/common/DesignerChatAdapter.d.ts +4 -2
  108. package/lib/types/components/webchatcontainerstateful/common/DesignerChatSDK.d.ts +5 -0
  109. package/lib/types/components/webchatcontainerstateful/common/utils/chatAdapterUtils.d.ts +8 -1
  110. package/lib/types/components/webchatcontainerstateful/common/utils/fontUtils.d.ts +10 -0
  111. package/lib/types/components/webchatcontainerstateful/interfaces/ICitation.d.ts +12 -0
  112. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/callActionMiddleware.d.ts +8 -0
  113. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/citationsMiddleware.d.ts +4 -0
  114. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/customEventMiddleware.d.ts +22 -0
  115. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.d.ts +5 -0
  116. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/queueOverflowHandlerMiddleware.d.ts +5 -0
  117. package/lib/types/contexts/common/CustomEventType.d.ts +6 -0
  118. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
  119. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +46 -45
  120. package/lib/types/firstresponselatency/FirstResponseLatencyTracker.d.ts +2 -2
  121. package/lib/types/firstresponselatency/util.d.ts +1 -0
  122. package/lib/types/index.d.ts +1 -0
  123. package/package.json +5 -4
  124. /package/lib/cjs/components/{confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.js → citationpanestateful/interfaces/ICitationPaneStatefulProps.js} +0 -0
  125. /package/lib/esm/components/{confirmationpanestateful/interfaces/IConfirmationPaneLocalizedText.js → citationpanestateful/interfaces/ICitationPaneStatefulProps.js} +0 -0
  126. /package/lib/types/components/confirmationpanestateful/interfaces/{IConfirmationPaneLocalizedText.d.ts → IConfirmationPaneLocalizedTexts.d.ts} +0 -0
@@ -136,6 +136,7 @@ export declare enum TelemetryEvent {
136
136
  EmailTranscriptLoaded = "EmailTranscriptLoaded",
137
137
  OutOfOfficePaneLoaded = "OutOfOfficePaneLoaded",
138
138
  ConfirmationPaneLoaded = "ConfirmationPaneLoaded",
139
+ CitationPaneLoaded = "CitationPaneLoaded",
139
140
  ProactiveChatPaneLoaded = "ProactiveChatPaneLoaded",
140
141
  ReconnectChatPaneLoaded = "ReconnectChatPaneLoaded",
141
142
  HeaderCloseButtonClicked = "HeaderCloseButtonClicked",
@@ -172,10 +173,12 @@ export declare enum TelemetryEvent {
172
173
  BotAuthActivityUndefinedSignInId = "BotAuthActivityUndefinedSignInId",
173
174
  ThirdPartyCookiesBlocked = "ThirdPartyCookiesBlocked",
174
175
  ParticipantsRemovedEvent = "ParticipantsRemovedEvent",
176
+ QueueOverflowEvent = "QueueOverflowEvent",
175
177
  ProcessingHTMLTextMiddlewareFailed = "ProcessingHTMLTextMiddlewareFailed",
176
178
  ProcessingSanitizationMiddlewareFailed = "ProcessingSanitizationMiddlewareFailed",
177
179
  FormatTagsMiddlewareJSONStringifyFailed = "FormatTagsMiddlewareJSONStringifyFailed",
178
180
  AttachmentUploadValidatorMiddlewareFailed = "AttachmentUploadValidatorMiddlewareFailed",
181
+ CitationMiddlewareFailed = "CitationMiddlewareFailed",
179
182
  QueuePositionMessageRecieved = "QueuePositionMessageRecieved",
180
183
  AverageWaitTimeMessageRecieved = "AverageWaitTimeMessageRecieved",
181
184
  DataMaskingRuleApplied = "DataMaskingRuleApplied",
@@ -210,6 +213,7 @@ export declare enum TelemetryEvent {
210
213
  SystemMessageReceived = "SystemMessageReceived",
211
214
  RehydrateMessageReceived = "RehydrateMessageReceived",
212
215
  CustomContextReceived = "CustomContextReceived",
216
+ CustomEventAction = "CustomEventAction",
213
217
  NetworkDisconnected = "NetworkDisconnected",
214
218
  NetworkReconnected = "NetworkReconnected",
215
219
  LinkModePostChatWorkflowStarted = "LinkModePostChatWorkflowStarted",
@@ -259,7 +263,9 @@ export declare enum TelemetryEvent {
259
263
  UXLCWChatButtonLoadingStart = "UXLCWChatButtonLoadingStart",
260
264
  UXLCWChatButtonLoadingCompleted = "UXLCWChatButtonLoadingCompleted",
261
265
  UXConfirmationPaneStart = "UXConfirmationPaneStart",
266
+ UXCitationPaneStart = "UXCitationPaneStart",
262
267
  UXConfirmationPaneCompleted = "UXConfirmationPaneCompleted",
268
+ UXCitationPaneCompleted = "UXCitationPaneCompleted",
263
269
  UXLiveChatWidgetStart = "UXLiveChatWidgetStart",
264
270
  UXLiveChatWidgetCompleted = "UXLiveChatWidgetCompleted",
265
271
  AppInsightsInitialized = "AppInsightsInitialized",
@@ -1,5 +1,6 @@
1
1
  import { FacadeChatSDK } from "./facades/FacadeChatSDK";
2
2
  import { ITimer } from "./interfaces/ITimer";
3
+ import * as CustomEventType from "../contexts/common/CustomEventType";
3
4
  export declare const setTabIndices: (elements: HTMLElement[] | null, tabIndexMap: Map<string, number>, shouldBeFocusable: boolean) => void;
4
5
  export declare const findParentFocusableElementsWithoutChildContainer: (elementId: string) => HTMLElement[] | null;
5
6
  export declare const findAllFocusableElement: (parent: string | HTMLElement) => any[] | null;
@@ -47,3 +48,10 @@ export declare const formatTemplateString: (templateMessage: string, values: any
47
48
  export declare const parseLowerCaseString: (property: string | boolean | undefined) => string;
48
49
  export declare const setOcUserAgent: (chatSDK: any) => void;
49
50
  export declare function getDeviceType(): string;
51
+ export declare const isValidCustomEvent: (payload: object) => boolean;
52
+ export declare const getCustomEventValue: (customEventPayload: CustomEventType.ICustomEvent) => string;
53
+ export declare function isEndConversationDueToOverflowActivity(activity: {
54
+ channelData?: {
55
+ tags?: string[];
56
+ };
57
+ }): boolean | undefined;
@@ -0,0 +1,5 @@
1
+ import React from "react";
2
+ export declare const CitationDim: React.FC<{
3
+ brightness?: string;
4
+ }>;
5
+ export default CitationDim;
@@ -0,0 +1,4 @@
1
+ import React from "react";
2
+ import { ICitationPaneStatefulProps } from "./interfaces/ICitationPaneStatefulProps";
3
+ export declare const CitationPaneStateful: (props: ICitationPaneStatefulProps) => React.JSX.Element;
4
+ export default CitationPaneStateful;
@@ -0,0 +1,11 @@
1
+ export declare const defaultCitationPaneStyles: {
2
+ pane: React.CSSProperties;
3
+ };
4
+ export declare const defaultCitationContentCSS: (controlId: string) => string;
5
+ declare const _default: {
6
+ defaultCitationPaneStyles: {
7
+ pane: React.CSSProperties;
8
+ };
9
+ defaultCitationContentCSS: (controlId: string) => string;
10
+ };
11
+ export default _default;
@@ -0,0 +1,19 @@
1
+ import { ICitationPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/citationpane/interfaces/ICitationPaneProps";
2
+ export interface ICitationPaneStatefulProps extends ICitationPaneProps {
3
+ /**
4
+ * id: Optional custom ID for the citation pane container
5
+ */
6
+ id?: string;
7
+ /**
8
+ * title: Optional title for the citation pane
9
+ */
10
+ title?: string;
11
+ /**
12
+ * onClose: Optional callback function called when the citation pane is closed
13
+ */
14
+ onClose?: () => void;
15
+ /**
16
+ * contentHtml: Optional HTML content to display in the citation pane
17
+ */
18
+ contentHtml?: string;
19
+ }
@@ -1,2 +1,2 @@
1
- import { IConfirmationPaneLocalizedTexts } from "../../interfaces/IConfirmationPaneLocalizedText";
1
+ import { IConfirmationPaneLocalizedTexts } from "../../interfaces/IConfirmationPaneLocalizedTexts";
2
2
  export declare const defaultConfirmationPaneLocalizedTexts: IConfirmationPaneLocalizedTexts;
@@ -1,4 +1,4 @@
1
- import { IConfirmationPaneLocalizedTexts } from "./IConfirmationPaneLocalizedText";
1
+ import { IConfirmationPaneLocalizedTexts } from "./IConfirmationPaneLocalizedTexts";
2
2
  import { IConfirmationPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/confirmationpane/interfaces/IConfirmationPaneProps";
3
3
  export interface IConfirmationPaneStatefulProps extends IConfirmationPaneProps {
4
4
  /**
@@ -0,0 +1,4 @@
1
+ import { FacadeChatSDK } from "../../../common/facades/FacadeChatSDK";
2
+ import { BroadcastService } from "@microsoft/omnichannel-chat-components";
3
+ export declare const customEventCallback: (facadeChatSDK: FacadeChatSDK) => (event: object) => void;
4
+ export declare const subscribeToSendCustomEvent: (broadcastService: typeof BroadcastService, facadeChatSDK: FacadeChatSDK, customEventCallback: (fackageSdK: FacadeChatSDK) => (event: object) => void) => void;
@@ -1 +1,2 @@
1
- export declare const getMockChatSDKIfApplicable: (chatSDK: any, type?: string) => any;
1
+ import { IMockProps } from "../interfaces/IMockProps";
2
+ export declare const getMockChatSDKIfApplicable: (chatSDK: any, mockProps?: IMockProps) => any;
@@ -1,7 +1,9 @@
1
1
  import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
2
+ import { IAppInsightsConfig } from "../../../common/telemetry/interfaces/IAppInsightsConfig";
2
3
  import { IAudioNotificationProps } from "../../footerstateful/audionotificationstateful/interfaces/IAudioNotificationProps";
3
4
  import { ICallingContainerProps } from "@microsoft/omnichannel-chat-components/lib/types/components/callingcontainer/interfaces/ICallingContainerProps";
4
5
  import { IChatButtonProps } from "@microsoft/omnichannel-chat-components/lib/types/components/chatbutton/interfaces/IChatButtonProps";
6
+ import { ICitationPaneStatefulProps } from "../../citationpanestateful/interfaces/ICitationPaneStatefulProps";
5
7
  import { IConfirmationPaneStatefulProps } from "../../confirmationpanestateful/interfaces/IConfirmationPaneStatefulProps";
6
8
  import { IContextDataStore } from "../../../common/interfaces/IContextDataStore";
7
9
  import { IDownloadTranscriptProps } from "../../footerstateful/downloadtranscriptstateful/interfaces/IDownloadTranscriptProps";
@@ -27,7 +29,6 @@ import { IStartChatErrorPaneProps } from "../../startchaterrorpanestateful/inter
27
29
  import { ITelemetryConfig } from "../../../common/telemetry/interfaces/ITelemetryConfig";
28
30
  import { IWebChatContainerStatefulProps } from "../../webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps";
29
31
  import { OmnichannelChatSDK } from "@microsoft/omnichannel-chat-sdk";
30
- import { IAppInsightsConfig } from "../../../common/telemetry/interfaces/IAppInsightsConfig";
31
32
  export interface ILiveChatWidgetProps {
32
33
  audioNotificationProps?: IAudioNotificationProps;
33
34
  callingContainerProps?: ICallingContainerProps;
@@ -51,6 +52,7 @@ export interface ILiveChatWidgetProps {
51
52
  preChatSurveyPaneProps?: IPreChatSurveyPaneProps;
52
53
  proactiveChatPaneProps?: IProactiveChatPaneStatefulProps;
53
54
  reconnectChatPaneProps?: IReconnectChatPaneStatefulProps;
55
+ citationPaneProps?: ICitationPaneStatefulProps;
54
56
  startChatErrorPaneProps?: IStartChatErrorPaneProps;
55
57
  styleProps?: ILiveChatWidgetStyleProps;
56
58
  telemetryConfig: ITelemetryConfig;
@@ -1,8 +1,10 @@
1
- declare enum LiveChatWidgetMockType {
1
+ import { Message } from "botframework-directlinejs";
2
+ export declare enum LiveChatWidgetMockType {
2
3
  Test = "Test",
3
- Demo = "Demo"
4
+ Demo = "Demo",
5
+ Designer = "Designer"
4
6
  }
5
7
  export interface IMockProps {
6
8
  type: LiveChatWidgetMockType;
9
+ mockMessages?: Message[];
7
10
  }
8
- export {};
@@ -1,8 +1,10 @@
1
1
  import { Message } from "botframework-directlinejs";
2
- import { Observable } from "rxjs/Observable";
3
2
  import MockAdapter from "./mockadapter";
3
+ import { Observable } from "rxjs/Observable";
4
4
  export declare class DesignerChatAdapter extends MockAdapter {
5
- constructor();
5
+ messages?: Message[];
6
+ constructor(messages?: Message[]);
7
+ private processMessage;
6
8
  private postUserActivity;
7
9
  postActivity(activity: Message): Observable<string>;
8
10
  }
@@ -1,7 +1,12 @@
1
1
  import { DesignerChatAdapter } from "./DesignerChatAdapter";
2
+ import { Message } from "botframework-directlinejs";
2
3
  import { MockChatSDK } from "./mockchatsdk";
3
4
  export declare class DesignerChatSDK extends MockChatSDK {
4
5
  constructor();
6
+ /**
7
+ * Create a chat adapter for the designer. Uses this.mockMessages if set.
8
+ */
9
+ mockMessages?: Message[];
5
10
  createChatAdapter(): DesignerChatAdapter;
6
11
  localeId: string;
7
12
  /**
@@ -1,9 +1,16 @@
1
- import { Activity, Attachment, Message, User } from "botframework-directlinejs";
1
+ import { Activity, Attachment, AttachmentLayout, CardAction, Message, User } from "botframework-directlinejs";
2
2
  import { Subscriber } from "rxjs/Subscriber";
3
3
  export declare const customerUser: User;
4
4
  export declare const botUser: User;
5
+ export declare const agentUser: User;
5
6
  export declare const postEchoActivity: (activityObserver: Subscriber<Activity> | undefined, activity: Message, user: User, delay?: number) => void;
6
7
  export declare const postBotMessageActivity: (activityObserver: Subscriber<Activity> | undefined, text: string, tags?: string, delay?: number) => void;
8
+ export declare const postAgentMessageActivity: (activityObserver: Subscriber<Activity> | undefined, text: string, tags?: string, delay?: number) => void;
7
9
  export declare const postSystemMessageActivity: (activityObserver: Subscriber<Activity> | undefined, text: string, delay?: number) => void;
8
10
  export declare const postBotTypingActivity: (activityObserver: Subscriber<Activity> | undefined, delay?: number) => void;
9
11
  export declare const postBotAttachmentActivity: (activityObserver: Subscriber<Activity> | undefined, attachments?: Attachment[], delay?: number) => void;
12
+ export declare const postAgentAttachmentActivity: (activityObserver: Subscriber<Activity> | undefined, attachments?: Attachment[], delay?: number, attachmentLayout?: AttachmentLayout) => void;
13
+ export declare const postAgentSuggestedActionsActivity: (activityObserver: Subscriber<Activity> | undefined, text: string, suggestedActions: {
14
+ actions: CardAction[];
15
+ to?: string[];
16
+ }, delay?: number) => void;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Utility functions for font handling and emoji support
3
+ */
4
+ /**
5
+ * Creates a font family optimized for iOS emoji support
6
+ * Uses system-ui as the primary font for better emoji rendering on iOS
7
+ * @param primaryFont - The base font family string (optional, used as fallback)
8
+ * @returns Font family string optimized for iOS emoji support
9
+ */
10
+ export declare const createIOSOptimizedEmojiFont: (primaryFont?: string) => string;
@@ -0,0 +1,12 @@
1
+ export interface ICitation {
2
+ id: string;
3
+ text?: string;
4
+ title?: string;
5
+ type?: string;
6
+ position?: number;
7
+ entityType?: string;
8
+ entityContext?: string;
9
+ url?: string;
10
+ searchSourceId?: string;
11
+ chunkId?: string;
12
+ }
@@ -0,0 +1,8 @@
1
+ /******
2
+ * CallActionMiddleware
3
+ *
4
+ * Intercepts custom call actions and handles tel: URL navigation
5
+ ******/
6
+ import { IWebChatAction } from "../../../interfaces/IWebChatAction";
7
+ declare const createCallActionMiddleware: () => () => (next: any) => (action: IWebChatAction) => any;
8
+ export default createCallActionMiddleware;
@@ -0,0 +1,4 @@
1
+ import { ILiveChatWidgetAction } from "../../../../../contexts/common/ILiveChatWidgetAction";
2
+ import { ILiveChatWidgetContext } from "../../../../../contexts/common/ILiveChatWidgetContext";
3
+ import { IWebChatAction } from "../../../interfaces/IWebChatAction";
4
+ export declare const createCitationsMiddleware: (state: ILiveChatWidgetContext, dispatch: (action: ILiveChatWidgetAction) => void) => () => (next: (action: IWebChatAction) => void) => (action: IWebChatAction) => void;
@@ -0,0 +1,22 @@
1
+ /******
2
+ * CustomEventMiddleware
3
+ *
4
+ * This middleware is invoked when a custom event is received.
5
+ * The callback is then invoked to handle the custom event.
6
+ ******/
7
+ import { IWebChatAction } from "../../../interfaces/IWebChatAction";
8
+ import { BroadcastService } from "@microsoft/omnichannel-chat-components";
9
+ export declare const isValidCustomEvent: (activity: {
10
+ channelData?: {
11
+ metadata?: {
12
+ customEvent?: string;
13
+ customEventName?: string;
14
+ customEventValue?: unknown;
15
+ };
16
+ };
17
+ from?: {
18
+ role: string;
19
+ };
20
+ }) => boolean;
21
+ declare const createCustomEventMiddleware: (broadcastservice: typeof BroadcastService) => () => (next: (action: IWebChatAction) => void) => (action: IWebChatAction) => void;
22
+ export default createCustomEventMiddleware;
@@ -0,0 +1,5 @@
1
+ import { IWebChatAction } from "../../../interfaces/IWebChatAction";
2
+ export declare const localizedStringsBotInitialsMiddleware: () => ({ dispatch }: {
3
+ dispatch: any;
4
+ }) => (next: any) => (action: IWebChatAction) => any;
5
+ export declare const getOverriddenLocalizedStrings: (existingOverrides?: any) => (strings: any) => any;
@@ -0,0 +1,5 @@
1
+ import { Dispatch } from "react";
2
+ import { ILiveChatWidgetAction } from "../../../../../contexts/common/ILiveChatWidgetAction";
3
+ import { ILiveChatWidgetContext } from "../../../../../contexts/common/ILiveChatWidgetContext";
4
+ import { IWebChatAction } from "../../../interfaces/IWebChatAction";
5
+ export declare const createQueueOverflowMiddleware: (state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>) => () => (next: (action: IWebChatAction) => void) => (action: IWebChatAction) => void;
@@ -0,0 +1,6 @@
1
+ export interface ICustomEvent {
2
+ messageId?: string;
3
+ customEvent?: string;
4
+ customEventName: string;
5
+ customEventValue: unknown;
6
+ }
@@ -12,6 +12,7 @@ export interface ILiveChatWidgetContext {
12
12
  preChatSurveyResponse: string;
13
13
  chatToken: any;
14
14
  renderingMiddlewareProps: IRenderingMiddlewareProps | undefined;
15
+ citations?: Record<string, string>;
15
16
  postChatContext: any;
16
17
  middlewareLocalizedTexts: ILiveChatWidgetLocalizedTexts | undefined;
17
18
  telemetryInternalData: IInternalTelemetryData;
@@ -2,49 +2,50 @@ export declare enum LiveChatWidgetActionType {
2
2
  SET_WIDGET_ELEMENT_ID = 0,
3
3
  SET_RENDERING_MIDDLEWARE_PROPS = 1,
4
4
  SET_MIDDLEWARE_LOCALIZED_TEXTS = 2,
5
- SET_GLOBAL_DIR = 3,
6
- SET_MINIMIZED = 4,
7
- SET_CONVERSATION_STATE = 5,
8
- SET_PREVIOUS_FOCUSED_ELEMENT_ID = 6,
9
- SET_START_CHAT_FAILING = 7,
10
- SET_START_CHAT_FAILURE_TYPE = 8,
11
- SET_OUTSIDE_OPERATING_HOURS = 9,
12
- SET_PRE_CHAT_SURVEY_RESPONSE = 10,
13
- SET_CUSTOM_CONTEXT = 11,
14
- SET_SHOW_CONFIRMATION = 12,
15
- SET_SHOW_EMAIL_TRANSCRIPT_PANE = 13,
16
- SET_PRECHAT_RESPONSE_EMAIL = 14,
17
- SET_AUDIO_NOTIFICATION = 15,
18
- SET_E2VV_ENABLED = 16,
19
- SET_POST_CHAT_CONTEXT = 17,
20
- SHOW_CALLING_CONTAINER = 18,
21
- SET_INCOMING_CALL = 19,
22
- DISABLE_VIDEO_CALL = 20,
23
- DISABLE_LOCAL_VIDEO = 21,
24
- DISABLE_REMOTE_VIDEO = 22,
25
- SET_CHAT_TOKEN = 23,
26
- SET_START_CHAT_BUTTON_DISPLAY = 24,
27
- SET_PROACTIVE_CHAT_PARAMS = 25,
28
- SET_TELEMETRY_DATA = 26,
29
- SET_RECONNECT_ID = 27,
30
- SET_UNREAD_MESSAGE_COUNT = 28,
31
- SET_FOCUS_CHAT_BUTTON = 29,
32
- SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED = 30,
33
- SET_CONVERSATION_ENDED_BY = 31,
34
- SET_WIDGET_STATE = 32,
35
- SET_LIVE_CHAT_CONTEXT = 33,
36
- SET_BOT_OAUTH_SIGNIN_ID = 34,
37
- SET_WIDGET_SIZE = 35,
38
- SET_WIDGET_INSTANCE_ID = 36,
39
- SET_LIVE_CHAT_CONFIG = 37,
40
- SET_POST_CHAT_WORKFLOW_IN_PROGRESS = 38,
41
- SET_INITIAL_CHAT_SDK_REQUEST_ID = 39,
42
- SET_SHOULD_USE_BOT_SURVEY = 40,
43
- SET_CHAT_DISCONNECT_EVENT_RECEIVED = 41,
44
- SET_SURVEY_MODE = 42,
45
- SET_CONFIRMATION_STATE = 43,
46
- SET_POST_CHAT_PARTICIPANT_TYPE = 44,
47
- SET_CONVERSATIONAL_SURVEY_ENABLED = 45,
48
- SET_CONVERSATIONAL_SURVEY_DISPLAY = 46,
49
- GET_IN_MEMORY_STATE = 47
5
+ SET_CITATIONS = 3,
6
+ SET_GLOBAL_DIR = 4,
7
+ SET_MINIMIZED = 5,
8
+ SET_CONVERSATION_STATE = 6,
9
+ SET_PREVIOUS_FOCUSED_ELEMENT_ID = 7,
10
+ SET_START_CHAT_FAILING = 8,
11
+ SET_START_CHAT_FAILURE_TYPE = 9,
12
+ SET_OUTSIDE_OPERATING_HOURS = 10,
13
+ SET_PRE_CHAT_SURVEY_RESPONSE = 11,
14
+ SET_CUSTOM_CONTEXT = 12,
15
+ SET_SHOW_CONFIRMATION = 13,
16
+ SET_SHOW_EMAIL_TRANSCRIPT_PANE = 14,
17
+ SET_PRECHAT_RESPONSE_EMAIL = 15,
18
+ SET_AUDIO_NOTIFICATION = 16,
19
+ SET_E2VV_ENABLED = 17,
20
+ SET_POST_CHAT_CONTEXT = 18,
21
+ SHOW_CALLING_CONTAINER = 19,
22
+ SET_INCOMING_CALL = 20,
23
+ DISABLE_VIDEO_CALL = 21,
24
+ DISABLE_LOCAL_VIDEO = 22,
25
+ DISABLE_REMOTE_VIDEO = 23,
26
+ SET_CHAT_TOKEN = 24,
27
+ SET_START_CHAT_BUTTON_DISPLAY = 25,
28
+ SET_PROACTIVE_CHAT_PARAMS = 26,
29
+ SET_TELEMETRY_DATA = 27,
30
+ SET_RECONNECT_ID = 28,
31
+ SET_UNREAD_MESSAGE_COUNT = 29,
32
+ SET_FOCUS_CHAT_BUTTON = 30,
33
+ SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED = 31,
34
+ SET_CONVERSATION_ENDED_BY = 32,
35
+ SET_WIDGET_STATE = 33,
36
+ SET_LIVE_CHAT_CONTEXT = 34,
37
+ SET_BOT_OAUTH_SIGNIN_ID = 35,
38
+ SET_WIDGET_SIZE = 36,
39
+ SET_WIDGET_INSTANCE_ID = 37,
40
+ SET_LIVE_CHAT_CONFIG = 38,
41
+ SET_POST_CHAT_WORKFLOW_IN_PROGRESS = 39,
42
+ SET_INITIAL_CHAT_SDK_REQUEST_ID = 40,
43
+ SET_SHOULD_USE_BOT_SURVEY = 41,
44
+ SET_CHAT_DISCONNECT_EVENT_RECEIVED = 42,
45
+ SET_SURVEY_MODE = 43,
46
+ SET_CONFIRMATION_STATE = 44,
47
+ SET_POST_CHAT_PARTICIPANT_TYPE = 45,
48
+ SET_CONVERSATIONAL_SURVEY_ENABLED = 46,
49
+ SET_CONVERSATIONAL_SURVEY_DISPLAY = 47,
50
+ GET_IN_MEMORY_STATE = 48
50
51
  }
@@ -1,11 +1,11 @@
1
1
  import { MessagePayload } from "./Constants";
2
2
  export declare class FirstResponseLatencyTracker {
3
3
  private isABotConversation;
4
- private isStarted;
5
- private isEnded;
4
+ private isTracking;
6
5
  private startTrackingMessage?;
7
6
  private stopTrackingMessage?;
8
7
  private isReady;
8
+ private trackingTimeoutId?;
9
9
  constructor();
10
10
  private createTrackingMessage;
11
11
  private startTracking;
@@ -22,3 +22,4 @@ export declare const buildMessagePayload: (activity: IActivity, userId: string)
22
22
  export declare const polyfillMessagePayloadForEvent: (activity: IActivity, payload: MessagePayload, conversationId?: string) => MessagePayload;
23
23
  export declare const getScenarioType: (activity: IActivity) => ScenarioType;
24
24
  export declare const createTrackingMessage: (payload: MessagePayload, type: string) => TrackingMessage;
25
+ export declare const maskPayloadText: (payload: MessagePayload) => MessagePayload;
@@ -7,5 +7,6 @@ import useFacadeChatSDKStore from "./hooks/useFacadeChatSDKStore";
7
7
  export { default as LiveChatWidget } from "./components/livechatwidget/LiveChatWidget";
8
8
  export { getMockChatSDKIfApplicable } from "./components/livechatwidget/common/getMockChatSDKIfApplicable";
9
9
  export { getWidgetCacheId, getWidgetEndChatEventName, ConversationState };
10
+ export { LiveChatWidgetMockType } from "./components/livechatwidget/interfaces/IMockProps";
10
11
  export { encodeComponentString, decodeComponentString, BroadcastService, useChatSDKStore, useChatContextStore, useFacadeChatSDKStore };
11
12
  export * from "./components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "1.8.2-main.fc93d3d",
3
+ "version": "1.8.3-main.1381896",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -86,8 +86,8 @@
86
86
  "dependencies": {
87
87
  "@azure/core-tracing": "^1.2.0",
88
88
  "@microsoft/applicationinsights-web": "^3.3.6",
89
- "@microsoft/omnichannel-chat-components": "1.1.12",
90
- "@microsoft/omnichannel-chat-sdk": "^1.11.4",
89
+ "@microsoft/omnichannel-chat-components": "1.1.15",
90
+ "@microsoft/omnichannel-chat-sdk": "^1.11.6",
91
91
  "@opentelemetry/api": "^1.9.0",
92
92
  "abort-controller": "^3",
93
93
  "abort-controller-es5": "^2.0.1",
@@ -144,7 +144,8 @@
144
144
  "**/abort-controller-es5": "^2.0.1",
145
145
  "**/minimist": "1.2.6",
146
146
  "**/sanitize-html": "2.14.0",
147
- "@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.cd77847.0"
147
+ "@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.cd77847.0",
148
+ "**/semver": "7.5.4"
148
149
  },
149
150
  "jest": {
150
151
  "verbose": true,