@atlaskit/editor-common 119.2.1 → 119.4.0

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,79 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 119.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`710e3d9ec4c65`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/710e3d9ec4c65) -
8
+ Allow a table nested inside a panel, but only at the document root, inside a synced block, or
9
+ inside a layout column (the `panel_c1` variant).
10
+
11
+ `panel_c1` is now marked `stage0` and emitted as a standalone JSON Schema definition (via
12
+ `noExtend`), so table-in-panel validates in the stage-0 schema at those positions only — a plain
13
+ `panel` elsewhere still rejects a table.
14
+
15
+ The runtime `@atlaskit/adf-utils` validator can now accept table-in-panel via the `panel_c1` spec
16
+ directly, gated behind the `platform_editor_table_in_panel_patch_1` feature gate. Three validator
17
+ fixes make this work (all gated — when the gate is off, the validator behaves exactly as before):
18
+ 1. A variant tuple's overridden content-item names are resolved to their base specs the same way
19
+ base-spec content is (e.g. `paragraph_with_no_marks` → `paragraph`). Previously they stayed
20
+ raw, so `panel_c1` matched only plainly-named children (`table`) and rejected variant-named
21
+ ones (a normal `paragraph`).
22
+ 2. `createSpec` retains a variant whose overridden content is a nested `$or` list (e.g.
23
+ `panel_c1`) when the validator is built from an explicit node list (as `validateADFEntity`
24
+ does).
25
+ 3. When a stored node matches several candidate specs, the multi-branch matcher prefers a branch
26
+ that validates cleanly over one that only "succeeds" by wrapping otherwise-valid content as
27
+ `unsupportedBlock` — so `panel_c1` is chosen instead of the base `panel` repairing the table
28
+ away.
29
+
30
+ The `allowTableInPanel` override in `@atlaskit/editor-common` is retained but gated by the same
31
+ feature gate: when `platform_editor_table_in_panel_patch_1` is on the override is skipped (the
32
+ validator fixes handle table-in-panel); when it is off the override runs as before. So the single
33
+ gate flips between the new validator behaviour (on) and the previous override behaviour (off).
34
+
35
+ Also adds `panel-with-nested-table` validation fixtures.
36
+
37
+ **BREAKING (`@atlaskit/adf-schema`):** marking `panel_c1` as `stage0` (correcting an earlier
38
+ omission) renames its generated `schema-next` exports: `panelC1` → `panelC1Stage0`, `PanelC1Node`
39
+ → `PanelC1Stage0Node`, `PanelC1Definition` → `PanelC1Stage0Definition`.
40
+
41
+ Migration — update imports from `@atlaskit/adf-schema/schema-next`:
42
+
43
+ ```ts
44
+ // Before
45
+ import {
46
+ panelC1,
47
+ type PanelC1Node,
48
+ type PanelC1Definition,
49
+ } from '@atlaskit/adf-schema/schema-next';
50
+
51
+ // After
52
+ import {
53
+ panelC1Stage0,
54
+ type PanelC1Stage0Node,
55
+ type PanelC1Stage0Definition,
56
+ } from '@atlaskit/adf-schema/schema-next';
57
+ ```
58
+
59
+ ### Patch Changes
60
+
61
+ - [`eec66a5b383e5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/eec66a5b383e5) -
62
+ Scope selection toolbar interactions and dropdown refocus behavior to their owning editor behind
63
+ the `platform_editor_toolbar_multi_editor_fix` experiment.
64
+ - [`07a24b62d9f86`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/07a24b62d9f86) -
65
+ Fix MBE empty frame placeholder styling to tolerate ProseMirror selection marker elements.
66
+ - Updated dependencies
67
+
68
+ ## 119.3.0
69
+
70
+ ### Minor Changes
71
+
72
+ - [`47b2ae576b031`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/47b2ae576b031) -
73
+ [ux] Under the `cc_maui_remix_button_hover_corridor` experiment, replace the Remix button's
74
+ rendered hover corridor and fixed right-margin exclusion with the existing click-wrapper hover
75
+ tracking. Hide block controls over the marked object sidebar container and its control surfaces.
76
+
3
77
  ## 119.2.1
4
78
 
5
79
  ### Patch Changes
@@ -0,0 +1,10 @@
1
+ {
2
+ "name": "@atlaskit/editor-common/block-controls-suppression",
3
+ "main": "../dist/cjs/block-controls-suppression.js",
4
+ "module": "../dist/esm/block-controls-suppression.js",
5
+ "module:es2019": "../dist/es2019/block-controls-suppression.js",
6
+ "sideEffects": [
7
+ "**/*.compiled.css"
8
+ ],
9
+ "types": "../dist/types/block-controls-suppression.d.ts"
10
+ }
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.isBlockControlsSuppressionTarget = exports.blockControlsSuppressionProps = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
+ var BLOCK_CONTROLS_SUPPRESSION_ATTRIBUTE = 'data-block-controls-suppression';
10
+ var BLOCK_CONTROLS_SUPPRESSION_SELECTOR = "[".concat(BLOCK_CONTROLS_SUPPRESSION_ATTRIBUTE, "]");
11
+
12
+ /**
13
+ * Marks external control surfaces where editor or renderer block controls must be hidden. This
14
+ * prevents controls such as Remix and comment buttons from appearing underneath Rovo or the object
15
+ * sidebar while those controls are being used.
16
+ */
17
+ var blockControlsSuppressionProps = exports.blockControlsSuppressionProps = (0, _defineProperty2.default)({}, BLOCK_CONTROLS_SUPPRESSION_ATTRIBUTE, 'true');
18
+ var isBlockControlsSuppressionTarget = exports.isBlockControlsSuppressionTarget = function isBlockControlsSuppressionTarget(target) {
19
+ return target instanceof Element && target.closest(BLOCK_CONTROLS_SUPPRESSION_SELECTOR) !== null;
20
+ };
@@ -53,7 +53,7 @@ var getContainerCssExtendedStyles = function getContainerCssExtendedStyles(activ
53
53
  var getEmptyFramePlaceholderStyles = function getEmptyFramePlaceholderStyles(activeChildIndex, placeholderText) {
54
54
  return (0, _react2.css)((0, _defineProperty2.default)({}, "& .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1
55
55
  // 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
56
- , ") > p:only-child:has(.ProseMirror-trailingBreak:only-child)::before"), {
56
+ , ") > p:only-child:has(> .ProseMirror-trailingBreak):not(:has(> :not(.ProseMirror-widget):not(.ProseMirror-separator):not(.ProseMirror-trailingBreak)))::before"), {
57
57
  color: "var(--ds-text-subtlest, #6B6E76)",
58
58
  // JSON.stringify produces a quoted and escaped CSS string.
59
59
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
@@ -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 = "119.2.0";
31
+ var packageVersion = "119.3.0";
32
32
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
33
33
  // Remove URL as it has UGC
34
34
  // Ignored via go/ees007
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.EditorToolbarUIProvider = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  var _editorToolbar = require("@atlaskit/editor-toolbar");
10
+ var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
10
11
  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); }
11
12
  var EditorToolbarUIProvider = exports.EditorToolbarUIProvider = function EditorToolbarUIProvider(_ref) {
12
13
  var children = _ref.children,
@@ -26,6 +27,9 @@ var EditorToolbarUIProvider = exports.EditorToolbarUIProvider = function EditorT
26
27
  // When closed via keyboard Escape, keep focus on the trigger for better keyboard UX.
27
28
  var isKeyboardEscape = event instanceof KeyboardEvent && event.key === 'Escape';
28
29
  var shouldFocusEditor = !isKeyboardEscape;
30
+ if ((0, _isExperimentEnabled.isExperimentEnabled)('platform_editor_toolbar_multi_editor_fix') && event instanceof MouseEvent && event.target instanceof Element && !event.target.closest('[role="menu"]')) {
31
+ return;
32
+ }
29
33
  if (shouldFocusEditor) {
30
34
  // On Dropdown closed, focus is returned to trigger button by default in requestAnimationFrame
31
35
  // Hence, `.focus()` should also be called in requestAnimationFrame
@@ -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 = "119.2.0";
27
+ var packageVersion = "119.3.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -13,6 +13,7 @@ Object.defineProperty(exports, "wrapWithUnsupported", {
13
13
  });
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
15
15
  var _validator = require("@atlaskit/adf-utils/validator");
16
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
16
17
  var _analytics = require("../analytics");
17
18
  var _trackUnsupportedContent = require("./track-unsupported-content");
18
19
  var _wrapWithUnsupported = require("./wrapWithUnsupported");
@@ -94,9 +95,11 @@ var validationErrorHandler = exports.validationErrorHandler = function validatio
94
95
 
95
96
  // panel_c1 is a ProseMirror-only variant: on save, table-in-panel documents are stored as
96
97
  // plain ADF `panel` nodes containing a `table`. The base validator-spec does not permit
97
- // `table` inside `panel` (it's gated behind the experiment), so we suppress the
98
- // INVALID_CONTENT error when the experiment is active.
99
- if (options.allowTableInPanel) {
98
+ // `table` inside `panel`, so suppress the INVALID_CONTENT error when the experiment is active.
99
+ // Only while platform_editor_table_in_panel_patch_1 is OFF: with the patch on, the adf-utils
100
+ // validator accepts table-in-panel positionally (doc / layout column / synced block only), and
101
+ // this blunt suppression would wrongly allow it in every panel.
102
+ if (options.allowTableInPanel && !(0, _fg.fg)('platform_editor_table_in_panel_patch_1')) {
100
103
  var _meta = error.meta;
101
104
  if ((_meta === null || _meta === void 0 ? void 0 : _meta.parentType) === 'panel' && error.code === 'INVALID_CONTENT' && entity.type === 'table') {
102
105
  return entity;
@@ -0,0 +1,12 @@
1
+ const BLOCK_CONTROLS_SUPPRESSION_ATTRIBUTE = 'data-block-controls-suppression';
2
+ const BLOCK_CONTROLS_SUPPRESSION_SELECTOR = `[${BLOCK_CONTROLS_SUPPRESSION_ATTRIBUTE}]`;
3
+
4
+ /**
5
+ * Marks external control surfaces where editor or renderer block controls must be hidden. This
6
+ * prevents controls such as Remix and comment buttons from appearing underneath Rovo or the object
7
+ * sidebar while those controls are being used.
8
+ */
9
+ export const blockControlsSuppressionProps = {
10
+ [BLOCK_CONTROLS_SUPPRESSION_ATTRIBUTE]: 'true'
11
+ };
12
+ export const isBlockControlsSuppressionTarget = target => target instanceof Element && target.closest(BLOCK_CONTROLS_SUPPRESSION_SELECTOR) !== null;
@@ -42,7 +42,7 @@ const getEmptyFramePlaceholderStyles = (activeChildIndex, placeholderText) => cs
42
42
  // 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
43
43
  [`& .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(${activeChildIndex + 1
44
44
  // 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
45
- }) > p:only-child:has(.ProseMirror-trailingBreak:only-child)::before`]: {
45
+ }) > p:only-child:has(> .ProseMirror-trailingBreak):not(:has(> :not(.ProseMirror-widget):not(.ProseMirror-separator):not(.ProseMirror-trailingBreak)))::before`]: {
46
46
  color: "var(--ds-text-subtlest, #6B6E76)",
47
47
  // JSON.stringify produces a quoted and escaped CSS string.
48
48
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
@@ -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 = "119.2.0";
17
+ const packageVersion = "119.3.0";
18
18
  const sanitiseSentryEvents = (data, _hint) => {
19
19
  // Remove URL as it has UGC
20
20
  // Ignored via go/ees007
@@ -1,5 +1,6 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { ToolbarUIProvider } from '@atlaskit/editor-toolbar';
3
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
3
4
  export const EditorToolbarUIProvider = ({
4
5
  children,
5
6
  api,
@@ -20,6 +21,9 @@ export const EditorToolbarUIProvider = ({
20
21
  // When closed via keyboard Escape, keep focus on the trigger for better keyboard UX.
21
22
  const isKeyboardEscape = event instanceof KeyboardEvent && event.key === 'Escape';
22
23
  const shouldFocusEditor = !isKeyboardEscape;
24
+ if (isExperimentEnabled('platform_editor_toolbar_multi_editor_fix') && event instanceof MouseEvent && event.target instanceof Element && !event.target.closest('[role="menu"]')) {
25
+ return;
26
+ }
23
27
  if (shouldFocusEditor) {
24
28
  // On Dropdown closed, focus is returned to trigger button by default in requestAnimationFrame
25
29
  // Hence, `.focus()` should also be called in requestAnimationFrame
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "119.2.0";
17
+ const packageVersion = "119.3.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -1,4 +1,5 @@
1
1
  import { validator } from '@atlaskit/adf-utils/validator';
2
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
2
3
  import { ACTION_SUBJECT_ID } from '../analytics';
3
4
  export const UNSUPPORTED_NODE_ATTRIBUTE = 'unsupportedNodeAttribute';
4
5
  import { fireUnsupportedEvent } from './track-unsupported-content';
@@ -79,9 +80,11 @@ export const validationErrorHandler = (entity, error, options, marks, validate,
79
80
 
80
81
  // panel_c1 is a ProseMirror-only variant: on save, table-in-panel documents are stored as
81
82
  // plain ADF `panel` nodes containing a `table`. The base validator-spec does not permit
82
- // `table` inside `panel` (it's gated behind the experiment), so we suppress the
83
- // INVALID_CONTENT error when the experiment is active.
84
- if (options.allowTableInPanel) {
83
+ // `table` inside `panel`, so suppress the INVALID_CONTENT error when the experiment is active.
84
+ // Only while platform_editor_table_in_panel_patch_1 is OFF: with the patch on, the adf-utils
85
+ // validator accepts table-in-panel positionally (doc / layout column / synced block only), and
86
+ // this blunt suppression would wrongly allow it in every panel.
87
+ if (options.allowTableInPanel && !fg('platform_editor_table_in_panel_patch_1')) {
85
88
  const meta = error.meta;
86
89
  if ((meta === null || meta === void 0 ? void 0 : meta.parentType) === 'panel' && error.code === 'INVALID_CONTENT' && entity.type === 'table') {
87
90
  return entity;
@@ -0,0 +1,13 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
+ var BLOCK_CONTROLS_SUPPRESSION_ATTRIBUTE = 'data-block-controls-suppression';
3
+ var BLOCK_CONTROLS_SUPPRESSION_SELECTOR = "[".concat(BLOCK_CONTROLS_SUPPRESSION_ATTRIBUTE, "]");
4
+
5
+ /**
6
+ * Marks external control surfaces where editor or renderer block controls must be hidden. This
7
+ * prevents controls such as Remix and comment buttons from appearing underneath Rovo or the object
8
+ * sidebar while those controls are being used.
9
+ */
10
+ export var blockControlsSuppressionProps = _defineProperty({}, BLOCK_CONTROLS_SUPPRESSION_ATTRIBUTE, 'true');
11
+ export var isBlockControlsSuppressionTarget = function isBlockControlsSuppressionTarget(target) {
12
+ return target instanceof Element && target.closest(BLOCK_CONTROLS_SUPPRESSION_SELECTOR) !== null;
13
+ };
@@ -46,7 +46,7 @@ var getContainerCssExtendedStyles = function getContainerCssExtendedStyles(activ
46
46
  var getEmptyFramePlaceholderStyles = function getEmptyFramePlaceholderStyles(activeChildIndex, placeholderText) {
47
47
  return css(_defineProperty({}, "& .multiBodiedExtension-content-dom-wrapper > [data-extension-frame='true']:nth-of-type(".concat(activeChildIndex + 1
48
48
  // 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
49
- , ") > p:only-child:has(.ProseMirror-trailingBreak:only-child)::before"), {
49
+ , ") > p:only-child:has(> .ProseMirror-trailingBreak):not(:has(> :not(.ProseMirror-widget):not(.ProseMirror-separator):not(.ProseMirror-trailingBreak)))::before"), {
50
50
  color: "var(--ds-text-subtlest, #6B6E76)",
51
51
  // JSON.stringify produces a quoted and escaped CSS string.
52
52
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
@@ -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 = "119.2.0";
23
+ var packageVersion = "119.3.0";
24
24
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
25
25
  // Remove URL as it has UGC
26
26
  // Ignored via go/ees007
@@ -1,5 +1,6 @@
1
1
  import React, { useCallback } from 'react';
2
2
  import { ToolbarUIProvider } from '@atlaskit/editor-toolbar';
3
+ import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
3
4
  export var EditorToolbarUIProvider = function EditorToolbarUIProvider(_ref) {
4
5
  var children = _ref.children,
5
6
  api = _ref.api,
@@ -18,6 +19,9 @@ export var EditorToolbarUIProvider = function EditorToolbarUIProvider(_ref) {
18
19
  // When closed via keyboard Escape, keep focus on the trigger for better keyboard UX.
19
20
  var isKeyboardEscape = event instanceof KeyboardEvent && event.key === 'Escape';
20
21
  var shouldFocusEditor = !isKeyboardEscape;
22
+ if (isExperimentEnabled('platform_editor_toolbar_multi_editor_fix') && event instanceof MouseEvent && event.target instanceof Element && !event.target.closest('[role="menu"]')) {
23
+ return;
24
+ }
21
25
  if (shouldFocusEditor) {
22
26
  // On Dropdown closed, focus is returned to trigger button by default in requestAnimationFrame
23
27
  // Hence, `.focus()` should also be called in requestAnimationFrame
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "119.2.0";
24
+ var packageVersion = "119.3.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -2,6 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
4
  import { validator } from '@atlaskit/adf-utils/validator';
5
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
5
6
  import { ACTION_SUBJECT_ID } from '../analytics';
6
7
  export var UNSUPPORTED_NODE_ATTRIBUTE = 'unsupportedNodeAttribute';
7
8
  import { fireUnsupportedEvent } from './track-unsupported-content';
@@ -81,9 +82,11 @@ export var validationErrorHandler = function validationErrorHandler(entity, erro
81
82
 
82
83
  // panel_c1 is a ProseMirror-only variant: on save, table-in-panel documents are stored as
83
84
  // plain ADF `panel` nodes containing a `table`. The base validator-spec does not permit
84
- // `table` inside `panel` (it's gated behind the experiment), so we suppress the
85
- // INVALID_CONTENT error when the experiment is active.
86
- if (options.allowTableInPanel) {
85
+ // `table` inside `panel`, so suppress the INVALID_CONTENT error when the experiment is active.
86
+ // Only while platform_editor_table_in_panel_patch_1 is OFF: with the patch on, the adf-utils
87
+ // validator accepts table-in-panel positionally (doc / layout column / synced block only), and
88
+ // this blunt suppression would wrongly allow it in every panel.
89
+ if (options.allowTableInPanel && !fg('platform_editor_table_in_panel_patch_1')) {
87
90
  var _meta = error.meta;
88
91
  if ((_meta === null || _meta === void 0 ? void 0 : _meta.parentType) === 'panel' && error.code === 'INVALID_CONTENT' && entity.type === 'table') {
89
92
  return entity;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Marks external control surfaces where editor or renderer block controls must be hidden. This
3
+ * prevents controls such as Remix and comment buttons from appearing underneath Rovo or the object
4
+ * sidebar while those controls are being used.
5
+ */
6
+ export declare const blockControlsSuppressionProps: {
7
+ readonly 'data-block-controls-suppression': 'true';
8
+ };
9
+ export declare const isBlockControlsSuppressionTarget: (target: EventTarget | null) => boolean;
@@ -11,8 +11,8 @@ export declare const validationErrorHandler: (entity: ADFEntity, error: Validati
11
11
  type: string;
12
12
  } | undefined;
13
13
  export declare const validateADFEntity: (schema: Schema, node: ADFEntity, dispatchAnalyticsEvent?: DispatchAnalyticsEvent, validationOverrides?: {
14
+ allowExpandInPanel?: boolean;
14
15
  allowNestedTables?: boolean;
15
16
  allowTableInPanel?: boolean;
16
- allowExpandInPanel?: boolean;
17
17
  }) => ADFEntity;
18
18
  export { wrapWithUnsupported } from './wrapWithUnsupported';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "119.2.1",
3
+ "version": "119.4.0",
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/"
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@atlaskit/activity-provider": "^3.0.0",
32
- "@atlaskit/adf-schema": "^56.7.0",
33
- "@atlaskit/adf-utils": "^20.5.0",
32
+ "@atlaskit/adf-schema": "^57.0.0",
33
+ "@atlaskit/adf-utils": "^20.6.0",
34
34
  "@atlaskit/afm-i18n-platform-editor-editor-common": "2.200.0",
35
35
  "@atlaskit/analytics-listeners": "^11.1.0",
36
36
  "@atlaskit/analytics-namespaced-context": "^8.1.0",
@@ -42,7 +42,7 @@
42
42
  "@atlaskit/css": "^1.0.0",
43
43
  "@atlaskit/custom-steps": "^1.0.0",
44
44
  "@atlaskit/dropdown-menu": "^18.0.0",
45
- "@atlaskit/editor-json-transformer": "^9.3.0",
45
+ "@atlaskit/editor-json-transformer": "^9.4.0",
46
46
  "@atlaskit/editor-palette": "^3.4.0",
47
47
  "@atlaskit/editor-prosemirror": "^8.0.0",
48
48
  "@atlaskit/editor-shared-styles": "^4.0.0",
@@ -168,6 +168,10 @@
168
168
  "platform_editor_use_new_experiments_api": {
169
169
  "type": "boolean"
170
170
  },
171
+ "platform_editor_table_in_panel_patch_1": {
172
+ "type": "boolean",
173
+ "referenceOnly": true
174
+ },
171
175
  "platform-dst-popper-consolidation": {
172
176
  "type": "boolean",
173
177
  "referenceOnly": true