@microsoft/omnichannel-chat-widget 1.7.4-main.e66bbe9 → 1.7.4

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.
@@ -122,6 +122,7 @@ exports.TelemetryEvent = TelemetryEvent;
122
122
  TelemetryEvent["CloseChatCall"] = "CloseChatCall";
123
123
  TelemetryEvent["CloseChatMethodException"] = "CloseChatMethodException";
124
124
  TelemetryEvent["PrechatSurveyLoaded"] = "PrechatSurveyLoaded";
125
+ TelemetryEvent["PrechatSurveyExpected"] = "PrechatSurveyExpected";
125
126
  TelemetryEvent["PrechatSubmitted"] = "PrechatSubmitted";
126
127
  TelemetryEvent["StartChatSDKCall"] = "StartChatCall";
127
128
  TelemetryEvent["StartChatEventRecevied"] = "StartChatEventReceived";
@@ -110,6 +110,9 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
110
110
  return;
111
111
  } else {
112
112
  var _state$appStates;
113
+ _TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
114
+ Event: _TelemetryConstants.TelemetryEvent.PrechatSurveyExpected
115
+ });
113
116
  dispatch({
114
117
  type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_PRE_CHAT_SURVEY_RESPONSE,
115
118
  payload: preChatSurveyResponse
@@ -42,6 +42,9 @@ const PostChatSurveyPaneStateful = props => {
42
42
  } else {
43
43
  surveyInviteLink = generateSurveyInviteLink(state.domainStates.postChatContext.surveyInviteLink, surveyMode, state.domainStates.postChatContext.formsProLocale, props.isCustomerVoiceSurveyCompact ?? true);
44
44
  }
45
+ if (props.copilotSurveyContext) {
46
+ surveyInviteLink = `${surveyInviteLink}&mcs_additionalcontext=${JSON.stringify(props.copilotSurveyContext)}`;
47
+ }
45
48
  const styleProps = {
46
49
  ...props.styleProps,
47
50
  generalStyleProps: generalStyleProps
@@ -8,9 +8,9 @@ var _Constants = require("../../common/Constants");
8
8
  var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _utils = require("../../common/utils");
11
- var _markdownIt = _interopRequireDefault(require("markdown-it"));
12
11
  var _ConversationState = require("../../contexts/common/ConversationState");
13
12
  var _LiveChatWidgetActionType = require("../../contexts/common/LiveChatWidgetActionType");
13
+ var _markdownIt = _interopRequireDefault(require("markdown-it"));
14
14
  var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
15
15
  var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
16
16
  var _defaultGeneralPreChatSurveyPaneStyleProps = require("./common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps");
@@ -116,6 +116,7 @@ export let TelemetryEvent;
116
116
  TelemetryEvent["CloseChatCall"] = "CloseChatCall";
117
117
  TelemetryEvent["CloseChatMethodException"] = "CloseChatMethodException";
118
118
  TelemetryEvent["PrechatSurveyLoaded"] = "PrechatSurveyLoaded";
119
+ TelemetryEvent["PrechatSurveyExpected"] = "PrechatSurveyExpected";
119
120
  TelemetryEvent["PrechatSubmitted"] = "PrechatSubmitted";
120
121
  TelemetryEvent["StartChatSDKCall"] = "StartChatCall";
121
122
  TelemetryEvent["StartChatEventRecevied"] = "StartChatEventReceived";
@@ -104,6 +104,9 @@ const setPreChatAndInitiateChat = async (facadeChatSDK, dispatch, setAdapter, is
104
104
  return;
105
105
  } else {
106
106
  var _state$appStates;
107
+ TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
108
+ Event: TelemetryEvent.PrechatSurveyExpected
109
+ });
107
110
  dispatch({
108
111
  type: LiveChatWidgetActionType.SET_PRE_CHAT_SURVEY_RESPONSE,
109
112
  payload: preChatSurveyResponse
@@ -33,6 +33,9 @@ export const PostChatSurveyPaneStateful = props => {
33
33
  } else {
34
34
  surveyInviteLink = generateSurveyInviteLink(state.domainStates.postChatContext.surveyInviteLink, surveyMode, state.domainStates.postChatContext.formsProLocale, props.isCustomerVoiceSurveyCompact ?? true);
35
35
  }
36
+ if (props.copilotSurveyContext) {
37
+ surveyInviteLink = `${surveyInviteLink}&mcs_additionalcontext=${JSON.stringify(props.copilotSurveyContext)}`;
38
+ }
36
39
  const styleProps = {
37
40
  ...props.styleProps,
38
41
  generalStyleProps: generalStyleProps
@@ -2,9 +2,9 @@ import { HtmlAttributeNames, Regex } from "../../common/Constants";
2
2
  import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
3
3
  import React, { useEffect } from "react";
4
4
  import { extractPreChatSurveyResponseValues, findAllFocusableElement, getStateFromCache, getWidgetCacheId, isUndefinedOrEmpty, parseAdaptiveCardPayload } from "../../common/utils";
5
- import MarkdownIt from "markdown-it";
6
5
  import { ConversationState } from "../../contexts/common/ConversationState";
7
6
  import { LiveChatWidgetActionType } from "../../contexts/common/LiveChatWidgetActionType";
7
+ import MarkdownIt from "markdown-it";
8
8
  import { PreChatSurveyPane } from "@microsoft/omnichannel-chat-components";
9
9
  import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
10
10
  import { defaultGeneralPreChatSurveyPaneStyleProps } from "./common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps";
@@ -109,6 +109,7 @@ export declare enum TelemetryEvent {
109
109
  CloseChatCall = "CloseChatCall",
110
110
  CloseChatMethodException = "CloseChatMethodException",
111
111
  PrechatSurveyLoaded = "PrechatSurveyLoaded",
112
+ PrechatSurveyExpected = "PrechatSurveyExpected",
112
113
  PrechatSubmitted = "PrechatSubmitted",
113
114
  StartChatSDKCall = "StartChatCall",
114
115
  StartChatEventRecevied = "StartChatEventReceived",
@@ -1,4 +1,5 @@
1
1
  import { IPostChatSurveyPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/postchatsurveypane/interfaces/IPostChatSurveyPaneProps";
2
2
  export interface IPostChatSurveyPaneStatefulProps extends IPostChatSurveyPaneProps {
3
3
  isCustomerVoiceSurveyCompact?: boolean;
4
+ copilotSurveyContext?: Record<string, string>;
4
5
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@microsoft/omnichannel-chat-widget",
3
- "version": "1.7.4-main.e66bbe9",
3
+ "version": "1.7.4",
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.4",
79
+ "@microsoft/omnichannel-chat-sdk": "^1.10.6",
80
80
  "@opentelemetry/api": "^1.9.0",
81
81
  "abort-controller-es5": "^2.0.1",
82
82
  "dompurify": "^2.5.4",