@microsoft/omnichannel-chat-widget 1.7.5 → 1.7.6-main.d227a81

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.
@@ -141,6 +141,7 @@ exports.TelemetryEvent = TelemetryEvent;
141
141
  TelemetryEvent["ConfirmationCancelButtonClicked"] = "ConfirmationCancelButtonClicked";
142
142
  TelemetryEvent["ConfirmationConfirmButtonClicked"] = "ConfirmationConfirmButtonClicked";
143
143
  TelemetryEvent["LoadingPaneLoaded"] = "LoadingPaneLoaded";
144
+ TelemetryEvent["LoadingPaneUnloaded"] = "LoadingPaneUnloaded";
144
145
  TelemetryEvent["StartChatErrorPaneLoaded"] = "StartChatErrorPaneLoaded";
145
146
  TelemetryEvent["EmailTranscriptLoaded"] = "EmailTranscriptLoaded";
146
147
  TelemetryEvent["OutOfOfficePaneLoaded"] = "OutOfOfficePaneLoaded";
@@ -73,6 +73,12 @@ const LoadingPaneStateful = props => {
73
73
  Event: _TelemetryConstants.TelemetryEvent.UXLoadingPaneCompleted,
74
74
  ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
75
75
  });
76
+ return () => {
77
+ _TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
78
+ Event: _TelemetryConstants.TelemetryEvent.LoadingPaneUnloaded,
79
+ Description: "Loading pane unmount."
80
+ });
81
+ };
76
82
  }, []);
