@microsoft/omnichannel-chat-widget 1.5.1-main.c3533cf → 1.5.1-main.ee4453c

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 (74) hide show
  1. package/lib/cjs/common/Constants.js +15 -8
  2. package/lib/cjs/common/telemetry/TelemetryConstants.js +1 -2
  3. package/lib/cjs/common/utils.js +2 -1
  4. package/lib/cjs/components/livechatwidget/common/endChat.js +16 -4
  5. package/lib/cjs/components/livechatwidget/common/startChat.js +8 -82
  6. package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +205 -0
  7. package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.spec.js +282 -0
  8. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +12 -13
  9. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
  10. package/lib/cjs/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +68 -0
  11. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneGeneralStyleProps.js +17 -0
  12. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconImageProps.js +17 -0
  13. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconStyleProps.js +15 -0
  14. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneSubtitleStyleProps.js +17 -0
  15. package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneTitleStyleProps.js +17 -0
  16. package/lib/cjs/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneControlProps.js +1 -0
  17. package/lib/cjs/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneProps.js +1 -0
  18. package/lib/cjs/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneStyleProps.js +1 -0
  19. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +2 -11
  20. package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.spec.js +1 -1
  21. package/lib/cjs/contexts/common/ConversationState.js +1 -0
  22. package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +1 -0
  23. package/lib/cjs/controller/componentController.js +5 -1
  24. package/lib/esm/common/Constants.js +11 -6
  25. package/lib/esm/common/telemetry/TelemetryConstants.js +1 -2
  26. package/lib/esm/common/utils.js +3 -2
  27. package/lib/esm/components/livechatwidget/common/endChat.js +14 -3
  28. package/lib/esm/components/livechatwidget/common/startChat.js +9 -83
  29. package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +198 -0
  30. package/lib/esm/components/livechatwidget/common/startChatErrorHandler.spec.js +280 -0
  31. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +14 -15
  32. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
  33. package/lib/esm/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +57 -0
  34. package/lib/esm/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneGeneralStyleProps.js +10 -0
  35. package/lib/esm/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconImageProps.js +10 -0
  36. package/lib/esm/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconStyleProps.js +8 -0
  37. package/lib/esm/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneSubtitleStyleProps.js +10 -0
  38. package/lib/esm/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneTitleStyleProps.js +10 -0
  39. package/lib/esm/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneControlProps.js +1 -0
  40. package/lib/esm/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneProps.js +1 -0
  41. package/lib/esm/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneStyleProps.js +1 -0
  42. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +2 -11
  43. package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.spec.js +1 -1
  44. package/lib/esm/contexts/common/ConversationState.js +1 -0
  45. package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +1 -0
  46. package/lib/esm/controller/componentController.js +3 -0
  47. package/lib/types/common/Constants.d.ts +13 -4
  48. package/lib/types/common/telemetry/TelemetryConstants.d.ts +1 -1
  49. package/lib/types/components/livechatwidget/common/endChat.d.ts +4 -3
  50. package/lib/types/components/livechatwidget/common/startChatErrorHandler.d.ts +5 -0
  51. package/lib/types/components/livechatwidget/common/startChatErrorHandler.spec.d.ts +1 -0
  52. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts +1 -0
  53. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +1 -1
  54. package/lib/types/components/startchaterrorpanestateful/StartChatErrorPaneStateful.d.ts +3 -0
  55. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneGeneralStyleProps.d.ts +2 -0
  56. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconImageProps.d.ts +2 -0
  57. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconStyleProps.d.ts +2 -0
  58. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneSubtitleStyleProps.d.ts +2 -0
  59. package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneTitleStyleProps.d.ts +2 -0
  60. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneClassNames.d.ts +5 -0
  61. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneComponentOverrides.d.ts +6 -0
  62. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneControlProps.d.ts +10 -0
  63. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneProps.d.ts +8 -0
  64. package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneStyleProps.d.ts +10 -0
  65. package/lib/types/contexts/common/ConversationState.d.ts +2 -1
  66. package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
  67. package/lib/types/controller/componentController.d.ts +1 -0
  68. package/package.json +3 -3
  69. package/lib/types/components/loadingpanestateful/interfaces/IStartChatErrorPaneControlProps.d.ts +0 -4
  70. package/lib/types/components/loadingpanestateful/interfaces/IStartChatErrorPaneProps.d.ts +0 -4
  71. /package/lib/cjs/components/{loadingpanestateful/interfaces/IStartChatErrorPaneControlProps.js → startchaterrorpanestateful/interfaces/IStartChatErrorPaneClassNames.js} +0 -0
  72. /package/lib/cjs/components/{loadingpanestateful/interfaces/IStartChatErrorPaneProps.js → startchaterrorpanestateful/interfaces/IStartChatErrorPaneComponentOverrides.js} +0 -0
  73. /package/lib/esm/components/{loadingpanestateful/interfaces/IStartChatErrorPaneControlProps.js → startchaterrorpanestateful/interfaces/IStartChatErrorPaneClassNames.js} +0 -0
  74. /package/lib/esm/components/{loadingpanestateful/interfaces/IStartChatErrorPaneProps.js → startchaterrorpanestateful/interfaces/IStartChatErrorPaneComponentOverrides.js} +0 -0
