@microsoft/omnichannel-chat-widget 0.1.0-main.d48dae2 → 0.1.0-main.d553f80

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 (75) hide show
  1. package/lib/cjs/common/Constants.js +2 -0
  2. package/lib/cjs/common/telemetry/TelemetryConstants.js +4 -0
  3. package/lib/cjs/common/utils.js +20 -7
  4. package/lib/cjs/components/headerstateful/HeaderStateful.js +2 -1
  5. package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +44 -0
  6. package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +39 -0
  7. package/lib/cjs/components/livechatwidget/common/Deferred.js +42 -0
  8. package/lib/cjs/components/livechatwidget/common/authHelper.js +52 -0
  9. package/lib/cjs/components/livechatwidget/common/createAdapter.js +3 -0
  10. package/lib/cjs/components/livechatwidget/common/createInternetConnectionChangeHandler.js +12 -0
  11. package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +6 -1
  12. package/lib/cjs/components/livechatwidget/common/endChat.js +3 -3
  13. package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +4 -0
  14. package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +35 -23
  15. package/lib/cjs/components/livechatwidget/common/startChat.js +39 -47
  16. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +107 -44
  17. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
  18. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +11 -0
  19. package/lib/cjs/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +4 -1
  20. package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +11 -0
  21. package/lib/cjs/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.js +1 -0
  22. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +2 -1
  23. package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +1 -0
  24. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +2 -1
  25. package/lib/cjs/contexts/createReducer.js +8 -0
  26. package/lib/esm/common/Constants.js +2 -0
  27. package/lib/esm/common/telemetry/TelemetryConstants.js +4 -0
  28. package/lib/esm/common/utils.js +14 -5
  29. package/lib/esm/components/headerstateful/HeaderStateful.js +2 -1
  30. package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +34 -0
  31. package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +29 -0
  32. package/lib/esm/components/livechatwidget/common/Deferred.js +33 -0
  33. package/lib/esm/components/livechatwidget/common/authHelper.js +39 -0
  34. package/lib/esm/components/livechatwidget/common/createAdapter.js +3 -1
  35. package/lib/esm/components/livechatwidget/common/createInternetConnectionChangeHandler.js +8 -0
  36. package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +6 -1
  37. package/lib/esm/components/livechatwidget/common/endChat.js +3 -3
  38. package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +4 -0
  39. package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +36 -25
  40. package/lib/esm/components/livechatwidget/common/startChat.js +35 -47
  41. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +106 -46
  42. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
  43. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +10 -0
  44. package/lib/esm/components/webchatcontainerstateful/common/defaultProps/defaultWebChatContainerStatefulProps.js +3 -1
  45. package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +4 -0
  46. package/lib/esm/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.js +1 -0
  47. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +2 -1
  48. package/lib/esm/contexts/common/LiveChatWidgetActionType.js +1 -0
  49. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +2 -1
  50. package/lib/esm/contexts/createReducer.js +8 -0
  51. package/lib/types/common/Constants.d.ts +1 -0
  52. package/lib/types/common/telemetry/TelemetryConstants.d.ts +3 -1
  53. package/lib/types/common/telemetry/TelemetryHelper.d.ts +1 -1
  54. package/lib/types/common/utils.d.ts +4 -3
  55. package/lib/types/components/footerstateful/downloadtranscriptstateful/DownloadTranscriptStateful.d.ts +1 -1
  56. package/lib/types/components/headerstateful/interfaces/IHeaderStatefulParams.d.ts +2 -1
  57. package/lib/types/components/livechatwidget/common/ActivityStreamHandler.d.ts +14 -0
  58. package/lib/types/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.d.ts +7 -0
  59. package/lib/types/components/livechatwidget/common/Deferred.d.ts +9 -0
  60. package/lib/types/components/livechatwidget/common/authHelper.d.ts +4 -0
  61. package/lib/types/components/livechatwidget/common/endChat.d.ts +1 -1
  62. package/lib/types/components/livechatwidget/common/reconnectChatHelper.d.ts +4 -4
  63. package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +1 -1
  64. package/lib/types/components/livechatwidget/common/startChat.d.ts +2 -2
  65. package/lib/types/components/livechatwidget/common/startProactiveChat.d.ts +1 -1
  66. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +1 -0
  67. package/lib/types/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.d.ts +2 -0
  68. package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +4 -0
  69. package/lib/types/components/webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps.d.ts +2 -0
  70. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +1 -1
  71. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.d.ts +1 -1
  72. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.d.ts +1 -1
  73. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
  74. package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +2 -1
  75. package/package.json +4 -3
@@ -1,3 +1,3 @@
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) => Promise<void>;
3
+ export declare const setPostChatContextAndLoadSurvey: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>, persistedChat?: boolean | undefined) => Promise<void>;
@@ -4,6 +4,6 @@ import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetA
4
4
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
5
5
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
6
6
  declare const prepareStartChat: (props: ILiveChatWidgetProps, chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any) => Promise<void>;
7
- declare const setPreChatAndInitiateChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, isProactiveChat?: boolean | false, proactiveChatEnablePrechatState?: boolean | false) => Promise<void>;
8
- declare const initStartChat: (chatSDK: any, chatConfig: ChatConfig | undefined, getAuthToken: ((authClientFunction?: string) => Promise<string | null>) | undefined, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, params?: any, persistedState?: any) => Promise<void>;
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
9
  export { prepareStartChat, initStartChat, setPreChatAndInitiateChat };
@@ -1,4 +1,4 @@
1
1
  import { Dispatch } from "react";
2
2
  import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
