@microsoft/omnichannel-chat-widget 1.8.4-hotfix.system-message-spacing.1 → 1.8.4-main.1a8b799
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 +3 -0
- package/lib/cjs/common/utils.js +34 -14
- package/lib/cjs/components/citationpanestateful/CitationPaneStateful.js +2 -1
- package/lib/cjs/components/confirmationpanestateful/ConfirmationPaneStateful.js +2 -1
- package/lib/cjs/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -1
- package/lib/cjs/components/livechatwidget/common/endChat.js +2 -0
- package/lib/cjs/components/livechatwidget/common/initWebChatComposer.js +2 -1
- package/lib/cjs/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +48 -1
- package/lib/cjs/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +2 -1
- package/lib/cjs/components/webchatcontainerstateful/WebChatContainerStateful.js +19 -8
- package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +3 -1
- package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +24 -7
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AdaptiveCardAccessibilityWrapper.js +77 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +7 -2
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +8 -1
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +3 -13
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentSentAnnouncementMiddleware.js +81 -0
- package/lib/cjs/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +9 -3
- package/lib/esm/common/Constants.js +3 -0
- package/lib/esm/common/utils.js +34 -14
- package/lib/esm/components/citationpanestateful/CitationPaneStateful.js +2 -1
- package/lib/esm/components/confirmationpanestateful/ConfirmationPaneStateful.js +2 -1
- package/lib/esm/components/emailtranscriptpanestateful/EmailTranscriptPaneStateful.js +2 -1
- package/lib/esm/components/livechatwidget/common/endChat.js +2 -0
- package/lib/esm/components/livechatwidget/common/initWebChatComposer.js +2 -1
- package/lib/esm/components/livechatwidget/livechatwidgetstateful/LiveChatWidgetStateful.js +48 -1
- package/lib/esm/components/prechatsurveypanestateful/common/defaultStyles/defaultGeneralPreChatSurveyPaneStyleProps.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/WebChatContainerStateful.js +19 -8
- package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultAdaptiveCardStyles.js +3 -1
- package/lib/esm/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js +1 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.js +21 -5
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachmentMiddleware.js +2 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AdaptiveCardAccessibilityWrapper.js +69 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.js +7 -2
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultTimestampRetryStyles.js +8 -1
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/timestamps/NotDeliveredTimestamp.js +3 -13
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentSentAnnouncementMiddleware.js +74 -0
- package/lib/esm/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/localizedStringsBotInitialsMiddleware.js +9 -3
- package/lib/types/common/Constants.d.ts +2 -0
- package/lib/types/common/utils.d.ts +1 -1
- package/lib/types/components/webchatcontainerstateful/interfaces/IAdaptiveCardStyles.d.ts +1 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware.d.ts +2 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/attachments/AdaptiveCardAccessibilityWrapper.d.ts +12 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/defaultStyles/defaultSystemMessageStyles.d.ts +3 -0
- package/lib/types/components/webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentSentAnnouncementMiddleware.d.ts +12 -0
- package/package.json +7 -6
|
@@ -146,6 +146,9 @@ _defineProperty(Constants, "customEventValue", "customEventValue");
|
|
|
146
146
|
_defineProperty(Constants, "Hidden", "Hidden");
|
|
147
147
|
_defineProperty(Constants, "EndConversationDueToOverflow", "endconversationduetooverflow");
|
|
148
148
|
_defineProperty(Constants, "SkipSessionCloseForPersistentChatFlag", "skipSessionCloseForPersistentChat");
|
|
149
|
+
// Minimum font-size for input fields to prevent iOS Safari auto-zoom on focus
|
|
150
|
+
_defineProperty(Constants, "minInputFontSizePx", 16);
|
|
151
|
+
_defineProperty(Constants, "minInputFontSize", "16px");
|
|
149
152
|
const Regex = (_class = /*#__PURE__*/_createClass(function Regex() {
|
|
150
153
|
_classCallCheck(this, Regex);
|
|
151
154
|
}), _defineProperty(_class, "EmailRegex", "^(?:[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"[^\"\\\\]*(?:\\\\.[^\"\\\\]*)*\")@(?:[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]?)\\])$"), _class);
|
package/lib/cjs/common/utils.js
CHANGED
|
@@ -85,26 +85,46 @@ exports.findAllFocusableElement = findAllFocusableElement;
|
|
|
85
85
|
const preventFocusToMoveOutOfElement = elementId => {
|
|
86
86
|
const container = document.getElementById(elementId);
|
|
87
87
|
if (!container) {
|
|
88
|
-
return;
|
|
88
|
+
return () => {/* no-op */};
|
|
89
89
|
}
|
|
90
90
|
const focusableElements = findAllFocusableElement(container);
|
|
91
91
|
if (!focusableElements) {
|
|
92
|
-
return;
|
|
92
|
+
return () => {/* no-op */};
|
|
93
93
|
}
|
|
94
94
|
const firstFocusableElement = focusableElements[0];
|
|
95
95
|
const lastFocusableElement = focusableElements[focusableElements.length - 1];
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
96
|
+
const cleanups = [];
|
|
97
|
+
if (firstFocusableElement === lastFocusableElement) {
|
|
98
|
+
const handler = e => {
|
|
99
|
+
if (e.key === _KeyCodes.KeyCodes.TAB && !e.shiftKey) {
|
|
100
|
+
e.preventDefault();
|
|
101
|
+
firstFocusableElement.focus();
|
|
102
|
+
} else if (e.key === _KeyCodes.KeyCodes.TAB && e.shiftKey) {
|
|
103
|
+
e.preventDefault();
|
|
104
|
+
firstFocusableElement.focus();
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
firstFocusableElement.addEventListener("keydown", handler);
|
|
108
|
+
cleanups.push(() => firstFocusableElement.removeEventListener("keydown", handler));
|
|
109
|
+
} else {
|
|
110
|
+
const firstHandler = e => {
|
|
111
|
+
if (e.shiftKey && e.key === _KeyCodes.KeyCodes.TAB) {
|
|
112
|
+
e.preventDefault();
|
|
113
|
+
lastFocusableElement === null || lastFocusableElement === void 0 ? void 0 : lastFocusableElement.focus();
|
|
114
|
+
}
|
|
115
|
+
};
|
|
116
|
+
firstFocusableElement.addEventListener("keydown", firstHandler);
|
|
117
|
+
cleanups.push(() => firstFocusableElement.removeEventListener("keydown", firstHandler));
|
|
118
|
+
const lastHandler = e => {
|
|
119
|
+
if (!e.shiftKey && e.key === _KeyCodes.KeyCodes.TAB) {
|
|
120
|
+
e.preventDefault();
|
|
121
|
+
firstFocusableElement === null || firstFocusableElement === void 0 ? void 0 : firstFocusableElement.focus();
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
lastFocusableElement.addEventListener("keydown", lastHandler);
|
|
125
|
+
cleanups.push(() => lastFocusableElement.removeEventListener("keydown", lastHandler));
|
|
126
|
+
}
|
|
127
|
+
return () => cleanups.forEach(fn => fn());
|
|
108
128
|
};
|
|
109
129
|
exports.preventFocusToMoveOutOfElement = preventFocusToMoveOutOfElement;
|
|
110
130
|
const setFocusOnSendBox = () => {
|
|
@@ -44,7 +44,7 @@ const CitationPaneStateful = props => {
|
|
|
44
44
|
|
|
45
45
|
// Initial focus pattern (mirrors ConfirmationPaneStateful): focus first focusable element (will re-attempt after visibility becomes true)
|
|
46
46
|
(0, _react.useEffect)(() => {
|
|
47
|
-
(0, _utils.preventFocusToMoveOutOfElement)(controlId);
|
|
47
|
+
const cleanup = (0, _utils.preventFocusToMoveOutOfElement)(controlId);
|
|
48
48
|
const focusableElements = (0, _utils.findAllFocusableElement)(`#${controlId}`);
|
|
49
49
|
requestAnimationFrame(() => {
|
|
50
50
|
if (focusableElements && focusableElements.length > 0 && focusableElements[0]) {
|
|
@@ -62,6 +62,7 @@ const CitationPaneStateful = props => {
|
|
|
62
62
|
Event: _TelemetryConstants.TelemetryEvent.UXCitationPaneCompleted,
|
|
63
63
|
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
64
64
|
});
|
|
65
|
+
return cleanup;
|
|
65
66
|
}, []);
|
|
66
67
|
|
|
67
68
|
// Retry focus once pane is actually visible (isReady) in case initial attempt occurred while wrapper was visibility:hidden
|
|
@@ -82,7 +82,7 @@ const ConfirmationPaneStateful = props => {
|
|
|
82
82
|
|
|
83
83
|
// Move focus to the first button
|
|
84
84
|
(0, _react.useEffect)(() => {
|
|
85
|
-
(0, _utils.preventFocusToMoveOutOfElement)(controlProps.id);
|
|
85
|
+
const cleanup = (0, _utils.preventFocusToMoveOutOfElement)(controlProps.id);
|
|
86
86
|
const focusableElements = (0, _utils.findAllFocusableElement)(`#${controlProps.id}`);
|
|
87
87
|
requestAnimationFrame(() => {
|
|
88
88
|
if (focusableElements && focusableElements.length > 0 && focusableElements[0]) {
|
|
@@ -100,6 +100,7 @@ const ConfirmationPaneStateful = props => {
|
|
|
100
100
|
Event: _TelemetryConstants.TelemetryEvent.UXConfirmationPaneCompleted,
|
|
101
101
|
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
102
102
|
});
|
|
103
|
+
return cleanup;
|
|
103
104
|
}, []);
|
|
104
105
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_DimLayer.DimLayer, {
|
|
105
106
|
brightness: (controlProps === null || controlProps === void 0 ? void 0 : controlProps.brightnessValueOnDim) ?? "0.2"
|
|
@@ -103,7 +103,7 @@ const EmailTranscriptPaneStateful = props => {
|
|
|
103
103
|
|
|
104
104
|
// Move focus to the first button
|
|
105
105
|
(0, _react.useEffect)(() => {
|
|
106
|
-
(0, _utils.preventFocusToMoveOutOfElement)(controlProps.id);
|
|
106
|
+
const cleanup = (0, _utils.preventFocusToMoveOutOfElement)(controlProps.id);
|
|
107
107
|
const focusableElements = (0, _utils.findAllFocusableElement)(`#${controlProps.id}`);
|
|
108
108
|
if (focusableElements) {
|
|
109
109
|
focusableElements[0].focus();
|
|
@@ -118,6 +118,7 @@ const EmailTranscriptPaneStateful = props => {
|
|
|
118
118
|
Event: _TelemetryConstants.TelemetryEvent.UXEmailTranscriptPaneCompleted,
|
|
119
119
|
ElapsedTimeInMilliseconds: uiTimer.milliSecondsElapsed
|
|
120
120
|
});
|
|
121
|
+
return cleanup;
|
|
121
122
|
}, [initialEmail]);
|
|
122
123
|
return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_DimLayer.DimLayer, {
|
|
123
124
|
brightness: (controlProps === null || controlProps === void 0 ? void 0 : controlProps.brightnessValueOnDim) ?? "0.2"
|
|
@@ -11,6 +11,7 @@ var _renderSurveyHelpers = require("./renderSurveyHelpers");
|
|
|
11
11
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
12
12
|
var _ConversationState = require("../../../contexts/common/ConversationState");
|
|
13
13
|
var _LazyLoadActivity = require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activities/LazyLoadActivity");
|
|
14
|
+
var _activityMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware");
|
|
14
15
|
var _LiveChatWidgetActionType = require("../../../contexts/common/LiveChatWidgetActionType");
|
|
15
16
|
var _NotificationHandler = require("../../webchatcontainerstateful/webchatcontroller/notification/NotificationHandler");
|
|
16
17
|
var _NotificationScenarios = require("../../webchatcontainerstateful/webchatcontroller/enums/NotificationScenarios");
|
|
@@ -249,6 +250,7 @@ const endChat = async (props, facadeChatSDK, state, dispatch, setAdapter, setWeb
|
|
|
249
250
|
|
|
250
251
|
// Call direct reset to ensure LazyLoadHandler gets reset regardless of broadcast timing
|
|
251
252
|
_LazyLoadActivity.LazyLoadHandler.directReset();
|
|
253
|
+
(0, _activityMiddleware.resetActivityMiddlewareCache)();
|
|
252
254
|
_omnichannelChatComponents.BroadcastService.postMessage({
|
|
253
255
|
eventName: _TelemetryConstants.BroadcastEvent.PersistentConversationReset
|
|
254
256
|
});
|
|
@@ -16,6 +16,7 @@ var _LiveChatWidgetActionType = require("../../../contexts/common/LiveChatWidget
|
|
|
16
16
|
var _TelemetryHelper = require("../../../common/telemetry/TelemetryHelper");
|
|
17
17
|
var _WebChatStoreLoader = require("../../webchatcontainerstateful/webchatcontroller/WebChatStoreLoader");
|
|
18
18
|
var _attachmentProcessingMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentProcessingMiddleware"));
|
|
19
|
+
var _attachmentSentAnnouncementMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/attachmentSentAnnouncementMiddleware"));
|
|
19
20
|
var _channelDataMiddleware = _interopRequireDefault(require("../../webchatcontainerstateful/webchatcontroller/middlewares/storemiddlewares/channelDataMiddleware"));
|
|
20
21
|
var _activityMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityMiddleware");
|
|
21
22
|
var _activityStatusMiddleware = require("../../webchatcontainerstateful/webchatcontroller/middlewares/renderingmiddlewares/activityStatusMiddleware");
|
|
@@ -125,7 +126,7 @@ const initWebChatComposer = (props, state, dispatch, facadeChatSDK, endChat) =>
|
|
|
125
126
|
};
|
|
126
127
|
webChatStore = (0, _botframeworkWebchat.createStore)({},
|
|
127
128
|
//initial state
|
|
128
|
-
_preProcessingMiddleware.default, _attachmentProcessingMiddleware.default, (0, _attachmentUploadValidatorMiddleware.default)((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : _state$domainStates$l.allowedFileExtensions, (_state$domainStates$l2 = state.domainStates.liveChatConfig) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.maxUploadFileSize, localizedTexts), (0, _customEventMiddleware.default)(_omnichannelChatComponents.BroadcastService), (0, _queueOverflowHandlerMiddleware.createQueueOverflowMiddleware)(state, dispatch), (0, _channelDataMiddleware.default)(addConversationalSurveyTagsCallback), (0, _conversationEndMiddleware.default)(conversationEndCallback, startConversationalSurveyCallback, endConversationalSurveyCallback), (0, _dataMaskingMiddleware.default)((_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : _state$domainStates$l3.DataMaskingInfo), _messageTimestampMiddleware.createMessageTimeStampMiddleware, _messageSequenceIdOverrideMiddleware.createMessageSequenceIdOverrideMiddleware, (0, _citationsMiddleware.createCitationsMiddleware)(state, dispatch), _gifUploadMiddleware.default, _htmlPlayerMiddleware.default, (0, _htmlTextMiddleware.default)(honorsTargetInHTMLLinks), (0, _maxMessageSizeValidator.default)(localizedTexts), _sanitizationMiddleware.default, (0, _callActionMiddleware.default)(),
|
|
129
|
+
_preProcessingMiddleware.default, _attachmentProcessingMiddleware.default, (0, _attachmentUploadValidatorMiddleware.default)((_state$domainStates$l = state.domainStates.liveChatConfig) === null || _state$domainStates$l === void 0 ? void 0 : _state$domainStates$l.allowedFileExtensions, (_state$domainStates$l2 = state.domainStates.liveChatConfig) === null || _state$domainStates$l2 === void 0 ? void 0 : _state$domainStates$l2.maxUploadFileSize, localizedTexts), _attachmentSentAnnouncementMiddleware.default, (0, _customEventMiddleware.default)(_omnichannelChatComponents.BroadcastService), (0, _queueOverflowHandlerMiddleware.createQueueOverflowMiddleware)(state, dispatch), (0, _channelDataMiddleware.default)(addConversationalSurveyTagsCallback), (0, _conversationEndMiddleware.default)(conversationEndCallback, startConversationalSurveyCallback, endConversationalSurveyCallback), (0, _dataMaskingMiddleware.default)((_state$domainStates$l3 = state.domainStates.liveChatConfig) === null || _state$domainStates$l3 === void 0 ? void 0 : _state$domainStates$l3.DataMaskingInfo), _messageTimestampMiddleware.createMessageTimeStampMiddleware, _messageSequenceIdOverrideMiddleware.createMessageSequenceIdOverrideMiddleware, (0, _citationsMiddleware.createCitationsMiddleware)(state, dispatch), _gifUploadMiddleware.default, _htmlPlayerMiddleware.default, (0, _htmlTextMiddleware.default)(honorsTargetInHTMLLinks), (0, _maxMessageSizeValidator.default)(localizedTexts), _sanitizationMiddleware.default, (0, _callActionMiddleware.default)(),
|
|
129
130
|
// Pass a callback so middleware can push initials into React context for reactivity
|
|
130
131
|
(0, _localizedStringsBotInitialsMiddleware.localizedStringsBotInitialsMiddleware)(initials => {
|
|
131
132
|
dispatch({
|
|
@@ -1075,10 +1075,31 @@ const LiveChatWidgetStateful = props => {
|
|
|
1075
1075
|
.webchat__basic-transcript__activity-markdown-body > :last-child {
|
|
1076
1076
|
margin-bottom: 0px;
|
|
1077
1077
|
}
|
|
1078
|
-
|
|
1078
|
+
|
|
1079
1079
|
.webchat__basic-transcript__activity-markdown-body > :first-child {
|
|
1080
1080
|
margin-top: 0px;
|
|
1081
1081
|
}
|
|
1082
|
+
|
|
1083
|
+
/* Remove browser-default <p> margins inside system messages.
|
|
1084
|
+
Without this, each markdown paragraph adds ~1em top+bottom gap
|
|
1085
|
+
which causes the oversized line spacing visible on iOS Safari.
|
|
1086
|
+
Also disable iOS Safari's auto font-size scaling (-webkit-text-size-adjust)
|
|
1087
|
+
which inflates font sizes and causes line-height to grow over time
|
|
1088
|
+
when the layout is viewed in a narrow viewport. */
|
|
1089
|
+
.webchat__basic-transcript__activity-markdown-body {
|
|
1090
|
+
-webkit-text-size-adjust: 100%;
|
|
1091
|
+
text-size-adjust: 100%;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
.webchat__basic-transcript__activity-markdown-body p {
|
|
1095
|
+
margin-top: 0;
|
|
1096
|
+
margin-bottom: 4px;
|
|
1097
|
+
line-height: 1.4;
|
|
1098
|
+
}
|
|
1099
|
+
|
|
1100
|
+
.webchat__basic-transcript__activity-markdown-body p:last-child {
|
|
1101
|
+
margin-bottom: 0;
|
|
1102
|
+
}
|
|
1082
1103
|
|
|
1083
1104
|
.webchat__basic-transcript__activity-markdown-body img.webchat__render-markdown__external-link-icon {
|
|
1084
1105
|
background-image : url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIzIDMgMTggMTgiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTcuMjUwMSA0LjUwMDE3SDEwLjc0OTVDMTEuMTYzNyA0LjUwMDE3IDExLjQ5OTUgNC44MzU5NiAxMS40OTk1IDUuMjUwMTdDMTEuNDk5NSA1LjYyOTg2IDExLjIxNzMgNS45NDM2NiAxMC44NTEzIDUuOTkzMzJMMTAuNzQ5NSA2LjAwMDE3SDcuMjQ5NzRDNi4wNzA3OSA1Ljk5OTYxIDUuMTAzNDkgNi45MDY1NiA1LjAwNzg2IDguMDYxMTJMNS4wMDAyOCA4LjIyMDAzTDUuMDAzMTIgMTYuNzUwN0M1LjAwMzQzIDE3Ljk0MTUgNS45Mjg4NSAxOC45MTYxIDcuMDk5NjYgMTguOTk0OUw3LjI1MzcxIDE5LjAwMDFMMTUuNzUxOCAxOC45ODg0QzE2Ljk0MTUgMTguOTg2OCAxNy45MTQ1IDE4LjA2MiAxNy45OTM1IDE2Ljg5MjNMMTcuOTk4NyAxNi43Mzg0VjEzLjIzMjFDMTcuOTk4NyAxMi44MTc5IDE4LjMzNDUgMTIuNDgyMSAxOC43NDg3IDEyLjQ4MjFDMTkuMTI4NCAxMi40ODIxIDE5LjQ0MjIgMTIuNzY0MyAxOS40OTE4IDEzLjEzMDNMMTkuNDk4NyAxMy4yMzIxVjE2LjczODRDMTkuNDk4NyAxOC43NDA3IDE3LjkyOTMgMjAuMzc2OSAxNS45NTI4IDIwLjQ4MjlMMTUuNzUzOCAyMC40ODg0TDcuMjU4MjcgMjAuNTAwMUw3LjA1NDk1IDIwLjQ5NDlDNS4xNDIzOSAyMC4zOTU0IDMuNjA4OTUgMTguODYyNyAzLjUwODM3IDE2Ljk1MDJMMy41MDMxMiAxNi43NTExTDMuNTAwODkgOC4yNTI3TDMuNTA1MjkgOC4wNTAyQzMuNjA1MzkgNi4xMzc0OSA1LjEzODY3IDQuNjA0NDkgNy4wNTA5NiA0LjUwNTI3TDcuMjUwMSA0LjUwMDE3SDEwLjc0OTVINy4yNTAxWk0xMy43NDgxIDMuMDAxNDZMMjAuMzAxOCAzLjAwMTk3TDIwLjQwMTQgMy4wMTU3NUwyMC41MDIyIDMuMDQzOTNMMjAuNTU5IDMuMDY4MDNDMjAuNjEyMiAzLjA5MTIyIDIwLjY2MzQgMy4xMjE2MyAyMC43MTExIDMuMTU4ODVMMjAuNzgwNCAzLjIyMTU2TDIwLjg2NDEgMy4zMjAxNEwyMC45MTgzIDMuNDEwMjVMMjAuOTU3IDMuNTAwNTdMMjAuOTc2MiAzLjU2NDc2TDIwLjk4OTggMy42Mjg2MkwyMC45OTkyIDMuNzIyODJMMjAuOTk5NyAxMC4yNTU0QzIwLjk5OTcgMTAuNjY5NiAyMC42NjM5IDExLjAwNTQgMjAuMjQ5NyAxMS4wMDU0QzE5Ljg3IDExLjAwNTQgMTkuNTU2MiAxMC43MjMyIDE5LjUwNjUgMTAuMzU3MUwxOS40OTk3IDEwLjI1NTRMMTkuNDk4OSA1LjU2MTQ3TDEyLjI3OTcgMTIuNzg0N0MxMi4wMTM0IDEzLjA1MSAxMS41OTY4IDEzLjA3NTMgMTEuMzAzMSAxMi44NTc1TDExLjIxOSAxMi43ODQ5QzEwLjk1MjcgMTIuNTE4NyAxMC45Mjg0IDEyLjEwMjEgMTEuMTQ2MiAxMS44MDg0TDExLjIxODggMTEuNzI0M0wxOC40MzY5IDQuNTAxNDZIMTMuNzQ4MUMxMy4zNjg0IDQuNTAxNDYgMTMuMDU0NiA0LjIxOTMxIDEzLjAwNSAzLjg1MzI0TDEyLjk5ODEgMy43NTE0NkMxMi45OTgxIDMuMzcxNzcgMTMuMjgwMyAzLjA1Nzk3IDEzLjY0NjQgMy4wMDgzMUwxMy43NDgxIDMuMDAxNDZaIiBmaWxsPSIjMjEyMTIxIiAvPjwvc3ZnPg==) !important;
|
|
@@ -1086,6 +1107,32 @@ const LiveChatWidgetStateful = props => {
|
|
|
1086
1107
|
margin-left: .25em;
|
|
1087
1108
|
}
|
|
1088
1109
|
|
|
1110
|
+
/* ── iOS Safari: underline + number alignment fixes ────────────────
|
|
1111
|
+
1. Position underlines below all glyphs (not at alphabetic baseline)
|
|
1112
|
+
so they never intersect numbers in links or auto-detected tel: hrefs.
|
|
1113
|
+
2. Use a solid underline (skip-ink: none) so numbers aren't split by
|
|
1114
|
+
gaps the browser renders around descenders.
|
|
1115
|
+
3. Prevent ::marker pseudo-element from inheriting text-decoration,
|
|
1116
|
+
which Safari applies to ol/ul counters causing them to appear
|
|
1117
|
+
underlined and misaligned.
|
|
1118
|
+
4. Normalise ordered-list indentation across Safari/WebKit. */
|
|
1119
|
+
.webchat__basic-transcript__activity-markdown-body a {
|
|
1120
|
+
-webkit-text-underline-position: under;
|
|
1121
|
+
text-underline-position: under;
|
|
1122
|
+
text-decoration-skip-ink: none;
|
|
1123
|
+
-webkit-text-decoration-skip: none;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
.webchat__basic-transcript__activity-markdown-body ol li::marker,
|
|
1127
|
+
.webchat__basic-transcript__activity-markdown-body ul li::marker {
|
|
1128
|
+
text-decoration: none;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
.webchat__basic-transcript__activity-markdown-body ol {
|
|
1132
|
+
-webkit-padding-start: 1.5em;
|
|
1133
|
+
padding-inline-start: 1.5em;
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1089
1136
|
.webchat__link-definitions__header-text {
|
|
1090
1137
|
color: ${bubbleBackground}
|
|
1091
1138
|
}
|
|
@@ -12,6 +12,7 @@ const defaultGeneralPreChatSurveyPaneStyleProps = {
|
|
|
12
12
|
borderColor: "#F1F1F1",
|
|
13
13
|
overflowY: "auto",
|
|
14
14
|
height: "inherit",
|
|
15
|
-
width: "inherit"
|
|
15
|
+
width: "inherit",
|
|
16
|
+
overscrollBehavior: "none"
|
|
16
17
|
};
|
|
17
18
|
exports.defaultGeneralPreChatSurveyPaneStyleProps = defaultGeneralPreChatSurveyPaneStyleProps;
|
|
@@ -62,7 +62,7 @@ const createMagicCodeSuccessResponse = signin => {
|
|
|
62
62
|
};
|
|
63
63
|
};
|
|
64
64
|
const WebChatContainerStateful = props => {
|
|
65
|
-
var _props$webChatContain, _defaultWebChatContai, _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _props$
|
|
65
|
+
var _props$webChatContain, _defaultWebChatContai, _props$webChatContain2, _props$webChatContain3, _webChatContainerProp, _webChatContainerProp2, _webChatContainerProp3, _webChatContainerProp4, _webChatContainerProp5, _webChatContainerProp6, _webChatContainerProp7, _webChatContainerProp8, _webChatContainerProp9, _webChatContainerProp10, _webChatContainerProp11, _webChatContainerProp12, _props$webChatContain8, _props$webChatContain9, _defaultWebChatContai2, _props$webChatContain10, _props$webChatContain11, _defaultWebChatContai3, _webChatContainerProp13, _webChatContainerProp14, _webChatContainerProp15, _webChatContainerProp16, _webChatContainerProp17, _webChatContainerProp18, _webChatContainerProp19, _webChatContainerProp20, _webChatContainerProp21, _webChatContainerProp22, _webChatContainerProp23, _webChatContainerProp24, _webChatContainerProp25, _webChatContainerProp26, _webChatContainerProp27, _webChatContainerProp28, _webChatContainerProp29, _props$webChatContain12, _props$webChatContain13, _webChatContainerProp30, _webChatContainerProp31, _webChatContainerProp32, _webChatContainerProp33, _props$citationPanePr, _props$citationPanePr2, _props$citationPanePr3, _props$citationPanePr4, _props$citationPanePr5;
|
|
66
66
|
const [facadeChatSDK] = (0, _useFacadeChatSDKStore.default)();
|
|
67
67
|
|
|
68
68
|
// Create a font family that includes emoji support, based on the primary font or default
|
|
@@ -71,6 +71,10 @@ const WebChatContainerStateful = props => {
|
|
|
71
71
|
|
|
72
72
|
// Use iOS-optimized emoji font that prioritizes system-ui for proper emoji rendering
|
|
73
73
|
const fontFamilyWithEmojis = (0, _fontUtils.createIOSOptimizedEmojiFont)(primaryFont);
|
|
74
|
+
|
|
75
|
+
// Enforce minimum input font-size to prevent iOS Safari auto-zoom on focus
|
|
76
|
+
const configuredInputFontSize = ((_props$webChatContain2 = props.webChatContainerProps) === null || _props$webChatContain2 === void 0 ? void 0 : (_props$webChatContain3 = _props$webChatContain2.adaptiveCardStyles) === null || _props$webChatContain3 === void 0 ? void 0 : _props$webChatContain3.inputFontSize) ?? _defaultAdaptiveCardStyles.defaultAdaptiveCardStyles.inputFontSize;
|
|
77
|
+
const inputFontSize = parseFloat(configuredInputFontSize ?? String(_Constants.Constants.minInputFontSizePx)) < _Constants.Constants.minInputFontSizePx ? _Constants.Constants.minInputFontSize : configuredInputFontSize;
|
|
74
78
|
(0, _react2.useEffect)(() => {
|
|
75
79
|
uiTimer = (0, _utils.createTimer)();
|
|
76
80
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
@@ -170,7 +174,7 @@ const WebChatContainerStateful = props => {
|
|
|
170
174
|
...(webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.localizedTexts)
|
|
171
175
|
};
|
|
172
176
|
(0, _react2.useEffect)(() => {
|
|
173
|
-
var _props$
|
|
177
|
+
var _props$webChatContain4, _props$webChatContain5;
|
|
174
178
|
if ((0, _utils.getDeviceType)() !== "standard" && (webChatContainerProps === null || webChatContainerProps === void 0 ? void 0 : webChatContainerProps.webChatHistoryMobileAccessibilityLabel) !== undefined) {
|
|
175
179
|
const chatHistoryElement = document.querySelector(`.${_Constants.HtmlClassNames.webChatHistoryContainer}`);
|
|
176
180
|
if (chatHistoryElement) {
|
|
@@ -188,7 +192,7 @@ const WebChatContainerStateful = props => {
|
|
|
188
192
|
_TelemetryHelper.TelemetryHelper.logLoadingEvent(_TelemetryConstants.LogLevel.INFO, {
|
|
189
193
|
Event: _TelemetryConstants.TelemetryEvent.WebChatLoaded
|
|
190
194
|
});
|
|
191
|
-
if (((_props$
|
|
195
|
+
if (((_props$webChatContain4 = props.webChatContainerProps) === null || _props$webChatContain4 === void 0 ? void 0 : (_props$webChatContain5 = _props$webChatContain4.renderingMiddlewareProps) === null || _props$webChatContain5 === void 0 ? void 0 : _props$webChatContain5.disableThirdPartyCookiesAlert) !== true && !contextDataStore) {
|
|
192
196
|
try {
|
|
193
197
|
localStorage;
|
|
194
198
|
sessionStorage;
|
|
@@ -203,8 +207,8 @@ const WebChatContainerStateful = props => {
|
|
|
203
207
|
}
|
|
204
208
|
}, []);
|
|
205
209
|
(0, _react2.useEffect)(() => {
|
|
206
|
-
var _props$
|
|
207
|
-
if (!((_props$
|
|
210
|
+
var _props$webChatContain6, _props$webChatContain7;
|
|
211
|
+
if (!((_props$webChatContain6 = props.webChatContainerProps) !== null && _props$webChatContain6 !== void 0 && (_props$webChatContain7 = _props$webChatContain6.botMagicCode) !== null && _props$webChatContain7 !== void 0 && _props$webChatContain7.disabled)) {
|
|
208
212
|
return;
|
|
209
213
|
}
|
|
210
214
|
if (!window.BroadcastChannel) {
|
|
@@ -302,9 +306,15 @@ const WebChatContainerStateful = props => {
|
|
|
302
306
|
${webChatContainerProps !== null && webChatContainerProps !== void 0 && (_webChatContainerProp12 = webChatContainerProps.adaptiveCardStyles) !== null && _webChatContainerProp12 !== void 0 && _webChatContainerProp12.choiceInputPadding ? `padding: ${webChatContainerProps.adaptiveCardStyles.choiceInputPadding} !important;` : ""}
|
|
303
307
|
}
|
|
304
308
|
|
|
309
|
+
div[class="ac-input-container"] input,
|
|
310
|
+
div[class="ac-input-container"] textarea,
|
|
311
|
+
div[class="ac-input-container"] select {
|
|
312
|
+
font-size: ${inputFontSize} !important;
|
|
313
|
+
}
|
|
314
|
+
|
|
305
315
|
.ms_lcw_webchat_received_message>div.webchat__stacked-layout>div.webchat__stacked-layout__main>div.webchat__stacked-layout__content>div.webchat__stacked-layout__message-row>[class^=webchat]:not(.webchat__bubble--from-user)>.webchat__bubble__content {
|
|
306
|
-
background-color: ${((_props$
|
|
307
|
-
color:${((_props$
|
|
316
|
+
background-color: ${((_props$webChatContain8 = props.webChatContainerProps) === null || _props$webChatContain8 === void 0 ? void 0 : (_props$webChatContain9 = _props$webChatContain8.webChatStyles) === null || _props$webChatContain9 === void 0 ? void 0 : _props$webChatContain9.bubbleBackground) ?? ((_defaultWebChatContai2 = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai2 === void 0 ? void 0 : _defaultWebChatContai2.bubbleBackground)};
|
|
317
|
+
color:${((_props$webChatContain10 = props.webChatContainerProps) === null || _props$webChatContain10 === void 0 ? void 0 : (_props$webChatContain11 = _props$webChatContain10.webChatStyles) === null || _props$webChatContain11 === void 0 ? void 0 : _props$webChatContain11.bubbleTextColor) ?? ((_defaultWebChatContai3 = _defaultWebChatContainerStatefulProps.defaultWebChatContainerStatefulProps.webChatStyles) === null || _defaultWebChatContai3 === void 0 ? void 0 : _defaultWebChatContai3.bubbleTextColor)};
|
|
308
318
|
}
|
|
309
319
|
|
|
310
320
|
div[class="ac-textBlock"] a:link,
|
|
@@ -389,7 +399,7 @@ const WebChatContainerStateful = props => {
|
|
|
389
399
|
}
|
|
390
400
|
|
|
391
401
|
.webchat__stacked-layout_container>div {
|
|
392
|
-
background: ${(props === null || props === void 0 ? void 0 : (_props$
|
|
402
|
+
background: ${(props === null || props === void 0 ? void 0 : (_props$webChatContain12 = props.webChatContainerProps) === null || _props$webChatContain12 === void 0 ? void 0 : (_props$webChatContain13 = _props$webChatContain12.containerStyles) === null || _props$webChatContain13 === void 0 ? void 0 : _props$webChatContain13.background) ?? ""}
|
|
393
403
|
}
|
|
394
404
|
.webchat__toast_text {
|
|
395
405
|
display: flex;
|
|
@@ -418,6 +428,7 @@ const WebChatContainerStateful = props => {
|
|
|
418
428
|
|
|
419
429
|
.webchat__auto-resize-textarea__textarea.webchat__send-box-text-box__html-text-area {
|
|
420
430
|
font-family: ${fontFamilyWithEmojis} !important;
|
|
431
|
+
font-size: ${inputFontSize} !important;
|
|
421
432
|
}
|
|
422
433
|
|
|
423
434
|
/* Suggested actions carousel previous/next navigation focus */
|
|
@@ -4,6 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.defaultAdaptiveCardStyles = void 0;
|
|
7
|
+
var _Constants = require("../../../../common/Constants");
|
|
7
8
|
const defaultAdaptiveCardStyles = {
|
|
8
9
|
background: "white",
|
|
9
10
|
color: "black",
|
|
@@ -11,6 +12,7 @@ const defaultAdaptiveCardStyles = {
|
|
|
11
12
|
textWhiteSpace: "normal",
|
|
12
13
|
buttonWhiteSpace: "normal",
|
|
13
14
|
buttonFlexWrap: "nowrap",
|
|
14
|
-
buttonGap: "0px"
|
|
15
|
+
buttonGap: "0px",
|
|
16
|
+
inputFontSize: _Constants.Constants.minInputFontSize
|
|
15
17
|
};
|
|
16
18
|
exports.defaultAdaptiveCardStyles = defaultAdaptiveCardStyles;
|
package/lib/cjs/components/webchatcontainerstateful/common/defaultStyles/defaultWebChatStyles.js
CHANGED
|
@@ -34,7 +34,7 @@ const defaultWebChatStyles = {
|
|
|
34
34
|
suggestedActionsStackedHeight: 125,
|
|
35
35
|
suggestedActionsStackedOverflow: "scroll",
|
|
36
36
|
// eslint-disable-line @typescript-eslint/no-explicit-any
|
|
37
|
-
typingAnimationDuration:
|
|
37
|
+
typingAnimationDuration: 4500,
|
|
38
38
|
emojiSet: {
|
|
39
39
|
":)": "😊",
|
|
40
40
|
":-)": "😊",
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.createActivityMiddleware = void 0;
|
|
6
|
+
exports.resetActivityMiddlewareCache = exports.createActivityMiddleware = void 0;
|
|
7
7
|
var _LazyLoadActivity = _interopRequireWildcard(require("./activities/LazyLoadActivity"));
|
|
8
8
|
var _TelemetryConstants = require("../../../../../common/telemetry/TelemetryConstants");
|
|
9
9
|
var _Constants = require("../../../../../common/Constants");
|
|
@@ -32,9 +32,13 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
32
32
|
|
|
33
33
|
const loggedSystemMessages = new Array();
|
|
34
34
|
let lastRenderedAt = 0; // Track last rendered receivedAt timestamp for deduplication
|
|
35
|
+
// Cache original (pre-render) text per activity ID to prevent exponential <br> growth.
|
|
36
|
+
// BotFramework WebChat can mutate card.activity.text between renders (e.g. on minimize/open),
|
|
37
|
+
// so we always render from the original markdown source, not the possibly-HTML-mutated text.
|
|
38
|
+
const originalSystemMessageTexts = new Map();
|
|
35
39
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
36
40
|
const handleSystemMessage = (next, args, card, renderMarkdown, systemMessageStyleProps) => {
|
|
37
|
-
var _card$activity, _card$activity$channe, _card$activity$channe2, _card$activity2, _card$activity2$chann, _card$activity3, _card$activity3$chann, _card$activity3$chann2, _card$activity4, _card$activity4$chann, _card$activity5, _card$activity5$chann, _card$nextVisibleActi, _card$nextVisibleActi2, _card$activity6, _card$activity6$chann, _card$activity7, _card$nextVisibleActi3, _card$activity8;
|
|
41
|
+
var _card$activity, _card$activity$channe, _card$activity$channe2, _card$activity2, _card$activity2$chann, _card$activity3, _card$activity3$chann, _card$activity3$chann2, _card$activity4, _card$activity4$chann, _card$activity5, _card$activity5$chann, _card$nextVisibleActi, _card$nextVisibleActi2, _card$activity6, _card$activity6$chann, _card$activity7, _card$nextVisibleActi3, _card$activity8, _card$activity9, _card$activity9$chann;
|
|
38
42
|
const systemMessageStyles = {
|
|
39
43
|
..._defaultSystemMessageStyles.defaultSystemMessageStyles,
|
|
40
44
|
...systemMessageStyleProps
|
|
@@ -56,7 +60,12 @@ const handleSystemMessage = (next, args, card, renderMarkdown, systemMessageStyl
|
|
|
56
60
|
if ((_card$activity5 = card.activity) !== null && _card$activity5 !== void 0 && (_card$activity5$chann = _card$activity5.channelData) !== null && _card$activity5$chann !== void 0 && _card$activity5$chann.clientmessageid && ((_card$nextVisibleActi = card.nextVisibleActivity) === null || _card$nextVisibleActi === void 0 ? void 0 : (_card$nextVisibleActi2 = _card$nextVisibleActi.channelData) === null || _card$nextVisibleActi2 === void 0 ? void 0 : _card$nextVisibleActi2.clientmessageid) === ((_card$activity6 = card.activity) === null || _card$activity6 === void 0 ? void 0 : (_card$activity6$chann = _card$activity6.channelData) === null || _card$activity6$chann === void 0 ? void 0 : _card$activity6$chann.clientmessageid) || (_card$activity7 = card.activity) !== null && _card$activity7 !== void 0 && _card$activity7.messageid && ((_card$nextVisibleActi3 = card.nextVisibleActivity) === null || _card$nextVisibleActi3 === void 0 ? void 0 : _card$nextVisibleActi3.messageid) === ((_card$activity8 = card.activity) === null || _card$activity8 === void 0 ? void 0 : _card$activity8.messageid)) {
|
|
57
61
|
return () => false;
|
|
58
62
|
}
|
|
59
|
-
card.activity.
|
|
63
|
+
const activityKey = card.activity.id || ((_card$activity9 = card.activity) === null || _card$activity9 === void 0 ? void 0 : (_card$activity9$chann = _card$activity9.channelData) === null || _card$activity9$chann === void 0 ? void 0 : _card$activity9$chann.clientmessageid);
|
|
64
|
+
if (activityKey && !originalSystemMessageTexts.has(activityKey)) {
|
|
65
|
+
originalSystemMessageTexts.set(activityKey, card.activity.text);
|
|
66
|
+
}
|
|
67
|
+
const sourceText = (activityKey && originalSystemMessageTexts.get(activityKey)) ?? card.activity.text;
|
|
68
|
+
const renderedHtml = renderMarkdown(sourceText);
|
|
60
69
|
// eslint-disable-next-line react/display-name
|
|
61
70
|
return () => /*#__PURE__*/_react.default.createElement("div", {
|
|
62
71
|
key: card.activity.id,
|
|
@@ -64,7 +73,7 @@ const handleSystemMessage = (next, args, card, renderMarkdown, systemMessageStyl
|
|
|
64
73
|
"aria-hidden": "false",
|
|
65
74
|
className: _Constants.Constants.markDownSystemMessageClass,
|
|
66
75
|
dangerouslySetInnerHTML: {
|
|
67
|
-
__html:
|
|
76
|
+
__html: renderedHtml
|
|
68
77
|
}
|
|
69
78
|
});
|
|
70
79
|
};
|
|
@@ -97,12 +106,12 @@ const createActivityMiddleware = (renderMarkdown, systemMessageStyleProps, userM
|
|
|
97
106
|
return handleSystemMessage(next, args, card, renderMarkdown, systemMessageStyleProps);
|
|
98
107
|
}
|
|
99
108
|
if (isTagIncluded(card, _Constants.Constants.persistentChatHistoryMessagePullTriggerTag)) {
|
|
100
|
-
var _card$
|
|
109
|
+
var _card$activity10, _card$activity10$chan, _card$activity10$chan2;
|
|
101
110
|
// Safety check: if this is a new chat session and flag is false, auto-correct it
|
|
102
111
|
if (!_LazyLoadActivity.LazyLoadHandler.hasMoreHistoryAvailable) {
|
|
103
112
|
_LazyLoadActivity.LazyLoadHandler.setHasMoreHistoryAvailable(true);
|
|
104
113
|
}
|
|
105
|
-
const receivedAt = card === null || card === void 0 ? void 0 : (_card$
|
|
114
|
+
const receivedAt = card === null || card === void 0 ? void 0 : (_card$activity10 = card.activity) === null || _card$activity10 === void 0 ? void 0 : (_card$activity10$chan = _card$activity10.channelData) === null || _card$activity10$chan === void 0 ? void 0 : (_card$activity10$chan2 = _card$activity10$chan.webChat) === null || _card$activity10$chan2 === void 0 ? void 0 : _card$activity10$chan2.receivedAt;
|
|
106
115
|
if (receivedAt < lastRenderedAt) {
|
|
107
116
|
card.activity = null;
|
|
108
117
|
return () => false;
|
|
@@ -157,4 +166,12 @@ const createActivityMiddleware = (renderMarkdown, systemMessageStyleProps, userM
|
|
|
157
166
|
}
|
|
158
167
|
return next(...args);
|
|
159
168
|
};
|
|
160
|
-
|
|
169
|
+
|
|
170
|
+
/** Clear module-level caches. Call on conversation end / chat close. */
|
|
171
|
+
exports.createActivityMiddleware = createActivityMiddleware;
|
|
172
|
+
const resetActivityMiddlewareCache = () => {
|
|
173
|
+
loggedSystemMessages.length = 0;
|
|
174
|
+
lastRenderedAt = 0;
|
|
175
|
+
originalSystemMessageTexts.clear();
|
|
176
|
+
};
|
|
177
|
+
exports.resetActivityMiddlewareCache = resetActivityMiddlewareCache;
|
|
@@ -7,6 +7,7 @@ exports.createAttachmentMiddleware = void 0;
|
|
|
7
7
|
var _Constants = require("../../../../../common/Constants");
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
var _FileAttachmentIconManager = require("../../../common/utils/FileAttachmentIconManager");
|
|
10
|
+
var _AdaptiveCardAccessibilityWrapper = _interopRequireDefault(require("./attachments/AdaptiveCardAccessibilityWrapper"));
|
|
10
11
|
var _Attachment = _interopRequireDefault(require("./attachments/Attachment"));
|
|
11
12
|
var _TelemetryConstants = require("../../../../../common/telemetry/TelemetryConstants");
|
|
12
13
|
var _omnichannelChatComponents = require("@microsoft/omnichannel-chat-components");
|
|
@@ -120,7 +121,7 @@ const createAttachmentMiddleware = enableInlinePlaying => {
|
|
|
120
121
|
...((_state$domainStates$r3 = state.domainStates.renderingMiddlewareProps) === null || _state$domainStates$r3 === void 0 ? void 0 : _state$domainStates$r3.attachmentAdaptiveCardStyles)
|
|
121
122
|
};
|
|
122
123
|
if (type === _Constants.WebChatMiddlewareConstants.adaptiveCard || _Constants.Constants.supportedAdaptiveCardContentTypes.indexOf(contentType) >= 0) {
|
|
123
|
-
return /*#__PURE__*/_react.default.createElement(
|
|
124
|
+
return /*#__PURE__*/_react.default.createElement(_AdaptiveCardAccessibilityWrapper.default, {
|
|
124
125
|
id: attachmentId,
|
|
125
126
|
style: atttachmentAdaptiveCardStyles
|
|
126
127
|
}, next(...args));
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
+
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); }
|
|
9
|
+
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; }
|
|
10
|
+
/**
|
|
11
|
+
* Wraps an adaptive card and patches radio button groups with correct
|
|
12
|
+
* ARIA attributes (role="radiogroup", aria-setsize, aria-posinset) after
|
|
13
|
+
* the card renders, so screen readers announce the correct option count.
|
|
14
|
+
*/
|
|
15
|
+
const AdaptiveCardAccessibilityWrapper = _ref => {
|
|
16
|
+
let {
|
|
17
|
+
id,
|
|
18
|
+
style,
|
|
19
|
+
children
|
|
20
|
+
} = _ref;
|
|
21
|
+
const containerRef = (0, _react.useRef)(null);
|
|
22
|
+
(0, _react.useEffect)(() => {
|
|
23
|
+
if (!containerRef.current) return;
|
|
24
|
+
const patchRadioGroups = () => {
|
|
25
|
+
const container = containerRef.current;
|
|
26
|
+
if (!container) return;
|
|
27
|
+
|
|
28
|
+
// Find all radio inputs inside the adaptive card
|
|
29
|
+
const radios = container.querySelectorAll("input[type='radio']");
|
|
30
|
+
if (radios.length === 0) return;
|
|
31
|
+
|
|
32
|
+
// Group radios by their name attribute (each ChoiceSet has a unique name)
|
|
33
|
+
const groups = new Map();
|
|
34
|
+
radios.forEach(radio => {
|
|
35
|
+
var _groups$get;
|
|
36
|
+
const name = radio.getAttribute("name") || "__default";
|
|
37
|
+
if (!groups.has(name)) {
|
|
38
|
+
groups.set(name, []);
|
|
39
|
+
}
|
|
40
|
+
(_groups$get = groups.get(name)) === null || _groups$get === void 0 ? void 0 : _groups$get.push(radio);
|
|
41
|
+
});
|
|
42
|
+
groups.forEach(radioInputs => {
|
|
43
|
+
const groupSize = radioInputs.length;
|
|
44
|
+
radioInputs.forEach((radio, index) => {
|
|
45
|
+
radio.setAttribute("aria-setsize", String(groupSize));
|
|
46
|
+
radio.setAttribute("aria-posinset", String(index + 1));
|
|
47
|
+
|
|
48
|
+
// Ensure the parent container has radiogroup role
|
|
49
|
+
const parent = radio.closest("[role='radiogroup']") || radio.closest(".ac-input-container");
|
|
50
|
+
if (parent && !parent.getAttribute("role")) {
|
|
51
|
+
parent.setAttribute("role", "radiogroup");
|
|
52
|
+
}
|
|
53
|
+
});
|
|
54
|
+
});
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
// Use MutationObserver to patch after WebChat finishes rendering the card
|
|
58
|
+
const observer = new MutationObserver(() => {
|
|
59
|
+
patchRadioGroups();
|
|
60
|
+
});
|
|
61
|
+
observer.observe(containerRef.current, {
|
|
62
|
+
childList: true,
|
|
63
|
+
subtree: true
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// Also run immediately in case the card is already rendered
|
|
67
|
+
patchRadioGroups();
|
|
68
|
+
return () => observer.disconnect();
|
|
69
|
+
}, []);
|
|
70
|
+
return /*#__PURE__*/_react.default.createElement("div", {
|
|
71
|
+
id: id,
|
|
72
|
+
style: style,
|
|
73
|
+
ref: containerRef
|
|
74
|
+
}, children);
|
|
75
|
+
};
|
|
76
|
+
var _default = AdaptiveCardAccessibilityWrapper;
|
|
77
|
+
exports.default = _default;
|
|
@@ -12,7 +12,12 @@ const defaultSystemMessageStyles = {
|
|
|
12
12
|
borderRadius: 0,
|
|
13
13
|
minHeight: "auto",
|
|
14
14
|
fontFamily: "'Segoe UI', Arial, sans-serif",
|
|
15
|
-
lineHeight: "
|
|
16
|
-
padding: "0px 10px 0 10px"
|
|
15
|
+
lineHeight: "1.4",
|
|
16
|
+
padding: "0px 10px 0 10px",
|
|
17
|
+
// iOS Safari: position underlines below all glyphs so they do not
|
|
18
|
+
// intersect numbers. Also enforce lining figures for consistent baselines.
|
|
19
|
+
WebkitTextUnderlinePosition: "under",
|
|
20
|
+
textUnderlinePosition: "under",
|
|
21
|
+
fontVariantNumeric: "lining-nums"
|
|
17
22
|
};
|
|
18
23
|
exports.defaultSystemMessageStyles = defaultSystemMessageStyles;
|
|
@@ -8,6 +8,13 @@ var _defaultTimestampContentStyles = require("./defaultTimestampContentStyles");
|
|
|
8
8
|
const defaultTimestampRetryStyles = {
|
|
9
9
|
..._defaultTimestampContentStyles.defaultTimestampContentStyles,
|
|
10
10
|
color: "#0063B1",
|
|
11
|
-
cursor: "pointer"
|
|
11
|
+
cursor: "pointer",
|
|
12
|
+
border: "none",
|
|
13
|
+
padding: 0,
|
|
14
|
+
margin: 0,
|
|
15
|
+
textDecoration: "none",
|
|
16
|
+
display: "inline",
|
|
17
|
+
fontWeight: "inherit",
|
|
18
|
+
textAlign: "inherit"
|
|
12
19
|
};
|
|
13
20
|
exports.defaultTimestampRetryStyles = defaultTimestampRetryStyles;
|
|
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.NotDeliveredTimestamp = void 0;
|
|
7
7
|
var _react = _interopRequireWildcard(require("react"));
|
|
8
|
-
var _KeyCodes = require("../../../../../../common/KeyCodes");
|
|
9
8
|
var _react2 = require("@fluentui/react");
|
|
10
9
|
var _defaultMiddlewareLocalizedTexts = require("../../../../common/defaultProps/defaultMiddlewareLocalizedTexts");
|
|
11
10
|
var _defaultTimestampContentStyles = require("../defaultStyles/defaultTimestampContentStyles");
|
|
@@ -65,24 +64,15 @@ const NotDeliveredTimestamp = _ref => {
|
|
|
65
64
|
await postActivity(activity);
|
|
66
65
|
focus("sendBox");
|
|
67
66
|
}, [activity, focus, postActivity]);
|
|
68
|
-
const onRetryKeyEnter = event => {
|
|
69
|
-
if (event.code === _KeyCodes.KeyCodes.ENTER) {
|
|
70
|
-
event.preventDefault();
|
|
71
|
-
onRetryClick();
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
67
|
return /*#__PURE__*/_react.default.createElement(_react2.Stack, {
|
|
75
68
|
style: contentStyles,
|
|
76
69
|
dir: dir,
|
|
77
70
|
horizontal: true
|
|
78
71
|
}, /*#__PURE__*/_react.default.createElement("span", null, " ", (0, _utils.getTimestampHourMinute)(timestamp)), /*#__PURE__*/_react.default.createElement("span", null, " \xA0-\xA0 "), /*#__PURE__*/_react.default.createElement("span", {
|
|
79
72
|
style: failedTextStyles
|
|
80
|
-
}, " ", ((_state$domainStates$m = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m === void 0 ? void 0 : _state$domainStates$m.MIDDLEWARE_MESSAGE_NOT_DELIVERED) ?? _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_MESSAGE_NOT_DELIVERED, " "), /*#__PURE__*/_react.default.createElement("span", null, " \xA0-\xA0 "), /*#__PURE__*/_react.default.createElement("
|
|
73
|
+
}, " ", ((_state$domainStates$m = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m === void 0 ? void 0 : _state$domainStates$m.MIDDLEWARE_MESSAGE_NOT_DELIVERED) ?? _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_MESSAGE_NOT_DELIVERED, " "), /*#__PURE__*/_react.default.createElement("span", null, " \xA0-\xA0 "), /*#__PURE__*/_react.default.createElement("button", {
|
|
81
74
|
style: retryTextStyles,
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
onKeyDown: onRetryKeyEnter,
|
|
85
|
-
tabIndex: 0
|
|
86
|
-
}, " ", ((_state$domainStates$m2 = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m2 === void 0 ? void 0 : _state$domainStates$m2.MIDDLEWARE_MESSAGE_RETRY) ?? _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_MESSAGE_RETRY, " "));
|
|
75
|
+
onClick: onRetryClick
|
|
76
|
+
}, ((_state$domainStates$m2 = state.domainStates.middlewareLocalizedTexts) === null || _state$domainStates$m2 === void 0 ? void 0 : _state$domainStates$m2.MIDDLEWARE_MESSAGE_RETRY) ?? _defaultMiddlewareLocalizedTexts.defaultMiddlewareLocalizedTexts.MIDDLEWARE_MESSAGE_RETRY));
|
|
87
77
|
};
|
|
88
78
|
exports.NotDeliveredTimestamp = NotDeliveredTimestamp;
|