@atlaskit/editor-common 134.7.2 → 134.8.1
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/CHANGELOG.md +24 -0
- package/dist/cjs/extensibility/Extension/Extension/index.js +3 -1
- package/dist/cjs/extensibility/MultiBodiedExtension/index.js +3 -1
- package/dist/cjs/extensibility/utils/get-breakout-width.js +27 -0
- package/dist/cjs/extensibility/utils/has-breakout-width.js +11 -0
- package/dist/cjs/extensibility/utils/should-extension-breakout.js +10 -1
- package/dist/cjs/extensions/messages.js +5 -0
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/cjs/ui/HoverLinkOverlay/index.js +45 -10
- package/dist/es2019/extensibility/Extension/Extension/index.js +3 -1
- package/dist/es2019/extensibility/MultiBodiedExtension/index.js +3 -1
- package/dist/es2019/extensibility/utils/get-breakout-width.js +9 -0
- package/dist/es2019/extensibility/utils/has-breakout-width.js +4 -0
- package/dist/es2019/extensibility/utils/should-extension-breakout.js +9 -1
- package/dist/es2019/extensions/messages.js +5 -0
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/es2019/ui/HoverLinkOverlay/index.js +36 -3
- package/dist/esm/extensibility/Extension/Extension/index.js +3 -1
- package/dist/esm/extensibility/MultiBodiedExtension/index.js +3 -1
- package/dist/esm/extensibility/utils/get-breakout-width.js +21 -0
- package/dist/esm/extensibility/utils/has-breakout-width.js +6 -0
- package/dist/esm/extensibility/utils/should-extension-breakout.js +10 -1
- package/dist/esm/extensions/messages.js +5 -0
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/dist/esm/ui/HoverLinkOverlay/index.js +45 -10
- package/dist/types/extensibility/utils/get-breakout-width.d.ts +3 -0
- package/dist/types/extensibility/utils/has-breakout-width.d.ts +3 -0
- package/dist/types/extensibility/utils/should-extension-breakout.d.ts +2 -1
- package/dist/types/extensions/messages.d.ts +24 -19
- package/extensibility/get-breakout-width/package.json +10 -0
- package/extensibility/has-breakout-width/package.json +10 -0
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 134.8.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 134.8.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`af6421f9b80ca`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/af6421f9b80ca) -
|
|
14
|
+
[EDITOR-9924] When `platform_editor_lovability_resize_exts_gracefully` and
|
|
15
|
+
`platform_editor_lovability_resize_exts_patch_1` are enabled, use the breakout mark for extension
|
|
16
|
+
node width across both resizing cohorts and synchronize existing layouts with breakout widths for
|
|
17
|
+
users in the resizing: false cohort.
|
|
18
|
+
|
|
19
|
+
### Patch Changes
|
|
20
|
+
|
|
21
|
+
- [`56839f6b1b63c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/56839f6b1b63c) -
|
|
22
|
+
Defer smart-link hover overlay measurements with a one-shot ResizeObserver and avoid interleaving
|
|
23
|
+
hidden-label style writes with layout reads in the `platform_editor_improve_inp_batch_2`
|
|
24
|
+
experiment treatment.
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
3
27
|
## 134.7.2
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -21,6 +21,7 @@ var _hooks = require("../../../hooks");
|
|
|
21
21
|
var _NodeViewContentHole = require("../../../react-node-view/NodeViewContentHole");
|
|
22
22
|
var _ui = require("../../../ui");
|
|
23
23
|
var _utils = require("../../../utils");
|
|
24
|
+
var _hasBreakoutWidth = require("../../utils/has-breakout-width");
|
|
24
25
|
var _shouldExtensionBreakout = require("../../utils/should-extension-breakout");
|
|
25
26
|
var _ExtensionCommentBadge = require("../ExtensionCommentBadge");
|
|
26
27
|
var _Lozenge = _interopRequireDefault(require("../Lozenge"));
|
|
@@ -113,7 +114,8 @@ function ExtensionWithPluginState(props) {
|
|
|
113
114
|
editorAppearance: editorAppearance,
|
|
114
115
|
hasBreakoutMark: (_node$marks = node.marks) === null || _node$marks === void 0 ? void 0 : _node$marks.some(function (mark) {
|
|
115
116
|
return mark.type.name === 'breakout';
|
|
116
|
-
})
|
|
117
|
+
}),
|
|
118
|
+
hasBreakoutWidth: (0, _hasBreakoutWidth.hasBreakoutWidth)(node.marks)
|
|
117
119
|
});
|
|
118
120
|
|
|
119
121
|
// We don't want to show border for non-empty 1p bodied extensions in live pages
|
|
@@ -24,6 +24,7 @@ var _MultiBodiedExtension = require("../../ui/MultiBodiedExtension");
|
|
|
24
24
|
var _utils = require("../../utils");
|
|
25
25
|
var _Lozenge = _interopRequireDefault(require("../Extension/Lozenge"));
|
|
26
26
|
var _ExtensionFloatingLabel = require("../Extension/Lozenge/ExtensionFloatingLabel");
|
|
27
|
+
var _hasBreakoutWidth = require("../utils/has-breakout-width");
|
|
27
28
|
var _shouldExtensionBreakout = require("../utils/should-extension-breakout");
|
|
28
29
|
var _actionApi = require("./action-api");
|
|
29
30
|
var _styles = require("./styles");
|
|
@@ -256,7 +257,8 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
256
257
|
isTopLevelNode: true,
|
|
257
258
|
hasBreakoutMark: (_node$marks = node.marks) === null || _node$marks === void 0 ? void 0 : _node$marks.some(function (mark) {
|
|
258
259
|
return mark.type.name === 'breakout';
|
|
259
|
-
})
|
|
260
|
+
}),
|
|
261
|
+
hasBreakoutWidth: (0, _hasBreakoutWidth.hasBreakoutWidth)(node.marks)
|
|
260
262
|
});
|
|
261
263
|
var mbeWrapperStyles = {};
|
|
262
264
|
if (shouldBreakout) {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getBreakoutWidth = void 0;
|
|
7
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
8
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
9
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
10
|
+
/** returns the breakout width if the node has a breakout mark with a positive breakout width. */
|
|
11
|
+
var getBreakoutWidth = exports.getBreakoutWidth = function getBreakoutWidth(marks) {
|
|
12
|
+
var _iterator = _createForOfIteratorHelper(marks !== null && marks !== void 0 ? marks : []),
|
|
13
|
+
_step;
|
|
14
|
+
try {
|
|
15
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
16
|
+
var mark = _step.value;
|
|
17
|
+
if (mark.type.name === 'breakout' && typeof mark.attrs.width === 'number' && mark.attrs.width > 0) {
|
|
18
|
+
return mark.attrs.width;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
} catch (err) {
|
|
22
|
+
_iterator.e(err);
|
|
23
|
+
} finally {
|
|
24
|
+
_iterator.f();
|
|
25
|
+
}
|
|
26
|
+
return undefined;
|
|
27
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.hasBreakoutWidth = void 0;
|
|
7
|
+
var _getBreakoutWidth = require("./get-breakout-width");
|
|
8
|
+
/** returns true if the node has a breakout mark with a positive breakout width. */
|
|
9
|
+
var hasBreakoutWidth = exports.hasBreakoutWidth = function hasBreakoutWidth(marks) {
|
|
10
|
+
return (0, _getBreakoutWidth.getBreakoutWidth)(marks) !== undefined;
|
|
11
|
+
};
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.shouldExtensionBreakout = void 0;
|
|
7
7
|
var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
|
|
8
|
+
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
8
9
|
var breakoutLayouts = new Set(['full-width', 'wide']);
|
|
9
10
|
var shouldRespectBreakoutForAppearance = function shouldRespectBreakoutForAppearance(appearance) {
|
|
10
11
|
if (!appearance) {
|
|
@@ -24,8 +25,16 @@ var shouldExtensionBreakout = exports.shouldExtensionBreakout = function shouldE
|
|
|
24
25
|
isTopLevelNode = _ref$isTopLevelNode === void 0 ? true : _ref$isTopLevelNode,
|
|
25
26
|
editorAppearance = _ref.editorAppearance,
|
|
26
27
|
_ref$hasBreakoutMark = _ref.hasBreakoutMark,
|
|
27
|
-
hasBreakoutMark = _ref$hasBreakoutMark === void 0 ? false : _ref$hasBreakoutMark
|
|
28
|
+
hasBreakoutMark = _ref$hasBreakoutMark === void 0 ? false : _ref$hasBreakoutMark,
|
|
29
|
+
_ref$hasBreakoutWidth = _ref.hasBreakoutWidth,
|
|
30
|
+
hasBreakoutWidth = _ref$hasBreakoutWidth === void 0 ? false : _ref$hasBreakoutWidth;
|
|
28
31
|
// the breakout mark wrapper owns the width, so the legacy layout must not size the node too
|
|
32
|
+
if ((0, _fg.fg)('platform_editor_lovability_resize_exts_gracefully') && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_lovability_resize_exts_patch_1') && hasBreakoutWidth) {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// once platform_editor_lovability_resize_exts_patch_1 is rolled out, we can remove this redundant check.
|
|
37
|
+
// because the previous check should have returned false already for extensions with breakout widths.
|
|
29
38
|
if (hasBreakoutMark && (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_lovability_resize_extensions')) {
|
|
30
39
|
return false;
|
|
31
40
|
}
|
|
@@ -13,6 +13,11 @@ exports.messages = void 0;
|
|
|
13
13
|
var _reactIntl = require("react-intl");
|
|
14
14
|
var _configPanelMessages = require("./configPanelMessages");
|
|
15
15
|
var messages = exports.messages = (0, _reactIntl.defineMessages)({
|
|
16
|
+
customWidth: {
|
|
17
|
+
id: 'fabric.editor.extension.customWidth',
|
|
18
|
+
defaultMessage: 'Custom width',
|
|
19
|
+
description: 'Label for the layout button in the extension toolbar when the extension has been resized to a custom width.'
|
|
20
|
+
},
|
|
16
21
|
edit: {
|
|
17
22
|
id: 'fabric.editor.edit',
|
|
18
23
|
defaultMessage: 'Edit',
|
|
@@ -27,7 +27,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
27
27
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
28
28
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
29
29
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
30
|
-
var packageVersion = "134.
|
|
30
|
+
var packageVersion = "134.8.0";
|
|
31
31
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
32
32
|
// Remove URL as it has UGC
|
|
33
33
|
// Ignored via go/ees007
|
|
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
23
23
|
* @jsx jsx
|
|
24
24
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
25
25
|
var packageName = "@atlaskit/editor-common";
|
|
26
|
-
var packageVersion = "134.
|
|
26
|
+
var packageVersion = "134.8.0";
|
|
27
27
|
var halfFocusRing = 1;
|
|
28
28
|
var dropOffset = '0, 8';
|
|
29
29
|
// Ignored via go/ees005
|
|
@@ -136,6 +136,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
136
136
|
isHovered = _useState4[0],
|
|
137
137
|
setHovered = _useState4[1];
|
|
138
138
|
var openTextWidthRef = (0, _react.useRef)(null);
|
|
139
|
+
var shouldDeferMeasurement = (0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_improve_inp_batch_2');
|
|
139
140
|
var regularPadding = DYNAMIC_PADDING_BLOCK;
|
|
140
141
|
var memoizedHoverLinkStyles = (0, _react.useMemo)(function () {
|
|
141
142
|
return {
|
|
@@ -150,21 +151,55 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
150
151
|
if (!isVisible || !isHovered) {
|
|
151
152
|
return;
|
|
152
153
|
}
|
|
154
|
+
if (shouldDeferMeasurement) {
|
|
155
|
+
var container = containerRef.current;
|
|
156
|
+
var button = hoverLinkButtonRef.current;
|
|
157
|
+
var hiddenText = hiddenTextRef.current;
|
|
158
|
+
if (!container || !button || !hiddenText) {
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
var observer = new ResizeObserver(function () {
|
|
162
|
+
// One measurement per hover; hiding the label must not trigger another one.
|
|
163
|
+
observer.disconnect();
|
|
164
|
+
var cardWidth = container.offsetWidth;
|
|
165
|
+
var openButtonWidth = button.offsetWidth;
|
|
166
|
+
// Get the hidden text width
|
|
167
|
+
var openTextWidth = hiddenText.offsetWidth || DEFAULT_OPEN_TEXT_WIDTH;
|
|
168
|
+
if (!cardWidth || !openButtonWidth) {
|
|
169
|
+
return;
|
|
170
|
+
}
|
|
171
|
+
var canShowLabel = cardWidth - openTextWidth > MIN_AVAILABLE_SPACE_WITH_LABEL_OVERLAY + ICON_WIDTH;
|
|
172
|
+
|
|
173
|
+
// When a smart link wraps to multiple lines in a constrained container (e.g. table cell),
|
|
174
|
+
// the hover button can overflow beyond the container bounds. We detect this by comparing
|
|
175
|
+
// the button's right edge to the container's right edge, and hide the label if it overflows.
|
|
176
|
+
var containerRight = container.getBoundingClientRect().right;
|
|
177
|
+
var buttonRight = button.getBoundingClientRect().right;
|
|
178
|
+
if (buttonRight > containerRight) {
|
|
179
|
+
canShowLabel = false;
|
|
180
|
+
}
|
|
181
|
+
setShowLabel(canShowLabel);
|
|
182
|
+
});
|
|
183
|
+
observer.observe(button);
|
|
184
|
+
return function () {
|
|
185
|
+
return observer.disconnect();
|
|
186
|
+
};
|
|
187
|
+
}
|
|
153
188
|
var cardWidth = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.offsetWidth;
|
|
154
189
|
var openButtonWidth = (_hoverLinkButtonRef$c = hoverLinkButtonRef.current) === null || _hoverLinkButtonRef$c === void 0 ? void 0 : _hoverLinkButtonRef$c.offsetWidth;
|
|
155
190
|
// Get the hidden text width
|
|
156
191
|
if (!openTextWidthRef.current) {
|
|
157
|
-
var
|
|
158
|
-
if (
|
|
192
|
+
var _hiddenText = hiddenTextRef.current;
|
|
193
|
+
if (_hiddenText) {
|
|
159
194
|
// Measure the width of the hidden text
|
|
160
195
|
// Temporarily make the element visible to measure its width
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
openTextWidthRef.current =
|
|
196
|
+
_hiddenText.style.visibility = 'hidden';
|
|
197
|
+
_hiddenText.style.display = 'inline';
|
|
198
|
+
openTextWidthRef.current = _hiddenText.offsetWidth;
|
|
164
199
|
|
|
165
200
|
// Reset the hiddenText's display property
|
|
166
|
-
|
|
167
|
-
|
|
201
|
+
_hiddenText.style.display = 'none';
|
|
202
|
+
_hiddenText.style.visibility = 'inherit';
|
|
168
203
|
} else {
|
|
169
204
|
openTextWidthRef.current = DEFAULT_OPEN_TEXT_WIDTH;
|
|
170
205
|
}
|
|
@@ -186,7 +221,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
186
221
|
}
|
|
187
222
|
}
|
|
188
223
|
setShowLabel(canShowLabel);
|
|
189
|
-
}, [isVisible, isHovered]);
|
|
224
|
+
}, [isVisible, isHovered, shouldDeferMeasurement]);
|
|
190
225
|
var handleOverlayChange = function handleOverlayChange(isHovered) {
|
|
191
226
|
setHovered(isHovered);
|
|
192
227
|
|
|
@@ -247,13 +282,13 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
247
282
|
,
|
|
248
283
|
onFocus: (0, _expValEquals.expValEquals)('editor_a11y__enghealth-46814_fy26', 'isEnabled', true) ? function () {} : undefined,
|
|
249
284
|
onBlur: (0, _expValEquals.expValEquals)('editor_a11y__enghealth-46814_fy26', 'isEnabled', true) ? function () {} : undefined
|
|
250
|
-
}, children, (0, _react2.jsx)("span", {
|
|
285
|
+
}, children, (!shouldDeferMeasurement || isHovered) && (0, _react2.jsx)("span", {
|
|
251
286
|
css: hiddenTextStyle,
|
|
252
287
|
"aria-hidden": "true"
|
|
253
288
|
}, (0, _react2.jsx)(_text.Text, {
|
|
254
289
|
ref: hiddenTextRef,
|
|
255
290
|
size: "small",
|
|
256
|
-
maxLines: 1
|
|
291
|
+
maxLines: shouldDeferMeasurement ? undefined : 1
|
|
257
292
|
}, label)), isHovered && (0, _react2.jsx)(_anchor.Anchor, {
|
|
258
293
|
ref: hoverLinkButtonRef,
|
|
259
294
|
xcss: linkStylesCommon,
|
|
@@ -17,6 +17,7 @@ import { useSharedPluginStateWithSelector } from '../../../hooks';
|
|
|
17
17
|
import { NodeViewContentHole } from '../../../react-node-view/NodeViewContentHole';
|
|
18
18
|
import { overflowShadow } from '../../../ui';
|
|
19
19
|
import { calculateBreakoutStyles } from '../../../utils';
|
|
20
|
+
import { hasBreakoutWidth } from '../../utils/has-breakout-width';
|
|
20
21
|
import { shouldExtensionBreakout } from '../../utils/should-extension-breakout';
|
|
21
22
|
import { ExtensionCommentBadge } from '../ExtensionCommentBadge';
|
|
22
23
|
import ExtensionLozenge from '../Lozenge';
|
|
@@ -100,7 +101,8 @@ function ExtensionWithPluginState(props) {
|
|
|
100
101
|
layout,
|
|
101
102
|
isTopLevelNode,
|
|
102
103
|
editorAppearance,
|
|
103
|
-
hasBreakoutMark: (_node$marks = node.marks) === null || _node$marks === void 0 ? void 0 : _node$marks.some(mark => mark.type.name === 'breakout')
|
|
104
|
+
hasBreakoutMark: (_node$marks = node.marks) === null || _node$marks === void 0 ? void 0 : _node$marks.some(mark => mark.type.name === 'breakout'),
|
|
105
|
+
hasBreakoutWidth: hasBreakoutWidth(node.marks)
|
|
104
106
|
});
|
|
105
107
|
|
|
106
108
|
// We don't want to show border for non-empty 1p bodied extensions in live pages
|
|
@@ -20,6 +20,7 @@ import { removeMarginsAndBorder, sharedMultiBodiedExtensionStyles } from '../../
|
|
|
20
20
|
import { calculateBreakoutStyles, getExtensionLozengeData } from '../../utils';
|
|
21
21
|
import ExtensionLozenge from '../Extension/Lozenge';
|
|
22
22
|
import { ExtensionFloatingLabel } from '../Extension/Lozenge/ExtensionFloatingLabel';
|
|
23
|
+
import { hasBreakoutWidth } from '../utils/has-breakout-width';
|
|
23
24
|
import { shouldExtensionBreakout } from '../utils/should-extension-breakout';
|
|
24
25
|
import { useMultiBodiedExtensionActions } from './action-api';
|
|
25
26
|
import { mbeExtensionWrapperCSSStyles, mbeExtensionWrapperCSSStylesOld, overlayStyles, overlayStylesOld } from './styles';
|
|
@@ -244,7 +245,8 @@ const MultiBodiedExtensionWithWidth = ({
|
|
|
244
245
|
layout,
|
|
245
246
|
editorAppearance,
|
|
246
247
|
isTopLevelNode: true,
|
|
247
|
-
hasBreakoutMark: (_node$marks = node.marks) === null || _node$marks === void 0 ? void 0 : _node$marks.some(mark => mark.type.name === 'breakout')
|
|
248
|
+
hasBreakoutMark: (_node$marks = node.marks) === null || _node$marks === void 0 ? void 0 : _node$marks.some(mark => mark.type.name === 'breakout'),
|
|
249
|
+
hasBreakoutWidth: hasBreakoutWidth(node.marks)
|
|
248
250
|
});
|
|
249
251
|
let mbeWrapperStyles = {};
|
|
250
252
|
if (shouldBreakout) {
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** returns the breakout width if the node has a breakout mark with a positive breakout width. */
|
|
2
|
+
export const getBreakoutWidth = marks => {
|
|
3
|
+
for (const mark of marks !== null && marks !== void 0 ? marks : []) {
|
|
4
|
+
if (mark.type.name === 'breakout' && typeof mark.attrs.width === 'number' && mark.attrs.width > 0) {
|
|
5
|
+
return mark.attrs.width;
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return undefined;
|
|
9
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
2
3
|
const breakoutLayouts = new Set(['full-width', 'wide']);
|
|
3
4
|
const shouldRespectBreakoutForAppearance = appearance => {
|
|
4
5
|
if (!appearance) {
|
|
@@ -16,9 +17,16 @@ export const shouldExtensionBreakout = ({
|
|
|
16
17
|
layout,
|
|
17
18
|
isTopLevelNode = true,
|
|
18
19
|
editorAppearance,
|
|
19
|
-
hasBreakoutMark = false
|
|
20
|
+
hasBreakoutMark = false,
|
|
21
|
+
hasBreakoutWidth = false
|
|
20
22
|
}) => {
|
|
21
23
|
// the breakout mark wrapper owns the width, so the legacy layout must not size the node too
|
|
24
|
+
if (fg('platform_editor_lovability_resize_exts_gracefully') && isExperimentEnabled('platform_editor_lovability_resize_exts_patch_1') && hasBreakoutWidth) {
|
|
25
|
+
return false;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// once platform_editor_lovability_resize_exts_patch_1 is rolled out, we can remove this redundant check.
|
|
29
|
+
// because the previous check should have returned false already for extensions with breakout widths.
|
|
22
30
|
if (hasBreakoutMark && isExperimentEnabled('platform_editor_lovability_resize_extensions')) {
|
|
23
31
|
return false;
|
|
24
32
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { defineMessages } from 'react-intl';
|
|
2
2
|
export const messages = defineMessages({
|
|
3
|
+
customWidth: {
|
|
4
|
+
id: 'fabric.editor.extension.customWidth',
|
|
5
|
+
defaultMessage: 'Custom width',
|
|
6
|
+
description: 'Label for the layout button in the extension toolbar when the extension has been resized to a custom width.'
|
|
7
|
+
},
|
|
3
8
|
edit: {
|
|
4
9
|
id: 'fabric.editor.edit',
|
|
5
10
|
defaultMessage: 'Edit',
|
|
@@ -13,7 +13,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
13
13
|
const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
14
14
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
15
15
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
16
|
-
const packageVersion = "134.
|
|
16
|
+
const packageVersion = "134.8.0";
|
|
17
17
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
18
18
|
// Remove URL as it has UGC
|
|
19
19
|
// Ignored via go/ees007
|
|
@@ -13,7 +13,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
13
13
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
14
14
|
import Layer from '../Layer';
|
|
15
15
|
const packageName = "@atlaskit/editor-common";
|
|
16
|
-
const packageVersion = "134.
|
|
16
|
+
const packageVersion = "134.8.0";
|
|
17
17
|
const halfFocusRing = 1;
|
|
18
18
|
const dropOffset = '0, 8';
|
|
19
19
|
// Ignored via go/ees005
|
|
@@ -115,6 +115,7 @@ const HoverLinkOverlay = ({
|
|
|
115
115
|
const [showLabel, setShowLabel] = useState(true);
|
|
116
116
|
const [isHovered, setHovered] = useState(false);
|
|
117
117
|
const openTextWidthRef = useRef(null);
|
|
118
|
+
const shouldDeferMeasurement = isExperimentEnabled('platform_editor_improve_inp_batch_2');
|
|
118
119
|
const regularPadding = DYNAMIC_PADDING_BLOCK;
|
|
119
120
|
const memoizedHoverLinkStyles = useMemo(() => ({
|
|
120
121
|
paddingBlock: compactPadding ? '1px' : regularPadding
|
|
@@ -127,6 +128,38 @@ const HoverLinkOverlay = ({
|
|
|
127
128
|
if (!isVisible || !isHovered) {
|
|
128
129
|
return;
|
|
129
130
|
}
|
|
131
|
+
if (shouldDeferMeasurement) {
|
|
132
|
+
const container = containerRef.current;
|
|
133
|
+
const button = hoverLinkButtonRef.current;
|
|
134
|
+
const hiddenText = hiddenTextRef.current;
|
|
135
|
+
if (!container || !button || !hiddenText) {
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const observer = new ResizeObserver(() => {
|
|
139
|
+
// One measurement per hover; hiding the label must not trigger another one.
|
|
140
|
+
observer.disconnect();
|
|
141
|
+
const cardWidth = container.offsetWidth;
|
|
142
|
+
const openButtonWidth = button.offsetWidth;
|
|
143
|
+
// Get the hidden text width
|
|
144
|
+
const openTextWidth = hiddenText.offsetWidth || DEFAULT_OPEN_TEXT_WIDTH;
|
|
145
|
+
if (!cardWidth || !openButtonWidth) {
|
|
146
|
+
return;
|
|
147
|
+
}
|
|
148
|
+
let canShowLabel = cardWidth - openTextWidth > MIN_AVAILABLE_SPACE_WITH_LABEL_OVERLAY + ICON_WIDTH;
|
|
149
|
+
|
|
150
|
+
// When a smart link wraps to multiple lines in a constrained container (e.g. table cell),
|
|
151
|
+
// the hover button can overflow beyond the container bounds. We detect this by comparing
|
|
152
|
+
// the button's right edge to the container's right edge, and hide the label if it overflows.
|
|
153
|
+
const containerRight = container.getBoundingClientRect().right;
|
|
154
|
+
const buttonRight = button.getBoundingClientRect().right;
|
|
155
|
+
if (buttonRight > containerRight) {
|
|
156
|
+
canShowLabel = false;
|
|
157
|
+
}
|
|
158
|
+
setShowLabel(canShowLabel);
|
|
159
|
+
});
|
|
160
|
+
observer.observe(button);
|
|
161
|
+
return () => observer.disconnect();
|
|
162
|
+
}
|
|
130
163
|
const cardWidth = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.offsetWidth;
|
|
131
164
|
const openButtonWidth = (_hoverLinkButtonRef$c = hoverLinkButtonRef.current) === null || _hoverLinkButtonRef$c === void 0 ? void 0 : _hoverLinkButtonRef$c.offsetWidth;
|
|
132
165
|
// Get the hidden text width
|
|
@@ -163,7 +196,7 @@ const HoverLinkOverlay = ({
|
|
|
163
196
|
}
|
|
164
197
|
}
|
|
165
198
|
setShowLabel(canShowLabel);
|
|
166
|
-
}, [isVisible, isHovered]);
|
|
199
|
+
}, [isVisible, isHovered, shouldDeferMeasurement]);
|
|
167
200
|
const handleOverlayChange = isHovered => {
|
|
168
201
|
setHovered(isHovered);
|
|
169
202
|
|
|
@@ -220,13 +253,13 @@ const HoverLinkOverlay = ({
|
|
|
220
253
|
,
|
|
221
254
|
onFocus: expValEquals('editor_a11y__enghealth-46814_fy26', 'isEnabled', true) ? () => {} : undefined,
|
|
222
255
|
onBlur: expValEquals('editor_a11y__enghealth-46814_fy26', 'isEnabled', true) ? () => {} : undefined
|
|
223
|
-
}, children, jsx("span", {
|
|
256
|
+
}, children, (!shouldDeferMeasurement || isHovered) && jsx("span", {
|
|
224
257
|
css: hiddenTextStyle,
|
|
225
258
|
"aria-hidden": "true"
|
|
226
259
|
}, jsx(Text, {
|
|
227
260
|
ref: hiddenTextRef,
|
|
228
261
|
size: "small",
|
|
229
|
-
maxLines: 1
|
|
262
|
+
maxLines: shouldDeferMeasurement ? undefined : 1
|
|
230
263
|
}, label)), isHovered && jsx(Anchor, {
|
|
231
264
|
ref: hoverLinkButtonRef,
|
|
232
265
|
xcss: linkStylesCommon,
|
|
@@ -23,6 +23,7 @@ import { useSharedPluginStateWithSelector } from '../../../hooks';
|
|
|
23
23
|
import { NodeViewContentHole } from '../../../react-node-view/NodeViewContentHole';
|
|
24
24
|
import { overflowShadow } from '../../../ui';
|
|
25
25
|
import { calculateBreakoutStyles } from '../../../utils';
|
|
26
|
+
import { hasBreakoutWidth } from '../../utils/has-breakout-width';
|
|
26
27
|
import { shouldExtensionBreakout } from '../../utils/should-extension-breakout';
|
|
27
28
|
import { ExtensionCommentBadge } from '../ExtensionCommentBadge';
|
|
28
29
|
import ExtensionLozenge from '../Lozenge';
|
|
@@ -106,7 +107,8 @@ function ExtensionWithPluginState(props) {
|
|
|
106
107
|
editorAppearance: editorAppearance,
|
|
107
108
|
hasBreakoutMark: (_node$marks = node.marks) === null || _node$marks === void 0 ? void 0 : _node$marks.some(function (mark) {
|
|
108
109
|
return mark.type.name === 'breakout';
|
|
109
|
-
})
|
|
110
|
+
}),
|
|
111
|
+
hasBreakoutWidth: hasBreakoutWidth(node.marks)
|
|
110
112
|
});
|
|
111
113
|
|
|
112
114
|
// We don't want to show border for non-empty 1p bodied extensions in live pages
|
|
@@ -25,6 +25,7 @@ import { removeMarginsAndBorder, sharedMultiBodiedExtensionStyles } from '../../
|
|
|
25
25
|
import { calculateBreakoutStyles, getExtensionLozengeData } from '../../utils';
|
|
26
26
|
import ExtensionLozenge from '../Extension/Lozenge';
|
|
27
27
|
import { ExtensionFloatingLabel } from '../Extension/Lozenge/ExtensionFloatingLabel';
|
|
28
|
+
import { hasBreakoutWidth } from '../utils/has-breakout-width';
|
|
28
29
|
import { shouldExtensionBreakout } from '../utils/should-extension-breakout';
|
|
29
30
|
import { useMultiBodiedExtensionActions } from './action-api';
|
|
30
31
|
import { mbeExtensionWrapperCSSStyles, mbeExtensionWrapperCSSStylesOld, overlayStyles, overlayStylesOld } from './styles';
|
|
@@ -249,7 +250,8 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
249
250
|
isTopLevelNode: true,
|
|
250
251
|
hasBreakoutMark: (_node$marks = node.marks) === null || _node$marks === void 0 ? void 0 : _node$marks.some(function (mark) {
|
|
251
252
|
return mark.type.name === 'breakout';
|
|
252
|
-
})
|
|
253
|
+
}),
|
|
254
|
+
hasBreakoutWidth: hasBreakoutWidth(node.marks)
|
|
253
255
|
});
|
|
254
256
|
var mbeWrapperStyles = {};
|
|
255
257
|
if (shouldBreakout) {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
2
|
+
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
3
|
+
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
4
|
+
/** returns the breakout width if the node has a breakout mark with a positive breakout width. */
|
|
5
|
+
export var getBreakoutWidth = function getBreakoutWidth(marks) {
|
|
6
|
+
var _iterator = _createForOfIteratorHelper(marks !== null && marks !== void 0 ? marks : []),
|
|
7
|
+
_step;
|
|
8
|
+
try {
|
|
9
|
+
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
10
|
+
var mark = _step.value;
|
|
11
|
+
if (mark.type.name === 'breakout' && typeof mark.attrs.width === 'number' && mark.attrs.width > 0) {
|
|
12
|
+
return mark.attrs.width;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
} catch (err) {
|
|
16
|
+
_iterator.e(err);
|
|
17
|
+
} finally {
|
|
18
|
+
_iterator.f();
|
|
19
|
+
}
|
|
20
|
+
return undefined;
|
|
21
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
2
3
|
var breakoutLayouts = new Set(['full-width', 'wide']);
|
|
3
4
|
var shouldRespectBreakoutForAppearance = function shouldRespectBreakoutForAppearance(appearance) {
|
|
4
5
|
if (!appearance) {
|
|
@@ -18,8 +19,16 @@ export var shouldExtensionBreakout = function shouldExtensionBreakout(_ref) {
|
|
|
18
19
|
isTopLevelNode = _ref$isTopLevelNode === void 0 ? true : _ref$isTopLevelNode,
|
|
19
20
|
editorAppearance = _ref.editorAppearance,
|
|
20
21
|
_ref$hasBreakoutMark = _ref.hasBreakoutMark,
|
|
21
|
-
hasBreakoutMark = _ref$hasBreakoutMark === void 0 ? false : _ref$hasBreakoutMark
|
|
22
|
+
hasBreakoutMark = _ref$hasBreakoutMark === void 0 ? false : _ref$hasBreakoutMark,
|
|
23
|
+
_ref$hasBreakoutWidth = _ref.hasBreakoutWidth,
|
|
24
|
+
hasBreakoutWidth = _ref$hasBreakoutWidth === void 0 ? false : _ref$hasBreakoutWidth;
|
|
22
25
|
// the breakout mark wrapper owns the width, so the legacy layout must not size the node too
|
|
26
|
+
if (fg('platform_editor_lovability_resize_exts_gracefully') && isExperimentEnabled('platform_editor_lovability_resize_exts_patch_1') && hasBreakoutWidth) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
// once platform_editor_lovability_resize_exts_patch_1 is rolled out, we can remove this redundant check.
|
|
31
|
+
// because the previous check should have returned false already for extensions with breakout widths.
|
|
23
32
|
if (hasBreakoutMark && isExperimentEnabled('platform_editor_lovability_resize_extensions')) {
|
|
24
33
|
return false;
|
|
25
34
|
}
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { defineMessages } from 'react-intl';
|
|
2
2
|
export var messages = defineMessages({
|
|
3
|
+
customWidth: {
|
|
4
|
+
id: 'fabric.editor.extension.customWidth',
|
|
5
|
+
defaultMessage: 'Custom width',
|
|
6
|
+
description: 'Label for the layout button in the extension toolbar when the extension has been resized to a custom width.'
|
|
7
|
+
},
|
|
3
8
|
edit: {
|
|
4
9
|
id: 'fabric.editor.edit',
|
|
5
10
|
defaultMessage: 'Edit',
|
|
@@ -19,7 +19,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
19
19
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
20
20
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
21
21
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
22
|
-
var packageVersion = "134.
|
|
22
|
+
var packageVersion = "134.8.0";
|
|
23
23
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
24
24
|
// Remove URL as it has UGC
|
|
25
25
|
// Ignored via go/ees007
|
|
@@ -20,7 +20,7 @@ import withAnalyticsContext from '@atlaskit/analytics-next/withAnalyticsContext'
|
|
|
20
20
|
import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
21
21
|
import Layer from '../Layer';
|
|
22
22
|
var packageName = "@atlaskit/editor-common";
|
|
23
|
-
var packageVersion = "134.
|
|
23
|
+
var packageVersion = "134.8.0";
|
|
24
24
|
var halfFocusRing = 1;
|
|
25
25
|
var dropOffset = '0, 8';
|
|
26
26
|
// Ignored via go/ees005
|
|
@@ -121,6 +121,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
121
121
|
isHovered = _useState4[0],
|
|
122
122
|
setHovered = _useState4[1];
|
|
123
123
|
var openTextWidthRef = useRef(null);
|
|
124
|
+
var shouldDeferMeasurement = isExperimentEnabled('platform_editor_improve_inp_batch_2');
|
|
124
125
|
var regularPadding = DYNAMIC_PADDING_BLOCK;
|
|
125
126
|
var memoizedHoverLinkStyles = useMemo(function () {
|
|
126
127
|
return {
|
|
@@ -135,21 +136,55 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
135
136
|
if (!isVisible || !isHovered) {
|
|
136
137
|
return;
|
|
137
138
|
}
|
|
139
|
+
if (shouldDeferMeasurement) {
|
|
140
|
+
var container = containerRef.current;
|
|
141
|
+
var button = hoverLinkButtonRef.current;
|
|
142
|
+
var hiddenText = hiddenTextRef.current;
|
|
143
|
+
if (!container || !button || !hiddenText) {
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
var observer = new ResizeObserver(function () {
|
|
147
|
+
// One measurement per hover; hiding the label must not trigger another one.
|
|
148
|
+
observer.disconnect();
|
|
149
|
+
var cardWidth = container.offsetWidth;
|
|
150
|
+
var openButtonWidth = button.offsetWidth;
|
|
151
|
+
// Get the hidden text width
|
|
152
|
+
var openTextWidth = hiddenText.offsetWidth || DEFAULT_OPEN_TEXT_WIDTH;
|
|
153
|
+
if (!cardWidth || !openButtonWidth) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
var canShowLabel = cardWidth - openTextWidth > MIN_AVAILABLE_SPACE_WITH_LABEL_OVERLAY + ICON_WIDTH;
|
|
157
|
+
|
|
158
|
+
// When a smart link wraps to multiple lines in a constrained container (e.g. table cell),
|
|
159
|
+
// the hover button can overflow beyond the container bounds. We detect this by comparing
|
|
160
|
+
// the button's right edge to the container's right edge, and hide the label if it overflows.
|
|
161
|
+
var containerRight = container.getBoundingClientRect().right;
|
|
162
|
+
var buttonRight = button.getBoundingClientRect().right;
|
|
163
|
+
if (buttonRight > containerRight) {
|
|
164
|
+
canShowLabel = false;
|
|
165
|
+
}
|
|
166
|
+
setShowLabel(canShowLabel);
|
|
167
|
+
});
|
|
168
|
+
observer.observe(button);
|
|
169
|
+
return function () {
|
|
170
|
+
return observer.disconnect();
|
|
171
|
+
};
|
|
172
|
+
}
|
|
138
173
|
var cardWidth = (_containerRef$current = containerRef.current) === null || _containerRef$current === void 0 ? void 0 : _containerRef$current.offsetWidth;
|
|
139
174
|
var openButtonWidth = (_hoverLinkButtonRef$c = hoverLinkButtonRef.current) === null || _hoverLinkButtonRef$c === void 0 ? void 0 : _hoverLinkButtonRef$c.offsetWidth;
|
|
140
175
|
// Get the hidden text width
|
|
141
176
|
if (!openTextWidthRef.current) {
|
|
142
|
-
var
|
|
143
|
-
if (
|
|
177
|
+
var _hiddenText = hiddenTextRef.current;
|
|
178
|
+
if (_hiddenText) {
|
|
144
179
|
// Measure the width of the hidden text
|
|
145
180
|
// Temporarily make the element visible to measure its width
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
openTextWidthRef.current =
|
|
181
|
+
_hiddenText.style.visibility = 'hidden';
|
|
182
|
+
_hiddenText.style.display = 'inline';
|
|
183
|
+
openTextWidthRef.current = _hiddenText.offsetWidth;
|
|
149
184
|
|
|
150
185
|
// Reset the hiddenText's display property
|
|
151
|
-
|
|
152
|
-
|
|
186
|
+
_hiddenText.style.display = 'none';
|
|
187
|
+
_hiddenText.style.visibility = 'inherit';
|
|
153
188
|
} else {
|
|
154
189
|
openTextWidthRef.current = DEFAULT_OPEN_TEXT_WIDTH;
|
|
155
190
|
}
|
|
@@ -171,7 +206,7 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
171
206
|
}
|
|
172
207
|
}
|
|
173
208
|
setShowLabel(canShowLabel);
|
|
174
|
-
}, [isVisible, isHovered]);
|
|
209
|
+
}, [isVisible, isHovered, shouldDeferMeasurement]);
|
|
175
210
|
var handleOverlayChange = function handleOverlayChange(isHovered) {
|
|
176
211
|
setHovered(isHovered);
|
|
177
212
|
|
|
@@ -232,13 +267,13 @@ var HoverLinkOverlay = function HoverLinkOverlay(_ref) {
|
|
|
232
267
|
,
|
|
233
268
|
onFocus: expValEquals('editor_a11y__enghealth-46814_fy26', 'isEnabled', true) ? function () {} : undefined,
|
|
234
269
|
onBlur: expValEquals('editor_a11y__enghealth-46814_fy26', 'isEnabled', true) ? function () {} : undefined
|
|
235
|
-
}, children, jsx("span", {
|
|
270
|
+
}, children, (!shouldDeferMeasurement || isHovered) && jsx("span", {
|
|
236
271
|
css: hiddenTextStyle,
|
|
237
272
|
"aria-hidden": "true"
|
|
238
273
|
}, jsx(Text, {
|
|
239
274
|
ref: hiddenTextRef,
|
|
240
275
|
size: "small",
|
|
241
|
-
maxLines: 1
|
|
276
|
+
maxLines: shouldDeferMeasurement ? undefined : 1
|
|
242
277
|
}, label)), isHovered && jsx(Anchor, {
|
|
243
278
|
ref: hoverLinkButtonRef,
|
|
244
279
|
xcss: linkStylesCommon,
|
|
@@ -2,8 +2,9 @@ import type { EditorAppearance } from '../../types';
|
|
|
2
2
|
interface ShouldExtensionBreakoutArgs {
|
|
3
3
|
editorAppearance?: EditorAppearance;
|
|
4
4
|
hasBreakoutMark?: boolean;
|
|
5
|
+
hasBreakoutWidth?: boolean;
|
|
5
6
|
isTopLevelNode?: boolean;
|
|
6
7
|
layout?: string;
|
|
7
8
|
}
|
|
8
|
-
export declare const shouldExtensionBreakout: ({ layout, isTopLevelNode, editorAppearance, hasBreakoutMark, }: ShouldExtensionBreakoutArgs) => boolean;
|
|
9
|
+
export declare const shouldExtensionBreakout: ({ layout, isTopLevelNode, editorAppearance, hasBreakoutMark, hasBreakoutWidth, }: ShouldExtensionBreakoutArgs) => boolean;
|
|
9
10
|
export {};
|
|
@@ -1,58 +1,63 @@
|
|
|
1
1
|
export declare const messages: {
|
|
2
|
-
|
|
3
|
-
id: string;
|
|
2
|
+
confirmDeleteLinkedModalMessage: {
|
|
4
3
|
defaultMessage: string;
|
|
5
4
|
description: string;
|
|
6
|
-
};
|
|
7
|
-
deleteElementTitle: {
|
|
8
5
|
id: string;
|
|
6
|
+
};
|
|
7
|
+
confirmDeleteLinkedModalOKButton: {
|
|
9
8
|
defaultMessage: string;
|
|
10
9
|
description: string;
|
|
11
|
-
};
|
|
12
|
-
unnamedSource: {
|
|
13
10
|
id: string;
|
|
11
|
+
};
|
|
12
|
+
confirmModalCheckboxLabel: {
|
|
14
13
|
defaultMessage: string;
|
|
15
14
|
description: string;
|
|
16
|
-
};
|
|
17
|
-
confirmDeleteLinkedModalOKButton: {
|
|
18
15
|
id: string;
|
|
16
|
+
};
|
|
17
|
+
customWidth: {
|
|
19
18
|
defaultMessage: string;
|
|
20
19
|
description: string;
|
|
21
|
-
};
|
|
22
|
-
confirmDeleteLinkedModalMessage: {
|
|
23
20
|
id: string;
|
|
21
|
+
};
|
|
22
|
+
deleteElementTitle: {
|
|
24
23
|
defaultMessage: string;
|
|
25
24
|
description: string;
|
|
26
|
-
};
|
|
27
|
-
confirmModalCheckboxLabel: {
|
|
28
25
|
id: string;
|
|
26
|
+
};
|
|
27
|
+
edit: {
|
|
29
28
|
defaultMessage: string;
|
|
30
29
|
description: string;
|
|
31
|
-
};
|
|
32
|
-
saveIndicator: {
|
|
33
30
|
id: string;
|
|
31
|
+
};
|
|
32
|
+
extensionLoadingError: {
|
|
34
33
|
defaultMessage: string;
|
|
35
34
|
description: string;
|
|
35
|
+
id: string;
|
|
36
36
|
};
|
|
37
37
|
panelLoadingError: {
|
|
38
|
-
id: string;
|
|
39
38
|
defaultMessage: string;
|
|
40
39
|
description: string;
|
|
40
|
+
id: string;
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
saveIndicator: {
|
|
43
|
+
defaultMessage: string;
|
|
44
|
+
description: string;
|
|
43
45
|
id: string;
|
|
46
|
+
};
|
|
47
|
+
unknownMacroHeader: {
|
|
44
48
|
defaultMessage: string;
|
|
45
49
|
description: string;
|
|
50
|
+
id: string;
|
|
46
51
|
};
|
|
47
52
|
unknownMacroPlaceholderAriaLabel: {
|
|
48
|
-
id: string;
|
|
49
53
|
defaultMessage: string;
|
|
50
54
|
description: string;
|
|
51
|
-
};
|
|
52
|
-
unknownMacroHeader: {
|
|
53
55
|
id: string;
|
|
56
|
+
};
|
|
57
|
+
unnamedSource: {
|
|
54
58
|
defaultMessage: string;
|
|
55
59
|
description: string;
|
|
60
|
+
id: string;
|
|
56
61
|
};
|
|
57
62
|
};
|
|
58
63
|
export { configPanelMessages } from './configPanelMessages';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-common/extensibility/get-breakout-width",
|
|
3
|
+
"main": "../../dist/cjs/extensibility/utils/get-breakout-width.js",
|
|
4
|
+
"module": "../../dist/esm/extensibility/utils/get-breakout-width.js",
|
|
5
|
+
"module:es2019": "../../dist/es2019/extensibility/utils/get-breakout-width.js",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"**/*.compiled.css"
|
|
8
|
+
],
|
|
9
|
+
"types": "../../dist/types/extensibility/utils/get-breakout-width.d.ts"
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@atlaskit/editor-common/extensibility/has-breakout-width",
|
|
3
|
+
"main": "../../dist/cjs/extensibility/utils/has-breakout-width.js",
|
|
4
|
+
"module": "../../dist/esm/extensibility/utils/has-breakout-width.js",
|
|
5
|
+
"module:es2019": "../../dist/es2019/extensibility/utils/has-breakout-width.js",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"**/*.compiled.css"
|
|
8
|
+
],
|
|
9
|
+
"types": "../../dist/types/extensibility/utils/has-breakout-width.d.ts"
|
|
10
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-common",
|
|
3
|
-
"version": "134.
|
|
3
|
+
"version": "134.8.1",
|
|
4
4
|
"description": "A package that contains common classes and components for editor and renderer",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"@atlaskit/editor-prosemirror": "^9.0.0",
|
|
48
48
|
"@atlaskit/editor-shared-styles": "^5.0.0",
|
|
49
49
|
"@atlaskit/editor-tables": "^3.2.0",
|
|
50
|
-
"@atlaskit/editor-toolbar": "^2.
|
|
50
|
+
"@atlaskit/editor-toolbar": "^2.9.0",
|
|
51
51
|
"@atlaskit/editor-toolbar-model": "^1.2.0",
|
|
52
52
|
"@atlaskit/editor-ui-control-model": "^3.0.0",
|
|
53
53
|
"@atlaskit/emoji": "^73.4.0",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"@atlaskit/platform-feature-flags-react": "^1.2.0",
|
|
75
75
|
"@atlaskit/popper": "^9.4.0",
|
|
76
76
|
"@atlaskit/primitives": "^22.6.0",
|
|
77
|
-
"@atlaskit/profilecard": "^27.
|
|
77
|
+
"@atlaskit/profilecard": "^27.6.0",
|
|
78
78
|
"@atlaskit/prosemirror-history": "^1.3.0",
|
|
79
79
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
80
80
|
"@atlaskit/react-ufo": "^8.4.0",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"@atlaskit/task-decision": "^21.14.0",
|
|
86
86
|
"@atlaskit/teams-app-config": "^3.1.0",
|
|
87
87
|
"@atlaskit/textfield": "^10.3.0",
|
|
88
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
88
|
+
"@atlaskit/tmp-editor-statsig": "^255.0.0",
|
|
89
89
|
"@atlaskit/tokens": "^20.9.0",
|
|
90
90
|
"@atlaskit/tooltip": "^24.4.0",
|
|
91
91
|
"@atlaskit/width-detector": "^7.2.0",
|