@microsoft/omnichannel-chat-widget 1.5.1-main.e2be12d → 1.5.1-main.ee4453c
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 +6 -1
- package/lib/cjs/common/telemetry/TelemetryConstants.js +1 -0
- package/lib/cjs/components/livechatwidget/common/startChatErrorHandler.js +12 -5
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +11 -6
- package/lib/cjs/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
- package/lib/cjs/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +68 -0
- package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneGeneralStyleProps.js +17 -0
- package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconImageProps.js +17 -0
- package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconStyleProps.js +15 -0
- package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneSubtitleStyleProps.js +17 -0
- package/lib/cjs/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneTitleStyleProps.js +17 -0
- package/lib/cjs/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneControlProps.js +1 -0
- package/lib/cjs/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneProps.js +1 -0
- package/lib/cjs/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneStyleProps.js +1 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +2 -3
- package/lib/cjs/contexts/common/ConversationState.js +1 -0
- package/lib/cjs/contexts/common/LiveChatWidgetContextInitialState.js +1 -0
- package/lib/cjs/controller/componentController.js +5 -1
- package/lib/esm/common/Constants.js +4 -0
- package/lib/esm/common/telemetry/TelemetryConstants.js +1 -0
- package/lib/esm/components/livechatwidget/common/startChatErrorHandler.js +12 -5
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +12 -7
- package/lib/esm/components/loadingpanestateful/LoadingPaneStateful.js +1 -1
- package/lib/esm/components/startchaterrorpanestateful/StartChatErrorPaneStateful.js +57 -0
- package/lib/esm/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneGeneralStyleProps.js +10 -0
- package/lib/esm/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconImageProps.js +10 -0
- package/lib/esm/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconStyleProps.js +8 -0
- package/lib/esm/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneSubtitleStyleProps.js +10 -0
- package/lib/esm/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneTitleStyleProps.js +10 -0
- package/lib/esm/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneControlProps.js +1 -0
- package/lib/esm/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneProps.js +1 -0
- package/lib/esm/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneStyleProps.js +1 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +2 -3
- package/lib/esm/contexts/common/ConversationState.js +1 -0
- package/lib/esm/contexts/common/LiveChatWidgetContextInitialState.js +1 -0
- package/lib/esm/controller/componentController.js +3 -0
- package/lib/types/common/Constants.d.ts +5 -0
- package/lib/types/common/telemetry/TelemetryConstants.d.ts +1 -0
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts +1 -0
- package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetProps.d.ts +1 -1
- package/lib/types/components/startchaterrorpanestateful/StartChatErrorPaneStateful.d.ts +3 -0
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneGeneralStyleProps.d.ts +2 -0
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconImageProps.d.ts +2 -0
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneIconStyleProps.d.ts +2 -0
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneSubtitleStyleProps.d.ts +2 -0
- package/lib/types/components/startchaterrorpanestateful/common/defaultStartChatErrorPaneTitleStyleProps.d.ts +2 -0
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneClassNames.d.ts +5 -0
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneComponentOverrides.d.ts +6 -0
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneControlProps.d.ts +10 -0
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneProps.d.ts +8 -0
- package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneStyleProps.d.ts +10 -0
- package/lib/types/contexts/common/ConversationState.d.ts +2 -1
- package/lib/types/contexts/common/ILiveChatWidgetContext.d.ts +1 -0
- package/lib/types/controller/componentController.d.ts +1 -0
- package/package.json +3 -3
- package/lib/types/components/loadingpanestateful/interfaces/IStartChatErrorPaneControlProps.d.ts +0 -4
- package/lib/types/components/loadingpanestateful/interfaces/IStartChatErrorPaneProps.d.ts +0 -4
- /package/lib/cjs/components/{loadingpanestateful/interfaces/IStartChatErrorPaneControlProps.js → startchaterrorpanestateful/interfaces/IStartChatErrorPaneClassNames.js} +0 -0
- /package/lib/cjs/components/{loadingpanestateful/interfaces/IStartChatErrorPaneProps.js → startchaterrorpanestateful/interfaces/IStartChatErrorPaneComponentOverrides.js} +0 -0
- /package/lib/esm/components/{loadingpanestateful/interfaces/IStartChatErrorPaneControlProps.js → startchaterrorpanestateful/interfaces/IStartChatErrorPaneClassNames.js} +0 -0
- /package/lib/esm/components/{loadingpanestateful/interfaces/IStartChatErrorPaneProps.js → startchaterrorpanestateful/interfaces/IStartChatErrorPaneComponentOverrides.js} +0 -0
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.WidgetLoadTelemetryMessage = exports.WidgetLoadCustomErrorString = exports.WebChatMiddlewareConstants = exports.TranscriptConstants = exports.StorageType = exports.Regex = exports.ParticipantType = exports.NotificationPaneConstants = exports.MimeTypes = exports.LocaleConstants = exports.LiveWorkItemState = exports.HtmlIdNames = exports.HtmlElementSelectors = exports.HtmlClassNames = exports.HtmlAttributeNames = exports.EnvironmentVersion = exports.ElementType = exports.E2VVOptions = exports.ConversationMode = exports.ConversationEndEntity = exports.Constants = exports.ConfirmationState = exports.AriaTelemetryConstants = exports.AMSConstants = void 0;
|
|
6
|
+
exports.WidgetLoadTelemetryMessage = exports.WidgetLoadCustomErrorString = exports.WebChatMiddlewareConstants = exports.TranscriptConstants = exports.StorageType = exports.StartChatErrorPaneConstants = exports.Regex = exports.ParticipantType = exports.NotificationPaneConstants = exports.MimeTypes = exports.LocaleConstants = exports.LiveWorkItemState = exports.HtmlIdNames = exports.HtmlElementSelectors = exports.HtmlClassNames = exports.HtmlAttributeNames = exports.EnvironmentVersion = exports.ElementType = exports.E2VVOptions = exports.ConversationMode = exports.ConversationEndEntity = exports.Constants = exports.ConfirmationState = exports.AriaTelemetryConstants = exports.AMSConstants = void 0;
|
|
7
7
|
var _class;
|
|
8
8
|
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; }
|
|
9
9
|
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
|
|
@@ -274,6 +274,11 @@ _defineProperty(NotificationPaneConstants, "IconText", "Notification Icon");
|
|
|
274
274
|
_defineProperty(NotificationPaneConstants, "ChatDisconnectTitleText", "Chat disconnected");
|
|
275
275
|
_defineProperty(NotificationPaneConstants, "ChatDisconnectSubtitleText", "For additional assistance, please close the chat and try again.");
|
|
276
276
|
_defineProperty(NotificationPaneConstants, "ChromeCloseIconName", "ChromeClose");
|
|
277
|
+
class StartChatErrorPaneConstants {}
|
|
278
|
+
exports.StartChatErrorPaneConstants = StartChatErrorPaneConstants;
|
|
279
|
+
_defineProperty(StartChatErrorPaneConstants, "DefaultStartChatErrorPaneId", "oc-lcw-start-chat-error-pane");
|
|
280
|
+
_defineProperty(StartChatErrorPaneConstants, "DefaultStartChatErrorTitleText", "We are unable to load chat at this time.");
|
|
281
|
+
_defineProperty(StartChatErrorPaneConstants, "DefaultStartChatErrorSubtitleText", "Please try again later.");
|
|
277
282
|
class AriaTelemetryConstants {}
|
|
278
283
|
exports.AriaTelemetryConstants = AriaTelemetryConstants;
|
|
279
284
|
// Aria Endpoint for different environment types.
|
|
@@ -136,6 +136,7 @@ exports.TelemetryEvent = TelemetryEvent;
|
|
|
136
136
|
TelemetryEvent["ConfirmationCancelButtonClicked"] = "ConfirmationCancelButtonClicked";
|
|
137
137
|
TelemetryEvent["ConfirmationConfirmButtonClicked"] = "ConfirmationConfirmButtonClicked";
|
|
138
138
|
TelemetryEvent["LoadingPaneLoaded"] = "LoadingPaneLoaded";
|
|
139
|
+
TelemetryEvent["StartChatErrorPaneLoaded"] = "StartChatErrorPaneLoaded";
|
|
139
140
|
TelemetryEvent["EmailTranscriptLoaded"] = "EmailTranscriptLoaded";
|
|
140
141
|
TelemetryEvent["OutOfOfficePaneLoaded"] = "OutOfOfficePaneLoaded";
|
|
141
142
|
TelemetryEvent["ConfirmationPaneLoaded"] = "ConfirmationPaneLoaded";
|
|
@@ -60,17 +60,24 @@ const handleStartChatError = (dispatch, chatSDK, props, ex, isStartChatSuccessfu
|
|
|
60
60
|
payload: true
|
|
61
61
|
});
|
|
62
62
|
if (!(props !== null && props !== void 0 && (_props$controlProps = props.controlProps) !== null && _props$controlProps !== void 0 && _props$controlProps.hideErrorUIPane)) {
|
|
63
|
+
// New flow of leveraging ConversationState.Error
|
|
63
64
|
// Set app state to failing start chat if hideErrorUI is not turned on
|
|
64
65
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
65
66
|
Event: _TelemetryConstants.TelemetryEvent.ErrorUIPaneLoaded,
|
|
66
67
|
Description: "Error UI Pane Loaded"
|
|
67
68
|
});
|
|
69
|
+
dispatch({
|
|
70
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
71
|
+
payload: _ConversationState.ConversationState.Error
|
|
72
|
+
});
|
|
73
|
+
} else {
|
|
74
|
+
// Old flow of leveraging ConversationState.Loading
|
|
75
|
+
// Show the loading pane in other cases for failure, this will help for both hideStartChatButton case
|
|
76
|
+
dispatch({
|
|
77
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
78
|
+
payload: _ConversationState.ConversationState.Loading
|
|
79
|
+
});
|
|
68
80
|
}
|
|
69
|
-
// Show the loading pane in other cases for failure, this will help for both hideStartChatButton case
|
|
70
|
-
dispatch({
|
|
71
|
-
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
72
|
-
payload: _ConversationState.ConversationState.Loading
|
|
73
|
-
});
|
|
74
81
|
|
|
75
82
|
// If sessionInit was successful but LCW startchat failed due to some reason e.g adapter didn't load
|
|
76
83
|
// we need to directly endChat to avoid leaving ghost chats in OC, not disturbing any other UI state
|
|
@@ -55,12 +55,13 @@ var _useChatAdapterStore = _interopRequireDefault(require("../../../hooks/useCha
|
|
|
55
55
|
var _useChatContextStore = _interopRequireDefault(require("../../../hooks/useChatContextStore"));
|
|
56
56
|
var _useChatSDKStore = _interopRequireDefault(require("../../../hooks/useChatSDKStore"));
|
|
57
57
|
var _defaultAdaptiveCardStyles = require("../../webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles");
|
|
58
|
+
var _StartChatErrorPaneStateful = _interopRequireDefault(require("../../startchaterrorpanestateful/StartChatErrorPaneStateful"));
|
|
58
59
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
59
60
|
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); }
|
|
60
61
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
61
62
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
62
63
|
const LiveChatWidgetStateful = props => {
|
|
63
|
-
var _props$webChatContain, _props$styleProps, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain5, _state$appStates14, _props$webChatContain6, _props$controlProps12, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _props$webChatContain7, _props$webChatContain8, _props$webChatContain9, _props$webChatContain10, _livechatProps$webCha, _livechatProps$styleP, _livechatProps$contro, _livechatProps$contro2, _livechatProps$compon, _livechatProps$contro3, _livechatProps$compon2, _livechatProps$contro4, _livechatProps$compon3, _livechatProps$contro5, _livechatProps$compon4, _livechatProps$contro6, _livechatProps$compon5, _livechatProps$contro7, _livechatProps$compon6, _livechatProps$contro8, _livechatProps$compon7, _livechatProps$contro9, _livechatProps$
|
|
64
|
+
var _props$webChatContain, _props$styleProps, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain5, _state$appStates14, _props$webChatContain6, _props$controlProps12, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _props$webChatContain7, _props$webChatContain8, _props$webChatContain9, _props$webChatContain10, _livechatProps$webCha, _livechatProps$styleP, _livechatProps$contro, _livechatProps$contro2, _livechatProps$compon, _livechatProps$contro3, _livechatProps$compon2, _livechatProps$contro4, _livechatProps$compon3, _livechatProps$contro5, _livechatProps$compon4, _livechatProps$contro6, _livechatProps$compon5, _livechatProps$contro7, _livechatProps$compon6, _livechatProps$contro8, _livechatProps$compon7, _livechatProps$contro9, _livechatProps$compon8, _livechatProps$contro10, _livechatProps$contro11, _livechatProps$compon9, _livechatProps$contro12, _livechatProps$compon10, _livechatProps$contro13, _livechatProps$compon11, _livechatProps$compon12, _livechatProps$compon13;
|
|
64
65
|
const [state, dispatch] = (0, _useChatContextStore.default)();
|
|
65
66
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
66
67
|
const [adapter, setAdapter] = (0, _useChatAdapterStore.default)();
|
|
@@ -193,6 +194,10 @@ const LiveChatWidgetStateful = props => {
|
|
|
193
194
|
};
|
|
194
195
|
(0, _react2.useEffect)(() => {
|
|
195
196
|
var _props$controlProps5, _props$controlProps6, _props$controlProps7, _props$chatConfig, _props$chatConfig$Liv, _props$controlProps9, _props$chatConfig2, _props$chatConfig2$Ch, _state$appStates5;
|
|
197
|
+
dispatch({
|
|
198
|
+
type: _LiveChatWidgetActionType.LiveChatWidgetActionType.SET_START_CHAT_FAILING,
|
|
199
|
+
payload: false
|
|
200
|
+
});
|
|
196
201
|
state.domainStates.confirmationPaneConfirmedOptionClicked = false;
|
|
197
202
|
state.domainStates.confirmationState = _Constants.ConfirmationState.NotSet;
|
|
198
203
|
setupClientDataStore();
|
|
@@ -707,18 +712,18 @@ const LiveChatWidgetStateful = props => {
|
|
|
707
712
|
}, headerDraggableConfig))), !((_livechatProps$contro5 = livechatProps.controlProps) !== null && _livechatProps$contro5 !== void 0 && _livechatProps$contro5.hideLoadingPane) && (0, _componentController.shouldShowLoadingPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon4 = livechatProps.componentOverrides) === null || _livechatProps$compon4 === void 0 ? void 0 : _livechatProps$compon4.loadingPane) || /*#__PURE__*/_react2.default.createElement(_LoadingPaneStateful.default, {
|
|
708
713
|
loadingPaneProps: livechatProps.loadingPaneProps,
|
|
709
714
|
startChatErrorPaneProps: livechatProps.startChatErrorPaneProps
|
|
710
|
-
})), !((_livechatProps$contro6 = livechatProps.controlProps) !== null && _livechatProps$contro6 !== void 0 && _livechatProps$contro6.
|
|
715
|
+
})), !((_livechatProps$contro6 = livechatProps.controlProps) !== null && _livechatProps$contro6 !== void 0 && _livechatProps$contro6.hideErrorUIPane) && (0, _componentController.shouldShowStartChatErrorPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon5 = livechatProps.componentOverrides) === null || _livechatProps$compon5 === void 0 ? void 0 : _livechatProps$compon5.startChatErrorPane) || /*#__PURE__*/_react2.default.createElement(_StartChatErrorPaneStateful.default, livechatProps.startChatErrorPaneProps)), !((_livechatProps$contro7 = livechatProps.controlProps) !== null && _livechatProps$contro7 !== void 0 && _livechatProps$contro7.hideOutOfOfficeHoursPane) && (0, _componentController.shouldShowOutOfOfficeHoursPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon6 = livechatProps.componentOverrides) === null || _livechatProps$compon6 === void 0 ? void 0 : _livechatProps$compon6.outOfOfficeHoursPane) || /*#__PURE__*/_react2.default.createElement(_OOOHPaneStateful.default, livechatProps.outOfOfficeHoursPaneProps)), !((_livechatProps$contro8 = livechatProps.controlProps) !== null && _livechatProps$contro8 !== void 0 && _livechatProps$contro8.hideReconnectChatPane) && (0, _componentController.shouldShowReconnectChatPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon7 = livechatProps.componentOverrides) === null || _livechatProps$compon7 === void 0 ? void 0 : _livechatProps$compon7.reconnectChatPane) || /*#__PURE__*/_react2.default.createElement(_ReconnectChatPaneStateful.default, {
|
|
711
716
|
reconnectChatProps: livechatProps.reconnectChatPaneProps,
|
|
712
717
|
initStartChat: initStartChatRelay
|
|
713
|
-
})), !((_livechatProps$
|
|
718
|
+
})), !((_livechatProps$contro9 = livechatProps.controlProps) !== null && _livechatProps$contro9 !== void 0 && _livechatProps$contro9.hidePreChatSurveyPane) && (0, _componentController.shouldShowPreChatSurveyPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon8 = livechatProps.componentOverrides) === null || _livechatProps$compon8 === void 0 ? void 0 : _livechatProps$compon8.preChatSurveyPane) || /*#__PURE__*/_react2.default.createElement(_PreChatSurveyPaneStateful.default, {
|
|
714
719
|
surveyProps: livechatProps.preChatSurveyPaneProps,
|
|
715
720
|
initStartChat: initStartChatRelay
|
|
716
|
-
})), !((_livechatProps$
|
|
721
|
+
})), !((_livechatProps$contro10 = livechatProps.controlProps) !== null && _livechatProps$contro10 !== void 0 && _livechatProps$contro10.hideCallingContainer) && (0, _componentController.shouldShowCallingContainer)(state) && /*#__PURE__*/_react2.default.createElement(_CallingContainerStateful.default, _extends({
|
|
717
722
|
voiceVideoCallingSdk: voiceVideoCallingSDK
|
|
718
|
-
}, livechatProps.callingContainerProps)), !((_livechatProps$
|
|
723
|
+
}, livechatProps.callingContainerProps)), !((_livechatProps$contro11 = livechatProps.controlProps) !== null && _livechatProps$contro11 !== void 0 && _livechatProps$contro11.hideWebChatContainer) && (0, _componentController.shouldShowWebChatContainer)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon9 = livechatProps.componentOverrides) === null || _livechatProps$compon9 === void 0 ? void 0 : _livechatProps$compon9.webChatContainer) || /*#__PURE__*/_react2.default.createElement(_WebChatContainerStateful.default, livechatProps)), !((_livechatProps$contro12 = livechatProps.controlProps) !== null && _livechatProps$contro12 !== void 0 && _livechatProps$contro12.hideConfirmationPane) && (0, _componentController.shouldShowConfirmationPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon10 = livechatProps.componentOverrides) === null || _livechatProps$compon10 === void 0 ? void 0 : _livechatProps$compon10.confirmationPane) || /*#__PURE__*/_react2.default.createElement(_ConfirmationPaneStateful.default, _extends({}, confirmationPaneProps, {
|
|
719
724
|
setPostChatContext: setPostChatContextRelay,
|
|
720
725
|
prepareEndChat: prepareEndChatRelay
|
|
721
|
-
}))), !((_livechatProps$
|
|
726
|
+
}))), !((_livechatProps$contro13 = livechatProps.controlProps) !== null && _livechatProps$contro13 !== void 0 && _livechatProps$contro13.hidePostChatLoadingPane) && (0, _componentController.shouldShowPostChatLoadingPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon11 = livechatProps.componentOverrides) === null || _livechatProps$compon11 === void 0 ? void 0 : _livechatProps$compon11.postChatLoadingPane) || /*#__PURE__*/_react2.default.createElement(_PostChatLoadingPaneStateful.default, livechatProps.postChatLoadingPaneProps)), (0, _componentController.shouldShowPostChatSurveyPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon12 = livechatProps.componentOverrides) === null || _livechatProps$compon12 === void 0 ? void 0 : _livechatProps$compon12.postChatSurveyPane) || /*#__PURE__*/_react2.default.createElement(_PostChatSurveyPaneStateful.default, _extends({}, livechatProps.postChatSurveyPaneProps, livechatProps.chatSDK))), (0, _createFooter.createFooter)(livechatProps, state), (0, _componentController.shouldShowEmailTranscriptPane)(state) && ((0, _omnichannelChatComponents.decodeComponentString)((_livechatProps$compon13 = livechatProps.componentOverrides) === null || _livechatProps$compon13 === void 0 ? void 0 : _livechatProps$compon13.emailTranscriptPane) || /*#__PURE__*/_react2.default.createElement(_EmailTranscriptPaneStateful.default, livechatProps.emailTranscriptPane))))));
|
|
722
727
|
};
|
|
723
728
|
exports.LiveChatWidgetStateful = LiveChatWidgetStateful;
|
|
724
729
|
var _default = LiveChatWidgetStateful;
|
|
@@ -9,10 +9,10 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
9
9
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
10
10
|
var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
11
11
|
var _defaultgeneralLoadingPaneStyleProps = require("./common/defaultStyleProps/defaultgeneralLoadingPaneStyleProps");
|
|
12
|
-
var _errorUILoadingPaneStyleProps = require("./common/errorUIStyleProps/errorUILoadingPaneStyleProps");
|
|
13
12
|
var _utils = require("../../common/utils");
|
|
14
13
|
var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
|
|
15
14
|
var _useWindowDimensions = _interopRequireDefault(require("../../hooks/useWindowDimensions"));
|
|
15
|
+
var _errorUILoadingPaneStyleProps = require("./common/errorUIStyleProps/errorUILoadingPaneStyleProps");
|
|
16
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
17
|
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); }
|
|
18
18
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.StartChatErrorPaneStateful = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
9
|
+
var _utils = require("../../common/utils");
|
|
10
|
+
var _useChatContextStore = _interopRequireDefault(require("../../hooks/useChatContextStore"));
|
|
11
|
+
var _TelemetryHelper = require("../../common/telemetry/TelemetryHelper");
|
|
12
|
+
var _TelemetryConstants = require("../../common/telemetry/TelemetryConstants");
|
|
13
|
+
var _defaultStartChatErrorPaneGeneralStyleProps = require("./common/defaultStartChatErrorPaneGeneralStyleProps");
|
|
14
|
+
var _defaultStartChatErrorPaneTitleStyleProps = require("./common/defaultStartChatErrorPaneTitleStyleProps");
|
|
15
|
+
var _defaultStartChatErrorPaneSubtitleStyleProps = require("./common/defaultStartChatErrorPaneSubtitleStyleProps");
|
|
16
|
+
var _defaultStartChatErrorPaneIconStyleProps = require("./common/defaultStartChatErrorPaneIconStyleProps");
|
|
17
|
+
var _defaultStartChatErrorPaneIconImageProps = require("./common/defaultStartChatErrorPaneIconImageProps");
|
|
18
|
+
var _Constants = require("../../common/Constants");
|
|
19
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
20
|
+
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); }
|
|
21
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
22
|
+
const StartChatErrorPaneStateful = startChatErrorPaneProps => {
|
|
23
|
+
var _startChatErrorPanePr, _startChatErrorPanePr2, _startChatErrorPanePr3, _startChatErrorPanePr4, _startChatErrorPanePr5, _startChatErrorPanePr6, _startChatErrorPanePr7;
|
|
24
|
+
const [state] = (0, _useChatContextStore.default)();
|
|
25
|
+
const generalStyleProps = Object.assign({}, _defaultStartChatErrorPaneGeneralStyleProps.defaultStartChatErrorPaneGeneralStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr === void 0 ? void 0 : _startChatErrorPanePr.generalStyleProps);
|
|
26
|
+
const titleStyleProps = Object.assign({}, _defaultStartChatErrorPaneTitleStyleProps.defaultStartChatErrorPaneTitleStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr2 = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr2 === void 0 ? void 0 : _startChatErrorPanePr2.titleStyleProps);
|
|
27
|
+
const subtitleStyleProps = Object.assign({}, _defaultStartChatErrorPaneSubtitleStyleProps.defaultStartChatErrorPaneSubtitleStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr3 = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr3 === void 0 ? void 0 : _startChatErrorPanePr3.subtitleStyleProps);
|
|
28
|
+
const iconStyleProps = Object.assign({}, _defaultStartChatErrorPaneIconStyleProps.defaultStartChatErrorPaneIconStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr4 = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr4 === void 0 ? void 0 : _startChatErrorPanePr4.iconStyleProps);
|
|
29
|
+
const iconImageProps = Object.assign({}, _defaultStartChatErrorPaneIconImageProps.defaultStartChatErrorPaneIconImageStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr5 = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr5 === void 0 ? void 0 : _startChatErrorPanePr5.iconImageProps);
|
|
30
|
+
const errorUIStyleProps = {
|
|
31
|
+
generalStyleProps: generalStyleProps,
|
|
32
|
+
titleStyleProps: titleStyleProps,
|
|
33
|
+
subtitleStyleProps: subtitleStyleProps,
|
|
34
|
+
iconStyleProps: iconStyleProps,
|
|
35
|
+
iconImageProps: iconImageProps
|
|
36
|
+
};
|
|
37
|
+
const errorPaneTitleText = (startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr6 = startChatErrorPaneProps.controlProps) === null || _startChatErrorPanePr6 === void 0 ? void 0 : _startChatErrorPanePr6.titleText) ?? _Constants.StartChatErrorPaneConstants.DefaultStartChatErrorTitleText;
|
|
38
|
+
const errorPaneSubtitleText = (startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr7 = startChatErrorPaneProps.controlProps) === null || _startChatErrorPanePr7 === void 0 ? void 0 : _startChatErrorPanePr7.subtitleText) ?? _Constants.StartChatErrorPaneConstants.DefaultStartChatErrorSubtitleText;
|
|
39
|
+
const errorUIControlProps = {
|
|
40
|
+
id: _Constants.StartChatErrorPaneConstants.DefaultStartChatErrorPaneId,
|
|
41
|
+
dir: state.domainStates.globalDir,
|
|
42
|
+
titleText: errorPaneTitleText,
|
|
43
|
+
subtitleText: errorPaneSubtitleText,
|
|
44
|
+
hideSpinner: true,
|
|
45
|
+
hideSpinnerText: true,
|
|
46
|
+
...(startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : startChatErrorPaneProps.controlProps)
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
// Move focus to the first button
|
|
50
|
+
(0, _react.useEffect)(() => {
|
|
51
|
+
const firstElement = (0, _utils.findAllFocusableElement)(`#${state.domainStates.widgetElementId}`);
|
|
52
|
+
if (firstElement && firstElement[0]) {
|
|
53
|
+
firstElement[0].focus();
|
|
54
|
+
}
|
|
55
|
+
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
56
|
+
Event: _TelemetryConstants.TelemetryEvent.StartChatErrorPaneLoaded,
|
|
57
|
+
Description: "Start chat error pane loaded."
|
|
58
|
+
});
|
|
59
|
+
}, []);
|
|
60
|
+
return /*#__PURE__*/_react.default.createElement(_omnichannelChatComponents.LoadingPane, {
|
|
61
|
+
componentOverrides: startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : startChatErrorPaneProps.componentOverrides,
|
|
62
|
+
controlProps: errorUIControlProps,
|
|
63
|
+
styleProps: errorUIStyleProps
|
|
64
|
+
});
|
|
65
|
+
};
|
|
66
|
+
exports.StartChatErrorPaneStateful = StartChatErrorPaneStateful;
|
|
67
|
+
var _default = StartChatErrorPaneStateful;
|
|
68
|
+
exports.default = _default;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultStartChatErrorPaneGeneralStyleProps = void 0;
|
|
7
|
+
const defaultStartChatErrorPaneGeneralStyleProps = {
|
|
8
|
+
position: "initial",
|
|
9
|
+
width: "100%",
|
|
10
|
+
height: "100%",
|
|
11
|
+
left: "0%",
|
|
12
|
+
top: "0%",
|
|
13
|
+
borderRadius: "0 0 4px 4px",
|
|
14
|
+
borderWidth: "0px",
|
|
15
|
+
backgroundColor: "#FFFFFF"
|
|
16
|
+
};
|
|
17
|
+
exports.defaultStartChatErrorPaneGeneralStyleProps = defaultStartChatErrorPaneGeneralStyleProps;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultStartChatErrorPaneIconImageStyleProps = void 0;
|
|
7
|
+
var _react = require("@fluentui/react");
|
|
8
|
+
var _Icons = require("../../../assets/Icons");
|
|
9
|
+
const defaultStartChatErrorPaneIconImageStyleProps = {
|
|
10
|
+
src: _Icons.AlertIcon,
|
|
11
|
+
imageFit: _react.ImageFit.centerContain,
|
|
12
|
+
width: "86px",
|
|
13
|
+
height: "86px",
|
|
14
|
+
shouldFadeIn: false,
|
|
15
|
+
shouldStartVisible: true
|
|
16
|
+
};
|
|
17
|
+
exports.defaultStartChatErrorPaneIconImageStyleProps = defaultStartChatErrorPaneIconImageStyleProps;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultStartChatErrorPaneIconStyleProps = void 0;
|
|
7
|
+
const defaultStartChatErrorPaneIconStyleProps = {
|
|
8
|
+
display: "flex",
|
|
9
|
+
order: 1,
|
|
10
|
+
alignSelf: "auto",
|
|
11
|
+
backgroundColor: "#FFFFFF",
|
|
12
|
+
boxShadow: "#FFFFFF 0px 0px 0px 0px",
|
|
13
|
+
margin: "0px 0px 0px 0px"
|
|
14
|
+
};
|
|
15
|
+
exports.defaultStartChatErrorPaneIconStyleProps = defaultStartChatErrorPaneIconStyleProps;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultStartChatErrorPaneSubtitleStyleProps = void 0;
|
|
7
|
+
const defaultStartChatErrorPaneSubtitleStyleProps = {
|
|
8
|
+
fontFamily: "'Segoe UI',Arial,sans-serif",
|
|
9
|
+
fontWeight: "normal",
|
|
10
|
+
fontSize: "18px",
|
|
11
|
+
color: "#36454F",
|
|
12
|
+
textAlign: "center",
|
|
13
|
+
display: "flex",
|
|
14
|
+
order: 3,
|
|
15
|
+
alignSelf: "auto"
|
|
16
|
+
};
|
|
17
|
+
exports.defaultStartChatErrorPaneSubtitleStyleProps = defaultStartChatErrorPaneSubtitleStyleProps;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.defaultStartChatErrorPaneTitleStyleProps = void 0;
|
|
7
|
+
const defaultStartChatErrorPaneTitleStyleProps = {
|
|
8
|
+
fontFamily: "'Segoe UI',Arial,sans-serif",
|
|
9
|
+
fontWeight: "normal",
|
|
10
|
+
fontSize: "18px",
|
|
11
|
+
color: "#36454F",
|
|
12
|
+
textAlign: "center",
|
|
13
|
+
display: "flex",
|
|
14
|
+
order: 2,
|
|
15
|
+
alignSelf: "auto"
|
|
16
|
+
};
|
|
17
|
+
exports.defaultStartChatErrorPaneTitleStyleProps = defaultStartChatErrorPaneTitleStyleProps;
|
package/lib/cjs/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneControlProps.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
package/lib/cjs/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneStyleProps.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";
|
|
@@ -54,7 +54,7 @@ const handleSystemMessage = (next, args, card, systemMessageStyleProps) => {
|
|
|
54
54
|
return () => /*#__PURE__*/_react.default.createElement("div", {
|
|
55
55
|
key: card.activity.id,
|
|
56
56
|
style: systemMessageStyles,
|
|
57
|
-
"aria-hidden": "
|
|
57
|
+
"aria-hidden": "false",
|
|
58
58
|
dangerouslySetInnerHTML: {
|
|
59
59
|
__html: (0, _utils.escapeHtml)(card.activity.text)
|
|
60
60
|
}
|
|
@@ -100,8 +100,7 @@ const createActivityMiddleware = (systemMessageStyleProps, userMessageStyleProps
|
|
|
100
100
|
return function () {
|
|
101
101
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
102
102
|
className: card.activity.from.role === _DirectLineSenderRole.DirectLineSenderRole.User ? _Constants.Constants.sentMessageClassName : _Constants.Constants.receivedMessageClassName,
|
|
103
|
-
style: userMessageStyles
|
|
104
|
-
"aria-hidden": "true"
|
|
103
|
+
style: userMessageStyles
|
|
105
104
|
}, next(...args)(...arguments));
|
|
106
105
|
};
|
|
107
106
|
}
|
|
@@ -17,4 +17,5 @@ exports.ConversationState = ConversationState;
|
|
|
17
17
|
ConversationState[ConversationState["PostchatLoading"] = 7] = "PostchatLoading";
|
|
18
18
|
ConversationState[ConversationState["Postchat"] = 8] = "Postchat";
|
|
19
19
|
ConversationState[ConversationState["Closed"] = 9] = "Closed";
|
|
20
|
+
ConversationState[ConversationState["Error"] = 10] = "Error";
|
|
20
21
|
})(ConversationState || (exports.ConversationState = ConversationState = {}));
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.shouldShowWebChatContainer = exports.shouldShowReconnectChatPane = exports.shouldShowProactiveChatPane = exports.shouldShowPreChatSurveyPane = exports.shouldShowPostChatSurveyPane = exports.shouldShowPostChatLoadingPane = exports.shouldShowOutOfOfficeHoursPane = exports.shouldShowLoadingPane = exports.shouldShowHeader = exports.shouldShowFooter = exports.shouldShowEmailTranscriptPane = exports.shouldShowConfirmationPane = exports.shouldShowChatButton = exports.shouldShowCallingContainer = void 0;
|
|
6
|
+
exports.shouldShowWebChatContainer = exports.shouldShowStartChatErrorPane = exports.shouldShowReconnectChatPane = exports.shouldShowProactiveChatPane = exports.shouldShowPreChatSurveyPane = exports.shouldShowPostChatSurveyPane = exports.shouldShowPostChatLoadingPane = exports.shouldShowOutOfOfficeHoursPane = exports.shouldShowLoadingPane = exports.shouldShowHeader = exports.shouldShowFooter = exports.shouldShowEmailTranscriptPane = exports.shouldShowConfirmationPane = exports.shouldShowChatButton = exports.shouldShowCallingContainer = void 0;
|
|
7
7
|
var _ConversationState = require("../contexts/common/ConversationState");
|
|
8
8
|
const shouldShowChatButton = state => {
|
|
9
9
|
var _state$appStates;
|
|
@@ -34,6 +34,10 @@ const shouldShowLoadingPane = state => {
|
|
|
34
34
|
return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.Loading;
|
|
35
35
|
};
|
|
36
36
|
exports.shouldShowLoadingPane = shouldShowLoadingPane;
|
|
37
|
+
const shouldShowStartChatErrorPane = state => {
|
|
38
|
+
return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.Error;
|
|
39
|
+
};
|
|
40
|
+
exports.shouldShowStartChatErrorPane = shouldShowStartChatErrorPane;
|
|
37
41
|
const shouldShowReconnectChatPane = state => {
|
|
38
42
|
return !state.appStates.isMinimized && state.appStates.conversationState === _ConversationState.ConversationState.ReconnectChat;
|
|
39
43
|
};
|
|
@@ -247,6 +247,10 @@ _defineProperty(NotificationPaneConstants, "IconText", "Notification Icon");
|
|
|
247
247
|
_defineProperty(NotificationPaneConstants, "ChatDisconnectTitleText", "Chat disconnected");
|
|
248
248
|
_defineProperty(NotificationPaneConstants, "ChatDisconnectSubtitleText", "For additional assistance, please close the chat and try again.");
|
|
249
249
|
_defineProperty(NotificationPaneConstants, "ChromeCloseIconName", "ChromeClose");
|
|
250
|
+
export class StartChatErrorPaneConstants {}
|
|
251
|
+
_defineProperty(StartChatErrorPaneConstants, "DefaultStartChatErrorPaneId", "oc-lcw-start-chat-error-pane");
|
|
252
|
+
_defineProperty(StartChatErrorPaneConstants, "DefaultStartChatErrorTitleText", "We are unable to load chat at this time.");
|
|
253
|
+
_defineProperty(StartChatErrorPaneConstants, "DefaultStartChatErrorSubtitleText", "Please try again later.");
|
|
250
254
|
export class AriaTelemetryConstants {}
|
|
251
255
|
// Aria Endpoint for different environment types.
|
|
252
256
|
_defineProperty(AriaTelemetryConstants, "GERMANY_ENDPOINT", "https://de.pipe.aria.microsoft.com/Collector/3.0/");
|
|
@@ -130,6 +130,7 @@ export let TelemetryEvent;
|
|
|
130
130
|
TelemetryEvent["ConfirmationCancelButtonClicked"] = "ConfirmationCancelButtonClicked";
|
|
131
131
|
TelemetryEvent["ConfirmationConfirmButtonClicked"] = "ConfirmationConfirmButtonClicked";
|
|
132
132
|
TelemetryEvent["LoadingPaneLoaded"] = "LoadingPaneLoaded";
|
|
133
|
+
TelemetryEvent["StartChatErrorPaneLoaded"] = "StartChatErrorPaneLoaded";
|
|
133
134
|
TelemetryEvent["EmailTranscriptLoaded"] = "EmailTranscriptLoaded";
|
|
134
135
|
TelemetryEvent["OutOfOfficePaneLoaded"] = "OutOfOfficePaneLoaded";
|
|
135
136
|
TelemetryEvent["ConfirmationPaneLoaded"] = "ConfirmationPaneLoaded";
|
|
@@ -55,17 +55,24 @@ export const handleStartChatError = (dispatch, chatSDK, props, ex, isStartChatSu
|
|
|
55
55
|
payload: true
|
|
56
56
|
});
|
|
57
57
|
if (!(props !== null && props !== void 0 && (_props$controlProps = props.controlProps) !== null && _props$controlProps !== void 0 && _props$controlProps.hideErrorUIPane)) {
|
|
58
|
+
// New flow of leveraging ConversationState.Error
|
|
58
59
|
// Set app state to failing start chat if hideErrorUI is not turned on
|
|
59
60
|
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
60
61
|
Event: TelemetryEvent.ErrorUIPaneLoaded,
|
|
61
62
|
Description: "Error UI Pane Loaded"
|
|
62
63
|
});
|
|
64
|
+
dispatch({
|
|
65
|
+
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
66
|
+
payload: ConversationState.Error
|
|
67
|
+
});
|
|
68
|
+
} else {
|
|
69
|
+
// Old flow of leveraging ConversationState.Loading
|
|
70
|
+
// Show the loading pane in other cases for failure, this will help for both hideStartChatButton case
|
|
71
|
+
dispatch({
|
|
72
|
+
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
73
|
+
payload: ConversationState.Loading
|
|
74
|
+
});
|
|
63
75
|
}
|
|
64
|
-
// Show the loading pane in other cases for failure, this will help for both hideStartChatButton case
|
|
65
|
-
dispatch({
|
|
66
|
-
type: LiveChatWidgetActionType.SET_CONVERSATION_STATE,
|
|
67
|
-
payload: ConversationState.Loading
|
|
68
|
-
});
|
|
69
76
|
|
|
70
77
|
// If sessionInit was successful but LCW startchat failed due to some reason e.g adapter didn't load
|
|
71
78
|
// we need to directly endChat to avoid leaving ghost chats in OC, not disturbing any other UI state
|
|
@@ -10,7 +10,7 @@ import { createTimer, getBroadcastChannelName, getConversationDetailsCall, getLo
|
|
|
10
10
|
import { defaultClientDataStoreProvider, isCookieAllowed } from "../../../common/storage/default/defaultClientDataStoreProvider";
|
|
11
11
|
import { chatSDKStateCleanUp, endChat, endChatStateCleanUp, prepareEndChat } from "../common/endChat";
|
|
12
12
|
import { handleChatReconnect, isPersistentEnabled, isReconnectEnabled } from "../common/reconnectChatHelper";
|
|
13
|
-
import { shouldShowCallingContainer, shouldShowChatButton, shouldShowConfirmationPane, shouldShowEmailTranscriptPane, shouldShowHeader, shouldShowLoadingPane, shouldShowOutOfOfficeHoursPane, shouldShowPostChatLoadingPane, shouldShowPostChatSurveyPane, shouldShowPreChatSurveyPane, shouldShowProactiveChatPane, shouldShowReconnectChatPane, shouldShowWebChatContainer } from "../../../controller/componentController";
|
|
13
|
+
import { shouldShowCallingContainer, shouldShowChatButton, shouldShowConfirmationPane, shouldShowEmailTranscriptPane, shouldShowStartChatErrorPane, shouldShowHeader, shouldShowLoadingPane, shouldShowOutOfOfficeHoursPane, shouldShowPostChatLoadingPane, shouldShowPostChatSurveyPane, shouldShowPreChatSurveyPane, shouldShowProactiveChatPane, shouldShowReconnectChatPane, shouldShowWebChatContainer } from "../../../controller/componentController";
|
|
14
14
|
import { ActivityStreamHandler } from "../common/ActivityStreamHandler";
|
|
15
15
|
import CallingContainerStateful from "../../callingcontainerstateful/CallingContainerStateful";
|
|
16
16
|
import ChatButtonStateful from "../../chatbuttonstateful/ChatButtonStateful";
|
|
@@ -51,8 +51,9 @@ import useChatAdapterStore from "../../../hooks/useChatAdapterStore";
|
|
|
51
51
|
import useChatContextStore from "../../../hooks/useChatContextStore";
|
|
52
52
|
import useChatSDKStore from "../../../hooks/useChatSDKStore";
|
|
53
53
|
import { defaultAdaptiveCardStyles } from "../../webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles";
|
|
54
|
+
import StartChatErrorPaneStateful from "../../startchaterrorpanestateful/StartChatErrorPaneStateful";
|
|
54
55
|
export const LiveChatWidgetStateful = props => {
|
|
55
|
-
var _props$webChatContain, _props$styleProps, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain5, _state$appStates14, _props$webChatContain6, _props$controlProps12, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _props$webChatContain7, _props$webChatContain8, _props$webChatContain9, _props$webChatContain10, _livechatProps$webCha, _livechatProps$styleP, _livechatProps$contro, _livechatProps$contro2, _livechatProps$compon, _livechatProps$contro3, _livechatProps$compon2, _livechatProps$contro4, _livechatProps$compon3, _livechatProps$contro5, _livechatProps$compon4, _livechatProps$contro6, _livechatProps$compon5, _livechatProps$contro7, _livechatProps$compon6, _livechatProps$contro8, _livechatProps$compon7, _livechatProps$contro9, _livechatProps$
|
|
56
|
+
var _props$webChatContain, _props$styleProps, _props$controlProps, _props$controlProps3, _state$appStates7, _props$webChatContain5, _state$appStates14, _props$webChatContain6, _props$controlProps12, _props$draggableChatW, _props$draggableChatW2, _props$draggableChatW3, _props$draggableChatW4, _props$draggableChatW5, _props$webChatContain7, _props$webChatContain8, _props$webChatContain9, _props$webChatContain10, _livechatProps$webCha, _livechatProps$styleP, _livechatProps$contro, _livechatProps$contro2, _livechatProps$compon, _livechatProps$contro3, _livechatProps$compon2, _livechatProps$contro4, _livechatProps$compon3, _livechatProps$contro5, _livechatProps$compon4, _livechatProps$contro6, _livechatProps$compon5, _livechatProps$contro7, _livechatProps$compon6, _livechatProps$contro8, _livechatProps$compon7, _livechatProps$contro9, _livechatProps$compon8, _livechatProps$contro10, _livechatProps$contro11, _livechatProps$compon9, _livechatProps$contro12, _livechatProps$compon10, _livechatProps$contro13, _livechatProps$compon11, _livechatProps$compon12, _livechatProps$compon13;
|
|
56
57
|
const [state, dispatch] = useChatContextStore();
|
|
57
58
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
58
59
|
const [adapter, setAdapter] = useChatAdapterStore();
|
|
@@ -185,6 +186,10 @@ export const LiveChatWidgetStateful = props => {
|
|
|
185
186
|
};
|
|
186
187
|
useEffect(() => {
|
|
187
188
|
var _props$controlProps5, _props$controlProps6, _props$controlProps7, _props$chatConfig, _props$chatConfig$Liv, _props$controlProps9, _props$chatConfig2, _props$chatConfig2$Ch, _state$appStates5;
|
|
189
|
+
dispatch({
|
|
190
|
+
type: LiveChatWidgetActionType.SET_START_CHAT_FAILING,
|
|
191
|
+
payload: false
|
|
192
|
+
});
|
|
188
193
|
state.domainStates.confirmationPaneConfirmedOptionClicked = false;
|
|
189
194
|
state.domainStates.confirmationState = ConfirmationState.NotSet;
|
|
190
195
|
setupClientDataStore();
|
|
@@ -699,17 +704,17 @@ export const LiveChatWidgetStateful = props => {
|
|
|
699
704
|
}, headerDraggableConfig))), !((_livechatProps$contro5 = livechatProps.controlProps) !== null && _livechatProps$contro5 !== void 0 && _livechatProps$contro5.hideLoadingPane) && shouldShowLoadingPane(state) && (decodeComponentString((_livechatProps$compon4 = livechatProps.componentOverrides) === null || _livechatProps$compon4 === void 0 ? void 0 : _livechatProps$compon4.loadingPane) || /*#__PURE__*/React.createElement(LoadingPaneStateful, {
|
|
700
705
|
loadingPaneProps: livechatProps.loadingPaneProps,
|
|
701
706
|
startChatErrorPaneProps: livechatProps.startChatErrorPaneProps
|
|
702
|
-
})), !((_livechatProps$contro6 = livechatProps.controlProps) !== null && _livechatProps$contro6 !== void 0 && _livechatProps$contro6.
|
|
707
|
+
})), !((_livechatProps$contro6 = livechatProps.controlProps) !== null && _livechatProps$contro6 !== void 0 && _livechatProps$contro6.hideErrorUIPane) && shouldShowStartChatErrorPane(state) && (decodeComponentString((_livechatProps$compon5 = livechatProps.componentOverrides) === null || _livechatProps$compon5 === void 0 ? void 0 : _livechatProps$compon5.startChatErrorPane) || /*#__PURE__*/React.createElement(StartChatErrorPaneStateful, livechatProps.startChatErrorPaneProps)), !((_livechatProps$contro7 = livechatProps.controlProps) !== null && _livechatProps$contro7 !== void 0 && _livechatProps$contro7.hideOutOfOfficeHoursPane) && shouldShowOutOfOfficeHoursPane(state) && (decodeComponentString((_livechatProps$compon6 = livechatProps.componentOverrides) === null || _livechatProps$compon6 === void 0 ? void 0 : _livechatProps$compon6.outOfOfficeHoursPane) || /*#__PURE__*/React.createElement(OutOfOfficeHoursPaneStateful, livechatProps.outOfOfficeHoursPaneProps)), !((_livechatProps$contro8 = livechatProps.controlProps) !== null && _livechatProps$contro8 !== void 0 && _livechatProps$contro8.hideReconnectChatPane) && shouldShowReconnectChatPane(state) && (decodeComponentString((_livechatProps$compon7 = livechatProps.componentOverrides) === null || _livechatProps$compon7 === void 0 ? void 0 : _livechatProps$compon7.reconnectChatPane) || /*#__PURE__*/React.createElement(ReconnectChatPaneStateful, {
|
|
703
708
|
reconnectChatProps: livechatProps.reconnectChatPaneProps,
|
|
704
709
|
initStartChat: initStartChatRelay
|
|
705
|
-
})), !((_livechatProps$
|
|
710
|
+
})), !((_livechatProps$contro9 = livechatProps.controlProps) !== null && _livechatProps$contro9 !== void 0 && _livechatProps$contro9.hidePreChatSurveyPane) && shouldShowPreChatSurveyPane(state) && (decodeComponentString((_livechatProps$compon8 = livechatProps.componentOverrides) === null || _livechatProps$compon8 === void 0 ? void 0 : _livechatProps$compon8.preChatSurveyPane) || /*#__PURE__*/React.createElement(PreChatSurveyPaneStateful, {
|
|
706
711
|
surveyProps: livechatProps.preChatSurveyPaneProps,
|
|
707
712
|
initStartChat: initStartChatRelay
|
|
708
|
-
})), !((_livechatProps$
|
|
713
|
+
})), !((_livechatProps$contro10 = livechatProps.controlProps) !== null && _livechatProps$contro10 !== void 0 && _livechatProps$contro10.hideCallingContainer) && shouldShowCallingContainer(state) && /*#__PURE__*/React.createElement(CallingContainerStateful, _extends({
|
|
709
714
|
voiceVideoCallingSdk: voiceVideoCallingSDK
|
|
710
|
-
}, livechatProps.callingContainerProps)), !((_livechatProps$
|
|
715
|
+
}, livechatProps.callingContainerProps)), !((_livechatProps$contro11 = livechatProps.controlProps) !== null && _livechatProps$contro11 !== void 0 && _livechatProps$contro11.hideWebChatContainer) && shouldShowWebChatContainer(state) && (decodeComponentString((_livechatProps$compon9 = livechatProps.componentOverrides) === null || _livechatProps$compon9 === void 0 ? void 0 : _livechatProps$compon9.webChatContainer) || /*#__PURE__*/React.createElement(WebChatContainerStateful, livechatProps)), !((_livechatProps$contro12 = livechatProps.controlProps) !== null && _livechatProps$contro12 !== void 0 && _livechatProps$contro12.hideConfirmationPane) && shouldShowConfirmationPane(state) && (decodeComponentString((_livechatProps$compon10 = livechatProps.componentOverrides) === null || _livechatProps$compon10 === void 0 ? void 0 : _livechatProps$compon10.confirmationPane) || /*#__PURE__*/React.createElement(ConfirmationPaneStateful, _extends({}, confirmationPaneProps, {
|
|
711
716
|
setPostChatContext: setPostChatContextRelay,
|
|
712
717
|
prepareEndChat: prepareEndChatRelay
|
|
713
|
-
}))), !((_livechatProps$
|
|
718
|
+
}))), !((_livechatProps$contro13 = livechatProps.controlProps) !== null && _livechatProps$contro13 !== void 0 && _livechatProps$contro13.hidePostChatLoadingPane) && shouldShowPostChatLoadingPane(state) && (decodeComponentString((_livechatProps$compon11 = livechatProps.componentOverrides) === null || _livechatProps$compon11 === void 0 ? void 0 : _livechatProps$compon11.postChatLoadingPane) || /*#__PURE__*/React.createElement(PostChatLoadingPaneStateful, livechatProps.postChatLoadingPaneProps)), shouldShowPostChatSurveyPane(state) && (decodeComponentString((_livechatProps$compon12 = livechatProps.componentOverrides) === null || _livechatProps$compon12 === void 0 ? void 0 : _livechatProps$compon12.postChatSurveyPane) || /*#__PURE__*/React.createElement(PostChatSurveyPaneStateful, _extends({}, livechatProps.postChatSurveyPaneProps, livechatProps.chatSDK))), createFooter(livechatProps, state), shouldShowEmailTranscriptPane(state) && (decodeComponentString((_livechatProps$compon13 = livechatProps.componentOverrides) === null || _livechatProps$compon13 === void 0 ? void 0 : _livechatProps$compon13.emailTranscriptPane) || /*#__PURE__*/React.createElement(EmailTranscriptPaneStateful, livechatProps.emailTranscriptPane))))));
|
|
714
719
|
};
|
|
715
720
|
export default LiveChatWidgetStateful;
|
|
@@ -3,10 +3,10 @@ import React, { useEffect } from "react";
|
|
|
3
3
|
import { LoadingPane } from "@microsoft/omnichannel-chat-components";
|
|
4
4
|
import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
5
5
|
import { defaultGeneralLoadingPaneStyleProps } from "./common/defaultStyleProps/defaultgeneralLoadingPaneStyleProps";
|
|
6
|
-
import { errorUILoadingPaneStyleProps } from "./common/errorUIStyleProps/errorUILoadingPaneStyleProps";
|
|
7
6
|
import { findAllFocusableElement } from "../../common/utils";
|
|
8
7
|
import useChatContextStore from "../../hooks/useChatContextStore";
|
|
9
8
|
import useWindowDimensions from "../../hooks/useWindowDimensions";
|
|
9
|
+
import { errorUILoadingPaneStyleProps } from "./common/errorUIStyleProps/errorUILoadingPaneStyleProps";
|
|
10
10
|
|
|
11
11
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
12
12
|
export const LoadingPaneStateful = props => {
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import React, { useEffect } from "react";
|
|
2
|
+
import { LoadingPane } from "@microsoft/omnichannel-chat-components";
|
|
3
|
+
import { findAllFocusableElement } from "../../common/utils";
|
|
4
|
+
import useChatContextStore from "../../hooks/useChatContextStore";
|
|
5
|
+
import { TelemetryHelper } from "../../common/telemetry/TelemetryHelper";
|
|
6
|
+
import { LogLevel, TelemetryEvent } from "../../common/telemetry/TelemetryConstants";
|
|
7
|
+
import { defaultStartChatErrorPaneGeneralStyleProps } from "./common/defaultStartChatErrorPaneGeneralStyleProps";
|
|
8
|
+
import { defaultStartChatErrorPaneTitleStyleProps } from "./common/defaultStartChatErrorPaneTitleStyleProps";
|
|
9
|
+
import { defaultStartChatErrorPaneSubtitleStyleProps } from "./common/defaultStartChatErrorPaneSubtitleStyleProps";
|
|
10
|
+
import { defaultStartChatErrorPaneIconStyleProps } from "./common/defaultStartChatErrorPaneIconStyleProps";
|
|
11
|
+
import { defaultStartChatErrorPaneIconImageStyleProps } from "./common/defaultStartChatErrorPaneIconImageProps";
|
|
12
|
+
import { StartChatErrorPaneConstants } from "../../common/Constants";
|
|
13
|
+
export const StartChatErrorPaneStateful = startChatErrorPaneProps => {
|
|
14
|
+
var _startChatErrorPanePr, _startChatErrorPanePr2, _startChatErrorPanePr3, _startChatErrorPanePr4, _startChatErrorPanePr5, _startChatErrorPanePr6, _startChatErrorPanePr7;
|
|
15
|
+
const [state] = useChatContextStore();
|
|
16
|
+
const generalStyleProps = Object.assign({}, defaultStartChatErrorPaneGeneralStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr === void 0 ? void 0 : _startChatErrorPanePr.generalStyleProps);
|
|
17
|
+
const titleStyleProps = Object.assign({}, defaultStartChatErrorPaneTitleStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr2 = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr2 === void 0 ? void 0 : _startChatErrorPanePr2.titleStyleProps);
|
|
18
|
+
const subtitleStyleProps = Object.assign({}, defaultStartChatErrorPaneSubtitleStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr3 = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr3 === void 0 ? void 0 : _startChatErrorPanePr3.subtitleStyleProps);
|
|
19
|
+
const iconStyleProps = Object.assign({}, defaultStartChatErrorPaneIconStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr4 = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr4 === void 0 ? void 0 : _startChatErrorPanePr4.iconStyleProps);
|
|
20
|
+
const iconImageProps = Object.assign({}, defaultStartChatErrorPaneIconImageStyleProps, startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr5 = startChatErrorPaneProps.styleProps) === null || _startChatErrorPanePr5 === void 0 ? void 0 : _startChatErrorPanePr5.iconImageProps);
|
|
21
|
+
const errorUIStyleProps = {
|
|
22
|
+
generalStyleProps: generalStyleProps,
|
|
23
|
+
titleStyleProps: titleStyleProps,
|
|
24
|
+
subtitleStyleProps: subtitleStyleProps,
|
|
25
|
+
iconStyleProps: iconStyleProps,
|
|
26
|
+
iconImageProps: iconImageProps
|
|
27
|
+
};
|
|
28
|
+
const errorPaneTitleText = (startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr6 = startChatErrorPaneProps.controlProps) === null || _startChatErrorPanePr6 === void 0 ? void 0 : _startChatErrorPanePr6.titleText) ?? StartChatErrorPaneConstants.DefaultStartChatErrorTitleText;
|
|
29
|
+
const errorPaneSubtitleText = (startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : (_startChatErrorPanePr7 = startChatErrorPaneProps.controlProps) === null || _startChatErrorPanePr7 === void 0 ? void 0 : _startChatErrorPanePr7.subtitleText) ?? StartChatErrorPaneConstants.DefaultStartChatErrorSubtitleText;
|
|
30
|
+
const errorUIControlProps = {
|
|
31
|
+
id: StartChatErrorPaneConstants.DefaultStartChatErrorPaneId,
|
|
32
|
+
dir: state.domainStates.globalDir,
|
|
33
|
+
titleText: errorPaneTitleText,
|
|
34
|
+
subtitleText: errorPaneSubtitleText,
|
|
35
|
+
hideSpinner: true,
|
|
36
|
+
hideSpinnerText: true,
|
|
37
|
+
...(startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : startChatErrorPaneProps.controlProps)
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
// Move focus to the first button
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
const firstElement = findAllFocusableElement(`#${state.domainStates.widgetElementId}`);
|
|
43
|
+
if (firstElement && firstElement[0]) {
|
|
44
|
+
firstElement[0].focus();
|
|
45
|
+
}
|
|
46
|
+
TelemetryHelper.logLoadingEvent(LogLevel.INFO, {
|
|
47
|
+
Event: TelemetryEvent.StartChatErrorPaneLoaded,
|
|
48
|
+
Description: "Start chat error pane loaded."
|
|
49
|
+
});
|
|
50
|
+
}, []);
|
|
51
|
+
return /*#__PURE__*/React.createElement(LoadingPane, {
|
|
52
|
+
componentOverrides: startChatErrorPaneProps === null || startChatErrorPaneProps === void 0 ? void 0 : startChatErrorPaneProps.componentOverrides,
|
|
53
|
+
controlProps: errorUIControlProps,
|
|
54
|
+
styleProps: errorUIStyleProps
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
export default StartChatErrorPaneStateful;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ImageFit } from "@fluentui/react";
|
|
2
|
+
import { AlertIcon } from "../../../assets/Icons";
|
|
3
|
+
export const defaultStartChatErrorPaneIconImageStyleProps = {
|
|
4
|
+
src: AlertIcon,
|
|
5
|
+
imageFit: ImageFit.centerContain,
|
|
6
|
+
width: "86px",
|
|
7
|
+
height: "86px",
|
|
8
|
+
shouldFadeIn: false,
|
|
9
|
+
shouldStartVisible: true
|
|
10
|
+
};
|
package/lib/esm/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneControlProps.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/lib/esm/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneStyleProps.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -47,7 +47,7 @@ const handleSystemMessage = (next, args, card, systemMessageStyleProps) => {
|
|
|
47
47
|
return () => /*#__PURE__*/React.createElement("div", {
|
|
48
48
|
key: card.activity.id,
|
|
49
49
|
style: systemMessageStyles,
|
|
50
|
-
"aria-hidden": "
|
|
50
|
+
"aria-hidden": "false",
|
|
51
51
|
dangerouslySetInnerHTML: {
|
|
52
52
|
__html: escapeHtml(card.activity.text)
|
|
53
53
|
}
|
|
@@ -93,8 +93,7 @@ export const createActivityMiddleware = (systemMessageStyleProps, userMessageSty
|
|
|
93
93
|
return function () {
|
|
94
94
|
return /*#__PURE__*/React.createElement("div", {
|
|
95
95
|
className: card.activity.from.role === DirectLineSenderRole.User ? Constants.sentMessageClassName : Constants.receivedMessageClassName,
|
|
96
|
-
style: userMessageStyles
|
|
97
|
-
"aria-hidden": "true"
|
|
96
|
+
style: userMessageStyles
|
|
98
97
|
}, next(...args)(...arguments));
|
|
99
98
|
};
|
|
100
99
|
}
|
|
@@ -10,4 +10,5 @@ export let ConversationState;
|
|
|
10
10
|
ConversationState[ConversationState["PostchatLoading"] = 7] = "PostchatLoading";
|
|
11
11
|
ConversationState[ConversationState["Postchat"] = 8] = "Postchat";
|
|
12
12
|
ConversationState[ConversationState["Closed"] = 9] = "Closed";
|
|
13
|
+
ConversationState[ConversationState["Error"] = 10] = "Error";
|
|
13
14
|
})(ConversationState || (ConversationState = {}));
|
|
@@ -22,6 +22,9 @@ export const shouldShowWebChatContainer = state => {
|
|
|
22
22
|
export const shouldShowLoadingPane = state => {
|
|
23
23
|
return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.Loading;
|
|
24
24
|
};
|
|
25
|
+
export const shouldShowStartChatErrorPane = state => {
|
|
26
|
+
return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.Error;
|
|
27
|
+
};
|
|
25
28
|
export const shouldShowReconnectChatPane = state => {
|
|
26
29
|
return !state.appStates.isMinimized && state.appStates.conversationState === ConversationState.ReconnectChat;
|
|
27
30
|
};
|
|
@@ -227,6 +227,11 @@ export declare class NotificationPaneConstants {
|
|
|
227
227
|
static readonly ChatDisconnectSubtitleText = "For additional assistance, please close the chat and try again.";
|
|
228
228
|
static readonly ChromeCloseIconName = "ChromeClose";
|
|
229
229
|
}
|
|
230
|
+
export declare class StartChatErrorPaneConstants {
|
|
231
|
+
static readonly DefaultStartChatErrorPaneId = "oc-lcw-start-chat-error-pane";
|
|
232
|
+
static readonly DefaultStartChatErrorTitleText = "We are unable to load chat at this time.";
|
|
233
|
+
static readonly DefaultStartChatErrorSubtitleText = "Please try again later.";
|
|
234
|
+
}
|
|
230
235
|
export declare class AriaTelemetryConstants {
|
|
231
236
|
static readonly GERMANY_ENDPOINT: string;
|
|
232
237
|
static readonly GCCH_ENDPOINT: string;
|
|
@@ -123,6 +123,7 @@ export declare enum TelemetryEvent {
|
|
|
123
123
|
ConfirmationCancelButtonClicked = "ConfirmationCancelButtonClicked",
|
|
124
124
|
ConfirmationConfirmButtonClicked = "ConfirmationConfirmButtonClicked",
|
|
125
125
|
LoadingPaneLoaded = "LoadingPaneLoaded",
|
|
126
|
+
StartChatErrorPaneLoaded = "StartChatErrorPaneLoaded",
|
|
126
127
|
EmailTranscriptLoaded = "EmailTranscriptLoaded",
|
|
127
128
|
OutOfOfficePaneLoaded = "OutOfOfficePaneLoaded",
|
|
128
129
|
ConfirmationPaneLoaded = "ConfirmationPaneLoaded",
|
package/lib/types/components/livechatwidget/interfaces/ILiveChatWidgetComponentOverrides.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ export interface ILiveChatWidgetComponentOverrides {
|
|
|
6
6
|
emailTranscriptPane?: ReactNode | string;
|
|
7
7
|
header?: ReactNode | string;
|
|
8
8
|
loadingPane?: ReactNode | string;
|
|
9
|
+
startChatErrorPane?: ReactNode | string;
|
|
9
10
|
outOfOfficeHoursPane?: ReactNode | string;
|
|
10
11
|
postChatLoadingPane?: ReactNode | string;
|
|
11
12
|
postChatSurveyPane?: ReactNode | string;
|
|
@@ -15,7 +15,7 @@ import { IOOOHPaneProps } from "@microsoft/omnichannel-chat-components/lib/types
|
|
|
15
15
|
import { IPreChatSurveyPaneProps } from "@microsoft/omnichannel-chat-components/lib/types/components/prechatsurveypane/interfaces/IPreChatSurveyPaneProps";
|
|
16
16
|
import { IProactiveChatPaneStatefulProps } from "../../proactivechatpanestateful/interfaces/IProactiveChatPaneStatefulProps";
|
|
17
17
|
import { IReconnectChatPaneStatefulProps } from "../../reconnectchatpanestateful/interfaces/IReconnectChatPaneStatefulProps";
|
|
18
|
-
import { IStartChatErrorPaneProps } from "../../
|
|
18
|
+
import { IStartChatErrorPaneProps } from "../../startchaterrorpanestateful/interfaces/IStartChatErrorPaneProps";
|
|
19
19
|
import { ITelemetryConfig } from "../../../common/telemetry/interfaces/ITelemetryConfig";
|
|
20
20
|
import { IWebChatContainerStatefulProps } from "../../webchatcontainerstateful/interfaces/IWebChatContainerStatefulProps";
|
|
21
21
|
import { OmnichannelChatSDK } from "@microsoft/omnichannel-chat-sdk";
|
package/lib/types/components/startchaterrorpanestateful/interfaces/IStartChatErrorPaneProps.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { IStartChatErrorPaneComponentOverrides } from "./IStartChatErrorPaneComponentOverrides";
|
|
2
|
+
import { IStartChatErrorPaneControlProps } from "./IStartChatErrorPaneControlProps";
|
|
3
|
+
import { IStartChatErrorPaneStyleProps } from "./IStartChatErrorPaneStyleProps";
|
|
4
|
+
export interface IStartChatErrorPaneProps {
|
|
5
|
+
componentOverrides?: IStartChatErrorPaneComponentOverrides;
|
|
6
|
+
controlProps?: IStartChatErrorPaneControlProps;
|
|
7
|
+
styleProps?: IStartChatErrorPaneStyleProps;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IImageProps, IStyle } from "@fluentui/react";
|
|
2
|
+
import { IStartChatErrorPaneClassNames } from "./IStartChatErrorPaneClassNames";
|
|
3
|
+
export interface IStartChatErrorPaneStyleProps {
|
|
4
|
+
generalStyleProps?: IStyle;
|
|
5
|
+
titleStyleProps?: IStyle;
|
|
6
|
+
subtitleStyleProps?: IStyle;
|
|
7
|
+
iconStyleProps?: IStyle;
|
|
8
|
+
iconImageProps?: IImageProps;
|
|
9
|
+
classNames?: IStartChatErrorPaneClassNames;
|
|
10
|
+
}
|
|
@@ -6,6 +6,7 @@ export declare const shouldShowFooter: (state: ILiveChatWidgetContext) => boolea
|
|
|
6
6
|
export declare const shouldShowEmailTranscriptPane: (state: ILiveChatWidgetContext) => boolean;
|
|
7
7
|
export declare const shouldShowWebChatContainer: (state: ILiveChatWidgetContext) => boolean;
|
|
8
8
|
export declare const shouldShowLoadingPane: (state: ILiveChatWidgetContext) => boolean;
|
|
9
|
+
export declare const shouldShowStartChatErrorPane: (state: ILiveChatWidgetContext) => boolean;
|
|
9
10
|
export declare const shouldShowReconnectChatPane: (state: ILiveChatWidgetContext) => boolean;
|
|
10
11
|
export declare const shouldShowPostChatLoadingPane: (state: ILiveChatWidgetContext) => boolean;
|
|
11
12
|
export declare const shouldShowOutOfOfficeHoursPane: (state: ILiveChatWidgetContext) => boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@microsoft/omnichannel-chat-widget",
|
|
3
|
-
"version": "1.5.1-main.
|
|
3
|
+
"version": "1.5.1-main.ee4453c",
|
|
4
4
|
"description": "Microsoft Omnichannel Chat Widget",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"types": "lib/types/index.d.ts",
|
|
@@ -74,8 +74,8 @@
|
|
|
74
74
|
"webpack-cli": "^4.9.2"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@microsoft/omnichannel-chat-components": "^1.0
|
|
78
|
-
"@microsoft/omnichannel-chat-sdk": "1.6.
|
|
77
|
+
"@microsoft/omnichannel-chat-components": "^1.1.0",
|
|
78
|
+
"@microsoft/omnichannel-chat-sdk": "1.6.2",
|
|
79
79
|
"abort-controller-es5": "^2.0.1",
|
|
80
80
|
"dompurify": "^2.3.4",
|
|
81
81
|
"markdown-it": "^12.3.2",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|