@microsoft/omnichannel-chat-widget 1.7.8-main.50111af → 1.7.8-main.8428c08

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 (98) hide show
  1. package/lib/cjs/common/Constants.js +9 -2
  2. package/lib/cjs/common/facades/FacadeChatSDK.js +21 -17
  3. package/lib/cjs/common/telemetry/ScenarioMarker.js +66 -0
  4. package/lib/cjs/common/telemetry/TelemetryConstants.js +53 -45
  5. package/lib/cjs/common/telemetry/TelemetryHelper.js +62 -69
  6. package/lib/cjs/common/telemetry/TelemetryManager.js +22 -9
  7. package/lib/cjs/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +11 -0
  8. package/lib/cjs/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
  9. package/lib/cjs/common/telemetry/loggers/appInsightsLogger.js +119 -0
  10. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +13 -9
  11. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +5 -4
  12. package/lib/cjs/components/footerstateful/FooterStateful.js +13 -8
  13. package/lib/cjs/components/headerstateful/HeaderStateful.js +21 -9
  14. package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
  15. package/lib/cjs/components/livechatwidget/common/renderSurveyHelpers.js +7 -4
  16. package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -3
  17. package/lib/cjs/components/livechatwidget/common/startChat.js +3 -3
  18. package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +7 -6
  19. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +11 -9
  20. package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +6 -4
  21. package/lib/cjs/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +9 -4
  22. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
  23. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +9 -7
  24. package/lib/cjs/firstresponselatency/FirstMessageTrackerFromBot.js +2 -2
  25. package/lib/cjs/firstresponselatency/FirstResponseLatencyTracker.js +1 -1
  26. package/lib/cjs/plugins/newMessageEventHandler.js +8 -8
  27. package/lib/esm/common/Constants.js +7 -1
  28. package/lib/esm/common/facades/FacadeChatSDK.js +21 -17
  29. package/lib/esm/common/telemetry/ScenarioMarker.js +59 -0
  30. package/lib/esm/common/telemetry/TelemetryConstants.js +53 -45
  31. package/lib/esm/common/telemetry/TelemetryHelper.js +62 -69
  32. package/lib/esm/common/telemetry/TelemetryManager.js +22 -9
  33. package/lib/esm/common/telemetry/defaultConfigs/defaultAppInsightsConfig.js +4 -0
  34. package/lib/esm/common/telemetry/interfaces/IAppInsightsConfig.js +1 -0
  35. package/lib/esm/common/telemetry/loggers/appInsightsLogger.js +111 -0
  36. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +13 -9
  37. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +5 -4
  38. package/lib/esm/components/footerstateful/FooterStateful.js +13 -8
  39. package/lib/esm/components/headerstateful/HeaderStateful.js +21 -9
  40. package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +3 -1
  41. package/lib/esm/components/livechatwidget/common/renderSurveyHelpers.js +7 -4
  42. package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +7 -3
  43. package/lib/esm/components/livechatwidget/common/startChat.js +3 -3
  44. package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +7 -6
  45. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +11 -9
  46. package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +6 -4
  47. package/lib/esm/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.js +9 -4
  48. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +9 -6
  49. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +9 -7
  50. package/lib/esm/firstresponselatency/FirstMessageTrackerFromBot.js +2 -2
  51. package/lib/esm/firstresponselatency/FirstResponseLatencyTracker.js +1 -1
  52. package/lib/esm/plugins/newMessageEventHandler.js +8 -8
  53. package/lib/types/common/Constants.d.ts +5 -0
  54. package/lib/types/common/telemetry/ScenarioMarker.d.ts +19 -0
  55. package/lib/types/common/telemetry/TelemetryConstants.d.ts +40 -32
  56. package/lib/types/common/telemetry/TelemetryHelper.d.ts +5 -0
  57. package/lib/types/common/telemetry/defaultConfigs/defaultAppInsightsConfig.d.ts +2 -0
  58. package/lib/types/common/telemetry/interfaces/IAppInsightsConfig.d.ts +4 -0
  59. package/lib/types/common/telemetry/interfaces/IChatSDKLogger.d.ts +1 -0
  60. package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +2 -0
  61. package/lib/types/common/telemetry/loggers/appInsightsLogger.d.ts +5 -0
  62. package/lib/types/components/callingcontainerstateful/CallingContainerStateful.d.ts +2 -1
  63. package/lib/types/components/chatbuttonstateful/ChatButtonStateful.d.ts +2 -1
  64. package/lib/types/components/confirmationpanestateful/ConfirmationPaneStateful.d.ts +2 -1
  65. package/lib/types/components/dimlayer/DimLayer.d.ts +2 -1
  66. package/lib/types/components/draggable/DraggableChatWidget.d.ts +2 -2
  67. package/lib/types/components/draggable/DraggableEventEmitter.d.ts +2 -2
  68. package/lib/types/components/draggable/DraggableEventReceiver.d.ts +2 -2
  69. package/lib/types/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.d.ts +2 -1
  70. package/lib/types/components/footerstateful/FooterStateful.d.ts +2 -1
  71. package/lib/types/components/footerstateful/audionotificationstateful/AudioNotificationStateful.d.ts +2 -1
  72. package/lib/types/components/headerstateful/HeaderStateful.d.ts +2 -1
  73. package/lib/types/components/livechatwidget/LiveChatWidget.d.ts +2 -1
  74. package/lib/types/components/livechatwidget/common/createFooter.d.ts +2 -1
  75. package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -0
  76. package/lib/types/components/loadingpanestateful/LoadingPaneStateful.d.ts +2 -1
  77. package/lib/types/components/notificationpanestateful/NotificationPaneStateful.d.ts +2 -1
  78. package/lib/types/components/ooohpanestateful/OOOHPaneStateful.d.ts +2 -1
  79. package/lib/types/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.d.ts +2 -1
  80. package/lib/types/components/postchatsurveypanestateful/PostChatSurveyPaneStateful.d.ts +2 -1
  81. package/lib/types/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.d.ts +2 -1
  82. package/lib/types/components/proactivechatpanestateful/ProactiveChatPaneStateful.d.ts +2 -1
  83. package/lib/types/components/reconnectchatpanestateful/ReconnectChatPaneStateful.d.ts +2 -1
  84. package/lib/types/components/startchaterrorpanestateful/StartChatErrorPaneStateful.d.ts +2 -1
  85. package/lib/types/components/webchatcontainerstateful/WebChatContainerStateful.d.ts +2 -1
  86. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Attachment.d.ts +2 -1
  87. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentContent.d.ts +2 -1
  88. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AttachmentIcon.d.ts +2 -1
  89. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/DownloadBlockedAttachment.d.ts +2 -1
  90. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/MaliciousAttachment.d.ts +2 -1
  91. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/ScanInProgressAttachment.d.ts +2 -1
  92. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/Spinner.d.ts +2 -1
  93. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/avatarMiddleware.d.ts +1 -1
  94. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.d.ts +2 -1
  95. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.d.ts +2 -1
  96. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +2 -1
  97. package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/typingIndicatorMiddleware.d.ts +2 -1
  98. package/package.json +10 -8
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { IAudioNotificationStatefulParams } from "./interfaces/IAudioNotificationStatefulParams";
2
- export declare const AudioNotificationStateful: (props: IAudioNotificationStatefulParams) => JSX.Element;
3
+ export declare const AudioNotificationStateful: (props: IAudioNotificationStatefulParams) => React.JSX.Element;
3
4
  export default AudioNotificationStateful;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { IHeaderStatefulParams } from "./interfaces/IHeaderStatefulParams";
