@microsoft/omnichannel-chat-widget 1.7.5-main.290ba08 → 1.7.5

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 (38) hide show
  1. package/lib/cjs/common/telemetry/TelemetryConstants.js +31 -0
  2. package/lib/cjs/common/telemetry/TelemetryHelper.js +10 -0
  3. package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +15 -1
  4. package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +14 -2
  5. package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +12 -0
  6. package/lib/cjs/components/footerstateful/FooterStateful.js +15 -0
  7. package/lib/cjs/components/headerstateful/HeaderStateful.js +16 -2
  8. package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +35 -2
  9. package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +14 -2
  10. package/lib/cjs/components/notificationpanestateful/NotificationPaneStateful.js +21 -7
  11. package/lib/cjs/components/ooohpanestateful/OOOHPaneStateful.js +12 -1
  12. package/lib/cjs/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +14 -3
  13. package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +13 -0
  14. package/lib/cjs/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +12 -0
  15. package/lib/cjs/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +12 -1
  16. package/lib/cjs/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +19 -8
  17. package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +14 -1
  18. package/lib/esm/common/telemetry/TelemetryConstants.js +31 -0
  19. package/lib/esm/common/telemetry/TelemetryHelper.js +10 -0
  20. package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +15 -1
  21. package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +14 -3
  22. package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +13 -1
  23. package/lib/esm/components/footerstateful/FooterStateful.js +14 -0
  24. package/lib/esm/components/headerstateful/HeaderStateful.js +16 -2
  25. package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +35 -2
  26. package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +13 -2
  27. package/lib/esm/components/notificationpanestateful/NotificationPaneStateful.js +21 -7
  28. package/lib/esm/components/ooohpanestateful/OOOHPaneStateful.js +12 -1
  29. package/lib/esm/components/postchatloadingpanestateful/PostChatLoadingPaneStateful.js +14 -3
  30. package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +13 -1
  31. package/lib/esm/components/proactivechatpanestateful/ProactiveChatPaneStateful.js +11 -0
  32. package/lib/esm/components/reconnectchatpanestateful/ReconnectChatPaneStateful.js +12 -1
  33. package/lib/esm/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +19 -8
  34. package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +14 -1
  35. package/lib/types/common/telemetry/TelemetryConstants.d.ts +32 -1
  36. package/lib/types/common/telemetry/TelemetryHelper.d.ts +1 -0
  37. package/lib/types/common/telemetry/definitions/Payload.d.ts +13 -0
  38. package/package.json +2 -2
@@ -9,10 +9,17 @@ import { ProactiveChatPane } from "@microsoft/omnichannel-chat-components";
9
9
  import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
10
10
  import { TelemetryTimers } from "../../common/telemetry/TelemetryManager";
11
11
  import useChatContextStore from "../../hooks/useChatContextStore";
12
+ let uiTimer;
12
13
 
13
14
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
14
15
  export const ProactiveChatPaneStateful = props => {
15
16
  var _proactiveChatProps$c;
17
+ useEffect(() => {
18
+ uiTimer = createTimer();
19
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
20
+ Event: TelemetryEvent.UXProactiveChatPaneStart
21
+ });
22
+ }, []);
16
23
  const [state, dispatch] = useChatContextStore();
17
24
  const {
18
25
  proactiveChatProps,
@@ -114,6 +121,10 @@ export const ProactiveChatPaneStateful = props => {
114
121
  TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
115
122
  Event: TelemetryEvent.ProactiveChatPaneLoaded
116
123
  });
124
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
125
+ Event: TelemetryEvent.UXProactiveChatCompleted,
126
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
127
+ });
117
128
  return () => {
118
129
  clearTimeout(timeoutEvent);
119
130
  };
@@ -1,13 +1,21 @@
1
1
  import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
2
2
  import React, { useEffect } from "react";
3
+ import { createTimer, setFocusOnElement } from "../../common/utils";
3
4
  import { ConversationState } from "../../contexts/common/ConversationState";
4
5
  import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
5
6
  import { ReconnectChatPane } from "@microsoft/omnichannel-chat-components";
6
7
  import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
7
- import { setFocusOnElement } from "../../common/utils";
8
8
  import useChatContextStore from "../../hooks/useChatContextStore";
9
9
  import useFacadeChatSDKStore from "../../hooks/useFacadeChatSDKStore";
