@microsoft/omnichannel-chat-widget 0.1.0-main.c461296 → 0.1.0-main.cda7a31

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 (179) hide show
  1. package/README.md +35 -11
  2. package/lib/cjs/common/Constants.js +50 -6
  3. package/lib/cjs/common/storage/default/defaultCacheManager.js +34 -0
  4. package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +114 -0
  5. package/lib/cjs/common/storage/default/defaultInMemoryDataStore.js +86 -0
  6. package/lib/cjs/common/telemetry/TelemetryConstants.js +51 -3
  7. package/lib/cjs/common/telemetry/TelemetryHelper.js +13 -0
  8. package/lib/cjs/common/telemetry/TelemetryManager.js +16 -5
  9. package/lib/cjs/common/telemetry/defaultConfigs/defaultAriaConfig.js +1 -1
  10. package/lib/cjs/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
  11. package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +54 -21
  12. package/lib/cjs/common/telemetry/loggers/consoleLogger.js +6 -5
  13. package/lib/cjs/common/utils.js +89 -2
  14. package/lib/cjs/components/callingcontainerstateful/CallingContainerStateful.js +14 -0
  15. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +20 -4
  16. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +8 -44
  17. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +4 -4
  18. package/lib/cjs/components/footerstateful/FooterStateful.js +6 -15
  19. package/lib/cjs/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +11 -2
  20. package/lib/cjs/components/headerstateful/HeaderStateful.js +15 -14
  21. package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +44 -0
  22. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +23 -0
  23. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
  24. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +39 -0
  25. package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +70 -0
  26. package/lib/cjs/components/livechatwidget/common/Deferred.js +42 -0
  27. package/lib/cjs/components/livechatwidget/common/authHelper.js +65 -0
  28. package/lib/cjs/components/livechatwidget/common/createAdapter.js +13 -1
  29. package/lib/cjs/components/livechatwidget/common/createFooter.js +7 -16
  30. package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +12 -0
  31. package/lib/cjs/components/livechatwidget/common/createMarkdown.js +31 -30
  32. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +36 -20
  33. package/lib/cjs/components/livechatwidget/common/endChat.js +93 -10
  34. package/lib/cjs/components/livechatwidget/common/initCallingSdk.js +1 -1
  35. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +27 -3
  36. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +144 -39
  37. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +6 -17
  38. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +0 -4
  39. package/lib/cjs/components/livechatwidget/common/shareObservable.js +45 -0
  40. package/lib/cjs/components/livechatwidget/common/startChat.js +166 -50
  41. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +310 -73
  42. package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +8 -0
  43. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +6 -4
  44. package/lib/cjs/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.js +1 -0
  45. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +5 -10
  46. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +17 -1
  47. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +98 -2
  48. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +4 -1
  49. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +11 -0
  50. package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +2 -0
  51. package/lib/cjs/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.js +1 -0
  52. package/lib/cjs/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.js +1 -0
  53. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +14 -0
  54. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +16 -2
  55. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +2 -1
  56. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +52 -0
  57. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +98 -0
  58. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.js +10 -0
  59. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +117 -0
  60. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +45 -0
  61. package/lib/cjs/contexts/common/ConversationState.js +3 -2
  62. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +11 -8
  63. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +15 -6
  64. package/lib/cjs/contexts/createReducer.js +26 -12
  65. package/lib/cjs/controller/componentController.js +3 -3
  66. package/lib/cjs/plugins/newMessageEventHandler.js +10 -13
  67. package/lib/esm/common/Constants.js +46 -5
  68. package/lib/esm/common/storage/default/defaultCacheManager.js +19 -0
  69. package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +102 -0
  70. package/lib/esm/common/storage/default/defaultInMemoryDataStore.js +71 -0
  71. package/lib/esm/common/telemetry/TelemetryConstants.js +51 -3
  72. package/lib/esm/common/telemetry/TelemetryHelper.js +13 -1
  73. package/lib/esm/common/telemetry/TelemetryManager.js +14 -5
  74. package/lib/esm/common/telemetry/defaultConfigs/defaultAriaConfig.js +1 -1
  75. package/lib/esm/common/telemetry/defaultConfigs/defaultTelemetryConfiguration.js +4 -1
  76. package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +55 -17
  77. package/lib/esm/common/telemetry/loggers/consoleLogger.js +6 -5
  78. package/lib/esm/common/utils.js +64 -1
  79. package/lib/esm/components/callingcontainerstateful/CallingContainerStateful.js +14 -0
  80. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +22 -7
  81. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +11 -42
  82. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +4 -4
  83. package/lib/esm/components/footerstateful/FooterStateful.js +6 -15
  84. package/lib/esm/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.js +9 -3
  85. package/lib/esm/components/headerstateful/HeaderStateful.js +15 -14
  86. package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +34 -0
  87. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +14 -0
  88. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.js +1 -0
  89. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +29 -0
  90. package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +59 -0
  91. package/lib/esm/components/livechatwidget/common/Deferred.js +33 -0
  92. package/lib/esm/components/livechatwidget/common/authHelper.js +50 -0
  93. package/lib/esm/components/livechatwidget/common/createAdapter.js +12 -2
  94. package/lib/esm/components/livechatwidget/common/createFooter.js +4 -15
  95. package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +8 -0
  96. package/lib/esm/components/livechatwidget/common/createMarkdown.js +31 -30
  97. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +36 -21
  98. package/lib/esm/components/livechatwidget/common/endChat.js +89 -11
  99. package/lib/esm/components/livechatwidget/common/initCallingSdk.js +1 -1
  100. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +25 -5
  101. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +134 -41
  102. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +5 -14
  103. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +0 -4
  104. package/lib/esm/components/livechatwidget/common/shareObservable.js +38 -0
  105. package/lib/esm/components/livechatwidget/common/startChat.js +161 -53
  106. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +298 -78
  107. package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +6 -0
  108. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +5 -4
  109. package/lib/esm/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.js +1 -0
  110. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +7 -11
  111. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +17 -1
  112. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +87 -2
  113. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +3 -1
  114. package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +4 -0
  115. package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +2 -0
  116. package/lib/esm/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.js +1 -0
  117. package/lib/esm/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.js +1 -0
  118. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +5 -0
  119. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +16 -2
  120. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +2 -1
  121. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.js +41 -0
  122. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.js +94 -0
  123. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.js +3 -0
  124. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.js +107 -0
  125. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.js +32 -0
  126. package/lib/esm/contexts/common/ConversationState.js +3 -2
  127. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +11 -8
  128. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +13 -6
  129. package/lib/esm/contexts/createReducer.js +26 -11
  130. package/lib/esm/controller/componentController.js +3 -3
  131. package/lib/esm/plugins/newMessageEventHandler.js +10 -12
  132. package/lib/types/common/Constants.d.ts +25 -2
  133. package/lib/types/common/interfaces/IContextDataStore.d.ts +2 -2
  134. package/lib/types/common/storage/default/defaultCacheManager.d.ts +4 -0
  135. package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +2 -0
  136. package/lib/types/common/storage/default/defaultInMemoryDataStore.d.ts +6 -0
  137. package/lib/types/common/telemetry/TelemetryConstants.d.ts +36 -5
  138. package/lib/types/common/telemetry/TelemetryHelper.d.ts +2 -0
  139. package/lib/types/common/telemetry/definitions/Payload.d.ts +12 -9
  140. package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +3 -3
  141. package/lib/types/common/utils.d.ts +8 -1
  142. package/lib/types/components/confirmationpanestateful/interfaces/IConfirmationPaneStatefulParams.d.ts +4 -4
  143. package/lib/types/components/footerstateful/audionotificationstateful/interfaces/IAudioNotificationStatefulParams.d.ts +0 -1
  144. package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +2 -1
  145. package/lib/types/components/livechatwidget/common/ActivityStreamHandler.d.ts +14 -0
  146. package/lib/types/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.d.ts +5 -0
  147. package/lib/types/components/livechatwidget/common/ActivitySubscriber/IActivitySubscriber.d.ts +6 -0
  148. package/lib/types/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.d.ts +7 -0
  149. package/lib/types/components/livechatwidget/common/ChatAdapterShim.d.ts +7 -0
  150. package/lib/types/components/livechatwidget/common/Deferred.d.ts +9 -0
  151. package/lib/types/components/livechatwidget/common/authHelper.d.ts +5 -0
  152. package/lib/types/components/livechatwidget/common/endChat.d.ts +4 -1
  153. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +6 -2
  154. package/lib/types/components/livechatwidget/common/shareObservable.d.ts +1 -0
  155. package/lib/types/components/livechatwidget/common/startChat.d.ts +4 -2
  156. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts +1 -0
  157. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +1 -0
  158. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +4 -3
  159. package/lib/types/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.d.ts +2 -2
  160. package/lib/types/components/postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps.d.ts +4 -0
  161. package/lib/types/components/reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps.d.ts +1 -1
  162. package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.d.ts +2 -0
  163. package/lib/types/components/webchatcontainerstateful/common/mockchatsdk.d.ts +1 -0
  164. package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +4 -0
  165. package/lib/types/components/webchatcontainerstateful/interfaces/IBotMagicCodeConfig.d.ts +4 -0
  166. package/lib/types/components/webchatcontainerstateful/interfaces/IRenderingMiddlewareProps.d.ts +2 -1
  167. package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +4 -0
  168. package/lib/types/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.d.ts +3 -0
  169. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -1
  170. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.d.ts +2 -0
  171. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/cardActionMiddleware.spec.d.ts +1 -0
  172. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultReceivedMessageAnchorStyles.d.ts +2 -0
  173. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/messageTimestampMiddleware.d.ts +5 -0
  174. package/lib/types/components/webchatcontainerstateful/webchatcontroller/webchattelemetry/WebChatLogger.d.ts +1 -0
  175. package/lib/types/contexts/common/ConversationState.d.ts +3 -2
  176. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +4 -2
  177. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +12 -9
  178. package/lib/types/contexts/common/LiveChatWidgetContextInitialState.d.ts +1 -2
  179. package/package.json +9 -9
