@atlaskit/editor-common 120.10.3 → 120.10.4
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 +8 -0
- package/dist/cjs/extensibility/MultiBodiedExtension/index.js +36 -18
- package/dist/cjs/monitoring/error.js +1 -1
- package/dist/cjs/ui/DropList/index.js +1 -1
- package/dist/es2019/extensibility/MultiBodiedExtension/index.js +36 -15
- package/dist/es2019/monitoring/error.js +1 -1
- package/dist/es2019/ui/DropList/index.js +1 -1
- package/dist/esm/extensibility/MultiBodiedExtension/index.js +36 -18
- package/dist/esm/monitoring/error.js +1 -1
- package/dist/esm/ui/DropList/index.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/editor-common
|
|
2
2
|
|
|
3
|
+
## 120.10.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`38efae8b5d945`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/38efae8b5d945) -
|
|
8
|
+
Scope MultiBodiedExtension active frame styles to the owning frames article to avoid showing
|
|
9
|
+
nested inactive tab bodies.
|
|
10
|
+
|
|
3
11
|
## 120.10.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -37,8 +37,11 @@ var _excluded = ["url"];
|
|
|
37
37
|
*/
|
|
38
38
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled, @typescript-eslint/consistent-type-imports -- Ignored via go/DSP-18766; jsx required at runtime for @jsxRuntime classic
|
|
39
39
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
40
|
-
var getContainerCssExtendedStyles = function getContainerCssExtendedStyles(activeChildIndex,
|
|
41
|
-
|
|
40
|
+
var getContainerCssExtendedStyles = function getContainerCssExtendedStyles(activeChildIndex, showMacroInteractionDesignUpdates) {
|
|
41
|
+
if ((0, _fg.fg)('platform_editor_nested_mbe_frames')) {
|
|
42
|
+
return _MultiBodiedExtension.sharedMultiBodiedExtensionStyles.mbeExtensionContainer;
|
|
43
|
+
}
|
|
44
|
+
var activeFrameSelector = ".multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ")");
|
|
42
45
|
|
|
43
46
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
44
47
|
return (0, _react2.css)(_MultiBodiedExtension.sharedMultiBodiedExtensionStyles.mbeExtensionContainer, (0, _defineProperty2.default)({}, activeFrameSelector, (0, _react2.css)(
|
|
@@ -47,10 +50,21 @@ var getContainerCssExtendedStyles = function getContainerCssExtendedStyles(activ
|
|
|
47
50
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
48
51
|
showMacroInteractionDesignUpdates && _MultiBodiedExtension.removeMarginsAndBorder)));
|
|
49
52
|
};
|
|
53
|
+
var getFramesActiveFrameStyles = function getFramesActiveFrameStyles(activeChildIndex, showMacroInteractionDesignUpdates) {
|
|
54
|
+
if (!(0, _fg.fg)('platform_editor_nested_mbe_frames')) {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
57
|
+
var activeFrameSelector = "& > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ")");
|
|
58
|
+
return (0, _react2.css)((0, _defineProperty2.default)({}, activeFrameSelector, (0, _react2.css)(
|
|
59
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
60
|
+
_MultiBodiedExtension.sharedMultiBodiedExtensionStyles.extensionFrameContent,
|
|
61
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
62
|
+
showMacroInteractionDesignUpdates && _MultiBodiedExtension.removeMarginsAndBorder)));
|
|
63
|
+
};
|
|
50
64
|
|
|
51
65
|
// Renders a visual placeholder when the active frame contains a single empty paragraph.
|
|
52
|
-
var getEmptyFramePlaceholderStyles = function getEmptyFramePlaceholderStyles(activeChildIndex,
|
|
53
|
-
var activeFramePlaceholderSelector =
|
|
66
|
+
var getEmptyFramePlaceholderStyles = function getEmptyFramePlaceholderStyles(activeChildIndex, placeholderText) {
|
|
67
|
+
var activeFramePlaceholderSelector = "& > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ") > p:only-child:has(> .ProseMirror-trailingBreak:only-child)::before");
|
|
54
68
|
return (0, _react2.css)((0, _defineProperty2.default)({}, activeFramePlaceholderSelector, {
|
|
55
69
|
color: "var(--ds-text-subtlest, #6B6E76)",
|
|
56
70
|
// JSON.stringify produces a quoted and escaped CSS string.
|
|
@@ -75,14 +89,19 @@ var hoverStylesOld = (0, _react2.css)({
|
|
|
75
89
|
}
|
|
76
90
|
});
|
|
77
91
|
var MultiBodiedExtensionFrames = function MultiBodiedExtensionFrames(_ref) {
|
|
78
|
-
var
|
|
79
|
-
|
|
92
|
+
var activeChildIndex = _ref.activeChildIndex,
|
|
93
|
+
articleRef = _ref.articleRef,
|
|
94
|
+
emptyFramePlaceholderText = _ref.emptyFramePlaceholderText,
|
|
95
|
+
shouldShowEmptyFramePlaceholder = _ref.shouldShowEmptyFramePlaceholder,
|
|
96
|
+
showMacroInteractionDesignUpdates = _ref.showMacroInteractionDesignUpdates;
|
|
80
97
|
return (0, _react2.jsx)("article", {
|
|
81
98
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
82
99
|
className: "multiBodiedExtension--frames",
|
|
100
|
+
css: [/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
|
|
101
|
+
getFramesActiveFrameStyles(activeChildIndex, showMacroInteractionDesignUpdates), shouldShowEmptyFramePlaceholder && getEmptyFramePlaceholderStyles(activeChildIndex, emptyFramePlaceholderText)
|
|
102
|
+
/* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */],
|
|
83
103
|
"data-testid": "multiBodiedExtension--frames",
|
|
84
104
|
"data-multibodiedextension-frames": true,
|
|
85
|
-
"data-multibodiedextension-frames-id": frameId,
|
|
86
105
|
ref: articleRef
|
|
87
106
|
});
|
|
88
107
|
};
|
|
@@ -212,10 +231,6 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
212
231
|
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
213
232
|
activeChildIndex = _useState4[0],
|
|
214
233
|
setActiveChildIndex = _useState4[1];
|
|
215
|
-
// Used by the gated active-frame styles to scope selection to this MBE instance.
|
|
216
|
-
// Editor frames sit under ProseMirror's contentDOM wrapper, so the id anchors the
|
|
217
|
-
// selector at the owning MBE before it reaches that wrapper and its direct frames.
|
|
218
|
-
var frameId = _react.default.useId();
|
|
219
234
|
// Adding to avoid aliasing `this` for the callbacks
|
|
220
235
|
var updateActiveChild = _react.default.useCallback(function (index) {
|
|
221
236
|
if (typeof index !== 'number') {
|
|
@@ -228,12 +243,19 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
228
243
|
var articleRef = _react.default.useCallback(function (node) {
|
|
229
244
|
return handleContentDOMRef(node);
|
|
230
245
|
}, [handleContentDOMRef]);
|
|
246
|
+
var shouldShowEmptyFramePlaceholder = (0, _isExperimentEnabled.isExperimentEnabled)('confluence_native_tabs_m15');
|
|
247
|
+
var emptyFramePlaceholderText = _react.default.useMemo(function () {
|
|
248
|
+
return JSON.stringify(formatMessage(_placeholderText.placeholderTextMessages.multiBodiedExtensionEmptyFramePlaceholderText));
|
|
249
|
+
}, [formatMessage]);
|
|
231
250
|
var childrenContainer = _react.default.useMemo(function () {
|
|
232
251
|
return (0, _react2.jsx)(MultiBodiedExtensionFrames, {
|
|
252
|
+
activeChildIndex: activeChildIndex,
|
|
233
253
|
articleRef: articleRef,
|
|
234
|
-
|
|
254
|
+
emptyFramePlaceholderText: emptyFramePlaceholderText,
|
|
255
|
+
shouldShowEmptyFramePlaceholder: shouldShowEmptyFramePlaceholder,
|
|
256
|
+
showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
|
|
235
257
|
});
|
|
236
|
-
}, [articleRef,
|
|
258
|
+
}, [activeChildIndex, articleRef, emptyFramePlaceholderText, shouldShowEmptyFramePlaceholder, showMacroInteractionDesignUpdates]);
|
|
237
259
|
var actions = (0, _actionApi.useMultiBodiedExtensionActions)({
|
|
238
260
|
updateActiveChild: updateActiveChild,
|
|
239
261
|
editorView: editorView,
|
|
@@ -266,10 +288,6 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
266
288
|
mbeWrapperStyles = breakoutStyles;
|
|
267
289
|
}
|
|
268
290
|
var shouldUseUpdatedChrome = (0, _expValEquals.expValEquals)('confluence_native_tabs_experiment', 'isEnabled', true);
|
|
269
|
-
var shouldShowEmptyFramePlaceholder = (0, _isExperimentEnabled.isExperimentEnabled)('confluence_native_tabs_m15');
|
|
270
|
-
var emptyFramePlaceholderText = _react.default.useMemo(function () {
|
|
271
|
-
return JSON.stringify(formatMessage(_placeholderText.placeholderTextMessages.multiBodiedExtensionEmptyFramePlaceholderText));
|
|
272
|
-
}, [formatMessage]);
|
|
273
291
|
var isSelectionInsideMultiBodiedExtension = useIsSelectionInsideNode(editorView, node, getPos, shouldUseUpdatedChrome && !isLivePageViewMode);
|
|
274
292
|
var isMultiBodiedExtensionActive = isNodeSelected || isSelectionInsideMultiBodiedExtension;
|
|
275
293
|
var shouldShowChromeOnInteraction = isNodeHovered || isMultiBodiedExtensionActive;
|
|
@@ -345,7 +363,7 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
345
363
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
346
364
|
className: containerClassNames,
|
|
347
365
|
css: [/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
|
|
348
|
-
getContainerCssExtendedStyles(activeChildIndex,
|
|
366
|
+
getContainerCssExtendedStyles(activeChildIndex, showMacroInteractionDesignUpdates)
|
|
349
367
|
/* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */],
|
|
350
368
|
"data-testid": "multiBodiedExtension--container",
|
|
351
369
|
"data-multiBodiedExtension-container": true,
|
|
@@ -28,7 +28,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
28
28
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
29
29
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
30
30
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
31
|
-
var packageVersion = "120.10.
|
|
31
|
+
var packageVersion = "120.10.3";
|
|
32
32
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
33
33
|
// Remove URL as it has UGC
|
|
34
34
|
// Ignored via go/ees007
|
|
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
|
|
|
24
24
|
* @jsx jsx
|
|
25
25
|
*/ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
26
26
|
var packageName = "@atlaskit/editor-common";
|
|
27
|
-
var packageVersion = "120.10.
|
|
27
|
+
var packageVersion = "120.10.3";
|
|
28
28
|
var halfFocusRing = 1;
|
|
29
29
|
var dropOffset = '0, 8';
|
|
30
30
|
var fadeIn = (0, _react2.keyframes)({
|
|
@@ -25,8 +25,11 @@ import { ExtensionFloatingLabel } from '../Extension/Lozenge/ExtensionFloatingLa
|
|
|
25
25
|
import { shouldExtensionBreakout } from '../utils/should-extension-breakout';
|
|
26
26
|
import { useMultiBodiedExtensionActions } from './action-api';
|
|
27
27
|
import { mbeExtensionWrapperCSSStyles, mbeExtensionWrapperCSSStylesOld, overlayStyles, overlayStylesOld } from './styles';
|
|
28
|
-
const getContainerCssExtendedStyles = (activeChildIndex,
|
|
29
|
-
|
|
28
|
+
const getContainerCssExtendedStyles = (activeChildIndex, showMacroInteractionDesignUpdates) => {
|
|
29
|
+
if (fg('platform_editor_nested_mbe_frames')) {
|
|
30
|
+
return sharedMultiBodiedExtensionStyles.mbeExtensionContainer;
|
|
31
|
+
}
|
|
32
|
+
const activeFrameSelector = `.multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1})`;
|
|
30
33
|
|
|
31
34
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
32
35
|
return css(sharedMultiBodiedExtensionStyles.mbeExtensionContainer, {
|
|
@@ -38,10 +41,24 @@ const getContainerCssExtendedStyles = (activeChildIndex, frameId, showMacroInter
|
|
|
38
41
|
showMacroInteractionDesignUpdates && removeMarginsAndBorder)
|
|
39
42
|
});
|
|
40
43
|
};
|
|
44
|
+
const getFramesActiveFrameStyles = (activeChildIndex, showMacroInteractionDesignUpdates) => {
|
|
45
|
+
if (!fg('platform_editor_nested_mbe_frames')) {
|
|
46
|
+
return undefined;
|
|
47
|
+
}
|
|
48
|
+
const activeFrameSelector = `& > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1})`;
|
|
49
|
+
return css({
|
|
50
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
51
|
+
[activeFrameSelector]: css(
|
|
52
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
53
|
+
sharedMultiBodiedExtensionStyles.extensionFrameContent,
|
|
54
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
55
|
+
showMacroInteractionDesignUpdates && removeMarginsAndBorder)
|
|
56
|
+
});
|
|
57
|
+
};
|
|
41
58
|
|
|
42
59
|
// Renders a visual placeholder when the active frame contains a single empty paragraph.
|
|
43
|
-
const getEmptyFramePlaceholderStyles = (activeChildIndex,
|
|
44
|
-
const activeFramePlaceholderSelector =
|
|
60
|
+
const getEmptyFramePlaceholderStyles = (activeChildIndex, placeholderText) => {
|
|
61
|
+
const activeFramePlaceholderSelector = `& > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1}) > p:only-child:has(> .ProseMirror-trailingBreak:only-child)::before`;
|
|
45
62
|
return css({
|
|
46
63
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
47
64
|
[activeFramePlaceholderSelector]: {
|
|
@@ -69,15 +86,20 @@ const hoverStylesOld = css({
|
|
|
69
86
|
}
|
|
70
87
|
});
|
|
71
88
|
const MultiBodiedExtensionFrames = ({
|
|
89
|
+
activeChildIndex,
|
|
72
90
|
articleRef,
|
|
73
|
-
|
|
91
|
+
emptyFramePlaceholderText,
|
|
92
|
+
shouldShowEmptyFramePlaceholder,
|
|
93
|
+
showMacroInteractionDesignUpdates
|
|
74
94
|
}) => {
|
|
75
95
|
return jsx("article", {
|
|
76
96
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
77
97
|
className: "multiBodiedExtension--frames",
|
|
98
|
+
css: [/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
|
|
99
|
+
getFramesActiveFrameStyles(activeChildIndex, showMacroInteractionDesignUpdates), shouldShowEmptyFramePlaceholder && getEmptyFramePlaceholderStyles(activeChildIndex, emptyFramePlaceholderText)
|
|
100
|
+
/* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */],
|
|
78
101
|
"data-testid": "multiBodiedExtension--frames",
|
|
79
102
|
"data-multibodiedextension-frames": true,
|
|
80
|
-
"data-multibodiedextension-frames-id": frameId,
|
|
81
103
|
ref: articleRef
|
|
82
104
|
});
|
|
83
105
|
};
|
|
@@ -204,10 +226,6 @@ const MultiBodiedExtensionWithWidth = ({
|
|
|
204
226
|
formatMessage
|
|
205
227
|
} = useIntl();
|
|
206
228
|
const [activeChildIndex, setActiveChildIndex] = useState(0);
|
|
207
|
-
// Used by the gated active-frame styles to scope selection to this MBE instance.
|
|
208
|
-
// Editor frames sit under ProseMirror's contentDOM wrapper, so the id anchors the
|
|
209
|
-
// selector at the owning MBE before it reaches that wrapper and its direct frames.
|
|
210
|
-
const frameId = React.useId();
|
|
211
229
|
// Adding to avoid aliasing `this` for the callbacks
|
|
212
230
|
const updateActiveChild = React.useCallback(index => {
|
|
213
231
|
if (typeof index !== 'number') {
|
|
@@ -220,12 +238,17 @@ const MultiBodiedExtensionWithWidth = ({
|
|
|
220
238
|
const articleRef = React.useCallback(node => {
|
|
221
239
|
return handleContentDOMRef(node);
|
|
222
240
|
}, [handleContentDOMRef]);
|
|
241
|
+
const shouldShowEmptyFramePlaceholder = isExperimentEnabled('confluence_native_tabs_m15');
|
|
242
|
+
const emptyFramePlaceholderText = React.useMemo(() => JSON.stringify(formatMessage(placeholderTextMessages.multiBodiedExtensionEmptyFramePlaceholderText)), [formatMessage]);
|
|
223
243
|
const childrenContainer = React.useMemo(() => {
|
|
224
244
|
return jsx(MultiBodiedExtensionFrames, {
|
|
245
|
+
activeChildIndex: activeChildIndex,
|
|
225
246
|
articleRef: articleRef,
|
|
226
|
-
|
|
247
|
+
emptyFramePlaceholderText: emptyFramePlaceholderText,
|
|
248
|
+
shouldShowEmptyFramePlaceholder: shouldShowEmptyFramePlaceholder,
|
|
249
|
+
showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
|
|
227
250
|
});
|
|
228
|
-
}, [articleRef,
|
|
251
|
+
}, [activeChildIndex, articleRef, emptyFramePlaceholderText, shouldShowEmptyFramePlaceholder, showMacroInteractionDesignUpdates]);
|
|
229
252
|
const actions = useMultiBodiedExtensionActions({
|
|
230
253
|
updateActiveChild,
|
|
231
254
|
editorView,
|
|
@@ -259,8 +282,6 @@ const MultiBodiedExtensionWithWidth = ({
|
|
|
259
282
|
mbeWrapperStyles = breakoutStyles;
|
|
260
283
|
}
|
|
261
284
|
const shouldUseUpdatedChrome = expValEquals('confluence_native_tabs_experiment', 'isEnabled', true);
|
|
262
|
-
const shouldShowEmptyFramePlaceholder = isExperimentEnabled('confluence_native_tabs_m15');
|
|
263
|
-
const emptyFramePlaceholderText = React.useMemo(() => JSON.stringify(formatMessage(placeholderTextMessages.multiBodiedExtensionEmptyFramePlaceholderText)), [formatMessage]);
|
|
264
285
|
const isSelectionInsideMultiBodiedExtension = useIsSelectionInsideNode(editorView, node, getPos, shouldUseUpdatedChrome && !isLivePageViewMode);
|
|
265
286
|
const isMultiBodiedExtensionActive = isNodeSelected || isSelectionInsideMultiBodiedExtension;
|
|
266
287
|
const shouldShowChromeOnInteraction = isNodeHovered || isMultiBodiedExtensionActive;
|
|
@@ -332,7 +353,7 @@ const MultiBodiedExtensionWithWidth = ({
|
|
|
332
353
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
333
354
|
className: containerClassNames,
|
|
334
355
|
css: [/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
|
|
335
|
-
getContainerCssExtendedStyles(activeChildIndex,
|
|
356
|
+
getContainerCssExtendedStyles(activeChildIndex, showMacroInteractionDesignUpdates)
|
|
336
357
|
/* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */],
|
|
337
358
|
"data-testid": "multiBodiedExtension--container",
|
|
338
359
|
"data-multiBodiedExtension-container": true,
|
|
@@ -14,7 +14,7 @@ const NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
14
14
|
const RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
15
15
|
const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
16
16
|
const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
17
|
-
const packageVersion = "120.10.
|
|
17
|
+
const packageVersion = "120.10.3";
|
|
18
18
|
const sanitiseSentryEvents = (data, _hint) => {
|
|
19
19
|
// Remove URL as it has UGC
|
|
20
20
|
// Ignored via go/ees007
|
|
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
14
14
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
15
15
|
import Layer from '../Layer';
|
|
16
16
|
const packageName = "@atlaskit/editor-common";
|
|
17
|
-
const packageVersion = "120.10.
|
|
17
|
+
const packageVersion = "120.10.3";
|
|
18
18
|
const halfFocusRing = 1;
|
|
19
19
|
const dropOffset = '0, 8';
|
|
20
20
|
const fadeIn = keyframes({
|
|
@@ -30,8 +30,11 @@ import { ExtensionFloatingLabel } from '../Extension/Lozenge/ExtensionFloatingLa
|
|
|
30
30
|
import { shouldExtensionBreakout } from '../utils/should-extension-breakout';
|
|
31
31
|
import { useMultiBodiedExtensionActions } from './action-api';
|
|
32
32
|
import { mbeExtensionWrapperCSSStyles, mbeExtensionWrapperCSSStylesOld, overlayStyles, overlayStylesOld } from './styles';
|
|
33
|
-
var getContainerCssExtendedStyles = function getContainerCssExtendedStyles(activeChildIndex,
|
|
34
|
-
|
|
33
|
+
var getContainerCssExtendedStyles = function getContainerCssExtendedStyles(activeChildIndex, showMacroInteractionDesignUpdates) {
|
|
34
|
+
if (fg('platform_editor_nested_mbe_frames')) {
|
|
35
|
+
return sharedMultiBodiedExtensionStyles.mbeExtensionContainer;
|
|
36
|
+
}
|
|
37
|
+
var activeFrameSelector = ".multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ")");
|
|
35
38
|
|
|
36
39
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
37
40
|
return css(sharedMultiBodiedExtensionStyles.mbeExtensionContainer, _defineProperty({}, activeFrameSelector, css(
|
|
@@ -40,10 +43,21 @@ var getContainerCssExtendedStyles = function getContainerCssExtendedStyles(activ
|
|
|
40
43
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
41
44
|
showMacroInteractionDesignUpdates && removeMarginsAndBorder)));
|
|
42
45
|
};
|
|
46
|
+
var getFramesActiveFrameStyles = function getFramesActiveFrameStyles(activeChildIndex, showMacroInteractionDesignUpdates) {
|
|
47
|
+
if (!fg('platform_editor_nested_mbe_frames')) {
|
|
48
|
+
return undefined;
|
|
49
|
+
}
|
|
50
|
+
var activeFrameSelector = "& > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ")");
|
|
51
|
+
return css(_defineProperty({}, activeFrameSelector, css(
|
|
52
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values, @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
53
|
+
sharedMultiBodiedExtensionStyles.extensionFrameContent,
|
|
54
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
55
|
+
showMacroInteractionDesignUpdates && removeMarginsAndBorder)));
|
|
56
|
+
};
|
|
43
57
|
|
|
44
58
|
// Renders a visual placeholder when the active frame contains a single empty paragraph.
|
|
45
|
-
var getEmptyFramePlaceholderStyles = function getEmptyFramePlaceholderStyles(activeChildIndex,
|
|
46
|
-
var activeFramePlaceholderSelector =
|
|
59
|
+
var getEmptyFramePlaceholderStyles = function getEmptyFramePlaceholderStyles(activeChildIndex, placeholderText) {
|
|
60
|
+
var activeFramePlaceholderSelector = "& > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ") > p:only-child:has(> .ProseMirror-trailingBreak:only-child)::before");
|
|
47
61
|
return css(_defineProperty({}, activeFramePlaceholderSelector, {
|
|
48
62
|
color: "var(--ds-text-subtlest, #6B6E76)",
|
|
49
63
|
// JSON.stringify produces a quoted and escaped CSS string.
|
|
@@ -68,14 +82,19 @@ var hoverStylesOld = css({
|
|
|
68
82
|
}
|
|
69
83
|
});
|
|
70
84
|
var MultiBodiedExtensionFrames = function MultiBodiedExtensionFrames(_ref) {
|
|
71
|
-
var
|
|
72
|
-
|
|
85
|
+
var activeChildIndex = _ref.activeChildIndex,
|
|
86
|
+
articleRef = _ref.articleRef,
|
|
87
|
+
emptyFramePlaceholderText = _ref.emptyFramePlaceholderText,
|
|
88
|
+
shouldShowEmptyFramePlaceholder = _ref.shouldShowEmptyFramePlaceholder,
|
|
89
|
+
showMacroInteractionDesignUpdates = _ref.showMacroInteractionDesignUpdates;
|
|
73
90
|
return jsx("article", {
|
|
74
91
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
75
92
|
className: "multiBodiedExtension--frames",
|
|
93
|
+
css: [/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
|
|
94
|
+
getFramesActiveFrameStyles(activeChildIndex, showMacroInteractionDesignUpdates), shouldShowEmptyFramePlaceholder && getEmptyFramePlaceholderStyles(activeChildIndex, emptyFramePlaceholderText)
|
|
95
|
+
/* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */],
|
|
76
96
|
"data-testid": "multiBodiedExtension--frames",
|
|
77
97
|
"data-multibodiedextension-frames": true,
|
|
78
|
-
"data-multibodiedextension-frames-id": frameId,
|
|
79
98
|
ref: articleRef
|
|
80
99
|
});
|
|
81
100
|
};
|
|
@@ -205,10 +224,6 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
205
224
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
206
225
|
activeChildIndex = _useState4[0],
|
|
207
226
|
setActiveChildIndex = _useState4[1];
|
|
208
|
-
// Used by the gated active-frame styles to scope selection to this MBE instance.
|
|
209
|
-
// Editor frames sit under ProseMirror's contentDOM wrapper, so the id anchors the
|
|
210
|
-
// selector at the owning MBE before it reaches that wrapper and its direct frames.
|
|
211
|
-
var frameId = React.useId();
|
|
212
227
|
// Adding to avoid aliasing `this` for the callbacks
|
|
213
228
|
var updateActiveChild = React.useCallback(function (index) {
|
|
214
229
|
if (typeof index !== 'number') {
|
|
@@ -221,12 +236,19 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
221
236
|
var articleRef = React.useCallback(function (node) {
|
|
222
237
|
return handleContentDOMRef(node);
|
|
223
238
|
}, [handleContentDOMRef]);
|
|
239
|
+
var shouldShowEmptyFramePlaceholder = isExperimentEnabled('confluence_native_tabs_m15');
|
|
240
|
+
var emptyFramePlaceholderText = React.useMemo(function () {
|
|
241
|
+
return JSON.stringify(formatMessage(placeholderTextMessages.multiBodiedExtensionEmptyFramePlaceholderText));
|
|
242
|
+
}, [formatMessage]);
|
|
224
243
|
var childrenContainer = React.useMemo(function () {
|
|
225
244
|
return jsx(MultiBodiedExtensionFrames, {
|
|
245
|
+
activeChildIndex: activeChildIndex,
|
|
226
246
|
articleRef: articleRef,
|
|
227
|
-
|
|
247
|
+
emptyFramePlaceholderText: emptyFramePlaceholderText,
|
|
248
|
+
shouldShowEmptyFramePlaceholder: shouldShowEmptyFramePlaceholder,
|
|
249
|
+
showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
|
|
228
250
|
});
|
|
229
|
-
}, [articleRef,
|
|
251
|
+
}, [activeChildIndex, articleRef, emptyFramePlaceholderText, shouldShowEmptyFramePlaceholder, showMacroInteractionDesignUpdates]);
|
|
230
252
|
var actions = useMultiBodiedExtensionActions({
|
|
231
253
|
updateActiveChild: updateActiveChild,
|
|
232
254
|
editorView: editorView,
|
|
@@ -259,10 +281,6 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
259
281
|
mbeWrapperStyles = breakoutStyles;
|
|
260
282
|
}
|
|
261
283
|
var shouldUseUpdatedChrome = expValEquals('confluence_native_tabs_experiment', 'isEnabled', true);
|
|
262
|
-
var shouldShowEmptyFramePlaceholder = isExperimentEnabled('confluence_native_tabs_m15');
|
|
263
|
-
var emptyFramePlaceholderText = React.useMemo(function () {
|
|
264
|
-
return JSON.stringify(formatMessage(placeholderTextMessages.multiBodiedExtensionEmptyFramePlaceholderText));
|
|
265
|
-
}, [formatMessage]);
|
|
266
284
|
var isSelectionInsideMultiBodiedExtension = useIsSelectionInsideNode(editorView, node, getPos, shouldUseUpdatedChrome && !isLivePageViewMode);
|
|
267
285
|
var isMultiBodiedExtensionActive = isNodeSelected || isSelectionInsideMultiBodiedExtension;
|
|
268
286
|
var shouldShowChromeOnInteraction = isNodeHovered || isMultiBodiedExtensionActive;
|
|
@@ -338,7 +356,7 @@ var MultiBodiedExtensionWithWidth = function MultiBodiedExtensionWithWidth(_ref2
|
|
|
338
356
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
339
357
|
className: containerClassNames,
|
|
340
358
|
css: [/* eslint-disable @atlaskit/design-system/consistent-css-prop-usage -- Ignored via go/DSP-18766 */
|
|
341
|
-
getContainerCssExtendedStyles(activeChildIndex,
|
|
359
|
+
getContainerCssExtendedStyles(activeChildIndex, showMacroInteractionDesignUpdates)
|
|
342
360
|
/* eslint-enable @atlaskit/design-system/consistent-css-prop-usage */],
|
|
343
361
|
"data-testid": "multiBodiedExtension--container",
|
|
344
362
|
"data-multiBodiedExtension-container": true,
|
|
@@ -20,7 +20,7 @@ var NETWORK_FAILURE_REGEX = /^network failure/i;
|
|
|
20
20
|
var RESIZE_OBSERVER_LOOP_REGEX = /ResizeObserver loop completed with undelivered notifications/;
|
|
21
21
|
var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
|
|
22
22
|
var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
|
|
23
|
-
var packageVersion = "120.10.
|
|
23
|
+
var packageVersion = "120.10.3";
|
|
24
24
|
var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
|
|
25
25
|
// Remove URL as it has UGC
|
|
26
26
|
// Ignored via go/ees007
|
|
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
|
|
|
21
21
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
22
22
|
import Layer from '../Layer';
|
|
23
23
|
var packageName = "@atlaskit/editor-common";
|
|
24
|
-
var packageVersion = "120.10.
|
|
24
|
+
var packageVersion = "120.10.3";
|
|
25
25
|
var halfFocusRing = 1;
|
|
26
26
|
var dropOffset = '0, 8';
|
|
27
27
|
var fadeIn = keyframes({
|
package/package.json
CHANGED