@microsoft/omnichannel-chat-widget 0.1.0-main.52da005 → 0.1.0-main.52fa2fc

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 (105) hide show
  1. package/README.md +7 -34
  2. package/lib/cjs/common/Constants.js +12 -3
  3. package/lib/cjs/common/storage/default/defaultCacheManager.js +2 -2
  4. package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +15 -6
  5. package/lib/cjs/common/telemetry/TelemetryConstants.js +35 -4
  6. package/lib/cjs/common/telemetry/TelemetryHelper.js +2 -1
  7. package/lib/cjs/common/utils.js +23 -2
  8. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +12 -19
  9. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +1 -1
  10. package/lib/cjs/components/headerstateful/HeaderStateful.js +5 -2
  11. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +139 -0
  12. package/lib/cjs/components/livechatwidget/common/agentEndConversationHelper.js +36 -0
  13. package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -0
  14. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +66 -14
  15. package/lib/cjs/components/livechatwidget/common/endChat.js +43 -63
  16. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +11 -49
  17. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +11 -7
  18. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +255 -2
  19. package/lib/cjs/components/livechatwidget/common/startChat.js +83 -64
  20. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +91 -45
  21. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +8 -1
  22. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +3 -1
  23. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
  24. package/lib/cjs/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +1 -1
  25. package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +2 -0
  26. package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +2 -0
  27. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +1 -3
  28. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
  29. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +1 -1
  30. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +1 -1
  31. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +2 -14
  32. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -11
  33. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +7 -3
  34. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +75 -11
  35. package/lib/cjs/contexts/common/ConversationEndEntity.js +12 -0
  36. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +11 -7
  37. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +10 -4
  38. package/lib/cjs/contexts/createReducer.js +36 -2
  39. package/lib/cjs/hooks/useDebounce.js +28 -0
  40. package/lib/cjs/hooks/useWindowDimensions.js +30 -0
  41. package/lib/cjs/plugins/newMessageEventHandler.js +14 -0
  42. package/lib/esm/common/Constants.js +10 -2
  43. package/lib/esm/common/storage/default/defaultCacheManager.js +2 -2
  44. package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +15 -6
  45. package/lib/esm/common/telemetry/TelemetryConstants.js +35 -4
  46. package/lib/esm/common/telemetry/TelemetryHelper.js +2 -1
  47. package/lib/esm/common/utils.js +20 -0
  48. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +12 -19
  49. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +1 -1
  50. package/lib/esm/components/headerstateful/HeaderStateful.js +5 -2
  51. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +134 -0
  52. package/lib/esm/components/livechatwidget/common/agentEndConversationHelper.js +30 -0
  53. package/lib/esm/components/livechatwidget/common/createAdapter.js +2 -0
  54. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +66 -14
  55. package/lib/esm/components/livechatwidget/common/endChat.js +45 -65
  56. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +13 -51
  57. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +12 -7
  58. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +255 -3
  59. package/lib/esm/components/livechatwidget/common/startChat.js +83 -64
  60. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +92 -46
  61. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +8 -1
  62. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +3 -1
  63. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
  64. package/lib/esm/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +1 -1
  65. package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +2 -0
  66. package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +2 -0
  67. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +1 -3
  68. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
  69. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +1 -1
  70. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +1 -1
  71. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +2 -14
  72. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -11
  73. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.js +5 -3
  74. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.js +75 -11
  75. package/lib/esm/contexts/common/ConversationEndEntity.js +5 -0
  76. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +11 -7
  77. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +10 -4
  78. package/lib/esm/contexts/createReducer.js +36 -2
  79. package/lib/esm/hooks/useDebounce.js +22 -0
  80. package/lib/esm/hooks/useWindowDimensions.js +23 -0
  81. package/lib/esm/plugins/newMessageEventHandler.js +14 -0
  82. package/lib/types/common/Constants.d.ts +9 -0
  83. package/lib/types/common/storage/default/defaultCacheManager.d.ts +1 -1
  84. package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +1 -1
  85. package/lib/types/common/telemetry/TelemetryConstants.d.ts +31 -6
  86. package/lib/types/common/telemetry/definitions/Contracts.d.ts +2 -0
  87. package/lib/types/common/telemetry/definitions/Payload.d.ts +1 -0
  88. package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +4 -0
  89. package/lib/types/common/utils.d.ts +1 -0
  90. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +0 -7
  91. package/lib/types/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.d.ts +9 -0
  92. package/lib/types/components/livechatwidget/common/agentEndConversationHelper.d.ts +6 -0
  93. package/lib/types/components/livechatwidget/common/initWebChatComposer.d.ts +1 -1
  94. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +1 -1
  95. package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +6 -1
  96. package/lib/types/components/livechatwidget/common/startChat.d.ts +3 -3
  97. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +2 -0
  98. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +1 -1
  99. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentUploadValidatorMiddleware.d.ts +1 -1
  100. package/lib/types/contexts/common/ConversationEndEntity.d.ts +4 -0
  101. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +6 -1
  102. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +11 -7
  103. package/lib/types/hooks/useDebounce.d.ts +3 -0
  104. package/lib/types/hooks/useWindowDimensions.d.ts +4 -0
  105. package/package.json +3 -3