@@ -1,7 +1,11 @@
1
1
  import "regenerator-runtime/runtime";
2
+ import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
2
3
  import { Dispatch } from "react";
3
4
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
4
5
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
6
+ declare const getChatReconnectContext: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, isReconnectEnabled?: boolean | undefined, reconnectId?: string | undefined) => Promise<any>;
5
7
  declare const getReconnectIdForAuthenticatedChat: (props: ILiveChatWidgetProps, chatSDK: any) => Promise<string | undefined>;
6
- declare const handleUnauthenticatedReconnectChat: (dispatch: Dispatch<ILiveChatWidgetAction>, reconnectId: string, initStartChat: any) => Promise<void>;
7
- export { getReconnectIdForAuthenticatedChat, handleUnauthenticatedReconnectChat };
8
+ declare const handleUnauthenticatedReconnectChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, isReconnectEnabled: boolean | undefined, reconnectId: string, initStartChat: any, redirectInSameWindow: boolean | undefined) => Promise<void>;
9
+ declare const startUnauthenticatedReconnectChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, isReconnectEnabled: boolean | undefined, reconnectId: string, initStartChat: any) => Promise<void>;
10
+ declare const handleRedirectUnauthenticatedReconnectChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, initStartChat: any, isReconnectEnabled: boolean | undefined, reconnectId: string, redirectInSameWindow: boolean | undefined) => Promise<void>;
11
+ export { getChatReconnectContext, getReconnectIdForAuthenticatedChat, handleUnauthenticatedReconnectChat, startUnauthenticatedReconnectChat, handleRedirectUnauthenticatedReconnectChat };
@@ -0,0 +1 @@
1
+ export declare function shareObservable(observable: any): any;
@@ -1,7 +1,9 @@
1
+ import ChatConfig from "@microsoft/omnichannel-chat-sdk/lib/core/ChatConfig";
1
2
  import { Dispatch } from "react";