10
+ let uiTimer;
10
11
  export const ReconnectChatPaneStateful = props => {
12
+ useEffect(() => {
13
+ uiTimer = createTimer();
14
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
15
+ Event: TelemetryEvent.UXReconnectChatPaneStart,
16
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
17
+ });
18
+ }, []);
11
19
  const [state, dispatch] = useChatContextStore();
12
20
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
13
21
  //const chatSDK: any = useChatSDKStore();
@@ -91,6 +99,9 @@ export const ReconnectChatPaneStateful = props => {
91
99
  TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
92
100
  Event: TelemetryEvent.ReconnectChatPaneLoaded
93
101
  });
102
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
103
+ Event: TelemetryEvent.UXReconnectChatCompleted
104
+ });
94
105
  }, []);
95
106
  return /*#__PURE__*/React.createElement(ReconnectChatPane, {
96
107
  componentOverrides: reconnectChatProps === null || reconnectChatProps === void 0 ? void 0 : reconnectChatProps.componentOverrides,
@@ -1,18 +1,25 @@
1
+ import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
1
2
  import React, { useEffect } from "react";
3
+ import { createTimer, findAllFocusableElement } from "../../common/utils";
2
4
  import { LoadingPane } from "@microsoft/omnichannel-chat-components";
3
- import { findAllFocusableElement } from "../../common/utils";
4
- import useChatContextStore from "../../hooks/useChatContextStore";
5
+ import { StartChatErrorPaneConstants } from "../../common/Constants";
6
+ import { StartChatFailureType } from "../../contexts/common/StartChatFailureType";
5
7
  import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
6
- import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
7
8
  import { defaultStartChatErrorPaneGeneralStyleProps } from "./common/defaultStartChatErrorPaneGeneralStyleProps";
8
- import { defaultStartChatErrorPaneTitleStyleProps } from "./common/defaultStartChatErrorPaneTitleStyleProps";
9
- import { defaultStartChatErrorPaneSubtitleStyleProps } from "./common/defaultStartChatErrorPaneSubtitleStyleProps";
10
- import { defaultStartChatErrorPaneIconStyleProps } from "./common/defaultStartChatErrorPaneIconStyleProps";
11
9
  import { defaultStartChatErrorPaneIconImageStyleProps } from "./common/defaultStartChatErrorPaneIconImageProps";
12
- import { StartChatErrorPaneConstants } from "../../common/Constants";
13
- import { StartChatFailureType } from "../../contexts/common/StartChatFailureType";
10
+ import { defaultStartChatErrorPaneIconStyleProps } from "./common/defaultStartChatErrorPaneIconStyleProps";
11
+ import { defaultStartChatErrorPaneSubtitleStyleProps } from "./common/defaultStartChatErrorPaneSubtitleStyleProps";
12
+ import { defaultStartChatErrorPaneTitleStyleProps } from "./common/defaultStartChatErrorPaneTitleStyleProps";
13
+ import useChatContextStore from "../../hooks/useChatContextStore";
14
+ let uiTimer;
14
15
  export const StartChatErrorPaneStateful = startChatErrorPaneProps => {
15
16
  var _startChatErrorPanePr, _startChatErrorPanePr2, _startChatErrorPanePr3, _startChatErrorPanePr4, _startChatErrorPanePr5, _startChatErrorPanePr6, _startChatErrorPanePr7, _startChatErrorPanePr8, _startChatErrorPanePr9, _startChatErrorPanePr10, _startChatErrorPanePr11;
17
+ useEffect(() => {
18
+ uiTimer = createTimer();
19
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
20
+ Event: TelemetryEvent.UXStartChatErrorPaneStart
21
+ });
22
+ }, []);
16
23
  const [state] = useChatContextStore();
17
24
  const generalStyleProps = Object.assign({}, defaultStartChatErrorPaneGeneralStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr === void 0 ? void 0 : _startChatErrorPanePr.generalStyleProps);
18
25
  const titleStyleProps = Object.assign({}, defaultStartChatErrorPaneTitleStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr2 = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr2 === void 0 ? void 0 : _startChatErrorPanePr2.titleStyleProps);
@@ -61,6 +68,10 @@ export const StartChatErrorPaneStateful = startChatErrorPaneProps => {
61
68
  Event: TelemetryEvent.StartChatErrorPaneLoaded,
62
69
  Description: "Start chat error pane loaded."
63
70
  });
