@microsoft/omnichannel-chat-widget 0.1.0-main.a7ac5de → 0.1.0-main.a7b2241
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/README.md +7 -34
- package/lib/cjs/assets/Icons.js +4 -2
- package/lib/cjs/common/Constants.js +7 -3
- package/lib/cjs/common/KeyCodes.js +3 -1
- package/lib/cjs/common/contextDataStore/DataStoreManager.js +3 -1
- package/lib/cjs/common/storage/default/defaultCacheManager.js +5 -3
- package/lib/cjs/common/storage/default/defaultClientDataStoreProvider.js +15 -6
- package/lib/cjs/common/telemetry/TelemetryConstants.js +13 -0
- package/lib/cjs/common/telemetry/TelemetryHelper.js +5 -2
- package/lib/cjs/common/telemetry/TelemetryManager.js +3 -1
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +1 -1
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +1 -1
- package/lib/cjs/components/headerstateful/HeaderStateful.js +6 -4
- package/lib/cjs/components/livechatwidget/common/ActivityStreamHandler.js +3 -1
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +139 -0
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +3 -1
- package/lib/cjs/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +3 -1
- package/lib/cjs/components/livechatwidget/common/ChatAdapterShim.js +3 -1
- package/lib/cjs/components/livechatwidget/common/Deferred.js +3 -1
- package/lib/cjs/components/livechatwidget/common/createAdapter.js +2 -0
- package/lib/cjs/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +66 -14
- package/lib/cjs/components/livechatwidget/common/endChat.js +23 -17
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +25 -13
- package/lib/cjs/components/livechatwidget/common/reconnectChatHelper.js +6 -9
- package/lib/cjs/components/livechatwidget/common/startChat.js +76 -53
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +44 -38
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +22 -2
- package/lib/cjs/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +57 -0
- package/lib/cjs/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
- package/lib/cjs/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/common/mockadapter.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/common/mockchatsdk.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +2 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +1 -3
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +5 -6
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +2 -14
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -11
- package/lib/cjs/contexts/common/LiveChatWidgetActionType.js +29 -28
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +5 -2
- package/lib/cjs/contexts/createReducer.js +8 -0
- package/lib/cjs/hooks/useDebounce.js +28 -0
- package/lib/cjs/hooks/useWindowDimensions.js +30 -0
- package/lib/cjs/plugins/newMessageEventHandler.js +14 -0
- package/lib/esm/assets/Icons.js +2 -1
- package/lib/esm/common/Constants.js +7 -3
- package/lib/esm/common/KeyCodes.js +3 -1
- package/lib/esm/common/contextDataStore/DataStoreManager.js +3 -1
- package/lib/esm/common/storage/default/defaultCacheManager.js +5 -3
- package/lib/esm/common/storage/default/defaultClientDataStoreProvider.js +15 -6
- package/lib/esm/common/telemetry/TelemetryConstants.js +13 -0
- package/lib/esm/common/telemetry/TelemetryHelper.js +5 -2
- package/lib/esm/common/telemetry/TelemetryManager.js +3 -1
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +1 -1
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +1 -1
- package/lib/esm/components/headerstateful/HeaderStateful.js +6 -4
- package/lib/esm/components/livechatwidget/common/ActivityStreamHandler.js +3 -1
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.js +134 -0
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/DefaultActivitySubscriber.js +3 -1
- package/lib/esm/components/livechatwidget/common/ActivitySubscriber/PauseActivitySubscriber.js +3 -1
- package/lib/esm/components/livechatwidget/common/ChatAdapterShim.js +3 -1
- package/lib/esm/components/livechatwidget/common/Deferred.js +3 -1
- package/lib/esm/components/livechatwidget/common/createAdapter.js +2 -0
- package/lib/esm/components/livechatwidget/common/defaultProps/dummyDefaultProps.js +66 -14
- package/lib/esm/components/livechatwidget/common/endChat.js +23 -17
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +25 -13
- package/lib/esm/components/livechatwidget/common/reconnectChatHelper.js +7 -9
- package/lib/esm/components/livechatwidget/common/startChat.js +76 -53
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +45 -39
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +22 -2
- package/lib/esm/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.js +50 -0
- package/lib/esm/components/prechatsurveypanestateful/PreChatSurveyPaneStateful.js +1 -1
- package/lib/esm/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/common/mockadapter.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/common/mockchatsdk.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/common/utils/FileAttachmentIconManager.js +2 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/BotMagicCodeStore.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/WebChatStoreLoader.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware.js +1 -3
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageBoxStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultUserMessageBoxStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/DeliveredTimestamp.js +5 -6
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +2 -14
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.js +2 -11
- package/lib/esm/contexts/common/LiveChatWidgetActionType.js +29 -28
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +5 -2
- package/lib/esm/contexts/createReducer.js +8 -0
- package/lib/esm/hooks/useDebounce.js +22 -0
- package/lib/esm/hooks/useWindowDimensions.js +23 -0
- package/lib/esm/plugins/newMessageEventHandler.js +14 -0
- package/lib/types/assets/Icons.d.ts +1 -0
- package/lib/types/common/Constants.d.ts +2 -0
- package/lib/types/common/storage/default/defaultCacheManager.d.ts +1 -1
- package/lib/types/common/storage/default/defaultClientDataStoreProvider.d.ts +1 -1
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +14 -1
- package/lib/types/common/telemetry/definitions/Contracts.d.ts +2 -0
- package/lib/types/common/telemetry/definitions/Payload.d.ts +1 -0
- package/lib/types/common/telemetry/interfaces/ITelemetryConfig.d.ts +4 -0
- package/lib/types/components/livechatwidget/common/ActivitySubscriber/BotAuthActivitySubscriber.d.ts +9 -0
- package/lib/types/components/livechatwidget/common/startChat.d.ts +3 -3
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetControlProps.d.ts +2 -0
- package/lib/types/components/loadingpanestateful/common/errorUIStyleProps/errorUILoadingPaneStyleProps.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/SendingTimestamp.d.ts +1 -1
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
- package/lib/types/contexts/common/LiveChatWidgetActionType.d.ts +29 -28
- package/lib/types/hooks/useDebounce.d.ts +3 -0
- package/lib/types/hooks/useWindowDimensions.d.ts +4 -0
- package/package.json +3 -3
|
@@ -8,30 +8,21 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
8
8
|
var _react2 = require("@fluentui/react");
|
|
9
9
|
var _defaultMiddlewareLocalizedTexts = require("../../../../common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
10
10
|
var _defaultTimestampContentStyles = require("../defaultStyles/defaultTimestampContentStyles");
|
|
11
|
-
var _utils = require("../../../../../../common/utils");
|
|
12
11
|
var _ = require("../../../../../..");
|
|
13
12
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
14
13
|
/* eslint @typescript-eslint/no-explicit-any: "off" */
|
|
15
|
-
const SendingTimestamp =
|
|
14
|
+
const SendingTimestamp = () => {
|
|
16
15
|
var _state$domainStates$r, _state$domainStates$r2, _state$domainStates$m;
|
|
17
|
-
let {
|
|
18
|
-
args
|
|
19
|
-
} = _ref;
|
|
20
16
|
const [state] = (0, _.useChatContextStore)();
|
|
21
17
|
const dir = ((_state$domainStates$r = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r === void 0 ? void 0 : _state$domainStates$r.timestampDir) ?? state.domainStates.globalDir;
|
|
22
18
|
const contentStyles = {
|
|
23
19
|
..._defaultTimestampContentStyles.defaultTimestampContentStyles,
|
|
24
20
|
...((_state$domainStates$r2 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r2 === void 0 ? void 0 : _state$domainStates$r2.timestampContentStyleProps)
|
|
25
21
|
};
|
|
26
|
-
const {
|
|
27
|
-
activity: {
|
|
28
|
-
timestamp
|
|
29
|
-
}
|
|
30
|
-
} = args;
|
|
31
22
|
return /*#__PURE__*/_react.default.createElement(_react2.Stack, {
|
|
32
23
|
style: contentStyles,
|
|
33
24
|
dir: dir,
|
|
34
25
|
horizontal: true
|
|
35
|
-
}, /*#__PURE__*/_react.default.createElement("span", null, " ", (
|
|
26
|
+
}, /*#__PURE__*/_react.default.createElement("span", null, " ", ((_state$domainStates$m = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m === void 0 ? void 0 : _state$domainStates$m.MIDDLEWARE_MESSAGE_SENDING) ?? _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_MESSAGE_SENDING, " "));
|
|
36
27
|
};
|
|
37
28
|
exports.SendingTimestamp = SendingTimestamp;
|
|
@@ -14,32 +14,33 @@ exports.LiveChatWidgetActionType = LiveChatWidgetActionType;
|
|
|
14
14
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_MINIMIZED"] = 4] = "SET_MINIMIZED";
|
|
15
15
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_STATE"] = 5] = "SET_CONVERSATION_STATE";
|
|
16
16
|
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PREVIOUS_FOCUSED_ELEMENT_ID"] = 6] = "SET_PREVIOUS_FOCUSED_ELEMENT_ID";
|
|
17
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
18
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
19
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
20
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
21
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
22
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
23
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
24
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
25
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
26
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
27
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
28
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
29
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
30
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
31
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
32
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
33
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
34
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
35
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
36
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
37
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
38
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
39
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
40
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
41
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
42
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
43
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
44
|
-
LiveChatWidgetActionType[LiveChatWidgetActionType["
|
|
17
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_FAILING"] = 7] = "SET_START_CHAT_FAILING";
|
|
18
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_OUTSIDE_OPERATING_HOURS"] = 8] = "SET_OUTSIDE_OPERATING_HOURS";
|
|
19
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRE_CHAT_SURVEY_RESPONSE"] = 9] = "SET_PRE_CHAT_SURVEY_RESPONSE";
|
|
20
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CUSTOM_CONTEXT"] = 10] = "SET_CUSTOM_CONTEXT";
|
|
21
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_CONFIRMATION"] = 11] = "SET_SHOW_CONFIRMATION";
|
|
22
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_SHOW_EMAIL_TRANSCRIPT_PANE"] = 12] = "SET_SHOW_EMAIL_TRANSCRIPT_PANE";
|
|
23
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PRECHAT_RESPONSE_EMAIL"] = 13] = "SET_PRECHAT_RESPONSE_EMAIL";
|
|
24
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_AUDIO_NOTIFICATION"] = 14] = "SET_AUDIO_NOTIFICATION";
|
|
25
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_E2VV_ENABLED"] = 15] = "SET_E2VV_ENABLED";
|
|
26
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_POST_CHAT_CONTEXT"] = 16] = "SET_POST_CHAT_CONTEXT";
|
|
27
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SHOW_CALLING_CONTAINER"] = 17] = "SHOW_CALLING_CONTAINER";
|
|
28
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_INCOMING_CALL"] = 18] = "SET_INCOMING_CALL";
|
|
29
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_VIDEO_CALL"] = 19] = "DISABLE_VIDEO_CALL";
|
|
30
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_LOCAL_VIDEO"] = 20] = "DISABLE_LOCAL_VIDEO";
|
|
31
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["DISABLE_REMOTE_VIDEO"] = 21] = "DISABLE_REMOTE_VIDEO";
|
|
32
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CHAT_TOKEN"] = 22] = "SET_CHAT_TOKEN";
|
|
33
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_START_CHAT_BUTTON_DISPLAY"] = 23] = "SET_START_CHAT_BUTTON_DISPLAY";
|
|
34
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_PROACTIVE_CHAT_PARAMS"] = 24] = "SET_PROACTIVE_CHAT_PARAMS";
|
|
35
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_TELEMETRY_DATA"] = 25] = "SET_TELEMETRY_DATA";
|
|
36
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_RECONNECT_ID"] = 26] = "SET_RECONNECT_ID";
|
|
37
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_UNREAD_MESSAGE_COUNT"] = 27] = "SET_UNREAD_MESSAGE_COUNT";
|
|
38
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_FOCUS_CHAT_BUTTON"] = 28] = "SET_FOCUS_CHAT_BUTTON";
|
|
39
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_CONVERSATION_ENDED_BY_AGENT"] = 29] = "SET_CONVERSATION_ENDED_BY_AGENT";
|
|
40
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_STATE"] = 30] = "SET_WIDGET_STATE";
|
|
41
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONTEXT"] = 31] = "SET_LIVE_CHAT_CONTEXT";
|
|
42
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_BOT_OAUTH_SIGNIN_ID"] = 32] = "SET_BOT_OAUTH_SIGNIN_ID";
|
|
43
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_SIZE"] = 33] = "SET_WIDGET_SIZE";
|
|
44
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_WIDGET_INSTANCE_ID"] = 34] = "SET_WIDGET_INSTANCE_ID";
|
|
45
|
+
LiveChatWidgetActionType[LiveChatWidgetActionType["SET_LIVE_CHAT_CONFIG"] = 35] = "SET_LIVE_CHAT_CONFIG";
|
|
45
46
|
})(LiveChatWidgetActionType || (exports.LiveChatWidgetActionType = LiveChatWidgetActionType = {}));
|
|
@@ -8,10 +8,12 @@ var _ConversationState = require("./ConversationState");
|
|
|
8
8
|
var _defaultMiddlewareLocalizedTexts = require("../../components/webchatcontainerstateful/common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
9
9
|
var _utils = require("../../common/utils");
|
|
10
10
|
var _defaultClientDataStoreProvider = require("../../common/storage/default/defaultClientDataStoreProvider");
|
|
11
|
+
var _Constants = require("../../common/Constants");
|
|
11
12
|
const getLiveChatWidgetContextInitialState = props => {
|
|
12
|
-
var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$controlProps, _props$webChatContain;
|
|
13
|
+
var _props$chatSDK, _props$chatSDK$omnich, _props$chatSDK2, _props$chatSDK2$omnic, _props$controlProps, _props$controlProps2, _props$webChatContain;
|
|
13
14
|
const widgetCacheId = (0, _utils.getWidgetCacheId)(props === null || props === void 0 ? void 0 : (_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, props === null || props === void 0 ? void 0 : (_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, (props === null || props === void 0 ? void 0 : (_props$controlProps = props.controlProps) === null || _props$controlProps === void 0 ? void 0 : _props$controlProps.widgetInstanceId) ?? "");
|
|
14
|
-
const
|
|
15
|
+
const cacheTtlInMins = (props === null || props === void 0 ? void 0 : (_props$controlProps2 = props.controlProps) === null || _props$controlProps2 === void 0 ? void 0 : _props$controlProps2.cacheTtlInMins) ?? _Constants.Constants.CacheTtlInMinutes;
|
|
16
|
+
const initialState = (0, _defaultClientDataStoreProvider.defaultClientDataStoreProvider)(cacheTtlInMins).getData(widgetCacheId, "localStorage");
|
|
15
17
|
if (!(0, _utils.isNullOrUndefined)(initialState)) {
|
|
16
18
|
return JSON.parse(initialState);
|
|
17
19
|
}
|
|
@@ -35,6 +37,7 @@ const getLiveChatWidgetContextInitialState = props => {
|
|
|
35
37
|
conversationState: _ConversationState.ConversationState.Closed,
|
|
36
38
|
isMinimized: false,
|
|
37
39
|
previousElementIdOnFocusBeforeModalOpen: null,
|
|
40
|
+
isStartChatFailing: false,
|
|
38
41
|
outsideOperatingHours: false,
|
|
39
42
|
preChatResponseEmail: "",
|
|
40
43
|
isAudioMuted: null,
|
|
@@ -59,6 +59,14 @@ const createReducer = () => {
|
|
|
59
59
|
conversationState: action.payload
|
|
60
60
|
}
|
|
61
61
|
};
|
|
62
|
+
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_START_CHAT_FAILING:
|
|
63
|
+
return {
|
|
64
|
+
...state,
|
|
65
|
+
appStates: {
|
|
66
|
+
...state.appStates,
|
|
67
|
+
isStartChatFailing: action.payload
|
|
68
|
+
}
|
|
69
|
+
};
|
|
62
70
|
case _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_OUTSIDE_OPERATING_HOURS:
|
|
63
71
|
return {
|
|
64
72
|
...state,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useDebounce;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
function useDebounce(func) {
|
|
9
|
+
let delay = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;
|
|
10
|
+
const timer = (0, _react.useRef)();
|
|
11
|
+
(0, _react.useEffect)(() => {
|
|
12
|
+
return () => {
|
|
13
|
+
if (!timer.current) return;
|
|
14
|
+
clearTimeout(timer.current);
|
|
15
|
+
};
|
|
16
|
+
}, []);
|
|
17
|
+
const debouncedFunction = function () {
|
|
18
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
19
|
+
args[_key] = arguments[_key];
|
|
20
|
+
}
|
|
21
|
+
const newTimer = setTimeout(() => {
|
|
22
|
+
func(...args);
|
|
23
|
+
}, delay);
|
|
24
|
+
clearTimeout(timer.current);
|
|
25
|
+
timer.current = newTimer;
|
|
26
|
+
};
|
|
27
|
+
return debouncedFunction;
|
|
28
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = useWindowDimensions;
|
|
7
|
+
var _react = require("react");
|
|
8
|
+
var _useDebounce = _interopRequireDefault(require("./useDebounce"));
|
|
9
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
10
|
+
function getWindowDimensions() {
|
|
11
|
+
const {
|
|
12
|
+
innerWidth: width,
|
|
13
|
+
innerHeight: height
|
|
14
|
+
} = window;
|
|
15
|
+
return {
|
|
16
|
+
width,
|
|
17
|
+
height
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function useWindowDimensions() {
|
|
21
|
+
let delay = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 200;
|
|
22
|
+
const [windowDimensions, setWindowDimensions] = (0, _react.useState)(getWindowDimensions());
|
|
23
|
+
const handleResize = () => setWindowDimensions(getWindowDimensions());
|
|
24
|
+
const debouncedHandleResize = (0, _useDebounce.default)(handleResize, delay);
|
|
25
|
+
(0, _react.useEffect)(() => {
|
|
26
|
+
window.addEventListener("resize", debouncedHandleResize);
|
|
27
|
+
return () => window.removeEventListener("resize", debouncedHandleResize);
|
|
28
|
+
}, []);
|
|
29
|
+
return windowDimensions;
|
|
30
|
+
}
|
|
@@ -15,6 +15,7 @@ const createOnNewAdapterActivityHandler = (chatId, userId) => {
|
|
|
15
15
|
const isHistoryMessage = isActivityMessage && ((activity === null || activity === void 0 ? void 0 : (_activity$channelData = activity.channelData) === null || _activity$channelData === void 0 ? void 0 : (_activity$channelData2 = _activity$channelData.tags) === null || _activity$channelData2 === void 0 ? void 0 : _activity$channelData2.includes(_Constants.Constants.historyMessageTag)) || (activity === null || activity === void 0 ? void 0 : (_activity$channelData3 = activity.channelData) === null || _activity$channelData3 === void 0 ? void 0 : _activity$channelData3.fromList));
|
|
16
16
|
raiseMessageEvent(activity, isHistoryMessage);
|
|
17
17
|
};
|
|
18
|
+
let isHistoryMessageReceivedEventRasied = false;
|
|
18
19
|
const raiseMessageEvent = (activity, isHistoryMessage) => {
|
|
19
20
|
if ((activity === null || activity === void 0 ? void 0 : activity.type) === _Constants.Constants.message) {
|
|
20
21
|
var _text, _text2, _activity$channelData4, _activity$from;
|
|
@@ -45,6 +46,10 @@ const createOnNewAdapterActivityHandler = (chatId, userId) => {
|
|
|
45
46
|
if (activity !== null && activity !== void 0 && (_activity$channelData5 = activity.channelData) !== null && _activity$channelData5 !== void 0 && (_activity$channelData6 = _activity$channelData5.tags) !== null && _activity$channelData6 !== void 0 && _activity$channelData6.includes(_Constants.Constants.systemMessageTag)) {
|
|
46
47
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
48
|
payload.messageType = _Constants.Constants.systemMessageTag;
|
|
49
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
50
|
+
Event: _TelemetryConstants.TelemetryEvent.SystemMessageReceived,
|
|
51
|
+
Description: "System message received"
|
|
52
|
+
});
|
|
48
53
|
} else {
|
|
49
54
|
var _activity$channelData7, _activity$channelData8, _activity$channelData9;
|
|
50
55
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
@@ -69,6 +74,15 @@ const createOnNewAdapterActivityHandler = (chatId, userId) => {
|
|
|
69
74
|
Description: "New message received",
|
|
70
75
|
Data: payload
|
|
71
76
|
});
|
|
77
|
+
} else {
|
|
78
|
+
if (!isHistoryMessageReceivedEventRasied) {
|
|
79
|
+
isHistoryMessageReceivedEventRasied = true;
|
|
80
|
+
_TelemetryHelper.TelemetryHelper.logActionEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
81
|
+
Event: _TelemetryConstants.TelemetryEvent.HistoryMessageReceived,
|
|
82
|
+
Description: "History message received",
|
|
83
|
+
Data: payload
|
|
84
|
+
});
|
|
85
|
+
}
|
|
72
86
|
}
|
|
73
87
|
}
|
|
74
88
|
}
|
package/lib/esm/assets/Icons.js
CHANGED
|
@@ -8,4 +8,5 @@ export const PDFIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy
|
|
|
8
8
|
export const PowerpointIcon = "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciDQogICAgdmlld0JveD0iMCAwIDIwNDggMjA0OCINCiAgICB3aWR0aD0iMTJweCINCiAgICBoZWlnaHQ9IjEycHgiPg0KICAgIDxwYXRoIGQ9Ik0yMDQ4IDQ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DhzLTgtMy42LTgtOFM3LjYsNCwxMiw0IE0xMiwyQzYuNSwyLDIsNi41LDIsMTJjMCw1LjUsNC41LDEwLDEwLDEwczEwLTQuNSwxMC0xMCAgIEMyMiw2LjUsMTcuNSwyLDEyLDJMMTIsMnoiLz48L2c+PC9zdmc+";
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
var _class;
|
|
2
|
-
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; }
|
|
2
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
4
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
5
|
export class Constants {}
|
|
4
6
|
_defineProperty(Constants, "magicCodeBroadcastChannel", "MagicCodeChannel");
|
|
5
7
|
_defineProperty(Constants, "magicCodeResponseBroadcastChannel", "MagicCodeResponseChannel");
|
|
@@ -42,8 +44,8 @@ _defineProperty(Constants, "acsChannel", "ACS_CHANNEL");
|
|
|
42
44
|
_defineProperty(Constants, "publicMessageTag", "public");
|
|
43
45
|
_defineProperty(Constants, "supportedAdaptiveCardContentTypes", ["application/vnd.microsoft.card.adaptive", "application/vnd.microsoft.card.audio", "application/vnd.microsoft.card.hero", "application/vnd.microsoft.card.receipt", "application/vnd.microsoft.card.thumbnail", "application/vnd.microsoft.card.signin", "application/vnd.microsoft.card.oauth"]);
|
|
44
46
|
_defineProperty(Constants, "maxUploadFileSize", "500000");
|
|
45
|
-
_defineProperty(Constants, "imageRegex", /(\.)(jpeg|jpg|jiff|png|gif|bmp)$/i);
|
|
46
|
-
_defineProperty(Constants, "audioMediaRegex", /(\.)(aac|aiff|alac|flac|mp2|mp3|pcm|wav|wma)$/i);
|
|
47
|
+
_defineProperty(Constants, "imageRegex", /(\.)(jpeg|jpg|jiff|png|gif|bmp|webp)$/i);
|
|
48
|
+
_defineProperty(Constants, "audioMediaRegex", /(\.)(aac|aiff|alac|amr|flac|mp2|mp3|pcm|wav|wma)$/i);
|
|
47
49
|
_defineProperty(Constants, "videoMediaRegex", /(\.)(avchd|avi|flv|mpe|mpeg|mpg|mpv|mp4|m4p|m4v|mov|qt|swf|webm|wmv)$/i);
|
|
48
50
|
_defineProperty(Constants, "chromeSupportedInlineMediaRegex", /(\.)(aac|mp3|wav|mp4)$/i);
|
|
49
51
|
_defineProperty(Constants, "firefoxSupportedInlineMediaRegex", /(\.)(aac|flac|mp3|wav|mp4|mov)$/i);
|
|
@@ -80,6 +82,7 @@ _defineProperty(Constants, "internetConnectionTestUrlText", "Omnichannel Connect
|
|
|
80
82
|
_defineProperty(Constants, "ChatWidgetStateChangedPrefix", "ChatWidgetStateChanged");
|
|
81
83
|
_defineProperty(Constants, "PostChatLoadingDurationInMs", 2000);
|
|
82
84
|
_defineProperty(Constants, "BrowserUnloadConfirmationMessage", "Do you want to leave chat?");
|
|
85
|
+
_defineProperty(Constants, "CacheTtlInMinutes", 15);
|
|
83
86
|
export const Regex = (_class = class Regex {}, _defineProperty(_class, "EmailRegex", "(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-zA-Z0-9-]*[a-zA-Z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])"), _class);
|
|
84
87
|
export class HtmlIdNames {}
|
|
85
88
|
_defineProperty(HtmlIdNames, "MSLiveChatWidget", "MSLiveChatWidget");
|
|
@@ -120,6 +123,7 @@ _defineProperty(HtmlAttributeNames, "noreferrerTag", "noreferrer");
|
|
|
120
123
|
_defineProperty(HtmlAttributeNames, "adaptiveCardClassName", "ac-adaptiveCard");
|
|
121
124
|
_defineProperty(HtmlAttributeNames, "adaptiveCardTextBlockClassName", "ac-textBlock");
|
|
122
125
|
_defineProperty(HtmlAttributeNames, "adaptiveCardToggleInputClassName", "ac-toggleInput");
|
|
126
|
+
_defineProperty(HtmlAttributeNames, "adaptiveCardActionSetClassName", "ac-actionSet");
|
|
123
127
|
export class WebChatMiddlewareConstants {}
|
|
124
128
|
_defineProperty(WebChatMiddlewareConstants, "nextVisibleActivity", "nextVisibleActivity");
|
|
125
129
|
_defineProperty(WebChatMiddlewareConstants, "timeBetweenTimestampGroups", 300000);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
var _class;
|
|
2
|
-
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; }
|
|
2
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
3
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
4
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
3
5
|
export const KeyCodes = (_class = class KeyCodes {}, _defineProperty(_class, "ENTER", "Enter"), _defineProperty(_class, "TAB", "Tab"), _class);
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
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; }
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
2
4
|
export class DataStoreManager {}
|
|
3
5
|
_defineProperty(DataStoreManager, "clientDataStore", void 0);
|
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
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; }
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
2
4
|
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
3
5
|
import { getWidgetCacheId } from "../../utils";
|
|
4
6
|
import { defaultClientDataStoreProvider } from "./defaultClientDataStoreProvider";
|
|
5
7
|
export class defaultCacheManager {}
|
|
6
8
|
_defineProperty(defaultCacheManager, "InternalCache", {});
|
|
7
|
-
export const registerBroadcastServiceForLocalStorage = (orgid, widgetId, widgetInstanceId) => {
|
|
9
|
+
export const registerBroadcastServiceForLocalStorage = (orgid, widgetId, widgetInstanceId, ttlInMins) => {
|
|
8
10
|
const widgetCacheId = getWidgetCacheId(orgid, widgetId, widgetInstanceId);
|
|
9
11
|
BroadcastService.getMessageByEventName(widgetCacheId).subscribe(msg => {
|
|
10
12
|
try {
|
|
11
|
-
defaultClientDataStoreProvider().setData(widgetCacheId, JSON.stringify(msg.payload), "localStorage");
|
|
13
|
+
defaultClientDataStoreProvider(ttlInMins).setData(widgetCacheId, JSON.stringify(msg.payload), "localStorage");
|
|
12
14
|
} catch (error) {
|
|
13
15
|
console.error("Error in setting data to localstorage", error);
|
|
14
16
|
}
|
|
@@ -1,18 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
+
|
|
3
3
|
import { LogLevel, TelemetryEvent } from "../../telemetry/TelemetryConstants";
|
|
4
|
-
|
|
4
|
+
import { TelemetryHelper } from "../../telemetry/TelemetryHelper";
|
|
5
|
+
import { inMemoryDataStore } from "./defaultInMemoryDataStore";
|
|
6
|
+
export const defaultClientDataStoreProvider = function () {
|
|
7
|
+
let cacheTtlinMins = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 0;
|
|
8
|
+
let ttlInMs = 0;
|
|
5
9
|
const isCookieAllowed = () => {
|
|
6
10
|
try {
|
|
7
11
|
localStorage;
|
|
8
12
|
sessionStorage;
|
|
9
13
|
return true;
|
|
10
14
|
} catch (error) {
|
|
11
|
-
|
|
15
|
+
if (!window.TPCWarningShown) {
|
|
16
|
+
console.warn("Third party cookies blocked.");
|
|
17
|
+
window.TPCWarningShown = true;
|
|
18
|
+
}
|
|
12
19
|
return false;
|
|
13
20
|
}
|
|
14
21
|
};
|
|
15
|
-
|
|
22
|
+
if (ttlInMs == 0) {
|
|
23
|
+
ttlInMs = cacheTtlinMins * 60 * 1000;
|
|
24
|
+
}
|
|
16
25
|
const dataStoreProvider = {
|
|
17
26
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
27
|
setData: (key, data, type) => {
|
|
@@ -22,7 +31,7 @@ export const defaultClientDataStoreProvider = () => {
|
|
|
22
31
|
const now = new Date();
|
|
23
32
|
const item = {
|
|
24
33
|
data: data,
|
|
25
|
-
expiry: now.getTime() +
|
|
34
|
+
expiry: now.getTime() + ttlInMs
|
|
26
35
|
};
|
|
27
36
|
const strItem = JSON.stringify(item);
|
|
28
37
|
if (type === "localStorage") {
|
|
@@ -49,6 +49,11 @@ export let BroadcastEvent;
|
|
|
49
49
|
BroadcastEvent["InitiateEndChatOnBrowserUnload"] = "InitiateEndChatOnBrowserUnload";
|
|
50
50
|
BroadcastEvent["ClosePopoutWindow"] = "ClosePopoutWindow";
|
|
51
51
|
BroadcastEvent["RaiseErrorEvent"] = "RaiseErrorEvent";
|
|
52
|
+
BroadcastEvent["NetworkDisconnected"] = "NetworkDisconnected";
|
|
53
|
+
BroadcastEvent["NetworkReconnected"] = "NetworkReconnected";
|
|
54
|
+
BroadcastEvent["SigninCardReceived"] = "SignInCardReceived";
|
|
55
|
+
BroadcastEvent["BotAuthConfigRequest"] = "BotAuthConfigRequest";
|
|
56
|
+
BroadcastEvent["BotAuthConfigResponse"] = "BotAuthConfigResponse";
|
|
52
57
|
})(BroadcastEvent || (BroadcastEvent = {}));
|
|
53
58
|
export let TelemetryEvent;
|
|
54
59
|
(function (TelemetryEvent) {
|
|
@@ -109,6 +114,7 @@ export let TelemetryEvent;
|
|
|
109
114
|
TelemetryEvent["DownloadTranscriptResponseNullOrUndefined"] = "DownloadTranscriptResponseNullOrUndefined";
|
|
110
115
|
TelemetryEvent["EmailTranscriptSent"] = "EmailTranscriptSent";
|
|
111
116
|
TelemetryEvent["EmailTranscriptFailed"] = "EmailTranscriptFailed";
|
|
117
|
+
TelemetryEvent["ErrorUIPaneLoaded"] = "ErrorUIPaneLoaded";
|
|
112
118
|
TelemetryEvent["DownloadTranscriptFailed"] = "DownloadTranscriptFailed";
|
|
113
119
|
TelemetryEvent["StartChatFailed"] = "StartChatFailed";
|
|
114
120
|
TelemetryEvent["IC3ThreadUpdateEventReceived"] = "IC3ThreadUpdateEventReceived";
|
|
@@ -138,6 +144,11 @@ export let TelemetryEvent;
|
|
|
138
144
|
TelemetryEvent["CustomerVoiceResponsePageLoaded"] = "CustomerVoiceResponsePageLoaded";
|
|
139
145
|
TelemetryEvent["CustomerVoiceFormResponseSubmitted"] = "CustomerVoiceFormResponseSubmitted";
|
|
140
146
|
TelemetryEvent["CustomerVoiceFormResponseError"] = "CustomerVoiceFormResponseError";
|
|
147
|
+
TelemetryEvent["BotAuthActivityEmptySasUrl"] = "BotAuthActivityEmptySasUrl";
|
|
148
|
+
TelemetryEvent["SetBotAuthProviderFetchConfig"] = "SetBotAuthProviderFetchConfig";
|
|
149
|
+
TelemetryEvent["SetBotAuthProviderHideCard"] = "SetBotAuthProviderHideCard";
|
|
150
|
+
TelemetryEvent["SetBotAuthProviderDisplayCard"] = "SetBotAuthProviderDisplayCard";
|
|
151
|
+
TelemetryEvent["SetBotAuthProviderNotFound"] = "SetBotAuthProviderNotFound";
|
|
141
152
|
TelemetryEvent["ProcessingHTMLTextMiddlewareFailed"] = "ProcessingHTMLTextMiddlewareFailed";
|
|
142
153
|
TelemetryEvent["ProcessingSanitizationMiddlewareFailed"] = "ProcessingSanitizationMiddlewareFailed";
|
|
143
154
|
TelemetryEvent["FormatTagsMiddlewareJSONStringifyFailed"] = "FormatTagsMiddlewareJSONStringifyFailed";
|
|
@@ -164,6 +175,8 @@ export let TelemetryEvent;
|
|
|
164
175
|
TelemetryEvent["ReconnectChatMinimize"] = "ReconnectChatMinimize";
|
|
165
176
|
TelemetryEvent["MessageSent"] = "MessageSent";
|
|
166
177
|
TelemetryEvent["MessageReceived"] = "MessageReceived";
|
|
178
|
+
TelemetryEvent["SystemMessageReceived"] = "SystemMessageReceived";
|
|
179
|
+
TelemetryEvent["HistoryMessageReceived"] = "HistoryMessageReceived";
|
|
167
180
|
TelemetryEvent["CustomContextReceived"] = "CustomContextReceived";
|
|
168
181
|
TelemetryEvent["NetworkDisconnected"] = "NetworkDisconnected";
|
|
169
182
|
TelemetryEvent["NetworkReconnected"] = "NetworkReconnected";
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
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; }
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
2
4
|
import { ScenarioType, TelemetryEvent } from "./TelemetryConstants";
|
|
3
5
|
import { newGuid } from "../utils";
|
|
4
6
|
import { TelemetryManager } from "./TelemetryManager";
|
|
@@ -54,6 +56,7 @@ export class TelemetryHelper {
|
|
|
54
56
|
event.ElapsedTimeInMilliseconds = payload.ElapsedTimeInMilliseconds;
|
|
55
57
|
event.ExceptionDetails = JSON.stringify(payload.ExceptionDetails);
|
|
56
58
|
event.Description = payload.Description;
|
|
59
|
+
event.CustomProperties = JSON.stringify(payload.CustomProperties);
|
|
57
60
|
});
|
|
58
61
|
}
|
|
59
62
|
static conformToWebChatContract(level, input) {
|
|
@@ -159,7 +162,7 @@ export class TelemetryHelper {
|
|
|
159
162
|
telemetryDataLocal.widgetId = telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.appId;
|
|
160
163
|
telemetryDataLocal.orgId = telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.orgId;
|
|
161
164
|
telemetryDataLocal.orgUrl = telemetryConfig === null || telemetryConfig === void 0 ? void 0 : telemetryConfig.orgUrl;
|
|
162
|
-
telemetryDataLocal.lcwRuntimeId = newGuid();
|
|
165
|
+
telemetryDataLocal.lcwRuntimeId = telemetryConfig.LCWRuntimeId ?? newGuid();
|
|
163
166
|
return telemetryDataLocal;
|
|
164
167
|
}
|
|
165
168
|
static addSessionDataToTelemetry(chatSession, telemetryInternalData) {
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
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; }
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
2
4
|
import { LogLevel, ScenarioType, TelemetryConstants, TelemetryEvent } from "./TelemetryConstants";
|
|
3
5
|
import { BroadcastService } from "@microsoft/omnichannel-chat-components";
|
|
4
6
|
import { ariaTelemetryLogger } from "./loggers/ariaTelemetryLogger";
|
|
@@ -82,7 +82,7 @@ export const ConfirmationPaneStateful = props => {
|
|
|
82
82
|
Event: TelemetryEvent.ConfirmationPaneLoaded
|
|
83
83
|
});
|
|
84
84
|
}, []);
|
|
85
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
85
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DimLayer, {
|
|
86
86
|
brightness: (controlProps === null || controlProps === void 0 ? void 0 : controlProps.brightnessValueOnDim) ?? "0.2"
|
|
87
87
|
}), /*#__PURE__*/React.createElement(ConfirmationPane, {
|
|
88
88
|
componentOverrides: props === null || props === void 0 ? void 0 : props.componentOverrides,
|
|
@@ -88,7 +88,7 @@ export const EmailTranscriptPaneStateful = props => {
|
|
|
88
88
|
Event: TelemetryEvent.EmailTranscriptLoaded
|
|
89
89
|
});
|
|
90
90
|
}, [initialEmail]);
|
|
91
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null,
|
|
91
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(DimLayer, {
|
|
92
92
|
brightness: (controlProps === null || controlProps === void 0 ? void 0 : controlProps.brightnessValueOnDim) ?? "0.2"
|
|
93
93
|
}), /*#__PURE__*/React.createElement(InputValidationPane, {
|
|
94
94
|
componentOverrides: props.componentOverrides,
|
|
@@ -21,6 +21,7 @@ export const HeaderStateful = props => {
|
|
|
21
21
|
const [outOfOperatingHours, setOutOfOperatingHours] = useState(((_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.OutOfOperatingHours) === "True");
|
|
22
22
|
const outOfOfficeStyleProps = Object.assign({}, defaultOutOfOfficeHeaderStyleProps, outOfOfficeHeaderProps === null || outOfOfficeHeaderProps === void 0 ? void 0 : outOfOfficeHeaderProps.styleProps);
|
|
23
23
|
const conversationState = useRef(state.appStates.conversationState);
|
|
24
|
+
const conversationEndedByAgent = useRef(state.appStates.conversationEndedByAgent);
|
|
24
25
|
const controlProps = {
|
|
25
26
|
id: "oc-lcw-header",
|
|
26
27
|
dir: state.domainStates.globalDir,
|
|
@@ -40,7 +41,7 @@ export const HeaderStateful = props => {
|
|
|
40
41
|
Event: TelemetryEvent.HeaderCloseButtonClicked,
|
|
41
42
|
Description: "Header Close button clicked."
|
|
42
43
|
});
|
|
43
|
-
if (conversationState.current === ConversationState.Active) {
|
|
44
|
+
if (conversationState.current === ConversationState.Active || conversationEndedByAgent.current) {
|
|
44
45
|
dispatch({
|
|
45
46
|
type: LiveChatWidgetActionType.SET_SHOW_CONFIRMATION,
|
|
46
47
|
payload: true
|
|
@@ -60,9 +61,9 @@ export const HeaderStateful = props => {
|
|
|
60
61
|
}
|
|
61
62
|
},
|
|
62
63
|
...(headerProps === null || headerProps === void 0 ? void 0 : headerProps.controlProps),
|
|
63
|
-
hideTitle: state.appStates.conversationState === ConversationState.Loading || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP = headerProps.controlProps) === null || _headerProps$controlP === void 0 ? void 0 : _headerProps$controlP.hideTitle),
|
|
64
|
-
hideIcon: state.appStates.conversationState === ConversationState.Loading || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP2 = headerProps.controlProps) === null || _headerProps$controlP2 === void 0 ? void 0 : _headerProps$controlP2.hideIcon),
|
|
65
|
-
hideCloseButton: state.appStates.conversationState === ConversationState.Loading || state.appStates.conversationState === ConversationState.Prechat || state.appStates.conversationState === ConversationState.ReconnectChat || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP3 = headerProps.controlProps) === null || _headerProps$controlP3 === void 0 ? void 0 : _headerProps$controlP3.hideCloseButton)
|
|
64
|
+
hideTitle: state.appStates.conversationState === ConversationState.Loading && !state.appStates.isStartChatFailing || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP = headerProps.controlProps) === null || _headerProps$controlP === void 0 ? void 0 : _headerProps$controlP.hideTitle),
|
|
65
|
+
hideIcon: state.appStates.conversationState === ConversationState.Loading && !state.appStates.isStartChatFailing || state.appStates.conversationState === ConversationState.PostchatLoading || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP2 = headerProps.controlProps) === null || _headerProps$controlP2 === void 0 ? void 0 : _headerProps$controlP2.hideIcon),
|
|
66
|
+
hideCloseButton: state.appStates.conversationState === ConversationState.Loading && !state.appStates.isStartChatFailing || state.appStates.conversationState === ConversationState.PostchatLoading || state.appStates.conversationState === ConversationState.Prechat || state.appStates.conversationState === ConversationState.ReconnectChat || (headerProps === null || headerProps === void 0 ? void 0 : (_headerProps$controlP3 = headerProps.controlProps) === null || _headerProps$controlP3 === void 0 ? void 0 : _headerProps$controlP3.hideCloseButton)
|
|
66
67
|
};
|
|
67
68
|
const outOfOfficeControlProps = {
|
|
68
69
|
id: "oc-lcw-header",
|
|
@@ -86,6 +87,7 @@ export const HeaderStateful = props => {
|
|
|
86
87
|
if (state.appStates.conversationState) {
|
|
87
88
|
conversationState.current = state.appStates.conversationState;
|
|
88
89
|
}
|
|
90
|
+
conversationEndedByAgent.current = state.appStates.conversationEndedByAgent;
|
|
89
91
|
}, [state.appStates]);
|
|
90
92
|
return /*#__PURE__*/React.createElement(Header, {
|
|
91
93
|
componentOverrides: headerProps === null || headerProps === void 0 ? void 0 : headerProps.componentOverrides,
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
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; }
|
|
1
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
3
|
+
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
2
4
|
import { Deferred } from "./Deferred";
|
|
3
5
|
export class ActivityStreamHandler {
|
|
4
6
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|