2
3
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
4
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
4
5
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
6
  declare const prepareStartChat: (props: ILiveChatWidgetProps, chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any) => Promise<void>;
6
- declare const initStartChat: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, params?: any, persistedState?: any) => Promise<void>;
7
- export { prepareStartChat, initStartChat };
7
+ declare const setPreChatAndInitiateChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string | undefined) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, isProactiveChat?: boolean | undefined, proactiveChatEnablePrechatState?: boolean | 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
+ export { prepareStartChat, initStartChat, setPreChatAndInitiateChat };
@@ -9,6 +9,7 @@ export interface ILiveChatWidgetComponentOverrides {
9
9
  outOfOfficeHoursPane?: ReactNode | string;
10
10
  postChatLoadingPane?: ReactNode | string;
11
11
  postChatSurveyPane?: ReactNode | string;
12
+ preChatSurveyPane?: ReactNode | string;
12
13
  proactiveChatPane?: ReactNode | string;
13
14
  reconnectChatPane?: ReactNode | string;
14
15
  webChatContainer?: ReactNode | string;
@@ -14,4 +14,5 @@ export interface ILiveChatWidgetControlProps {
14
14
  hideReconnectChatPane?: boolean;
15
15
  hideWebChatContainer?: boolean;
16
16
  skipChatButtonRendering?: boolean;
17
+ widgetInstanceId?: string | undefined;
17
18
  }
@@ -12,7 +12,6 @@ import { ILiveChatWidgetControlProps } from "./ILiveChatWidgetControlProps";
12
12
  import { ILiveChatWidgetStyleProps } from "./ILiveChatWidgetStyleProps";
13
13
  import { ILoadingPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/loadingpane/interfaces/ILoadingPaneProps";
14
14
  import { IOOOHPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/outofofficehourspane/interfaces/IOOOHPaneProps";
15
- import { IPostChatSurveyPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/postchatsurveypane/interfaces/IPostChatSurveyPaneProps";
16
15
  import { IPreChatSurveyPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneProps";
17
16
  import { IProactiveChatPaneStatefulProps } from "../../proactivechatpanestateful/interfaces/IProactiveChatPaneStatefulProps";
18
17
  import { IReconnectChatPaneStatefulProps } from "../../reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps";
@@ -21,6 +20,7 @@ import { IWebChatContainerStatefulProps } from "../../webchatcontainerstateful/i
21
20
  import { OmnichannelChatSDK } from "@microsoft/omnichannel-chat-sdk";
22
21
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
23
22
  import { IContextDataStore } from "../../../common/interfaces/IContextDataStore";
23
+ import { IPostChatSurveyPaneStatefulProps } from "../../postchatsurveypanestateful/interfaces/IPostChatSurveyPaneStatefulProps";
24
24
  export interface ILiveChatWidgetProps {
25
25
  audioNotificationProps?: IAudioNotificationProps;
26
26
  callingContainerProps?: ICallingContainerProps;
@@ -40,13 +40,14 @@ export interface ILiveChatWidgetProps {
40
40
  outOfOfficeHeaderProps?: IHeaderProps;
41
41
  outOfOfficeHoursPaneProps?: IOOOHPaneProps;
42
42
  postChatLoadingPaneProps?: ILoadingPaneProps;
43
- postChatSurveyPaneProps?: IPostChatSurveyPaneProps;
43
+ postChatSurveyPaneProps?: IPostChatSurveyPaneStatefulProps;
44
44
  preChatSurveyPaneProps?: IPreChatSurveyPaneProps;
45
45
  proactiveChatPaneProps?: IProactiveChatPaneStatefulProps;
46
46
  reconnectChatPaneProps?: IReconnectChatPaneStatefulProps;
47
47
  styleProps?: ILiveChatWidgetStyleProps;
48
- telemetryConfig?: ITelemetryConfig;
48
+ telemetryConfig: ITelemetryConfig;
49
49
  webChatContainerProps?: IWebChatContainerStatefulProps;
50
50
  liveChatContextFromCache?: ILiveChatWidgetContext;
51
51
  contextDataStore?: IContextDataStore;
52
+ getAuthToken?: (authClientFunction?: string) => Promise<string | null>;
52
53
  }
@@ -1,3 +1,3 @@
1
- import { IPostChatSurveyPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/postchatsurveypane/interfaces/IPostChatSurveyPaneProps";
2
- export declare const PostChatSurveyPaneStateful: (props: IPostChatSurveyPaneProps) => JSX.Element;
1
+ import { IPostChatSurveyPaneStatefulProps } from "./interfaces/IPostChatSurveyPaneStatefulProps";
2
+ export declare const PostChatSurveyPaneStateful: (props: IPostChatSurveyPaneStatefulProps) => JSX.Element;
3
3
  export default PostChatSurveyPaneStateful;
@@ -0,0 +1,4 @@
1
+ import { IPostChatSurveyPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/postchatsurveypane/interfaces/IPostChatSurveyPaneProps";
2
+ export interface IPostChatSurveyPaneStatefulProps extends IPostChatSurveyPaneProps {
3
+ isCustomerVoiceSurveyCompact?: boolean;
4
+ }
@@ -1,6 +1,6 @@
1
1
  import { IReconnectChatPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/reconnectchatpane/interfaces/IReconnectChatPaneProps";
2
2
  export interface IReconnectChatPaneStatefulProps extends IReconnectChatPaneProps {
3
- authClientFunction?: string;
4
3
  isReconnectEnabled?: boolean;
5
4
  reconnectId?: string;
5
+ redirectInSameWindow?: boolean;
6
6
  }
@@ -0,0 +1,2 @@
1
+ import { IAdaptiveCardStyles } from "../../interfaces/IAdaptiveCardStyles";
2
+ export declare const defaultAdaptiveCardStyles: IAdaptiveCardStyles;
@@ -1,6 +1,7 @@
1
1
  import MockAdapter from "./mockadapter";
2
2
  export declare class MockChatSDK {
3
3
  protected sleep: (ms: any) => Promise<unknown>;
4
+ isMockModeOn: boolean;
4
5
  startChat(): Promise<void>;
5
6
  endChat(): null;
6
7
  getChatToken(): null;
@@ -0,0 +1,4 @@
1
+ export interface IAdaptiveCardStyles {
2
+ background?: string;
3
+ color?: string;
4
+ }
@@ -0,0 +1,4 @@
1
+ export interface IBotMagicCodeConfig {
2
+ disabled?: boolean;
3
+ fwdUrl?: string;
4
+ }
@@ -1,5 +1,5 @@
1
- import { IAttachmentProps } from "./IAttachmentProps";
2
1
  import React from "react";
2
+ import { IAttachmentProps } from "./IAttachmentProps";
3
3
  export interface IRenderingMiddlewareProps {
4
4
  timestampDir?: "ltr" | "rtl" | "auto";
5
5
  disableActivityMiddleware?: boolean;
@@ -28,4 +28,5 @@ export interface IRenderingMiddlewareProps {
28
28
  attachmentDownloadIconStyles?: React.CSSProperties;
29
29
  attachmentContentStyles?: React.CSSProperties;
30
30
  attachmentSizeStyles?: React.CSSProperties;
31
+ receivedMessageAnchorStyles?: React.CSSProperties;
31
32
  }
@@ -1,8 +1,10 @@
1
+ import { IBotMagicCodeConfig } from "./IBotMagicCodeConfig";
1
2
  import { ILiveChatWidgetLocalizedTexts } from "../../../contexts/common/ILiveChatWidgetLocalizedTexts";
2
3
  import { IRenderingMiddlewareProps } from "./IRenderingMiddlewareProps";
3
4
  import { IStyle } from "@fluentui/react";
4
5
  import { IWebChatProps } from "./IWebChatProps";
5
6
  import { StyleOptions } from "botframework-webchat-api";
7
+ import { IAdaptiveCardStyles } from "./IAdaptiveCardStyles";
6
8
  export interface IWebChatContainerStatefulProps {
7
9
  containerStyles?: IStyle;
8
10
  disableNewLineMarkdownSupport?: boolean;
@@ -13,4 +15,6 @@ export interface IWebChatContainerStatefulProps {
13
15
  storeMiddlewares?: any[];
14
16
  renderingMiddlewareProps?: IRenderingMiddlewareProps;
15
17
  localizedTexts?: ILiveChatWidgetLocalizedTexts;
18
+ botMagicCode?: IBotMagicCodeConfig;
19
+ adaptiveCardStyles?: IAdaptiveCardStyles;
16
20
  }
@@ -0,0 +1,3 @@
1
+ export declare class BotMagicCodeStore {
2
+ static botOAuthSignInId: string;
3
+ }
@@ -1 +1 @@
1
- export declare const activityStatusMiddleware: () => (next: any) => (args: any) => JSX.Element | undefined;
1
+ export declare const activityStatusMiddleware: () => (next: any) => (args: any) => any;
@@ -0,0 +1,2 @@
1
+ import { IBotMagicCodeConfig } from "../../../interfaces/IBotMagicCodeConfig";
2
+ export declare const createCardActionMiddleware: (botMagicCodeConfig: IBotMagicCodeConfig | undefined) => () => (next: any) => (...args: any) => any;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const defaultReceivedMessageAnchorStyles: React.CSSProperties;
@@ -0,0 +1,5 @@
1
+ import { IWebChatAction } from "../../../interfaces/IWebChatAction";
2
+ declare const createMessageTimeStampMiddleware: ({ dispatch }: {
3
+ dispatch: any;
4
+ }) => (next: any) => (action: IWebChatAction) => any;
5
+ export default createMessageTimeStampMiddleware;
@@ -0,0 +1 @@
1
+ export declare function createWebChatTelemetry(): (event: any) => void;
@@ -6,6 +6,7 @@ export declare enum ConversationState {
6
6
  ProactiveChat = 4,
7
7
  Active = 5,
8
8
  InActive = 6,
9
- Postchat = 7,
10
- Closed = 8
9
+ PostchatLoading = 7,
10
+ Postchat = 8,
11
+ Closed = 9
11
12
  }
@@ -15,13 +15,15 @@ export interface ILiveChatWidgetContext {
15
15
  telemetryInternalData: IInternalTelemetryData;
16
16
  globalDir: "rtl" | "ltr";
17
17
  liveChatContext: any;
18
+ customContext: any;
19
+ widgetSize: any;
20
+ widgetInstanceId: string;
18
21
  };
19
22
  appStates: {
20
23
  conversationState: ConversationState;
21
24
  isMinimized: boolean;
22
- previousElementOnFocusBeforeModalOpen: HTMLElement | null;
25
+ previousElementIdOnFocusBeforeModalOpen: string | null;
23
26
  outsideOperatingHours: boolean;
24
- shouldShowPostChat: boolean;
25
27
  preChatResponseEmail: string;
26
28
  isAudioMuted: boolean | null;
27
29
  newMessage: boolean;
@@ -5,16 +5,16 @@ export declare enum LiveChatWidgetActionType {
5
5
  SET_GLOBAL_DIR = 3,
6
6
  SET_MINIMIZED = 4,
7
7
  SET_CONVERSATION_STATE = 5,
8
- SET_PREVIOUS_FOCUSED_ELEMENT = 6,
8
+ SET_PREVIOUS_FOCUSED_ELEMENT_ID = 6,
9
9
  SET_OUTSIDE_OPERATING_HOURS = 7,
10
10
  SET_PRE_CHAT_SURVEY_RESPONSE = 8,
11
- SET_SHOW_CONFIRMATION = 9,
12
- SET_SHOW_EMAIL_TRANSCRIPT_PANE = 10,
13
- SET_PRECHAT_RESPONSE_EMAIL = 11,
14
- SET_AUDIO_NOTIFICATION = 12,
15
- SET_E2VV_ENABLED = 13,
16
- SET_POST_CHAT_CONTEXT = 14,
17
- SET_SHOULD_SHOW_POST_CHAT = 15,
11
+ SET_CUSTOM_CONTEXT = 9,
12
+ SET_SHOW_CONFIRMATION = 10,
13
+ SET_SHOW_EMAIL_TRANSCRIPT_PANE = 11,
14
+ SET_PRECHAT_RESPONSE_EMAIL = 12,
15
+ SET_AUDIO_NOTIFICATION = 13,
16
+ SET_E2VV_ENABLED = 14,
17
+ SET_POST_CHAT_CONTEXT = 15,
18
18
  SHOW_CALLING_CONTAINER = 16,
19
19
  SET_INCOMING_CALL = 17,
20
20
  DISABLE_VIDEO_CALL = 18,
@@ -29,5 +29,8 @@ export declare enum LiveChatWidgetActionType {
29
29
  SET_FOCUS_CHAT_BUTTON = 27,
30
30
  SET_CONVERSATION_ENDED_BY_AGENT = 28,
31
31
  SET_WIDGET_STATE = 29,
32
- SET_LIVE_CHAT_CONTEXT = 30
32
+ SET_LIVE_CHAT_CONTEXT = 30,
33
+ SET_BOT_OAUTH_SIGNIN_ID = 31,
34
+ SET_WIDGET_SIZE = 32,
35
+ SET_WIDGET_INSTANCE_ID = 33
33
36
  }
@@ -1,3 +1,2 @@
1
- import { ILiveChatWidgetContext } from "./ILiveChatWidgetContext";
2
1
  import { ILiveChatWidgetProps } from "../../components/livechatwidget/interfaces/ILiveChatWidgetProps";
3
- export declare const getLiveChatWidgetContextInitialState: (props: ILiveChatWidgetProps) => ILiveChatWidgetContext;
2
+ export declare const getLiveChatWidgetContextInitialState: (props: ILiveChatWidgetProps) => any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "0.1.0-main.c461296",
3
+ "version": "0.1.0-main.cda7a31",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -16,7 +16,8 @@
16
16
  "import": "./lib/esm/index.js",
17
17
  "require": "./lib/cjs/index.js",
18
18
  "types": "./lib/types/index.d.ts"
19
- }
19
+ },
20
+ "./package.json": "./package.json"
20
21
  },
21
22
  "devDependencies": {
22
23
  "@babel/core": "^7.15.8",
@@ -67,22 +68,19 @@
67
68
  "storybook-addon-playwright": "^4.9.2",
68
69
  "terser-webpack-plugin": "^4.2.3",
69
70
  "ts-loader": "^9.2.6",
70
- "typescript": "^4.4.4",
71
+ "typescript": "4.6.4",
71
72
  "webpack": "^4.44.2",
72
73
  "webpack-cli": "^4.9.2"
73
74
  },
74
- "peerDependencies": {
75
- "react": "^16.14.0",
76
- "react-dom": "^16.14.0"
77
- },
78
75
  "dependencies": {
79
76
  "@fluentui/react": "^8.49.1",
80
- "@microsoft/omnichannel-chat-components": "0.1.0-main.2eda736",
81
- "@microsoft/omnichannel-chat-sdk": "1.0.1-main.077d17c",
77
+ "@microsoft/omnichannel-chat-components": "0.1.0-main.600e05c",
78
+ "@microsoft/omnichannel-chat-sdk": "1.1.1-main.4e1bf63",
82
79
  "abort-controller-es5": "^2.0.1",
83
80
  "dompurify": "^2.3.4",
84
81
  "markdown-it": "^12.3.2",
85
82
  "markdown-it-for-inline": "^0.1.1",
83
+ "md5-typescript": "^1.0.5",
86
84
  "p-defer-es5": "^2.0.1",
87
85
  "slack-markdown-it": "^1.0.5"
88
86
  },
@@ -93,6 +91,8 @@
93
91
  "build-storybook": "build-storybook",
94
92
  "build": "yarn lint && yarn build:esm && yarn build:cjs && tsc",
95
93
  "test:unit": "jest -c jest.config.unit.cjs --env=jsdom --runInBand --force-exit",
94
+ "test:e2e": "cd automation_tests && yarn test",
95
+ "test:e2e:build": "yarn build-sample && cd automation_tests && yarn test",
96
96
  "test:visual": "jest -c jest.config.visual.cjs",
97
97
  "test:all": "yarn test:unit && yarn test:visual",
98
98
  "build:esm": "babel ./src --config-file ./babel.esm.config.json --out-dir lib/esm --extensions .ts,.js,.tsx --ignore **/*.test.ts,**/*.stories.tsx,**/*.test.tsx",