71
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
72
+ Event: TelemetryEvent.UXStartChatErrorCompleted,
73
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
74
+ });
64
75
  }, []);
65
76
  return /*#__PURE__*/React.createElement(LoadingPane, {
66
77
  componentOverrides: startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : startChatErrorPaneProps.componentOverrides,
@@ -3,6 +3,7 @@
3
3
  import { Stack } from "@fluentui/react";
4
4
  import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
5
5
  import React, { useEffect } from "react";
6
+ import { createTimer, setFocusOnSendBox } from "../../common/utils";
6
7
  import { BotMagicCodeStore } from "./webchatcontroller/BotMagicCodeStore";
7
8
  import { Components } from "botframework-webchat";
8
9
  import { Constants } from "../../common/Constants";
@@ -19,8 +20,8 @@ import { defaultSentMessageAnchorStyles } from "./webchatcontroller/middlewares/
19
20
  import { defaultSystemMessageBoxStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles";
20
21
  import { defaultUserMessageBoxStyles } from "./webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles";
21
22
  import { defaultWebChatContainerStatefulProps } from "./common/defaultProps/defaultWebChatContainerStatefulProps";
22
- import { setFocusOnSendBox } from "../../common/utils";
23
23
  import { useChatContextStore } from "../..";
24
+ let uiTimer;
24
25
  const broadcastChannelMessageEvent = "message";
25
26
  const postActivity = activity => {
26
27
  // eslint-disable-line @typescript-eslint/no-explicit-any
@@ -48,6 +49,12 @@ const createMagicCodeSuccessResponse = signin => {
48
49
  };
49
50
  export const WebChatContainerStateful = props => {
50
51
  var _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _props$webChatContain5, _props$webChatContain6, _defaultWebChatContai, _props$webChatContain7, _props$webChatContain8, _defaultWebChatContai2, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15, _props$webChatContain9, _props$webChatContain10;
52
+ useEffect(() => {
53
+ uiTimer = createTimer();
54
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
55
+ Event: TelemetryEvent.UXWebchatContainerCompleted
56
+ });
57
+ }, []);
51
58
  const {
52
59
  BasicWebChat
53
60
  } = Components;
@@ -143,6 +150,12 @@ export const WebChatContainerStateful = props => {
143
150
  };
144
151
  magicCodeBroadcastChannel.addEventListener(broadcastChannelMessageEvent, eventListener);
145
152
  }, []);
153
+ useEffect(() => {
154
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
155
+ Event: TelemetryEvent.UXWebchatContainerCompleted,
156
+ ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
157
+ });
158
+ }, []);
146
159
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("style", null, `
147
160
  .webchat__stacked-layout__content .ac-pushButton {
148
161
  cursor: pointer;
@@ -160,6 +160,7 @@ export declare enum TelemetryEvent {
160
160
  SetBotAuthProviderNotFound = "SetBotAuthProviderNotFound",
161
161
  BotAuthActivityUndefinedSignInId = "BotAuthActivityUndefinedSignInId",
162
162
  ThirdPartyCookiesBlocked = "ThirdPartyCookiesBlocked",
163
+ ParticipantsRemovedEvent = "ParticipantsRemovedEvent",
163
164
  ProcessingHTMLTextMiddlewareFailed = "ProcessingHTMLTextMiddlewareFailed",
164
165
  ProcessingSanitizationMiddlewareFailed = "ProcessingSanitizationMiddlewareFailed",
165
166
  FormatTagsMiddlewareJSONStringifyFailed = "FormatTagsMiddlewareJSONStringifyFailed",
@@ -210,7 +211,37 @@ export declare enum TelemetryEvent {
210
211
  NewTokenSuccess = "NewTokenSuccess",
211
212
  NewTokenFailed = "NewTokenFailed",
212
213
  NewTokenExpired = "NewTokenExpired",
213
- TokenEmptyOrSame = "TokenEmptyOrSame"
214
+ TokenEmptyOrSame = "TokenEmptyOrSame",
215
+ UXFooterStart = "UXFooterStart",
216
+ UXFooterCompleted = "UXFooterCompleted",
217
+ UXHeaderStart = "UXHeaderStart",
218
+ UXHeaderCompleted = "UXHeaderCompleted",
219
+ UXLoadingPaneStart = "UXLoadingPaneStart",
220
+ UXLoadingPaneCompleted = "UXLoadingPaneCompleted",
221
+ UXNotificationPaneStart = "UXNotificationPaneStart",
222
+ UXNotificationPaneCompleted = "UXNotificationPaneCompleted",
223
+ UXOOHPaneStart = "UXOOHPaneStart",
224
+ UXOOHPaneCompleted = "UXOOHPaneCompleted",
225
+ UXPostChatLoadingPaneStart = "UXPostChatLoadingPaneStart",
226
+ UXPostChatLoadingPaneCompleted = "UXPostChatLoadingPaneCompleted",
227
+ UXPrechatPaneStart = "UXPrechatPaneStart",
228
+ UXPrechatPaneCompleted = "UXPrechatPaneCompleted",
229
+ UXProactiveChatPaneStart = "UXProactiveChatPaneStart",
230
+ UXProactiveChatCompleted = "UXProactiveChatCompleted",
231
+ UXReconnectChatPaneStart = "UXReconnectChatPaneStart",
232
+ UXReconnectChatCompleted = "UXReconnectChatCompleted",
233
+ UXStartChatErrorPaneStart = "UXStartChatErrorPaneStart",
234
+ UXStartChatErrorCompleted = "UXStartChatErrorCompleted",
235
+ UXEmailTranscriptPaneStart = "UXEmailTranscriptPaneStart",
236
+ UXEmailTranscriptPaneCompleted = "UXEmailTranscriptPaneCompleted",
237
+ UXWebchatContainerStart = "UXWebchatContainerStart",
238
+ UXWebchatContainerCompleted = "UXWebchatContainerCompleted",
239
+ UXLCWChatButtonStart = "UXLCWChatButtonStart",
240
+ UXLCWChatButtonCompleted = "UXLCWChatButtonCompleted",
241
+ UXConfirmationPaneStart = "UXConfirmationPaneStart",
242
+ UXConfirmationPaneCompleted = "UXConfirmationPaneCompleted",
243
+ UXLivechatwidgetStart = "UXLivechatwidgetStart",
244
+ UXLivechatwidgetCompleted = "UXLivechatwidgetCompleted"
214
245
  }
215
246
  export interface TelemetryInput {
216
247
  scenarioType: ScenarioType;
@@ -33,6 +33,7 @@ export declare class TelemetryHelper {
33
33
  static addConversationDataToTelemetry(liveWorkItem: LiveWorkItemDetails, telemetryInternalData: IInternalTelemetryData): IInternalTelemetryData;
34
34
  static logCallingEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper, callId?: string | undefined) => void;
35
35
  static logLoadingEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
36
+ static logUIEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
36
37
  static logActionEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
37
38
  static logSDKEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
38
39
  static logConfigDataEvent: (logLevel: LogLevel, payload: TelemetryEventWrapper) => void;
@@ -24,6 +24,19 @@ export interface LoadTelemetryData extends BaseTelemetryData {
24
24
  OCChatComponentsVersion?: string;
25
25
  Description?: string;
26
26
  }
27
+ export interface UITelemetryData extends BaseTelemetryData {
28
+ Event?: string;
29
+ ResourcePath?: string;
30
+ ElapsedTimeInMilliseconds?: number;
31
+ WidgetState?: string;
32
+ ChatState?: string;
33
+ ChatType?: string;
34
+ ExceptionDetails?: object;
35
+ OCChatSDKVersion?: string;
36
+ OCChatWidgetVersion?: string;
37
+ OCChatComponentsVersion?: string;
38
+ Description?: string;
39
+ }
27
40
  export interface MessageProcessingErrorData extends BaseTelemetryData {
28
41
  Event: string;
29
42
  ExceptionDetails: object;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "1.7.5-main.290ba08",
3
+ "version": "1.7.5",
4
4
  "description": "Microsoft Omnichannel Chat Widget",
5
5
  "main": "lib/cjs/index.js",
6
6
  "types": "lib/types/index.d.ts",
@@ -76,7 +76,7 @@
76
76
  "dependencies": {
77
77
  "@azure/core-tracing": "^1.2.0",
78
78
  "@microsoft/omnichannel-chat-components": "1.1.5",
79
- "@microsoft/omnichannel-chat-sdk": "^1.10.6",
79
+ "@microsoft/omnichannel-chat-sdk": "^1.10.9",
80
80
  "@opentelemetry/api": "^1.9.0",
81
81
  "abort-controller-es5": "^2.0.1",
82
82
  "dompurify": "^2.5.4",