2
- export declare const HeaderStateful: (props: IHeaderStatefulParams) => JSX.Element;
3
+ export declare const HeaderStateful: (props: IHeaderStatefulParams) => React.JSX.Element;
3
4
  export default HeaderStateful;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { ILiveChatWidgetProps } from "./interfaces/ILiveChatWidgetProps";
2
- export declare const LiveChatWidget: (props: ILiveChatWidgetProps) => JSX.Element;
3
+ export declare const LiveChatWidget: (props: ILiveChatWidgetProps) => React.JSX.Element;
3
4
  export default LiveChatWidget;
@@ -1,3 +1,4 @@
1
1
  import { ILiveChatWidgetContext } from "../../../contexts/common/ILiveChatWidgetContext";
2
2
  import { ILiveChatWidgetProps } from "../interfaces/ILiveChatWidgetProps";
3
- export declare const createFooter: (props: ILiveChatWidgetProps, state: ILiveChatWidgetContext) => {};
3
+ import React from "react";
4
+ export declare const createFooter: (props: ILiveChatWidgetProps, state: ILiveChatWidgetContext) => string | number | true | Iterable<React.ReactNode> | React.JSX.Element;
@@ -27,6 +27,7 @@ import { IStartChatErrorPaneProps } from "../../startchaterrorpanestateful/inter
27
27
  import { ITelemetryConfig } from "../../../common/telemetry/interfaces/ITelemetryConfig";