77
83
  return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.LoadingPane, {
78
84
  componentOverrides: loadingPaneProps === null || loadingPaneProps === void 0 ? void 0 : loadingPaneProps.componentOverrides,
@@ -14,7 +14,7 @@ class TranscriptHTMLBuilder {
14
14
  // eslint-disable-line @typescript-eslint/no-explicit-any
15
15
 
16
16
  constructor(options) {
17
- var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options8, _this$options9, _this$options10, _this$options11, _this$options12;
17
+ var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options8, _this$options9, _this$options10, _this$options11, _this$options12, _this$options13;
18
18
  _defineProperty(this, "options", void 0);
19
19
  _defineProperty(this, "pageTitle", "Customer Transcript");
20
20
  _defineProperty(this, "attachmentMessage", "The following attachment was uploaded during the conversation: ");
@@ -25,6 +25,7 @@ class TranscriptHTMLBuilder {
25
25
  _defineProperty(this, "agentAvatarFontColor", "#000");
26
26
  _defineProperty(this, "customerAvatarBackgroundColor", "#2266E3");
27
27
  _defineProperty(this, "customerAvatarFontColor", "#FFF");
28
+ _defineProperty(this, "customerDisplayName", "");
28
29
  _defineProperty(this, "disableMarkdownMessageFormatting", false);
29
30
  _defineProperty(this, "disableNewLineMarkdownSupport", false);
30
31
  _defineProperty(this, "externalScripts", {});
@@ -60,13 +61,16 @@ class TranscriptHTMLBuilder {
60
61
  if ((_this$options9 = this.options) !== null && _this$options9 !== void 0 && _this$options9.customerAvatarFontColor) {
61
62
  this.customerAvatarFontColor = this.options.customerAvatarFontColor;
62
63
  }
63
- if ((_this$options10 = this.options) !== null && _this$options10 !== void 0 && _this$options10.disableMarkdownMessageFormatting) {
64
+ if ((_this$options10 = this.options) !== null && _this$options10 !== void 0 && _this$options10.customerDisplayName) {
65
+ this.customerDisplayName = this.options.customerDisplayName;
66
+ }
67
+ if ((_this$options11 = this.options) !== null && _this$options11 !== void 0 && _this$options11.disableMarkdownMessageFormatting) {
64
68
  this.disableMarkdownMessageFormatting = this.options.disableMarkdownMessageFormatting;
65
69
  }
66
- if ((_this$options11 = this.options) !== null && _this$options11 !== void 0 && _this$options11.disableNewLineMarkdownSupport) {
70
+ if ((_this$options12 = this.options) !== null && _this$options12 !== void 0 && _this$options12.disableNewLineMarkdownSupport) {
67
71
  this.disableNewLineMarkdownSupport = this.options.disableNewLineMarkdownSupport;
68
72
  }
69
- if ((_this$options12 = this.options) !== null && _this$options12 !== void 0 && _this$options12.externalScripts) {
73
+ if ((_this$options13 = this.options) !== null && _this$options13 !== void 0 && _this$options13.externalScripts) {
70
74
  this.externalScripts = this.options.externalScripts;
71
75
  }
72
76
  }
@@ -528,7 +532,12 @@ class TranscriptHTMLBuilder {
528
532
  const avatarMiddleware = () => (next) => (...args) => {
529
533
  const [card] = args;
530
534
  const {fromUser, activity} = card;
531
- const initials = getIconText(activity.from.name);
535
+ let displayName = getIconText(activity.from.name);
536
+ let customerDisplayName = '${this.customerDisplayName}';
537
+
538
+ if (fromUser && customerDisplayName) {
539
+ displayName = customerDisplayName;
540
+ }
532
541
 
533
542
  const avatarElement = React.createElement(
534
543
  "div",
@@ -536,7 +545,7 @@ class TranscriptHTMLBuilder {
536
545
  React.createElement(
537
546
  "p",
538
547
  null,
539
- \`\${initials}\`
548
+ \`\${displayName}\`
540
549
  )
541
550
  );
542
551
 
@@ -135,6 +135,7 @@ export let TelemetryEvent;
135
135
  TelemetryEvent["ConfirmationCancelButtonClicked"] = "ConfirmationCancelButtonClicked";
136
136
  TelemetryEvent["ConfirmationConfirmButtonClicked"] = "ConfirmationConfirmButtonClicked";
137
137
  TelemetryEvent["LoadingPaneLoaded"] = "LoadingPaneLoaded";
138
+ TelemetryEvent["LoadingPaneUnloaded"] = "LoadingPaneUnloaded";
138
139
  TelemetryEvent["StartChatErrorPaneLoaded"] = "StartChatErrorPaneLoaded";
139
140
  TelemetryEvent["EmailTranscriptLoaded"] = "EmailTranscriptLoaded";
140
141
  TelemetryEvent["OutOfOfficePaneLoaded"] = "OutOfOfficePaneLoaded";
@@ -64,6 +64,12 @@ export const LoadingPaneStateful = props => {
64
64
  Event: TelemetryEvent.UXLoadingPaneCompleted,
65
65
  ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
66
66
  });
67
+ return () => {
68
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
69
+ Event: TelemetryEvent.LoadingPaneUnloaded,
70
+ Description: "Loading pane unmount."
71
+ });
72
+ };
67
73
  }, []);
68
74
  return /*#__PURE__*/React.createElement(LoadingPane, {
69
75
  componentOverrides: loadingPaneProps === null || loadingPaneProps === void 0 ? void 0 : loadingPaneProps.componentOverrides,
@@ -9,7 +9,7 @@ class TranscriptHTMLBuilder {
9
9
  // eslint-disable-line @typescript-eslint/no-explicit-any
10
10
 
11
11
  constructor(options) {
12
- var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options8, _this$options9, _this$options10, _this$options11, _this$options12;
12
+ var _this$options, _this$options2, _this$options3, _this$options4, _this$options5, _this$options6, _this$options7, _this$options8, _this$options9, _this$options10, _this$options11, _this$options12, _this$options13;
13
13
  _defineProperty(this, "options", void 0);
14
14
  _defineProperty(this, "pageTitle", "Customer Transcript");
15
15
  _defineProperty(this, "attachmentMessage", "The following attachment was uploaded during the conversation: ");
@@ -20,6 +20,7 @@ class TranscriptHTMLBuilder {
20
20
  _defineProperty(this, "agentAvatarFontColor", "#000");
21
21
  _defineProperty(this, "customerAvatarBackgroundColor", "#2266E3");
22
22
  _defineProperty(this, "customerAvatarFontColor", "#FFF");
23
+ _defineProperty(this, "customerDisplayName", "");
23
24
  _defineProperty(this, "disableMarkdownMessageFormatting", false);
24
25
  _defineProperty(this, "disableNewLineMarkdownSupport", false);
25
26
  _defineProperty(this, "externalScripts", {});
@@ -55,13 +56,16 @@ class TranscriptHTMLBuilder {
55
56
  if ((_this$options9 = this.options) !== null && _this$options9 !== void 0 && _this$options9.customerAvatarFontColor) {
56
57
  this.customerAvatarFontColor = this.options.customerAvatarFontColor;
57
58
  }
58
- if ((_this$options10 = this.options) !== null && _this$options10 !== void 0 && _this$options10.disableMarkdownMessageFormatting) {
59
+ if ((_this$options10 = this.options) !== null && _this$options10 !== void 0 && _this$options10.customerDisplayName) {
60
+ this.customerDisplayName = this.options.customerDisplayName;
61
+ }
62
+ if ((_this$options11 = this.options) !== null && _this$options11 !== void 0 && _this$options11.disableMarkdownMessageFormatting) {
59
63
  this.disableMarkdownMessageFormatting = this.options.disableMarkdownMessageFormatting;
60
64
  }
61
- if ((_this$options11 = this.options) !== null && _this$options11 !== void 0 && _this$options11.disableNewLineMarkdownSupport) {
65
+ if ((_this$options12 = this.options) !== null && _this$options12 !== void 0 && _this$options12.disableNewLineMarkdownSupport) {
62
66
  this.disableNewLineMarkdownSupport = this.options.disableNewLineMarkdownSupport;
63
67
  }
64
- if ((_this$options12 = this.options) !== null && _this$options12 !== void 0 && _this$options12.externalScripts) {
68
+ if ((_this$options13 = this.options) !== null && _this$options13 !== void 0 && _this$options13.externalScripts) {
65
69
  this.externalScripts = this.options.externalScripts;
66
70
  }
67
71
  }
@@ -523,7 +527,12 @@ class TranscriptHTMLBuilder {
523
527
  const avatarMiddleware = () => (next) => (...args) => {
524
528
  const [card] = args;
525
529
  const {fromUser, activity} = card;
526
- const initials = getIconText(activity.from.name);
530
+ let displayName = getIconText(activity.from.name);
531
+ let customerDisplayName = '${this.customerDisplayName}';
532
+
533
+ if (fromUser && customerDisplayName) {
534
+ displayName = customerDisplayName;
535
+ }
527
536
 
528
537
  const avatarElement = React.createElement(
529
538
  "div",
@@ -531,7 +540,7 @@ class TranscriptHTMLBuilder {
531
540
  React.createElement(
532
541
  "p",
533
542
  null,
534
- \`\${initials}\`
543
+ \`\${displayName}\`
535
544
  )
536
545
  );
537
546
 
@@ -128,6 +128,7 @@ export declare enum TelemetryEvent {
128
128
  ConfirmationCancelButtonClicked = "ConfirmationCancelButtonClicked",
129
129
  ConfirmationConfirmButtonClicked = "ConfirmationConfirmButtonClicked",
130
130
  LoadingPaneLoaded = "LoadingPaneLoaded",
131
+ LoadingPaneUnloaded = "LoadingPaneUnloaded",
131
132
  StartChatErrorPaneLoaded = "StartChatErrorPaneLoaded",
132
133
  EmailTranscriptLoaded = "EmailTranscriptLoaded",
133
134
  OutOfOfficePaneLoaded = "OutOfOfficePaneLoaded",
@@ -10,4 +10,5 @@ export interface IWebChatTranscriptConfig {
10
10
  agentAvatarFontColor?: string;
11
11
  customerAvatarBackgroundColor?: string;
12
12
  customerAvatarFontColor?: string;
13
+ customerDisplayName?: string;
13
14
  }
@@ -16,6 +16,7 @@ declare const createDownloadTranscriptProps: (downloadTranscriptProps: IDownload
16
16
  attachmentMessage?: string | undefined;
17
17
  networkOnlineMessage?: string | undefined;
18
18
  networkOfflineMessage?: string | undefined;
19
+ customerDisplayName?: string | undefined;
19
20
  };
20
21
  attachmentMessage?: string | undefined;
21
22
  bannerMessageOnError?: string | undefined;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "1.7.5",
3
+ "version": "1.7.6-main.d227a81",
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.9",
79
+ "@microsoft/omnichannel-chat-sdk": "^1.10.11",
80
80
  "@opentelemetry/api": "^1.9.0",
81
81
  "abort-controller-es5": "^2.0.1",
82
82
  "dompurify": "^2.5.4",