@@ -17,6 +17,8 @@ export declare class Constants {
17
17
  static readonly true = "true";
18
18
  static readonly false = "false";
19
19
  static readonly maximumUnreadMessageCount = 99;
20
+ static readonly userParticipantTypeTag = "User";
21
+ static readonly botParticipantTypeTag = "Bot";
20
22
  static readonly channelIdKey = "ChannelId-";
21
23
  static readonly ChannelId = "lcw";
22
24
  static readonly CustomerTag = "FromCustomer";
@@ -78,6 +80,7 @@ export declare class Constants {
78
80
  static readonly ChatWidgetStateChangedPrefix = "ChatWidgetStateChanged";
79
81
  static readonly PostChatLoadingDurationInMs = 2000;
80
82
  static readonly BrowserUnloadConfirmationMessage = "Do you want to leave chat?";
83
+ static readonly CacheTtlInMinutes = 15;
81
84
  }
82
85
  export declare const Regex: {
83
86
  new (): {};
@@ -125,6 +128,7 @@ export declare class HtmlAttributeNames {
125
128
  static readonly adaptiveCardClassName = "ac-adaptiveCard";
126
129
  static readonly adaptiveCardTextBlockClassName = "ac-textBlock";
127
130
  static readonly adaptiveCardToggleInputClassName = "ac-toggleInput";
131
+ static readonly adaptiveCardActionSetClassName = "ac-actionSet";
128
132
  }
129
133
  export declare class WebChatMiddlewareConstants {
130
134
  static readonly nextVisibleActivity = "nextVisibleActivity";
@@ -132,6 +136,11 @@ export declare class WebChatMiddlewareConstants {
132
136
  static readonly maxTextLength = 6000;
133
137
  static readonly adaptiveCard = "AdaptiveCard";
134
138
  }
139
+ export declare class AMSConstants {
140
+ static readonly supportedImagesMimeTypes: string[];
141
+ static readonly maxSupportedImageSize = 20;
142
+ static readonly maxSupportedFileSize = 300;
143
+ }
135
144
  export declare class MimeTypes {
136
145
  static readonly UnknownFileType = "application/octet-stream";
137
146
  }
@@ -1,4 +1,4 @@
1
1
  export declare class defaultCacheManager {
2
2
  static InternalCache: any;
3
3
  }
4
- export declare const registerBroadcastServiceForLocalStorage: (orgid: string, widgetId: string, widgetInstanceId: string) => void;
4
+ export declare const registerBroadcastServiceForLocalStorage: (orgid: string, widgetId: string, widgetInstanceId: string, ttlInMins: number) => void;
@@ -1,2 +1,2 @@
1
1
  import { IContextDataStore } from "../../interfaces/IContextDataStore";
2
- export declare const defaultClientDataStoreProvider: () => IContextDataStore;
2
+ export declare const defaultClientDataStoreProvider: (cacheTtlinMins?: number) => IContextDataStore;
@@ -42,7 +42,13 @@ export declare enum BroadcastEvent {
42
42
  CloseChat = "CloseChat",
43
43
  InitiateEndChatOnBrowserUnload = "InitiateEndChatOnBrowserUnload",
44
44
  ClosePopoutWindow = "ClosePopoutWindow",
45
- RaiseErrorEvent = "RaiseErrorEvent"
45
+ RaiseErrorEvent = "RaiseErrorEvent",
46
+ NetworkDisconnected = "NetworkDisconnected",
47
+ NetworkReconnected = "NetworkReconnected",
48
+ SigninCardReceived = "SignInCardReceived",
49
+ BotAuthConfigRequest = "BotAuthConfigRequest",
50
+ BotAuthConfigResponse = "BotAuthConfigResponse",
51
+ HideChatVisibilityChangeEvent = "hideChatVisibilityChangeEvent"
46
52
  }
47
53
  export declare enum TelemetryEvent {
48
54
  CallAdded = "CallAdded",
@@ -77,11 +83,10 @@ export declare enum TelemetryEvent {
77
83
  GetConversationDetailsCallFailed = "GetConversationDetailsCallFailed",
78
84
  EndChatSDKCallFailed = "EndChatSDKCallFailed",
79
85
  GetChatReconnectContextSDKCallFailed = "GetChatReconnectContextSDKCallFailed",
80
- PostChatContextCallSucceed = "PostChatContextCallSucceed",
81
- PostChatContextCallFailed = "PostChatContextCallFailed",
82
86
  ParseAdaptiveCardFailed = "ParseAdaptiveCardFailed",
83
87
  ClientDataStoreProviderFailed = "ClientDataStoreProviderFailed",
84
88
  InMemoryDataStoreFailed = "InMemoryDataStoreFailed",
89
+ ChatVisibilityChanged = "ChatVisibilityChanged",
85
90
  WebChatLoaded = "WebChatLoaded",
86
91
  LCWChatButtonClicked = "LCWChatButtonClicked",
87
92
  LCWChatButtonShow = "LCWChatButtonShow",
@@ -89,6 +94,7 @@ export declare enum TelemetryEvent {
89
94
  WidgetLoadComplete = "WidgetLoadComplete",
90
95
  WidgetLoadFailed = "WidgetLoadFailed",
91
96
  StartChatMethodException = "StartChatMethodException",
97
+ CloseChatCall = "CloseChatCall",
92
98
  CloseChatMethodException = "CloseChatMethodException",
93
99
  PrechatSurveyLoaded = "PrechatSurveyLoaded",
94
100
  PrechatSubmitted = "PrechatSubmitted",
@@ -102,6 +108,7 @@ export declare enum TelemetryEvent {
102
108
  DownloadTranscriptResponseNullOrUndefined = "DownloadTranscriptResponseNullOrUndefined",
103
109
  EmailTranscriptSent = "EmailTranscriptSent",
104
110
  EmailTranscriptFailed = "EmailTranscriptFailed",
111
+ ErrorUIPaneLoaded = "ErrorUIPaneLoaded",
105
112
  DownloadTranscriptFailed = "DownloadTranscriptFailed",
106
113
  StartChatFailed = "StartChatFailed",
107
114
  IC3ThreadUpdateEventReceived = "IC3ThreadUpdateEventReceived",
@@ -110,8 +117,6 @@ export declare enum TelemetryEvent {
110
117
  LoadingPaneLoaded = "LoadingPaneLoaded",
111
118
  EmailTranscriptLoaded = "EmailTranscriptLoaded",
112
119
  OutOfOfficePaneLoaded = "OutOfOfficePaneLoaded",
113
- PostChatSurveyLoadingPaneLoaded = "PostChatSurveyLoadingPaneLoaded",
114
- PostChatSurveyLoaded = "PostChatSurveyLoaded",
115
120
  ConfirmationPaneLoaded = "ConfirmationPaneLoaded",
116
121
  ProactiveChatPaneLoaded = "ProactiveChatPaneLoaded",
117
122
  ReconnectChatPaneLoaded = "ReconnectChatPaneLoaded",
@@ -124,6 +129,7 @@ export declare enum TelemetryEvent {
124
129
  SuppressBotMagicCodeSucceeded = "SuppressBotMagicCodeSucceeded",
125
130
  SuppressBotMagicCodeFailed = "SuppressBotMagicCodeFailed",
126
131
  GetConversationDetailsException = "GetConversationDetailsException",
132
+ AppStatesException = "AppStatesException",
127
133
  BrowserUnloadEventStarted = "BrowserUnloadEventStarted",
128
134
  GetAuthTokenCalled = "GetAuthTokenCalled",
129
135
  GetAuthTokenFailed = "GetAuthTokenFailed",
@@ -131,15 +137,23 @@ export declare enum TelemetryEvent {
131
137
  CustomerVoiceResponsePageLoaded = "CustomerVoiceResponsePageLoaded",
132
138
  CustomerVoiceFormResponseSubmitted = "CustomerVoiceFormResponseSubmitted",
133
139
  CustomerVoiceFormResponseError = "CustomerVoiceFormResponseError",
140
+ BotAuthActivityEmptySasUrl = "BotAuthActivityEmptySasUrl",
141
+ SetBotAuthProviderFetchConfig = "SetBotAuthProviderFetchConfig",
142
+ SetBotAuthProviderHideCard = "SetBotAuthProviderHideCard",
143
+ SetBotAuthProviderDisplayCard = "SetBotAuthProviderDisplayCard",
144
+ SetBotAuthProviderNotFound = "SetBotAuthProviderNotFound",
134
145
  ProcessingHTMLTextMiddlewareFailed = "ProcessingHTMLTextMiddlewareFailed",
135
146
  ProcessingSanitizationMiddlewareFailed = "ProcessingSanitizationMiddlewareFailed",
136
147
  FormatTagsMiddlewareJSONStringifyFailed = "FormatTagsMiddlewareJSONStringifyFailed",
148
+ AttachmentUploadValidatorMiddlewareFailed = "AttachmentUploadValidatorMiddlewareFailed",
137
149
  QueuePositionMessageRecieved = "QueuePositionMessageRecieved",
138
150
  AverageWaitTimeMessageRecieved = "AverageWaitTimeMessageRecieved",
139
151
  DataMaskingRuleApplied = "DataMaskingRuleApplied",
140
152
  DataMaskingRuleApplyFailed = "DataMaskingRuleApplyFailed",
141
153
  IC3ClientEvent = "IC3ClientEvent",
142
154
  ConversationEndedThreadEventReceived = "ConversationEndedThreadEventReceived",
155
+ ConversationEndedByCustomer = "ConversationEndedByCustomer",
156
+ ConversationEndedByAgent = "ConversationEndedByAgent",
143
157
  InvalidConfiguration = "InvalidConfiguration",
144
158
  SendTypingIndicatorSucceeded = "SendTypingIndicatorSucceeded",
145
159
  SendTypingIndicatorFailed = "SendTypingIndicatorFailed",
@@ -157,9 +171,20 @@ export declare enum TelemetryEvent {
157
171
  ReconnectChatMinimize = "ReconnectChatMinimize",
158
172
  MessageSent = "MessageSent",
159
173
  MessageReceived = "MessageReceived",
174
+ SystemMessageReceived = "SystemMessageReceived",
175
+ HistoryMessageReceived = "HistoryMessageReceived",
160
176
  CustomContextReceived = "CustomContextReceived",
161
177
  NetworkDisconnected = "NetworkDisconnected",
162
- NetworkReconnected = "NetworkReconnected"
178
+ NetworkReconnected = "NetworkReconnected",
179
+ LinkModePostChatWorkflowStarted = "LinkModePostChatWorkflowStarted",
180
+ EmbedModePostChatWorkflowStarted = "EmbedModePostChatWorkflowStarted",
181
+ PostChatWorkflowFromCustomer = "PostChatWorkflowFromCustomer",
182
+ PostChatWorkflowFromAgent = "PostChatWorkflowFromAgent",
183
+ PostChatWorkflowFromBot = "PostChatWorkflowFromBot",
184
+ PostChatContextCallSucceed = "PostChatContextCallSucceed",
185
+ PostChatContextCallFailed = "PostChatContextCallFailed",
186
+ PostChatSurveyLoadingPaneLoaded = "PostChatSurveyLoadingPaneLoaded",
187
+ PostChatSurveyLoaded = "PostChatSurveyLoaded"
163
188
  }
164
189
  export interface TelemetryInput {
165
190
  scenarioType: ScenarioType;
@@ -32,6 +32,8 @@ export interface LoadContract extends BaseContract {
32
32
  export interface ActionsContract extends BaseContract {
33
33
  Event?: string;
34
34
  ActionType?: string;
35
+ Description?: string;
36
+ CustomProperties?: any;
35
37
  }
36
38
  export interface IC3ClientContract extends BaseContract {
37
39
  Event?: string;
@@ -72,6 +72,7 @@ export interface ActionTelemetryData extends BaseTelemetryData {
72
72
  ActionType?: string;
73
73
  ExceptionDetails?: object;
74
74
  Description?: string;
75
+ CustomProperties?: any;
75
76
  }
76
77
  export interface CallingTelemetryData extends BaseTelemetryData {
77
78
  CallId?: string;
@@ -41,4 +41,8 @@ export interface ITelemetryConfig {
41
41
  * Omnichannel Chat SDK Version
42
42
  */
43
43
  OCChatSDKVersion: string;
44
+ /**
45
+ * LCW Runtime Id
46
+ */
47
+ LCWRuntimeId?: string;
44
48
  }
@@ -28,3 +28,4 @@ export declare const getStateFromCache: (orgId: string, widgetId: string, widget
28
28
  export declare const isUndefinedOrEmpty: (object: any) => boolean;
29
29
  export declare const addDelayInMs: (ms: number) => Promise<void>;
30
30
  export declare const getBroadcastChannelName: (widgetId: string, widgetInstanceId: string) => string;
31
+ export declare const debounceLeading: (fn: any, ms?: number) => (...args: any[]) => void;
@@ -1,14 +1,7 @@
1
- import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
2
1
  import { IConfirmationPaneStatefulProps } from "./IConfirmationPaneStatefulProps";
3
2
  export interface IConfirmationPaneStatefulParams extends IConfirmationPaneStatefulProps {
4
3
  /**
5
4
  * setPostChatContext: Internal Prop injected for setting Post Chat Context
6
5
  */
7
6
  setPostChatContext: () => Promise<void>;
8
- /**
9
- * prepareEndChat: Internal Prop injected for checking PostChat contexts and trigerring end of chat
10
- * @param adapter : The chat adapter for the live chat session
11
- * @param state : The chat state where the conversation is currently in
12
- */
13
- prepareEndChat: (adapter: any, state: ILiveChatWidgetContext) => Promise<void>;
14
7
  }
@@ -0,0 +1,9 @@
1
+ import { IActivitySubscriber } from "./IActivitySubscriber";
2
+ export declare class BotAuthActivitySubscriber implements IActivitySubscriber {
3
+ observer: any;
4
+ private signInCardSeen;
5
+ constructor();
6
+ applicable(activity: any): boolean;
7
+ apply(activity: any): Promise<any>;
8
+ next(activity: any): Promise<any>;
9
+ }
@@ -0,0 +1,6 @@
1
+ import { Dispatch } from "react";
2
+ import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
+ import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
4
+ import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
+ declare const handleAgentEndConversation: (props: ILiveChatWidgetProps, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>) => void;
6
+ export { handleAgentEndConversation };
@@ -3,4 +3,4 @@ import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetA
3
3
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
4
4
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
5
  import { IWebChatProps } from "../../webchatcontainerstateful/interfaces/IWebChatProps";
6
- export declare const initWebChatComposer: (props: ILiveChatWidgetProps, chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setWebChatStyles: any) => IWebChatProps;
6
+ export declare const initWebChatComposer: (props: ILiveChatWidgetProps, chatSDK: any, setAdapter: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, adapter: any, setWebChatStyles: any) => IWebChatProps;
@@ -5,5 +5,5 @@ import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetA
5
5
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
6
6
  declare const handleChatReconnect: (chatSDK: any, props: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, initStartChat: any, state: ILiveChatWidgetContext) => Promise<void>;
7
7
  declare const getChatReconnectContext: (chatSDK: any, chatConfig: ChatConfig, props: any, isAuthenticatedChat: boolean) => Promise<any>;
8
- declare const isReconnectEnabled: (chatConfig: ChatConfig) => any;
8
+ declare const isReconnectEnabled: (chatConfig?: ChatConfig | undefined) => boolean;
9
9
  export { handleChatReconnect, isReconnectEnabled, getChatReconnectContext };
@@ -1,3 +1,8 @@
1
1
  import { Dispatch } from "react";
2
2
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
- export declare const setPostChatContextAndLoadSurvey: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, persistedChat?: boolean | undefined) => Promise<void>;
3
+ import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
4
+ import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
+ declare const setPostChatContextAndLoadSurvey: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, persistedChat?: boolean | undefined) => Promise<void>;
6
+ declare const checkPostChatEnabled: (props: ILiveChatWidgetProps, state: ILiveChatWidgetContext) => boolean;
7
+ declare const initiatePostChat: (props: ILiveChatWidgetProps, chatSDK: any, setAdapter: any, setWebChatStyles: any, dispatch: Dispatch<ILiveChatWidgetAction>, adapter: any, state: ILiveChatWidgetContext) => Promise<void>;
8
+ export { setPostChatContextAndLoadSurvey, checkPostChatEnabled, initiatePostChat };
@@ -1,10 +1,10 @@
1
- import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
2
1
  import { Dispatch } from "react";
3
2
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
4
3
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
5
4
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
+ import StartChatOptionalParams from "@microsoft/omnichannel-chat-sdk/lib/core/StartChatOptionalParams";
6
6
  declare const prepareStartChat: (props: ILiveChatWidgetProps, chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any) => Promise<void>;
7
7
  declare const setPreChatAndInitiateChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, isProactiveChat?: boolean | undefined, proactiveChatEnablePrechatState?: boolean | undefined, state?: ILiveChatWidgetContext | undefined, props?: ILiveChatWidgetProps | undefined) => Promise<void>;
8
- declare const initStartChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, params?: any, persistedState?: any) => Promise<void>;
9
- declare const checkIfConversationStillValid: (chatSDK: any, props: any, requestId: any, dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<boolean>;
8
+ declare const initStartChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, props?: ILiveChatWidgetProps | undefined, params?: StartChatOptionalParams | undefined, persistedState?: any) => Promise<void>;
9
+ declare const checkIfConversationStillValid: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, state: ILiveChatWidgetContext) => Promise<boolean>;
10
10
  export { prepareStartChat, initStartChat, setPreChatAndInitiateChat, checkIfConversationStillValid };
@@ -4,6 +4,7 @@ export interface ILiveChatWidgetControlProps {
4
4
  hideCallingContainer?: boolean;
5
5
  hideChatButton?: boolean;
6
6
  hideConfirmationPane?: boolean;
7
+ hideErrorUIPane?: boolean;
7
8
  hideFooter?: boolean;
8
9
  hideHeader?: boolean;
9
10
  hideLoadingPane?: boolean;
@@ -15,4 +16,5 @@ export interface ILiveChatWidgetControlProps {
15
16
  hideWebChatContainer?: boolean;
16
17
  hideStartChatButton?: boolean;
17
18
  widgetInstanceId?: string | undefined;
19
+ cacheTtlInMins?: number;
18
20
  }
@@ -1 +1 @@
1
- export declare const SendingTimestamp: ({ args }: any) => JSX.Element;
1
+ export declare const SendingTimestamp: () => JSX.Element;
@@ -5,7 +5,7 @@
5
5
  ******/
6
6
  import { IWebChatAction } from "../../../interfaces/IWebChatAction";
7
7
  import { ILiveChatWidgetLocalizedTexts } from "../../../../../contexts/common/ILiveChatWidgetLocalizedTexts";
8
- declare const createAttachmentUploadValidatorMiddleware: (allowedFileExtensions: string, maxUploadFileSize: string, localizedTexts: ILiveChatWidgetLocalizedTexts) => ({ dispatch }: {
8
+ declare const createAttachmentUploadValidatorMiddleware: (allowedFileExtensions: string, maxFileSizeSupportedByDynamics: string, localizedTexts: ILiveChatWidgetLocalizedTexts) => ({ dispatch }: {
9
9
  dispatch: any;
10
10
  }) => (next: any) => (action: IWebChatAction) => any;
11
11
  export default createAttachmentUploadValidatorMiddleware;
@@ -0,0 +1,4 @@
1
+ export declare enum ConversationEndEntity {
2
+ Customer = 0,
3
+ Agent = 1
4
+ }
@@ -3,6 +3,7 @@ import { ConversationState } from "./ConversationState";
3
3
  import { IInternalTelemetryData } from "../../common/telemetry/interfaces/IInternalTelemetryData";
4
4
  import { ILiveChatWidgetLocalizedTexts } from "./ILiveChatWidgetLocalizedTexts";
5
5
  import { IRenderingMiddlewareProps } from "../../components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps";
6
+ import { ConversationEndEntity } from "./ConversationEndEntity";
6
7
  export interface ILiveChatWidgetContext {
7
8
  domainStates: {
8
9
  liveChatConfig: ChatConfig | undefined;
@@ -18,6 +19,7 @@ export interface ILiveChatWidgetContext {
18
19
  customContext: any;
19
20
  widgetSize: any;
20
21
  widgetInstanceId: string;
22
+ initialChatSdkRequestId: string;
21
23
  };
22
24
  appStates: {
23
25
  conversationState: ConversationState;
@@ -37,7 +39,10 @@ export interface ILiveChatWidgetContext {
37
39
  };
38
40
  e2vvEnabled: boolean;
39
41
  unreadMessageCount: number;
40
- conversationEndedByAgent: boolean;
42
+ conversationEndedByAgentEventReceived: boolean;
43
+ conversationEndedBy: ConversationEndEntity | undefined;
44
+ postChatWorkflowInProgress: boolean;
45
+ shouldUseBotSurvey: boolean;
41
46
  };
42
47
  uiStates: {
43
48
  showConfirmationPane: boolean;
@@ -28,11 +28,15 @@ export declare enum LiveChatWidgetActionType {
28
28
  SET_RECONNECT_ID = 26,
29
29
  SET_UNREAD_MESSAGE_COUNT = 27,
30
30
  SET_FOCUS_CHAT_BUTTON = 28,
31
- SET_CONVERSATION_ENDED_BY_AGENT = 29,
32
- SET_WIDGET_STATE = 30,
33
- SET_LIVE_CHAT_CONTEXT = 31,
34
- SET_BOT_OAUTH_SIGNIN_ID = 32,
35
- SET_WIDGET_SIZE = 33,
36
- SET_WIDGET_INSTANCE_ID = 34,
37
- SET_LIVE_CHAT_CONFIG = 35
31
+ SET_CONVERSATION_ENDED_BY_AGENT_EVENT_RECEIVED = 29,
32
+ SET_CONVERSATION_ENDED_BY = 30,
33
+ SET_WIDGET_STATE = 31,
34
+ SET_LIVE_CHAT_CONTEXT = 32,
35
+ SET_BOT_OAUTH_SIGNIN_ID = 33,
36
+ SET_WIDGET_SIZE = 34,
37
+ SET_WIDGET_INSTANCE_ID = 35,
38
+ SET_LIVE_CHAT_CONFIG = 36,
39
+ SET_POST_CHAT_WORKFLOW_IN_PROGRESS = 37,
40
+ SET_INITIAL_CHAT_SDK_REQUEST_ID = 38,
41
+ SET_SHOULD_USE_BOT_SURVEY = 39
38
42
  }
@@ -0,0 +1,3 @@
1
+ declare type FunctionType = (...args: unknown[]) => void;
2
+ export default function useDebounce<Fn extends FunctionType>(func: Fn, delay?: number): Fn;
3
+ export {};
@@ -0,0 +1,4 @@
1
+ export default function useWindowDimensions(delay?: number): {
2
+ width: number;
3
+ height: number;
4
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "0.1.0-main.52da005",
3
+ "version": "0.1.0-main.52fa2fc",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -74,8 +74,8 @@
74
74
  },
75
75
  "dependencies": {
76
76
  "@fluentui/react": "^8.49.1",
77
- "@microsoft/omnichannel-chat-components": "0.1.0-main.d066b23",
78
- "@microsoft/omnichannel-chat-sdk": "1.1.1-main.b88f92d",
77
+ "@microsoft/omnichannel-chat-components": "0.1.0-main.f4c21f0",
78
+ "@microsoft/omnichannel-chat-sdk": "1.2.1-main.171bfbe",
79
79
  "abort-controller-es5": "^2.0.1",
80
80
  "dompurify": "^2.3.4",
81
81
  "markdown-it": "^12.3.2",