3
  import { IProactiveChatNotificationConfig } from "../../proactivechatpanestateful/interfaces/IProactiveChatNotificationConfig";
4
- export declare const startProactiveChat: (dispatch: Dispatch<ILiveChatWidgetAction>, notificationConfig?: IProactiveChatNotificationConfig, enablePreChat?: boolean, inNewWindow?: boolean) => void;
4
+ export declare const startProactiveChat: (dispatch: Dispatch<ILiveChatWidgetAction>, notificationConfig?: IProactiveChatNotificationConfig | undefined, enablePreChat?: boolean | undefined, inNewWindow?: boolean | undefined) => void;
@@ -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
  }
@@ -0,0 +1,2 @@
1
+ import { IAdaptiveCardStyles } from "../../interfaces/IAdaptiveCardStyles";
2
+ export declare const defaultAdaptiveCardStyles: IAdaptiveCardStyles;
@@ -0,0 +1,4 @@
1
+ export interface IAdaptiveCardStyles {
2
+ background?: string;
3
+ color?: string;
4
+ }
@@ -4,6 +4,7 @@ import { IRenderingMiddlewareProps } from "./IRenderingMiddlewareProps";
4
4
  import { IStyle } from "@fluentui/react";
5
5
  import { IWebChatProps } from "./IWebChatProps";
6
6
  import { StyleOptions } from "botframework-webchat-api";
7
+ import { IAdaptiveCardStyles } from "./IAdaptiveCardStyles";
7
8
  export interface IWebChatContainerStatefulProps {
8
9
  containerStyles?: IStyle;
9
10
  disableNewLineMarkdownSupport?: boolean;
@@ -15,4 +16,5 @@ export interface IWebChatContainerStatefulProps {
15
16
  renderingMiddlewareProps?: IRenderingMiddlewareProps;
16
17
  localizedTexts?: ILiveChatWidgetLocalizedTexts;
17
18
  botMagicCode?: IBotMagicCodeConfig;
19
+ adaptiveCardStyles?: IAdaptiveCardStyles;
18
20
  }
@@ -7,4 +7,4 @@
7
7
  * 3. Decodes certain html characters that came through from chat services
8
8
  ******/
9
9
  import React from "react";
10
- export declare const createActivityMiddleware: (systemMessageStyleProps?: React.CSSProperties, userMessageStyleProps?: React.CSSProperties) => () => (next: any) => (...args: any) => any;
10
+ export declare const createActivityMiddleware: (systemMessageStyleProps?: React.CSSProperties | undefined, userMessageStyleProps?: React.CSSProperties | undefined) => () => (next: any) => (...args: any) => any;
@@ -1 +1 @@
1
- export declare const activityStatusMiddleware: () => (next: any) => (args: any) => JSX.Element | undefined;
1
+ export declare const activityStatusMiddleware: () => (next: any) => (args: any) => any;
@@ -5,4 +5,4 @@
5
5
  * 1. Renders the first two letters of the sender as the profile pic
6
6
  ******/
7
7
  import React from "react";
8
- export declare const createAvatarMiddleware: (avatarStyleProps?: React.CSSProperties, avatarTextStyleProps?: React.CSSProperties) => () => (next: any) => (args_0: any) => false | (() => JSX.Element);
8
+ export declare const createAvatarMiddleware: (avatarStyleProps?: React.CSSProperties | undefined, avatarTextStyleProps?: React.CSSProperties | undefined) => () => (next: any) => (args_0: any) => false | (() => JSX.Element);
@@ -17,6 +17,7 @@ export interface ILiveChatWidgetContext {
17
17
  liveChatContext: any;
18
18
  customContext: any;
19
19
  widgetSize: any;
20
+ widgetInstanceId: string;
20
21
  };
21
22
  appStates: {
22
23
  conversationState: ConversationState;
@@ -31,5 +31,6 @@ export declare enum LiveChatWidgetActionType {
31
31
  SET_WIDGET_STATE = 29,
32
32
  SET_LIVE_CHAT_CONTEXT = 30,
33
33
  SET_BOT_OAUTH_SIGNIN_ID = 31,
34
- SET_WIDGET_SIZE = 32
34
+ SET_WIDGET_SIZE = 32,
35
+ SET_WIDGET_INSTANCE_ID = 33
35
36
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "0.1.0-main.d48dae2",
3
+ "version": "0.1.0-main.d553f80",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -68,18 +68,19 @@
68
68
  "storybook-addon-playwright": "^4.9.2",
69
69
  "terser-webpack-plugin": "^4.2.3",
70
70
  "ts-loader": "^9.2.6",
71
- "typescript": "^4.4.4",
71
+ "typescript": "4.6.4",
72
72
  "webpack": "^4.44.2",
73
73
  "webpack-cli": "^4.9.2"
74
74
  },
75
75
  "dependencies": {
76
76
  "@fluentui/react": "^8.49.1",
77
- "@microsoft/omnichannel-chat-components": "0.1.0-main.7a911ca",
77
+ "@microsoft/omnichannel-chat-components": "0.1.0-main.5a87386",
78
78
  "@microsoft/omnichannel-chat-sdk": "1.0.1-main.077d17c",
79
79
  "abort-controller-es5": "^2.0.1",
80
80
  "dompurify": "^2.3.4",
81
81
  "markdown-it": "^12.3.2",
82
82
  "markdown-it-for-inline": "^0.1.1",
83
+ "md5-typescript": "^1.0.5",
83
84
  "p-defer-es5": "^2.0.1",
84
85
  "slack-markdown-it": "^1.0.5"
85
86
  },