@atlaskit/editor-common 120.10.2 → 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 CHANGED
@@ -1,5 +1,21 @@
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
+
11
+ ## 120.10.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [`9b0887c8cbac4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9b0887c8cbac4) -
16
+ Clean up feature gate `platform_editor_fix_media_in_renderer`
17
+ - Updated dependencies
18
+
3
19
  ## 120.10.2
4
20
 
5
21
  ### 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, frameId, showMacroInteractionDesignUpdates) {
41
- var activeFrameSelector = (0, _fg.fg)('platform_editor_nested_mbe_frames') ? "[data-multibodiedextension-frames-id='".concat(frameId, "'] > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(").concat(activeChildIndex + 1, ")") : ".multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ")");
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, frameId, placeholderText) {
53
- var activeFramePlaceholderSelector = (0, _fg.fg)('platform_editor_nested_mbe_frames') ? "& [data-multibodiedextension-frames-id='".concat(frameId, "'] > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(").concat(activeChildIndex + 1, ") > p:only-child:has(> .ProseMirror-trailingBreak:only-child)::before") : "& .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ") > p:only-child:has(> .ProseMirror-trailingBreak:only-child)::before");
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 articleRef = _ref.articleRef,
79
- frameId = _ref.frameId;
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
- frameId: frameId
254
+ emptyFramePlaceholderText: emptyFramePlaceholderText,
255
+ shouldShowEmptyFramePlaceholder: shouldShowEmptyFramePlaceholder,
256
+ showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
235
257
  });
236
- }, [articleRef, frameId]);
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, frameId, showMacroInteractionDesignUpdates), shouldShowEmptyFramePlaceholder && getEmptyFramePlaceholderStyles(activeChildIndex, frameId, emptyFramePlaceholderText)
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.1";
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.1";
27
+ var packageVersion = "120.10.3";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -147,11 +147,8 @@ function MediaSingle(_ref) {
147
147
  isInsideOfInlineExtension: isInsideOfInlineExtension,
148
148
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
149
149
  isInRenderer: isInRenderer && (0, _fg.fg)('media-perf-uplift-mutation-fix')
150
- })
151
- // eslint-disable-next-line react/jsx-props-no-spreading, @atlaskit/platform/no-preconditioning
152
- }, !(0, _fg.fg)('platform_editor_fix_media_in_renderer') ? {} : {
153
- 'data-layout': layout
154
- }, {
150
+ }),
151
+ "data-layout": layout,
155
152
  "data-width": mediaSingleWidth,
156
153
  "data-width-type": (size === null || size === void 0 ? void 0 : size.widthType) || 'percentage',
157
154
  "data-node-type": nodeType,
@@ -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, frameId, showMacroInteractionDesignUpdates) => {
29
- const activeFrameSelector = fg('platform_editor_nested_mbe_frames') ? `[data-multibodiedextension-frames-id='${frameId}'] > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1})` : `.multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1})`;
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, frameId, placeholderText) => {
44
- const activeFramePlaceholderSelector = fg('platform_editor_nested_mbe_frames') ? `& [data-multibodiedextension-frames-id='${frameId}'] > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1}) > p:only-child:has(> .ProseMirror-trailingBreak:only-child)::before` : `& .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1}) > p:only-child:has(> .ProseMirror-trailingBreak:only-child)::before`;
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
- frameId
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
- frameId: frameId
247
+ emptyFramePlaceholderText: emptyFramePlaceholderText,
248
+ shouldShowEmptyFramePlaceholder: shouldShowEmptyFramePlaceholder,
249
+ showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
227
250
  });