28
28
  import { IWebChatContainerStatefulProps } from "../../webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps";
29
29
  import { OmnichannelChatSDK } from "@microsoft/omnichannel-chat-sdk";
30
+ import { IAppInsightsConfig } from "../../../common/telemetry/interfaces/IAppInsightsConfig";
30
31
  export interface ILiveChatWidgetProps {
31
32
  audioNotificationProps?: IAudioNotificationProps;
32
33
  callingContainerProps?: ICallingContainerProps;
@@ -65,4 +66,5 @@ export interface ILiveChatWidgetProps {
65
66
  draggableChatWidgetProps?: IDraggableChatWidgetProps;
66
67
  mock?: IMockProps;
67
68
  featureConfigProps?: IFeatureConfigProps;
69
+ appInsightsConfig?: IAppInsightsConfig;
68
70
  }
@@ -1,2 +1,3 @@
1
- export declare const LoadingPaneStateful: (props: any) => JSX.Element;
1
+ import React from "react";
2
+ export declare const LoadingPaneStateful: (props: any) => React.JSX.Element;
2
3
  export default LoadingPaneStateful;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { INotificationPaneStatefulProps } from "./interfaces/INotificationPaneStatefulProps";
2
- export declare const NotificationPaneStateful: (props: INotificationPaneStatefulProps) => JSX.Element;
3
+ export declare const NotificationPaneStateful: (props: INotificationPaneStatefulProps) => React.JSX.Element;
3
4
  export default NotificationPaneStateful;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { IOOOHPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/outofofficehourspane/interfaces/IOOOHPaneProps";
2
- export declare const OutOfOfficeHoursPaneStateful: (props: IOOOHPaneProps) => JSX.Element;
3
+ export declare const OutOfOfficeHoursPaneStateful: (props: IOOOHPaneProps) => React.JSX.Element;
3
4
  export default OutOfOfficeHoursPaneStateful;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { ILoadingPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/loadingpane/interfaces/ILoadingPaneProps";
2
- export declare const PostChatLoadingPaneStateful: (props: ILoadingPaneProps) => JSX.Element;
3
+ export declare const PostChatLoadingPaneStateful: (props: ILoadingPaneProps) => React.JSX.Element;
3
4
  export default PostChatLoadingPaneStateful;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { IPostChatSurveyPaneStatefulProps } from "./interfaces/IPostChatSurveyPaneStatefulProps";
2
- export declare const PostChatSurveyPaneStateful: (props: IPostChatSurveyPaneStatefulProps) => JSX.Element;
3
+ export declare const PostChatSurveyPaneStateful: (props: IPostChatSurveyPaneStatefulProps) => React.JSX.Element;
3
4
  export default PostChatSurveyPaneStateful;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { IPreChatSurveyPaneStatefulParams } from "./interfaces/IPreChatSurveyPaneStatefulParams";
2
- export declare const PreChatSurveyPaneStateful: (props: IPreChatSurveyPaneStatefulParams) => JSX.Element;
3
+ export declare const PreChatSurveyPaneStateful: (props: IPreChatSurveyPaneStatefulParams) => React.JSX.Element;
3
4
  export default PreChatSurveyPaneStateful;
@@ -1,2 +1,3 @@
1
- export declare const ProactiveChatPaneStateful: (props: any) => JSX.Element;
1
+ import React from "react";
2
+ export declare const ProactiveChatPaneStateful: (props: any) => React.JSX.Element;
2
3
  export default ProactiveChatPaneStateful;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { IReconnectChatPaneStatefulParams } from "./interfaces/IReconnectChatPaneStatefulParams";
2
- export declare const ReconnectChatPaneStateful: (props: IReconnectChatPaneStatefulParams) => JSX.Element;
3
+ export declare const ReconnectChatPaneStateful: (props: IReconnectChatPaneStatefulParams) => React.JSX.Element;
3
4
  export default ReconnectChatPaneStateful;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { IStartChatErrorPaneProps } from "./interfaces/IStartChatErrorPaneProps";
2
- export declare const StartChatErrorPaneStateful: (startChatErrorPaneProps: IStartChatErrorPaneProps) => JSX.Element;
3
+ export declare const StartChatErrorPaneStateful: (startChatErrorPaneProps: IStartChatErrorPaneProps) => React.JSX.Element;
3
4
  export default StartChatErrorPaneStateful;
@@ -1,3 +1,4 @@
1
+ import React from "react";
1
2
  import { ILiveChatWidgetProps } from "../livechatwidget/interfaces/ILiveChatWidgetProps";
2
- export declare const WebChatContainerStateful: (props: ILiveChatWidgetProps) => JSX.Element;
3
+ export declare const WebChatContainerStateful: (props: ILiveChatWidgetProps) => React.JSX.Element;
3
4
  export default WebChatContainerStateful;
@@ -1,2 +1,3 @@
1
- declare const Attachment: (props: any) => JSX.Element;
1
+ import React from "react";
2
+ declare const Attachment: (props: any) => React.JSX.Element;
2
3
  export default Attachment;
@@ -1,2 +1,3 @@
1
- declare const AttachmentContent: (props: any) => JSX.Element;
1
+ import React from "react";
2
+ declare const AttachmentContent: (props: any) => React.JSX.Element;
2
3
  export default AttachmentContent;
@@ -1,2 +1,3 @@
1
- declare const AttachmentIcon: (props: any) => JSX.Element;
1
+ import React from "react";
2
+ declare const AttachmentIcon: (props: any) => React.JSX.Element;
2
3
  export default AttachmentIcon;
@@ -1,2 +1,3 @@
1
- declare const DownloadBlockedAttachment: (props: any) => JSX.Element;
1
+ import React from "react";
2
+ declare const DownloadBlockedAttachment: (props: any) => React.JSX.Element;
2
3
  export default DownloadBlockedAttachment;
@@ -1,2 +1,3 @@
1
- declare const MaliciousAttachment: (props: any) => JSX.Element;
1
+ import React from "react";
2
+ declare const MaliciousAttachment: (props: any) => React.JSX.Element;
2
3
  export default MaliciousAttachment;
@@ -1,2 +1,3 @@
1
- declare const ScanInProgressAttachment: (props: any) => JSX.Element;
1
+ import React from "react";
2
+ declare const ScanInProgressAttachment: (props: any) => React.JSX.Element;
2
3
  export default ScanInProgressAttachment;
@@ -1,2 +1,3 @@
1
- declare const Spinner: (props: any) => JSX.Element;
1
+ import React from "react";
2
+ declare const Spinner: (props: any) => React.JSX.Element;
2
3
  export default Spinner;
@@ -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, avatarTextStyleProps?: React.CSSProperties) => () => (next: any) => (args_0: any) => false | (() => React.JSX.Element);
@@ -1 +1,2 @@
1
- export declare const DeliveredTimestamp: ({ args, role, name }: any) => JSX.Element;
1
+ import React from "react";
2
+ export declare const DeliveredTimestamp: ({ args, role, name }: any) => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const NotDeliveredTimestamp: ({ args }: any) => JSX.Element;
1
+ import React from "react";
2
+ export declare const NotDeliveredTimestamp: ({ args }: any) => React.JSX.Element;
@@ -1 +1,2 @@
1
- export declare const SendingTimestamp: () => JSX.Element;
1
+ import React from "react";
2
+ export declare const SendingTimestamp: () => React.JSX.Element;
@@ -3,4 +3,5 @@
3
3
  *
4
4
  * This middleware changes the component that shows who's actively typing. It uses the default Microsoft LiveChatWidget styles.
5
5
  ******/
6
- export declare const typingIndicatorMiddleware: () => (next: any) => (args: any) => JSX.Element;
6
+ import React from "react";
7
+ export declare const typingIndicatorMiddleware: () => (next: any) => (args: any) => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "1.7.8-main.50111af",
3
+ "version": "1.7.8-main.8428c08",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -32,15 +32,16 @@
32
32
  "@storybook/addon-storyshots": "^6.4.8",
33
33
  "@storybook/react": "^6.4.8",
34
34
  "@storybook/testing-react": "^1.2.1",
35
- "@testing-library/jest-dom": "^5.15.0",
36
- "@testing-library/react": "^12.1.2",
35
+ "@testing-library/dom": "^10.4.0",
36
+ "@testing-library/jest-dom": "^6.6.3",
37
+ "@testing-library/react": "^16.2.0",
37
38
  "@types/core-js": "^2.5.5",
38
39
  "@types/dompurify": "^2.3.3",
39
40
  "@types/jest": "^27.0.2",
40
41
  "@types/jest-image-snapshot": "^4.3.1",
41
42
  "@types/markdown-it": "^12.2.3",
42
- "@types/react": "^17.0.30",
43
- "@types/react-dom": "^17.0.10",
43
+ "@types/react": "^18.3.13",
44
+ "@types/react-dom": "^18.3.6",
44
45
  "@types/styled-components": "^5.1.15",
45
46
  "@typescript-eslint/eslint-plugin": "^5.3.0",
46
47
  "@typescript-eslint/parser": "^5.2.0",
@@ -66,10 +67,10 @@
66
67
  "p-defer": "^4.0.1",
67
68
  "playwright": "^1.20.0",
68
69
  "postcss": "^8.3.9",
69
- "react": "^17.0.2",
70
+ "react": "^18.3.1",
70
71
  "react-docgen-typescript-plugin": "^1.0.8",
71
- "react-dom": "^17.0.2",
72
- "react-test-renderer": "^17.0.2",
72
+ "react-dom": "^18.3.1",
73
+ "react-test-renderer": "^18.3.1",
73
74
  "rimraf": "^6.0.1",
74
75
  "storybook-addon-playwright": "^4.9.2",
75
76
  "swiper": "^9.0.5",
@@ -82,6 +83,7 @@
82
83
  },
83
84
  "dependencies": {
84
85
  "@azure/core-tracing": "^1.2.0",
86
+ "@microsoft/applicationinsights-web": "^3.3.6",
85
87
  "@microsoft/omnichannel-chat-components": "1.1.9",
86
88
  "@microsoft/omnichannel-chat-sdk": "^1.10.17",
87
89
  "@opentelemetry/api": "^1.9.0",