@microsoft/omnichannel-chat-widget 0.1.0-main.86df755 → 0.1.0-main.cf54410
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.
- package/lib/cjs/common/Constants.js +2 -0
- package/lib/cjs/common/contextDataStore/DataStoreManager.js +14 -0
- package/lib/cjs/common/interfaces/IContextDataStore.js +1 -0
- package/lib/cjs/common/telemetry/TelemetryConstants.js +1 -0
- package/lib/cjs/common/telemetry/TelemetryHelper.js +9 -4
- package/lib/cjs/common/telemetry/TelemetryManager.js +12 -4
- package/lib/cjs/common/telemetry/defaultConfigs/defaultAriaConfig.js +3 -3
- package/lib/cjs/common/telemetry/loggers/ariaTelemetryLogger.js +14 -1
- package/lib/cjs/common/telemetry/loggers/consoleLogger.js +3 -0
- package/lib/cjs/components/chatbuttonstateful/ChatButtonStateful.js +8 -1
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +13 -26
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +27 -26
- package/lib/cjs/components/livechatwidget/common/disposeTelemetryLoggers.js +14 -0
- package/lib/cjs/components/livechatwidget/common/endChat.js +8 -0
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +8 -9
- package/lib/cjs/components/livechatwidget/common/registerTelemetryLoggers.js +18 -3
- package/lib/cjs/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +23 -22
- package/lib/cjs/components/livechatwidget/common/startChat.js +64 -18
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +27 -13
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +25 -8
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +4 -0
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +6 -3
- package/lib/cjs/contexts/createReducer.js +27 -0
- package/lib/esm/common/Constants.js +2 -0
- package/lib/esm/common/contextDataStore/DataStoreManager.js +5 -0
- package/lib/esm/common/interfaces/IContextDataStore.js +1 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +1 -0
- package/lib/esm/common/telemetry/TelemetryHelper.js +9 -4
- package/lib/esm/common/telemetry/TelemetryManager.js +8 -4
- package/lib/esm/common/telemetry/defaultConfigs/defaultAriaConfig.js +3 -3
- package/lib/esm/common/telemetry/loggers/ariaTelemetryLogger.js +14 -1
- package/lib/esm/common/telemetry/loggers/consoleLogger.js +3 -0
- package/lib/esm/components/chatbuttonstateful/ChatButtonStateful.js +9 -1
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +13 -26
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +29 -28
- package/lib/esm/components/livechatwidget/common/disposeTelemetryLoggers.js +4 -0
- package/lib/esm/components/livechatwidget/common/endChat.js +8 -0
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +8 -9
- package/lib/esm/components/livechatwidget/common/registerTelemetryLoggers.js +18 -2
- package/lib/esm/components/livechatwidget/common/setPostChatContextAndLoadSurvey.js +22 -22
- package/lib/esm/components/livechatwidget/common/startChat.js +62 -17
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +23 -12
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +26 -10
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +4 -0
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +6 -3
- package/lib/esm/contexts/createReducer.js +27 -0
- package/lib/types/common/Constants.d.ts +1 -0
- package/lib/types/common/contextDataStore/DataStoreManager.d.ts +4 -0
- package/lib/types/common/interfaces/IContextDataStore.d.ts +14 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +2 -1
- package/lib/types/common/telemetry/TelemetryManager.d.ts +1 -0
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +3 -0
- package/lib/types/common/telemetry/definitions/Payload.d.ts +3 -0
- package/lib/types/common/telemetry/interfaces/IChatSDKLogger.d.ts +1 -0
- package/lib/types/common/telemetry/interfaces/IInternalTelemetryData.d.ts +2 -0
- package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +12 -0
- package/lib/types/components/livechatwidget/common/disposeTelemetryLoggers.d.ts +1 -0
- package/lib/types/components/livechatwidget/common/setPostChatContextAndLoadSurvey.d.ts +1 -1
- package/lib/types/components/livechatwidget/common/startChat.d.ts +1 -1
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +2 -0
- package/lib/types/components/prechatsurveypanestateful/interfaces/IPreChatSurveyPaneStatefulParams.d.ts +1 -1
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +3 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +5 -1
- package/package.json +3 -1
|
@@ -41,6 +41,8 @@ _defineProperty(Constants, "false", "false");
|
|
|
41
41
|
|
|
42
42
|
_defineProperty(Constants, "maximumUnreadMessageCount", 99);
|
|
43
43
|
|
|
44
|
+
_defineProperty(Constants, "widgetStateDataKey", "LcwChatWidgetState");
|
|
45
|
+
|
|
44
46
|
_defineProperty(Constants, "channelIdKey", "ChannelId-");
|
|
45
47
|
|
|
46
48
|
_defineProperty(Constants, "ChannelId", "lcw");
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.DataStoreManager = void 0;
|
|
7
|
+
|
|
8
|
+
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
9
|
+
|
|
10
|
+
class DataStoreManager {}
|
|
11
|
+
|
|
12
|
+
exports.DataStoreManager = DataStoreManager;
|
|
13
|
+
|
|
14
|
+
_defineProperty(DataStoreManager, "clientDataStore", void 0);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -123,6 +123,7 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
123
123
|
TelemetryEvent["ReconnectChatContinueConversation"] = "ReconnectChatContinueConversation";
|
|
124
124
|
TelemetryEvent["ReconnectChatStartNewConversation"] = "ReconnectChatStartNewConversation";
|
|
125
125
|
TelemetryEvent["ReconnectChatMinimize"] = "ReconnectChatMinimize";
|
|
126
|
+
TelemetryEvent["ChatWidgetStateChanged"] = "ChatWidgetStateChanged";
|
|
126
127
|
})(TelemetryEvent || (exports.TelemetryEvent = TelemetryEvent = {}));
|
|
127
128
|
|
|
128
129
|
class TelemetryConstants {
|
|
@@ -109,6 +109,8 @@ class TelemetryHelper {
|
|
|
109
109
|
static conformToLoadContract(level, input) {
|
|
110
110
|
const payload = input.payload;
|
|
111
111
|
return TelemetryHelper.populate(level, payload, event => {
|
|
112
|
+
var _TelemetryManager$Int11, _TelemetryManager$Int12, _TelemetryManager$Int13;
|
|
113
|
+
|
|
112
114
|
event.Event = payload.Event;
|
|
113
115
|
event.ResourcePath = payload.ResourcePath;
|
|
114
116
|
event.WidgetState = payload.WidgetState;
|
|
@@ -116,16 +118,19 @@ class TelemetryHelper {
|
|
|
116
118
|
event.ChatType = payload.ChatType;
|
|
117
119
|
event.ElapsedTimeInMilliseconds = payload.ElapsedTimeInMilliseconds;
|
|
118
120
|
event.ExceptionDetails = JSON.stringify(payload.ExceptionDetails);
|
|
121
|
+
event.OCChatSDKVersion = ((_TelemetryManager$Int11 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int11 === void 0 ? void 0 : _TelemetryManager$Int11.OCChatSDKVersion) ?? "";
|
|
122
|
+
event.OCChatWidgetVersion = ((_TelemetryManager$Int12 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int12 === void 0 ? void 0 : _TelemetryManager$Int12.chatWidgetVersion) ?? "";
|
|
123
|
+
event.OCChatComponentsVersion = ((_TelemetryManager$Int13 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int13 === void 0 ? void 0 : _TelemetryManager$Int13.chatComponentVersion) ?? "";
|
|
119
124
|
});
|
|
120
125
|
}
|
|
121
126
|
|
|
122
127
|
static conformToIC3ClientContract(level, input) {
|
|
123
128
|
const payload = input.payload;
|
|
124
129
|
return TelemetryHelper.populate(level, payload, event => {
|
|
125
|
-
var _TelemetryManager$
|
|
130
|
+
var _TelemetryManager$Int14;
|
|
126
131
|
|
|
127
132
|
event.Event = payload.Event;
|
|
128
|
-
event.IC3ClientVersion = (_TelemetryManager$
|
|
133
|
+
event.IC3ClientVersion = (_TelemetryManager$Int14 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int14 === void 0 ? void 0 : _TelemetryManager$Int14.IC3ClientVersion;
|
|
129
134
|
event.SubscriptionId = payload.SubscriptionId;
|
|
130
135
|
event.EndpointUrl = payload.EndpointUrl;
|
|
131
136
|
event.EndpointId = payload.EndpointId;
|
|
@@ -249,14 +254,14 @@ _defineProperty(TelemetryHelper, "logActionEvent", (logLevel, payload) => {
|
|
|
249
254
|
});
|
|
250
255
|
|
|
251
256
|
_defineProperty(TelemetryHelper, "logSDKEvent", (logLevel, payload) => {
|
|
252
|
-
var _TelemetryManager$
|
|
257
|
+
var _TelemetryManager$Int15;
|
|
253
258
|
|
|
254
259
|
const telemetryEvent = {
|
|
255
260
|
eventName: (payload === null || payload === void 0 ? void 0 : payload.Event) ?? "",
|
|
256
261
|
logLevel: logLevel,
|
|
257
262
|
payload: { ...payload,
|
|
258
263
|
TransactionId: (0, _utils.newGuid)(),
|
|
259
|
-
RequestId: (_TelemetryManager$
|
|
264
|
+
RequestId: (_TelemetryManager$Int15 = _TelemetryManager.TelemetryManager.InternalTelemetryData) === null || _TelemetryManager$Int15 === void 0 ? void 0 : _TelemetryManager$Int15.currentRequestId
|
|
260
265
|
}
|
|
261
266
|
};
|
|
262
267
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.TelemetryTimers = exports.TelemetryManager = exports.RegisterLoggers = void 0;
|
|
6
|
+
exports.disposeLoggers = exports.TelemetryTimers = exports.TelemetryManager = exports.RegisterLoggers = void 0;
|
|
7
7
|
|
|
8
8
|
var _TelemetryConstants = require("./TelemetryConstants");
|
|
9
9
|
|
|
@@ -31,15 +31,23 @@ exports.TelemetryManager = TelemetryManager;
|
|
|
31
31
|
|
|
32
32
|
_defineProperty(TelemetryManager, "InternalTelemetryData", void 0);
|
|
33
33
|
|
|
34
|
-
const
|
|
35
|
-
|
|
34
|
+
const loggers = [];
|
|
35
|
+
|
|
36
|
+
const disposeLoggers = () => {
|
|
37
|
+
loggers.map(logger => {
|
|
38
|
+
logger.dispose();
|
|
39
|
+
});
|
|
40
|
+
};
|
|
36
41
|
|
|
42
|
+
exports.disposeLoggers = disposeLoggers;
|
|
43
|
+
|
|
44
|
+
const RegisterLoggers = () => {
|
|
37
45
|
const registerLoggers = () => {
|
|
38
46
|
var _TelemetryManager$Int, _TelemetryManager$Int2, _TelemetryManager$Int3, _TelemetryManager$Int4, _TelemetryManager$Int5, _TelemetryManager$Int6, _TelemetryManager$Int7, _TelemetryManager$Int8;
|
|
39
47
|
|
|
40
48
|
if (!((_TelemetryManager$Int = TelemetryManager.InternalTelemetryData) !== null && _TelemetryManager$Int !== void 0 && (_TelemetryManager$Int2 = _TelemetryManager$Int.telemetryConfig) !== null && _TelemetryManager$Int2 !== void 0 && _TelemetryManager$Int2.disableConsoleLog) || !((_TelemetryManager$Int3 = TelemetryManager.InternalTelemetryData) !== null && _TelemetryManager$Int3 !== void 0 && (_TelemetryManager$Int4 = _TelemetryManager$Int3.telemetryConfig) !== null && _TelemetryManager$Int4 !== void 0 && _TelemetryManager$Int4.telemetryDisabled)) {
|
|
41
49
|
_omnichannelChatComponents.BroadcastService.getAnyMessage().subscribe(event => {
|
|
42
|
-
if (event.payload) {
|
|
50
|
+
if (event.payload && event.eventName !== _TelemetryConstants.TelemetryEvent.ChatWidgetStateChanged) {
|
|
43
51
|
logTelemetry(event);
|
|
44
52
|
}
|
|
45
53
|
});
|
|
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.defaultAriaConfig = void 0;
|
|
7
7
|
const defaultAriaConfig = {
|
|
8
|
-
collectorUriForTelemetry: "
|
|
9
|
-
ariaTelemetryKey: "
|
|
10
|
-
ariaTelemetryApplicationName: "
|
|
8
|
+
collectorUriForTelemetry: "",
|
|
9
|
+
ariaTelemetryKey: "c7655518acf1403f93ff6b9f77942f0a-d01a02fd-6b50-4de3-a566-62eda11f93bc-7083",
|
|
10
|
+
ariaTelemetryApplicationName: "",
|
|
11
11
|
disableCookieUsage: true
|
|
12
12
|
};
|
|
13
13
|
exports.defaultAriaConfig = defaultAriaConfig;
|
|
@@ -32,7 +32,15 @@ const ariaTelemetryLogger = (ariaTelemetryKey, disabledCookieUsage, collectiorUr
|
|
|
32
32
|
configuration.collectorUri = collectiorUriForTelemetry;
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
try {
|
|
36
|
+
_logger = _AWTLogManager.default.initialize(ariaTelemetryKey, configuration);
|
|
37
|
+
|
|
38
|
+
if (_logger === undefined) {
|
|
39
|
+
_logger = _AWTLogManager.default.getLogger(ariaTelemetryKey);
|
|
40
|
+
}
|
|
41
|
+
} catch (error) {
|
|
42
|
+
console.log(error);
|
|
43
|
+
}
|
|
36
44
|
}
|
|
37
45
|
|
|
38
46
|
return _logger;
|
|
@@ -54,6 +62,11 @@ const ariaTelemetryLogger = (ariaTelemetryKey, disabledCookieUsage, collectiorUr
|
|
|
54
62
|
|
|
55
63
|
eventProperties.setPropertyWithPii(ariaTelemetryApplicationName, _Constants.Constants.LiveChatWidget, _Enums.AWTPiiKind.GenericData);
|
|
56
64
|
logger() ? logger().logEvent(eventProperties) : console.log("Unable to initialize aria logger");
|
|
65
|
+
},
|
|
66
|
+
dispose: () => {
|
|
67
|
+
_AWTLogManager.default.flush(function () {
|
|
68
|
+
console.log("Aria logger disposed");
|
|
69
|
+
});
|
|
57
70
|
}
|
|
58
71
|
};
|
|
59
72
|
return ariaLogger;
|
|
@@ -98,7 +98,14 @@ const ChatButtonStateful = props => {
|
|
|
98
98
|
ElapsedTimeInMilliseconds: _TelemetryManager.TelemetryTimers.LcwLoadToChatButtonTimer.milliSecondsElapsed
|
|
99
99
|
});
|
|
100
100
|
|
|
101
|
-
|
|
101
|
+
if (state.uiStates.focusChatButton) {
|
|
102
|
+
(0, _utils.setFocusOnElement)(document.getElementById((controlProps === null || controlProps === void 0 ? void 0 : controlProps.id) ?? "oc-lcw-chat-button"));
|
|
103
|
+
} else {
|
|
104
|
+
dispatch({
|
|
105
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_FOCUS_CHAT_BUTTON,
|
|
106
|
+
payload: true
|
|
107
|
+
});
|
|
108
|
+
}
|
|
102
109
|
}, []);
|
|
103
110
|
return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.ChatButton, {
|
|
104
111
|
componentOverrides: buttonProps === null || buttonProps === void 0 ? void 0 : buttonProps.componentOverrides,
|
|
@@ -13,10 +13,6 @@ var _utils = require("../../common/utils");
|
|
|
13
13
|
|
|
14
14
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
15
15
|
|
|
16
|
-
var _Constants = require("../../common/Constants");
|
|
17
|
-
|
|
18
|
-
var _ConversationState = require("../../contexts/common/ConversationState");
|
|
19
|
-
|
|
20
16
|
var _DimLayer = require("../dimlayer/DimLayer");
|
|
21
17
|
|
|
22
18
|
var _LiveChatWidgetActionType = require("../../contexts/common/LiveChatWidgetActionType");
|
|
@@ -35,6 +31,8 @@ var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatCo
|
|
|
35
31
|
|
|
36
32
|
var _useChatSDKStore = _interopRequireDefault(require("../../hooks/useChatSDKStore"));
|
|
37
33
|
|
|
34
|
+
var _Constants = require("../../common/Constants");
|
|
35
|
+
|
|
38
36
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
39
37
|
|
|
40
38
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -46,14 +44,14 @@ const ConfirmationPaneStateful = props => {
|
|
|
46
44
|
var _state$domainStates$l, _state$domainStates$l2, _state$domainStates$l3, _state$domainStates$l4;
|
|
47
45
|
|
|
48
46
|
const initialTabIndexMap = new Map();
|
|
49
|
-
let elements = [];
|
|
47
|
+
let elements = []; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
48
|
+
|
|
49
|
+
const chatSDK = (0, _useChatSDKStore.default)();
|
|
50
50
|
const [state, dispatch] = (0, _useChatContextStore.default)();
|
|
51
51
|
const {
|
|
52
|
-
setPostChatContext,
|
|
53
52
|
endChat
|
|
54
53
|
} = props; // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
55
|
-
|
|
56
|
-
const chatSDK = (0, _useChatSDKStore.default)(); // eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
54
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
57
55
|
|
|
58
56
|
const [adapter] = (0, _useChatAdapterStore.default)();
|
|
59
57
|
const isPostChatEnabled = (_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : (_state$domainStates$l2 = _state$domainStates$l.LiveWSAndLiveChatEngJoin) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.msdyn_postconversationsurveyenable;
|
|
@@ -73,26 +71,15 @@ const ConfirmationPaneStateful = props => {
|
|
|
73
71
|
});
|
|
74
72
|
|
|
75
73
|
try {
|
|
76
|
-
//
|
|
77
|
-
const conversationDetails = await chatSDK.getConversationDetails();
|
|
74
|
+
// check agent has joined conversation
|
|
75
|
+
const conversationDetails = await chatSDK.getConversationDetails();
|
|
78
76
|
|
|
79
77
|
if (isPostChatEnabled === "true" && postChatSurveyMode === _PostChatSurveyMode.PostChatSurveyMode.Embed && conversationDetails.canRenderPostChat === _Constants.Constants.truePascal) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
86
|
-
payload: _ConversationState.ConversationState.Loading
|
|
87
|
-
});
|
|
88
|
-
await setPostChatContext();
|
|
89
|
-
|
|
90
|
-
if (state.domainStates.postChatContext) {
|
|
91
|
-
dispatch({
|
|
92
|
-
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
93
|
-
payload: _ConversationState.ConversationState.Postchat
|
|
94
|
-
});
|
|
95
|
-
}
|
|
78
|
+
const loadPostChatEvent = {
|
|
79
|
+
eventName: "LoadPostChatSurvey"
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
_omnichannelChatComponents.BroadcastService.postMessage(loadPostChatEvent);
|
|
96
83
|
} else {
|
|
97
84
|
(0, _utils.setTabIndices)(elements, initialTabIndexMap, true);
|
|
98
85
|
|
|
@@ -150,7 +150,7 @@ const dummyDefaultProps = {
|
|
|
150
150
|
id: "oc-lcw-CurrentCall-timer",
|
|
151
151
|
showHours: false,
|
|
152
152
|
timerStyles: {
|
|
153
|
-
color: "
|
|
153
|
+
color: "#FFFFFF",
|
|
154
154
|
textAlign: "center",
|
|
155
155
|
backgroundColor: "#3d3c3c",
|
|
156
156
|
height: "45px",
|
|
@@ -181,8 +181,8 @@ const dummyDefaultProps = {
|
|
|
181
181
|
},
|
|
182
182
|
audioCallButtonStyleProps: {
|
|
183
183
|
borderRadius: "50%",
|
|
184
|
-
color: "
|
|
185
|
-
backgroundColor: "
|
|
184
|
+
color: "#FFFFFF",
|
|
185
|
+
backgroundColor: "#008000",
|
|
186
186
|
lineHeight: "40px",
|
|
187
187
|
height: "40px",
|
|
188
188
|
width: "40px",
|
|
@@ -193,8 +193,8 @@ const dummyDefaultProps = {
|
|
|
193
193
|
},
|
|
194
194
|
videoCallButtonStyleProps: {
|
|
195
195
|
borderRadius: "50%",
|
|
196
|
-
color: "
|
|
197
|
-
backgroundColor: "
|
|
196
|
+
color: "#FFFFFF",
|
|
197
|
+
backgroundColor: "#008000",
|
|
198
198
|
lineHeight: "40px",
|
|
199
199
|
height: "40px",
|
|
200
200
|
width: "40px",
|
|
@@ -209,8 +209,8 @@ const dummyDefaultProps = {
|
|
|
209
209
|
},
|
|
210
210
|
declineCallButtonStyleProps: {
|
|
211
211
|
borderRadius: "50%",
|
|
212
|
-
color: "
|
|
213
|
-
backgroundColor: "
|
|
212
|
+
color: "#FFFFFF",
|
|
213
|
+
backgroundColor: "#DC0000",
|
|
214
214
|
lineHeight: "40px",
|
|
215
215
|
height: "40px",
|
|
216
216
|
width: "40px",
|
|
@@ -219,12 +219,12 @@ const dummyDefaultProps = {
|
|
|
219
219
|
},
|
|
220
220
|
incomingCallTitleStyleProps: {
|
|
221
221
|
margin: "0 5px",
|
|
222
|
-
color: "
|
|
222
|
+
color: "#FFFFFF",
|
|
223
223
|
fontSize: 12,
|
|
224
224
|
fontFamily: "Segoe UI, Arial, sans-serif"
|
|
225
225
|
},
|
|
226
226
|
itemFocusStyleProps: {
|
|
227
|
-
outline: "2px solid
|
|
227
|
+
outline: "2px solid #FFFFFF"
|
|
228
228
|
}
|
|
229
229
|
},
|
|
230
230
|
currentCallStyleProps: {
|
|
@@ -236,7 +236,7 @@ const dummyDefaultProps = {
|
|
|
236
236
|
},
|
|
237
237
|
micButtonStyleProps: {
|
|
238
238
|
borderRadius: "2px",
|
|
239
|
-
color: "
|
|
239
|
+
color: "#FFFFFF",
|
|
240
240
|
backgroundColor: "#3d3c3c",
|
|
241
241
|
height: "45px",
|
|
242
242
|
width: "50px",
|
|
@@ -247,7 +247,7 @@ const dummyDefaultProps = {
|
|
|
247
247
|
},
|
|
248
248
|
videoOffButtonStyleProps: {
|
|
249
249
|
borderRadius: "2px",
|
|
250
|
-
color: "
|
|
250
|
+
color: "#FFFFFF",
|
|
251
251
|
backgroundColor: "#3d3c3c",
|
|
252
252
|
height: "45px",
|
|
253
253
|
width: "50px",
|
|
@@ -261,8 +261,8 @@ const dummyDefaultProps = {
|
|
|
261
261
|
},
|
|
262
262
|
endCallButtonStyleProps: {
|
|
263
263
|
borderRadius: "2px",
|
|
264
|
-
color: "
|
|
265
|
-
backgroundColor: "
|
|
264
|
+
color: "#FFFFFF",
|
|
265
|
+
backgroundColor: "#DC0000",
|
|
266
266
|
lineHeight: "50px",
|
|
267
267
|
height: "45px",
|
|
268
268
|
width: "50px",
|
|
@@ -271,7 +271,7 @@ const dummyDefaultProps = {
|
|
|
271
271
|
currentCallTimerStyleProps: {
|
|
272
272
|
borderRadius: "2px",
|
|
273
273
|
margin: "1px",
|
|
274
|
-
color: "
|
|
274
|
+
color: "#FFFFFF",
|
|
275
275
|
paddingTop: "18px",
|
|
276
276
|
fontSize: 12,
|
|
277
277
|
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
@@ -493,7 +493,7 @@ const dummyDefaultProps = {
|
|
|
493
493
|
},
|
|
494
494
|
styleProps: {
|
|
495
495
|
generalStyleProps: {
|
|
496
|
-
backgroundColor: "
|
|
496
|
+
backgroundColor: "#FFFFFF",
|
|
497
497
|
borderRadius: "2px",
|
|
498
498
|
color: "black",
|
|
499
499
|
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
@@ -535,7 +535,7 @@ const dummyDefaultProps = {
|
|
|
535
535
|
},
|
|
536
536
|
confirmButtonStyleProps: {
|
|
537
537
|
backgroundColor: "rgba(9,72,159,1)",
|
|
538
|
-
color: "
|
|
538
|
+
color: "#FFFFFF",
|
|
539
539
|
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
540
540
|
fontSize: "14px",
|
|
541
541
|
fontWeight: "500",
|
|
@@ -549,7 +549,7 @@ const dummyDefaultProps = {
|
|
|
549
549
|
border: "2px dotted #000"
|
|
550
550
|
},
|
|
551
551
|
cancelButtonStyleProps: {
|
|
552
|
-
backgroundColor: "
|
|
552
|
+
backgroundColor: "#FFFFFF",
|
|
553
553
|
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
554
554
|
fontSize: "14px",
|
|
555
555
|
fontWeight: "500",
|
|
@@ -934,16 +934,16 @@ const dummyDefaultProps = {
|
|
|
934
934
|
fontSize: 16,
|
|
935
935
|
fontFamily: "Segoe UI, Arial, sans-serif",
|
|
936
936
|
fontWeight: "450",
|
|
937
|
-
color: "
|
|
937
|
+
color: "#FFFFFF",
|
|
938
938
|
padding: "3px 0"
|
|
939
939
|
},
|
|
940
940
|
minimizeButtonStyleProps: {
|
|
941
|
-
color: "
|
|
941
|
+
color: "#FFFFFF",
|
|
942
942
|
margin: "5px 0",
|
|
943
943
|
fontSize: "12px"
|
|
944
944
|
},
|
|
945
945
|
closeButtonStyleProps: {
|
|
946
|
-
color: "
|
|
946
|
+
color: "#FFFFFF",
|
|
947
947
|
margin: "5px 0",
|
|
948
948
|
fontSize: "12px"
|
|
949
949
|
},
|
|
@@ -1105,7 +1105,7 @@ const dummyDefaultProps = {
|
|
|
1105
1105
|
titleStyleProps: {
|
|
1106
1106
|
// ...[Existing chat button title style props]
|
|
1107
1107
|
margin: "0 0 0 10px",
|
|
1108
|
-
color: "
|
|
1108
|
+
color: "#FFFFFF"
|
|
1109
1109
|
}
|
|
1110
1110
|
}
|
|
1111
1111
|
},
|
|
@@ -1471,7 +1471,7 @@ const dummyDefaultProps = {
|
|
|
1471
1471
|
bubbleBackground: "#315FA2",
|
|
1472
1472
|
bubbleBorderRadius: 4,
|
|
1473
1473
|
bubbleBorderWidth: 0,
|
|
1474
|
-
bubbleFromUserBackground: "
|
|
1474
|
+
bubbleFromUserBackground: "#FFFFFF",
|
|
1475
1475
|
bubbleFromUserBorderRadius: 4,
|
|
1476
1476
|
bubbleFromUserBorderWidth: 1,
|
|
1477
1477
|
bubbleFromUserTextColor: "Black",
|
|
@@ -1479,7 +1479,7 @@ const dummyDefaultProps = {
|
|
|
1479
1479
|
bubbleMaxWidth: 250,
|
|
1480
1480
|
bubbleMinHeight: 34,
|
|
1481
1481
|
bubbleMinWidth: 20,
|
|
1482
|
-
bubbleTextColor: "
|
|
1482
|
+
bubbleTextColor: "#FFFFFF",
|
|
1483
1483
|
hideSendBox: false,
|
|
1484
1484
|
hideUploadButton: true,
|
|
1485
1485
|
primaryFont: "Segoe UI, Arial, sans-serif",
|
|
@@ -1488,7 +1488,7 @@ const dummyDefaultProps = {
|
|
|
1488
1488
|
sendBoxTextWrap: true,
|
|
1489
1489
|
sendBoxHeight: 60,
|
|
1490
1490
|
sendBoxMaxHeight: 96,
|
|
1491
|
-
sendBoxBackground: "
|
|
1491
|
+
sendBoxBackground: "#FFFFFF",
|
|
1492
1492
|
showAvatarInGroup: true,
|
|
1493
1493
|
suggestedActionsStackedHeight: 125,
|
|
1494
1494
|
suggestedActionsStackedOverflow: "scroll",
|
|
@@ -1599,7 +1599,7 @@ const dummyDefaultProps = {
|
|
|
1599
1599
|
fontWeight: 600,
|
|
1600
1600
|
fontSize: "13px",
|
|
1601
1601
|
lineHeight: "18px",
|
|
1602
|
-
color: "
|
|
1602
|
+
color: "#FFFFFF",
|
|
1603
1603
|
paddingTop: "7px",
|
|
1604
1604
|
WebkitUserSelect: "none",
|
|
1605
1605
|
MozUserSelect: "none",
|
|
@@ -1703,6 +1703,7 @@ const dummyDefaultProps = {
|
|
|
1703
1703
|
PRECHAT_REQUIRED_FIELD_MISSING_MESSAGE: "{0} field is required",
|
|
1704
1704
|
MARKDOWN_EXTERNAL_LINK_ALT: "Opens in a new window; external."
|
|
1705
1705
|
}
|
|
1706
|
-
}
|
|
1706
|
+
},
|
|
1707
|
+
telemetryConfig: undefined
|
|
1707
1708
|
};
|
|
1708
1709
|
exports.dummyDefaultProps = dummyDefaultProps;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.disposeTelemetryLoggers = void 0;
|
|
7
|
+
|
|
8
|
+
var _TelemetryManager = require("../../../common/telemetry/TelemetryManager");
|
|
9
|
+
|
|
10
|
+
const disposeTelemetryLoggers = () => {
|
|
11
|
+
(0, _TelemetryManager.disposeLoggers)();
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
exports.disposeTelemetryLoggers = disposeTelemetryLoggers;
|
|
@@ -43,6 +43,10 @@ const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, a
|
|
|
43
43
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
44
44
|
payload: _ConversationState.ConversationState.Closed
|
|
45
45
|
});
|
|
46
|
+
dispatch({
|
|
47
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY_AGENT,
|
|
48
|
+
payload: false
|
|
49
|
+
});
|
|
46
50
|
dispatch({
|
|
47
51
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_RECONNECT_ID,
|
|
48
52
|
payload: undefined
|
|
@@ -55,6 +59,10 @@ const endChat = async (props, chatSDK, setAdapter, setWebChatStyles, dispatch, a
|
|
|
55
59
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CHAT_TOKEN,
|
|
56
60
|
payload: undefined
|
|
57
61
|
});
|
|
62
|
+
dispatch({
|
|
63
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_LIVE_CHAT_CONTEXT,
|
|
64
|
+
payload: undefined
|
|
65
|
+
});
|
|
58
66
|
|
|
59
67
|
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
60
68
|
eventName: "EndChat"
|
|
@@ -7,8 +7,6 @@ exports.initWebChatComposer = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _botframeworkWebchat = require("botframework-webchat");
|
|
9
9
|
|
|
10
|
-
var _ConversationState = require("../../../contexts/common/ConversationState");
|
|
11
|
-
|
|
12
10
|
var _LiveChatWidgetActionType = require("../../../contexts/common/LiveChatWidgetActionType");
|
|
13
11
|
|
|
14
12
|
var _PostChatSurveyMode = require("../../postchatsurveypanestateful/enums/PostChatSurveyMode");
|
|
@@ -55,7 +53,7 @@ var _preProcessingMiddleware = _interopRequireDefault(require("../../webchatcont
|
|
|
55
53
|
|
|
56
54
|
var _sanitizationMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/sanitizationMiddleware"));
|
|
57
55
|
|
|
58
|
-
var
|
|
56
|
+
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
59
57
|
|
|
60
58
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
61
59
|
|
|
@@ -89,15 +87,16 @@ const initWebChatComposer = (props, chatSDK, state, dispatch, setWebChatStyles)
|
|
|
89
87
|
}
|
|
90
88
|
|
|
91
89
|
if (isPostChatEnabled === "true" && postChatSurveyMode === _PostChatSurveyMode.PostChatSurveyMode.Embed) {
|
|
90
|
+
const loadPostChatEvent = {
|
|
91
|
+
eventName: "LoadPostChatSurvey"
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
_omnichannelChatComponents.BroadcastService.postMessage(loadPostChatEvent);
|
|
95
|
+
} else {
|
|
92
96
|
dispatch({
|
|
93
|
-
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.
|
|
97
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_ENDED_BY_AGENT,
|
|
94
98
|
payload: true
|
|
95
99
|
});
|
|
96
|
-
dispatch({
|
|
97
|
-
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
98
|
-
payload: _ConversationState.ConversationState.Loading
|
|
99
|
-
});
|
|
100
|
-
await (0, _setPostChatContextAndLoadSurvey.setPostChatContextAndLoadSurvey)(chatSDK, dispatch, true);
|
|
101
100
|
}
|
|
102
101
|
|
|
103
102
|
dispatch({
|
|
@@ -17,13 +17,21 @@ var _defaultTelemetryInternalData = require("../../../common/telemetry/defaultCo
|
|
|
17
17
|
|
|
18
18
|
var _defaultTelemetryConfiguration = require("../../../common/telemetry/defaultConfigs/defaultTelemetryConfiguration");
|
|
19
19
|
|
|
20
|
-
var _package =
|
|
20
|
+
var _package = require("@microsoft/omnichannel-chat-components/package.json");
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
var _package2 = require("@microsoft/omnichannel-chat-sdk/package.json");
|
|
23
23
|
|
|
24
24
|
const registerTelemetryLoggers = (props, dispatch) => {
|
|
25
25
|
var _props$liveChatContex, _props$liveChatContex2;
|
|
26
26
|
|
|
27
|
+
let widgetPackageInfo;
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
widgetPackageInfo = require("@microsoft/omnichannel-chat-widget/package.json");
|
|
31
|
+
} catch (error) {
|
|
32
|
+
widgetPackageInfo = "0.0.0-0";
|
|
33
|
+
}
|
|
34
|
+
|
|
27
35
|
const telemetryConfig = { ..._defaultTelemetryConfiguration.defaultTelemetryConfiguration,
|
|
28
36
|
...props.telemetryConfig
|
|
29
37
|
};
|
|
@@ -33,6 +41,8 @@ const registerTelemetryLoggers = (props, dispatch) => {
|
|
|
33
41
|
|
|
34
42
|
_TelemetryManager.TelemetryManager.InternalTelemetryData = (_props$liveChatContex3 = props.liveChatContextFromCache) === null || _props$liveChatContex3 === void 0 ? void 0 : (_props$liveChatContex4 = _props$liveChatContex3.domainStates) === null || _props$liveChatContex4 === void 0 ? void 0 : _props$liveChatContex4.telemetryInternalData;
|
|
35
43
|
} else {
|
|
44
|
+
var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$chatSDK3, _props$chatSDK3$omnic;
|
|
45
|
+
|
|
36
46
|
let telemetryData = { ..._defaultTelemetryInternalData.defaultInternalTelemetryData,
|
|
37
47
|
telemetryConfig: Object.assign({}, _defaultTelemetryConfiguration.defaultTelemetryConfiguration, telemetryConfig),
|
|
38
48
|
ariaConfig: Object.assign({}, _defaultAriaConfig.defaultAriaConfig, telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.ariaConfigurations)
|
|
@@ -43,7 +53,12 @@ const registerTelemetryLoggers = (props, dispatch) => {
|
|
|
43
53
|
}
|
|
44
54
|
|
|
45
55
|
telemetryData = _TelemetryHelper.TelemetryHelper.addWidgetDataToTelemetry(telemetryConfig, telemetryData);
|
|
46
|
-
telemetryData.OCChatSDKVersion =
|
|
56
|
+
telemetryData.OCChatSDKVersion = _package2.version;
|
|
57
|
+
telemetryData.chatComponentVersion = _package.version;
|
|
58
|
+
telemetryData.chatWidgetVersion = widgetPackageInfo;
|
|
59
|
+
telemetryData.orgId = (_props$chatSDK = props.chatSDK) === null || _props$chatSDK === void 0 ? void 0 : (_props$chatSDK$omnich = _props$chatSDK.omnichannelConfig) === null || _props$chatSDK$omnich === void 0 ? void 0 : _props$chatSDK$omnich.orgId;
|
|
60
|
+
telemetryData.widgetId = (_props$chatSDK2 = props.chatSDK) === null || _props$chatSDK2 === void 0 ? void 0 : (_props$chatSDK2$omnic = _props$chatSDK2.omnichannelConfig) === null || _props$chatSDK2$omnic === void 0 ? void 0 : _props$chatSDK2$omnic.widgetId;
|
|
61
|
+
telemetryData.orgUrl = (_props$chatSDK3 = props.chatSDK) === null || _props$chatSDK3 === void 0 ? void 0 : (_props$chatSDK3$omnic = _props$chatSDK3.omnichannelConfig) === null || _props$chatSDK3$omnic === void 0 ? void 0 : _props$chatSDK3$omnic.orgUrl;
|
|
47
62
|
dispatch({
|
|
48
63
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_TELEMETRY_DATA,
|
|
49
64
|
payload: telemetryData
|
|
@@ -13,21 +13,25 @@ var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
|
13
13
|
|
|
14
14
|
var _ConversationState = require("../../../contexts/common/ConversationState");
|
|
15
15
|
|
|
16
|
+
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
17
|
+
|
|
16
18
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
-
const setPostChatContextAndLoadSurvey = async (chatSDK, dispatch,
|
|
19
|
+
const setPostChatContextAndLoadSurvey = async (chatSDK, dispatch, persistedChat) => {
|
|
18
20
|
try {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
21
|
+
if (!persistedChat) {
|
|
22
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
23
|
+
const context = await chatSDK.getPostChatSurveyContext();
|
|
24
|
+
|
|
25
|
+
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
26
|
+
Event: _TelemetryConstants.TelemetryEvent.PostChatContextCallSucceed,
|
|
27
|
+
Description: "Postchat context call succeed."
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
dispatch({
|
|
31
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_POST_CHAT_CONTEXT,
|
|
32
|
+
payload: context
|
|
33
|
+
});
|
|
34
|
+
}
|
|
31
35
|
} catch (ex) {
|
|
32
36
|
_TelemetryHelper.TelemetryHelper.logSDKEvent(_TelemetryConstants.LogLevel.ERROR, {
|
|
33
37
|
Event: _TelemetryConstants.TelemetryEvent.PostChatContextCallFailed,
|
|
@@ -36,20 +40,17 @@ const setPostChatContextAndLoadSurvey = async (chatSDK, dispatch, loadSurvey) =>
|
|
|
36
40
|
}
|
|
37
41
|
});
|
|
38
42
|
}
|
|
39
|
-
/* -true: setPostChatContextAndLoadSurvey is called after passing all checks from ConfirmationPane and endChatMiddleware in usual scenario.
|
|
40
|
-
-false: Below if condition is needed for multi-tab scenarios. So when agent ends a chat and customer has opened chat in multiple tabs,
|
|
41
|
-
all tabs should show post chat survey as per existing functionality. But when an agent end a conversation, Omnichannel SDK
|
|
42
|
-
getPostChatSurveyContext returns as invalid conversation. To avoid that, caching the survey url is needed after chat starts and
|
|
43
|
-
in this case loadSurvey is false
|
|
44
|
-
*/
|
|
45
43
|
|
|
46
|
-
|
|
47
|
-
|
|
44
|
+
_omnichannelChatComponents.BroadcastService.getMessageByEventName("LoadPostChatSurvey").subscribe(msg => {
|
|
45
|
+
dispatch({
|
|
46
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
47
|
+
payload: _ConversationState.ConversationState.Loading
|
|
48
|
+
});
|
|
48
49
|
dispatch({
|
|
49
50
|
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
50
51
|
payload: _ConversationState.ConversationState.Postchat
|
|
51
52
|
});
|
|
52
|
-
}
|
|
53
|
+
});
|
|
53
54
|
};
|
|
54
55
|
|
|
55
56
|
exports.setPostChatContextAndLoadSurvey = setPostChatContextAndLoadSurvey;
|