228
- }, [articleRef, frameId]);
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, frameId, showMacroInteractionDesignUpdates), shouldShowEmptyFramePlaceholder && getEmptyFramePlaceholderStyles(activeChildIndex, frameId, emptyFramePlaceholderText)
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.1";
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.1";
17
+ const packageVersion = "120.10.3";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -131,11 +131,8 @@ export default function MediaSingle({
131
131
  isInsideOfInlineExtension,
132
132
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
133
133
  isInRenderer: isInRenderer && fg('media-perf-uplift-mutation-fix')
134
- })
135
- // eslint-disable-next-line react/jsx-props-no-spreading, @atlaskit/platform/no-preconditioning
136
- }, !fg('platform_editor_fix_media_in_renderer') ? {} : {
137
- 'data-layout': layout
138
- }, {
134
+ }),
135
+ "data-layout": layout,
139
136
  "data-width": mediaSingleWidth,
140
137
  "data-width-type": (size === null || size === void 0 ? void 0 : size.widthType) || 'percentage',
141
138
  "data-node-type": nodeType,
@@ -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, frameId, showMacroInteractionDesignUpdates) {
34
- var activeFrameSelector = fg('platform_editor_nested_mbe_frames') ? "[data-multibodiedextension-frames-id='".concat(frameId, "'] > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(").concat(activeChildIndex + 1, ")") : ".multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ")");
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, frameId, placeholderText) {
46
- var activeFramePlaceholderSelector = fg('platform_editor_nested_mbe_frames') ? "& [data-multibodiedextension-frames-id='".concat(frameId, "'] > .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(").concat(activeChildIndex + 1, ") > p:only-child:has(> .ProseMirror-trailingBreak:only-child)::before") : "& .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1, ") > p:only-child:has(> .ProseMirror-trailingBreak:only-child)::before");
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 articleRef = _ref.articleRef,
72
- frameId = _ref.frameId;
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
- frameId: frameId
247
+ emptyFramePlaceholderText: emptyFramePlaceholderText,
248
+ shouldShowEmptyFramePlaceholder: shouldShowEmptyFramePlaceholder,
249
+ showMacroInteractionDesignUpdates: showMacroInteractionDesignUpdates
228
250
  });
229
- }, [articleRef, frameId]);
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, frameId, showMacroInteractionDesignUpdates), shouldShowEmptyFramePlaceholder && getEmptyFramePlaceholderStyles(activeChildIndex, frameId, emptyFramePlaceholderText)
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.1";
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.1";
24
+ var packageVersion = "120.10.3";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -139,11 +139,8 @@ export default function MediaSingle(_ref) {
139
139
  isInsideOfInlineExtension: isInsideOfInlineExtension,
140
140
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values
141
141
  isInRenderer: isInRenderer && fg('media-perf-uplift-mutation-fix')
142
- })
143
- // eslint-disable-next-line react/jsx-props-no-spreading, @atlaskit/platform/no-preconditioning
144
- }, !fg('platform_editor_fix_media_in_renderer') ? {} : {
145
- 'data-layout': layout
146
- }, {
142
+ }),
143
+ "data-layout": layout,
147
144
  "data-width": mediaSingleWidth,
148
145
  "data-width-type": (size === null || size === void 0 ? void 0 : size.widthType) || 'percentage',
149
146
  "data-node-type": nodeType,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "120.10.2",
3
+ "version": "120.10.4",
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/"
@@ -84,7 +84,7 @@
84
84
  "@atlaskit/task-decision": "^21.9.0",
85
85
  "@atlaskit/teams-app-config": "^3.0.0",
86
86
  "@atlaskit/textfield": "^10.2.0",
87
- "@atlaskit/tmp-editor-statsig": "^170.0.0",
87
+ "@atlaskit/tmp-editor-statsig": "^171.0.0",
88
88
  "@atlaskit/tokens": "^16.11.0",
89
89
  "@atlaskit/tooltip": "^24.3.0",
90
90
  "@atlaskit/width-detector": "^7.2.0",
@@ -220,9 +220,6 @@
220
220
  "confluence_connect_macro_preset_height": {
221
221
  "type": "boolean"
222
222
  },
223
- "platform_editor_fix_media_in_renderer": {
224
- "type": "boolean"
225
- },
226
223
  "cc_comments_log_draft_annotation_ancestor_nodes": {
227
224
  "type": "boolean"
228
225
  },