@@ -120,10 +120,10 @@ export declare enum TelemetryEvent {
120
120
  ErrorUIPaneLoaded = "ErrorUIPaneLoaded",
121
121
  DownloadTranscriptFailed = "DownloadTranscriptFailed",
122
122
  StartChatFailed = "StartChatFailed",
123
- IC3ThreadUpdateEventReceived = "IC3ThreadUpdateEventReceived",
124
123
  ConfirmationCancelButtonClicked = "ConfirmationCancelButtonClicked",
125
124
  ConfirmationConfirmButtonClicked = "ConfirmationConfirmButtonClicked",
126
125
  LoadingPaneLoaded = "LoadingPaneLoaded",
126
+ StartChatErrorPaneLoaded = "StartChatErrorPaneLoaded",
127
127
  EmailTranscriptLoaded = "EmailTranscriptLoaded",
128
128
  OutOfOfficePaneLoaded = "OutOfOfficePaneLoaded",
129
129
  ConfirmationPaneLoaded = "ConfirmationPaneLoaded",
@@ -4,8 +4,9 @@ import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidget
4
4
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
5
5
  declare const prepareEndChat: (props: ILiveChatWidgetProps, chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, setWebChatStyles: any, adapter: any) => Promise<void>;
6
6
  declare const endChat: (props: ILiveChatWidgetProps, chatSDK: any, state: ILiveChatWidgetContext, dispatch: Dispatch<ILiveChatWidgetAction>, setAdapter: any, setWebChatStyles: any, adapter: any, skipEndChatSDK?: boolean | undefined, skipCloseChat?: boolean | undefined, postMessageToOtherTab?: boolean | undefined) => Promise<void>;
7
- export declare const callingStateCleanUp: (dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<void>;
8
- export declare const endChatStateCleanUp: (dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<void>;
9
- export declare const closeChatStateCleanUp: (dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<void>;
7
+ export declare const callingStateCleanUp: (dispatch: Dispatch<ILiveChatWidgetAction>) => void;
8
+ export declare const endChatStateCleanUp: (dispatch: Dispatch<ILiveChatWidgetAction>) => void;
9
+ export declare const closeChatStateCleanUp: (dispatch: Dispatch<ILiveChatWidgetAction>) => void;
10
+ export declare const chatSDKStateCleanUp: (chatSDK: any) => void;
10
11
  export declare const endVoiceVideoCallIfOngoing: (chatSDK: any, dispatch: Dispatch<ILiveChatWidgetAction>) => Promise<void>;
11
12
  export { prepareEndChat, endChat };
@@ -0,0 +1,5 @@
1
+ import { Dispatch } from "react";
2
+ import { ILiveChatWidgetAction } from "../../../contexts/common/ILiveChatWidgetAction";
3
+ import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
4
+ export declare const handleStartChatError: (dispatch: Dispatch<ILiveChatWidgetAction>, chatSDK: any, props: ILiveChatWidgetProps | undefined, ex: any, isStartChatSuccessful: boolean) => void;
5
+ export declare const logWidgetLoadComplete: (additionalMessage?: string | undefined) => void;
@@ -6,6 +6,7 @@ export interface ILiveChatWidgetComponentOverrides {
6
6
  emailTranscriptPane?: ReactNode | string;
7
7
  header?: ReactNode | string;
8
8
  loadingPane?: ReactNode | string;
9
+ startChatErrorPane?: ReactNode | string;
9
10
  outOfOfficeHoursPane?: ReactNode | string;
10
11
  postChatLoadingPane?: ReactNode | string;
11
12
  postChatSurveyPane?: ReactNode | string;
@@ -15,7 +15,7 @@ import { IOOOHPaneProps } from "@microsoft/omnichannel-chat-components/lib/types
15
15
  import { IPreChatSurveyPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneProps";
16
16
  import { IProactiveChatPaneStatefulProps } from "../../proactivechatpanestateful/interfaces/IProactiveChatPaneStatefulProps";
17
17
  import { IReconnectChatPaneStatefulProps } from "../../reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps";
18
- import { IStartChatErrorPaneProps } from "../../loadingpanestateful/interfaces/IStartChatErrorPaneProps";
18
+ import { IStartChatErrorPaneProps } from "../../startchaterrorpanestateful/interfaces/IStartChatErrorPaneProps";
19
19
  import { ITelemetryConfig } from "../../../common/telemetry/interfaces/ITelemetryConfig";
20
20
  import { IWebChatContainerStatefulProps } from "../../webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps";
21
21
  import { OmnichannelChatSDK } from "@microsoft/omnichannel-chat-sdk";
@@ -0,0 +1,3 @@
1
+ import { IStartChatErrorPaneProps } from "./interfaces/IStartChatErrorPaneProps";
2
+ export declare const StartChatErrorPaneStateful: (startChatErrorPaneProps: IStartChatErrorPaneProps) => JSX.Element;
3
+ export default StartChatErrorPaneStateful;
@@ -0,0 +1,2 @@
1
+ import { IStyle } from "@fluentui/react";
2
+ export declare const defaultStartChatErrorPaneGeneralStyleProps: IStyle;
@@ -0,0 +1,2 @@
1
+ import { IImageProps } from "@fluentui/react";
2
+ export declare const defaultStartChatErrorPaneIconImageStyleProps: IImageProps;
@@ -0,0 +1,2 @@
1
+ import { IStyle } from "@fluentui/react";
2
+ export declare const defaultStartChatErrorPaneIconStyleProps: IStyle;
@@ -0,0 +1,2 @@
1
+ import { IStyle } from "@fluentui/react";
2
+ export declare const defaultStartChatErrorPaneSubtitleStyleProps: IStyle;
@@ -0,0 +1,2 @@
1
+ import { IStyle } from "@fluentui/react";
2
+ export declare const defaultStartChatErrorPaneTitleStyleProps: IStyle;
@@ -0,0 +1,5 @@
1
+ export interface IStartChatErrorPaneClassNames {
2
+ iconClassName?: string;
3
+ titleClassName?: string;
4
+ subtitleClassName?: string;
5
+ }
@@ -0,0 +1,6 @@
1
+ import { ReactNode } from "react";
2
+ export interface IStartChatErrorPaneComponentOverrides {
3
+ icon?: ReactNode | string;
4
+ title?: ReactNode | string;
5
+ subtitle?: ReactNode | string;
6
+ }
@@ -0,0 +1,10 @@
1
+ export interface IStartChatErrorPaneControlProps {
2
+ id?: string;
3
+ role?: string;
4
+ dir?: "rtl" | "ltr" | "auto";
5
+ hideIcon?: boolean;
6
+ hideTitle?: boolean;
7
+ hideSubtitle?: boolean;
8
+ titleText?: string;
9
+ subtitleText?: string;
10
+ }
@@ -0,0 +1,8 @@
1
+ import { IStartChatErrorPaneComponentOverrides } from "./IStartChatErrorPaneComponentOverrides";
2
+ import { IStartChatErrorPaneControlProps } from "./IStartChatErrorPaneControlProps";
3
+ import { IStartChatErrorPaneStyleProps } from "./IStartChatErrorPaneStyleProps";
4
+ export interface IStartChatErrorPaneProps {
5
+ componentOverrides?: IStartChatErrorPaneComponentOverrides;
6
+ controlProps?: IStartChatErrorPaneControlProps;
7
+ styleProps?: IStartChatErrorPaneStyleProps;
8
+ }
@@ -0,0 +1,10 @@
1
+ import { IImageProps, IStyle } from "@fluentui/react";
2
+ import { IStartChatErrorPaneClassNames } from "./IStartChatErrorPaneClassNames";
3
+ export interface IStartChatErrorPaneStyleProps {
4
+ generalStyleProps?: IStyle;
5
+ titleStyleProps?: IStyle;
6
+ subtitleStyleProps?: IStyle;
7
+ iconStyleProps?: IStyle;
8
+ iconImageProps?: IImageProps;
9
+ classNames?: IStartChatErrorPaneClassNames;
10
+ }
@@ -8,5 +8,6 @@ export declare enum ConversationState {
8
8
  InActive = 6,
9
9
  PostchatLoading = 7,
10
10
  Postchat = 8,
11
- Closed = 9
11
+ Closed = 9,
12
+ Error = 10
12
13
  }
@@ -49,6 +49,7 @@ export interface ILiveChatWidgetContext {
49
49
  };
50
50
  uiStates: {
51
51
  showConfirmationPane: boolean;
52
+ showStartChatErrorPane: boolean;
52
53
  showEmailTranscriptPane: boolean;
53
54
  disableVideoCall: boolean;
54
55
  showCallingPopup: boolean;
@@ -6,6 +6,7 @@ export declare const shouldShowFooter: (state: ILiveChatWidgetContext) => boolea
6
6
  export declare const shouldShowEmailTranscriptPane: (state: ILiveChatWidgetContext) => boolean;
7
7
  export declare const shouldShowWebChatContainer: (state: ILiveChatWidgetContext) => boolean;
8
8
  export declare const shouldShowLoadingPane: (state: ILiveChatWidgetContext) => boolean;
9
+ export declare const shouldShowStartChatErrorPane: (state: ILiveChatWidgetContext) => boolean;
9
10
  export declare const shouldShowReconnectChatPane: (state: ILiveChatWidgetContext) => boolean;
10
11
  export declare const shouldShowPostChatLoadingPane: (state: ILiveChatWidgetContext) => boolean;
11
12
  export declare const shouldShowOutOfOfficeHoursPane: (state: ILiveChatWidgetContext) => boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "1.5.1-main.c3533cf",
3
+ "version": "1.5.1-main.ee4453c",
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
  "webpack-cli": "^4.9.2"
75
75
  },
76
76
  "dependencies": {
77
- "@microsoft/omnichannel-chat-components": "^1.0.9",
78
- "@microsoft/omnichannel-chat-sdk": "1.5.7",
77
+ "@microsoft/omnichannel-chat-components": "^1.1.0",
78
+ "@microsoft/omnichannel-chat-sdk": "1.6.2",
79
79
  "abort-controller-es5": "^2.0.1",
80
80
  "dompurify": "^2.3.4",
81
81
  "markdown-it": "^12.3.2",
@@ -1,4 +0,0 @@
1
- export interface IStartChatErrorPaneControlProps {
2
- titleText?: string;
3
- subtitleText?: string;
4
- }
@@ -1,4 +0,0 @@
1
- import { IStartChatErrorPaneControlProps } from "./IStartChatErrorPaneControlProps";
2
- export interface IStartChatErrorPaneProps {
3
- controlProps?: IStartChatErrorPaneControlProps;
4
- }