@atlaskit/editor-plugin-table 15.3.2 → 15.3.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,20 @@
1
1
  # @atlaskit/editor-plugin-table
2
2
 
3
+ ## 15.3.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`135fb050129cb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/135fb050129cb) -
8
+ [ux] [ED-25852] Fixes table menus rendering outside their container in Jira
9
+
10
+ ## 15.3.3
11
+
12
+ ### Patch Changes
13
+
14
+ - [`21fe79119fe74`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/21fe79119fe74) -
15
+ EDITOR-2447 Bump adf-schema to 51.3.2
16
+ - Updated dependencies
17
+
3
18
  ## 15.3.2
4
19
 
5
20
  ### Patch Changes
@@ -38,6 +38,7 @@ var _tableRowAddBelow = _interopRequireDefault(require("@atlaskit/icon/core/tabl
38
38
  var _tableRowDelete = _interopRequireDefault(require("@atlaskit/icon/core/table-row-delete"));
39
39
  var _crossCircle = _interopRequireDefault(require("@atlaskit/icon/glyph/cross-circle"));
40
40
  var _remove = _interopRequireDefault(require("@atlaskit/icon/glyph/editor/remove"));
41
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
41
42
  var _primitives = require("@atlaskit/primitives");
42
43
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
43
44
  var _commands = require("../../pm-plugins/commands");
@@ -88,13 +89,44 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
88
89
  // Ignored via go/ees005
89
90
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
90
91
  _this.props.editorView.dom, '.fabric-editor-popup-scroll-parent');
92
+ if (!parent && (0, _platformFeatureFlags.fg)('platform_editor_fix_table_menus_jira')) {
93
+ parent = (0, _utils.closestElement)(
94
+ // Ignored via go/ees005
95
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
96
+ _this.props.editorView.dom, '.ak-editor-content-area');
97
+ }
91
98
  if (!(parent && ref)) {
92
99
  return;
93
100
  }
94
101
  var boundariesRect = parent.getBoundingClientRect();
95
102
  var rect = ref.getBoundingClientRect();
96
- if (rect.left + rect.width > boundariesRect.width) {
97
- ref.style.left = "-".concat(rect.width, "px");
103
+ if ((0, _platformFeatureFlags.fg)('platform_editor_fix_table_menus_jira')) {
104
+ if (!!_this.props.mountPoint) {
105
+ return;
106
+ }
107
+ var offsetParent = ref === null || ref === void 0 ? void 0 : ref.offsetParent;
108
+ if (!offsetParent) {
109
+ return;
110
+ }
111
+ var offsetParentRect = offsetParent.getBoundingClientRect();
112
+ var rightOverflow = offsetParentRect.right + rect.width - boundariesRect.right;
113
+ var leftOverflow = boundariesRect.left - (offsetParentRect.left - rect.width);
114
+ if (rightOverflow > leftOverflow) {
115
+ ref.style.left = "-".concat(rect.width, "px");
116
+ }
117
+
118
+ // if it overflows regardless of side, let it overlap with the parent menu
119
+ if (leftOverflow > 0 && rightOverflow > 0) {
120
+ if (rightOverflow < leftOverflow) {
121
+ ref.style.left = "".concat(offsetParentRect.width - rightOverflow, "px");
122
+ } else {
123
+ ref.style.left = "-".concat(rect.width - leftOverflow, "px");
124
+ }
125
+ }
126
+ } else {
127
+ if (rect.left + rect.width > boundariesRect.width) {
128
+ ref.style.left = "-".concat(rect.width, "px");
129
+ }
98
130
  }
99
131
  });
100
132
  (0, _defineProperty2.default)(_this, "createBackgroundColorItem", function () {
@@ -738,7 +770,7 @@ var ContextualMenu = exports.ContextualMenu = /*#__PURE__*/function (_Component)
738
770
  onMouseLeave: this.closeSubmenu,
739
771
  ref: this.dropdownMenuRef
740
772
  }, (0, _react2.jsx)(_uiMenu.DropdownMenu, {
741
- mountTo: mountPoint
773
+ mountTo: (0, _platformFeatureFlags.fg)('platform_editor_fix_table_menus_jira') ? undefined : mountPoint
742
774
  //This needs be removed when the a11y is completely handled
743
775
  //Disabling key navigation now as it works only partially
744
776
  ,
@@ -10,6 +10,7 @@ var _ui = require("@atlaskit/editor-common/ui");
10
10
  var _utils = require("@atlaskit/editor-prosemirror/utils");
11
11
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
12
12
  var _utils2 = require("@atlaskit/editor-tables/utils");
13
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
14
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
14
15
  var _pluginFactory = require("../../pm-plugins/plugin-factory");
15
16
  var _consts = require("../consts");
@@ -110,6 +111,7 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
110
111
  ,
111
112
  allowBackgroundColor: pluginConfig.allowBackgroundColor,
112
113
  selectionRect: selectionRect,
114
+ mountPoint: (0, _platformFeatureFlags.fg)('platform_editor_fix_table_menus_jira') ? mountPoint : undefined,
113
115
  boundariesElement: boundariesElement,
114
116
  editorAnalyticsAPI: editorAnalyticsAPI,
115
117
  getEditorContainerWidth: getEditorContainerWidth,
@@ -23,6 +23,7 @@ var _shortcut = require("@atlaskit/editor-shared-styles/shortcut");
23
23
  var _tableMap = require("@atlaskit/editor-tables/table-map");
24
24
  var _utils2 = require("@atlaskit/editor-tables/utils");
25
25
  var _paintBucketEditorBackgroundColor = _interopRequireDefault(require("@atlaskit/icon/core/migration/paint-bucket--editor-background-color"));
26
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
26
27
  var _primitives = require("@atlaskit/primitives");
27
28
  var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
28
29
  var _toggle = _interopRequireDefault(require("@atlaskit/toggle"));
@@ -244,13 +245,44 @@ var DragMenu = /*#__PURE__*/_react.default.memo(function (_ref) {
244
245
  // Ignored via go/ees005
245
246
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
246
247
  editorView.dom, '.fabric-editor-popup-scroll-parent');
248
+ if (!parent && (0, _platformFeatureFlags.fg)('platform_editor_fix_table_menus_jira')) {
249
+ parent = (0, _utils.closestElement)(
250
+ // Ignored via go/ees005
251
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
252
+ editorView.dom, '.ak-editor-content-area');
253
+ }
247
254
  if (!(parent && ref)) {
248
255
  return;
249
256
  }
250
257
  var boundariesRect = parent.getBoundingClientRect();
251
258
  var rect = ref.getBoundingClientRect();
252
- if (rect.left + rect.width > boundariesRect.width) {
253
- ref.style.left = "-".concat(rect.width, "px");
259
+ if ((0, _platformFeatureFlags.fg)('platform_editor_fix_table_menus_jira')) {
260
+ if (!!mountPoint) {
261
+ return;
262
+ }
263
+ var offsetParent = ref === null || ref === void 0 ? void 0 : ref.offsetParent;
264
+ if (!offsetParent) {
265
+ return;
266
+ }
267
+ var offsetParentRect = offsetParent.getBoundingClientRect();
268
+ var rightOverflow = offsetParentRect.right + rect.width - boundariesRect.right;
269
+ var leftOverflow = boundariesRect.left - (offsetParentRect.left - rect.width);
270
+ if (rightOverflow > leftOverflow) {
271
+ ref.style.left = "-".concat(rect.width, "px");
272
+ }
273
+
274
+ // if it overflows regardless of side, let it overlap with the parent menu
275
+ if (leftOverflow > 0 && rightOverflow > 0) {
276
+ if (rightOverflow < leftOverflow) {
277
+ ref.style.left = "".concat(offsetParentRect.width - rightOverflow, "px");
278
+ } else {
279
+ ref.style.left = "-".concat(rect.width - leftOverflow, "px");
280
+ }
281
+ }
282
+ } else {
283
+ if (rect.left + rect.width > boundariesRect.width) {
284
+ ref.style.left = "-".concat(rect.width, "px");
285
+ }
254
286
  }
255
287
  };
256
288
  var setColor = function setColor(color) {
@@ -30,6 +30,7 @@ import TableRowAddBelowIcon from '@atlaskit/icon/core/table-row-add-below';
30
30
  import TableRowDeleteIcon from '@atlaskit/icon/core/table-row-delete';
31
31
  import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
32
32
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
33
+ import { fg } from '@atlaskit/platform-feature-flags';
33
34
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
34
35
  import { Box, xcss } from '@atlaskit/primitives';
35
36
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
@@ -63,17 +64,48 @@ export class ContextualMenu extends Component {
63
64
  });
64
65
  _defineProperty(this, "dropdownMenuRef", /*#__PURE__*/React.createRef());
65
66
  _defineProperty(this, "handleSubMenuRef", ref => {
66
- const parent = closestElement(
67
+ let parent = closestElement(
67
68
  // Ignored via go/ees005
68
69
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
69
70
  this.props.editorView.dom, '.fabric-editor-popup-scroll-parent');
71
+ if (!parent && fg('platform_editor_fix_table_menus_jira')) {
72
+ parent = closestElement(
73
+ // Ignored via go/ees005
74
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
75
+ this.props.editorView.dom, '.ak-editor-content-area');
76
+ }
70
77
  if (!(parent && ref)) {
71
78
  return;
72
79
  }
73
80
  const boundariesRect = parent.getBoundingClientRect();
74
81
  const rect = ref.getBoundingClientRect();
75
- if (rect.left + rect.width > boundariesRect.width) {
76
- ref.style.left = `-${rect.width}px`;
82
+ if (fg('platform_editor_fix_table_menus_jira')) {
83
+ if (!!this.props.mountPoint) {
84
+ return;
85
+ }
86
+ const offsetParent = ref === null || ref === void 0 ? void 0 : ref.offsetParent;
87
+ if (!offsetParent) {
88
+ return;
89
+ }
90
+ const offsetParentRect = offsetParent.getBoundingClientRect();
91
+ const rightOverflow = offsetParentRect.right + rect.width - boundariesRect.right;
92
+ const leftOverflow = boundariesRect.left - (offsetParentRect.left - rect.width);
93
+ if (rightOverflow > leftOverflow) {
94
+ ref.style.left = `-${rect.width}px`;
95
+ }
96
+
97
+ // if it overflows regardless of side, let it overlap with the parent menu
98
+ if (leftOverflow > 0 && rightOverflow > 0) {
99
+ if (rightOverflow < leftOverflow) {
100
+ ref.style.left = `${offsetParentRect.width - rightOverflow}px`;
101
+ } else {
102
+ ref.style.left = `-${rect.width - leftOverflow}px`;
103
+ }
104
+ }
105
+ } else {
106
+ if (rect.left + rect.width > boundariesRect.width) {
107
+ ref.style.left = `-${rect.width}px`;
108
+ }
77
109
  }
78
110
  });
79
111
  _defineProperty(this, "createBackgroundColorItem", () => {
@@ -797,7 +829,7 @@ export class ContextualMenu extends Component {
797
829
  onMouseLeave: this.closeSubmenu,
798
830
  ref: this.dropdownMenuRef
799
831
  }, jsx(DropdownMenu, {
800
- mountTo: mountPoint
832
+ mountTo: fg('platform_editor_fix_table_menus_jira') ? undefined : mountPoint
801
833
  //This needs be removed when the a11y is completely handled
802
834
  //Disabling key navigation now as it works only partially
803
835
  ,
@@ -8,6 +8,7 @@ import { Popup } from '@atlaskit/editor-common/ui';
8
8
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
9
9
  import { akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
10
10
  import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
13
  import { getPluginState } from '../../pm-plugins/plugin-factory';
13
14
  import { contextualMenuDropdownWidth, contextualMenuDropdownWidthDnD, contextualMenuTriggerSize, tablePopupMenuFitHeight } from '../consts';
@@ -106,6 +107,7 @@ const FloatingContextualMenu = ({
106
107
  ,
107
108
  allowBackgroundColor: pluginConfig.allowBackgroundColor,
108
109
  selectionRect: selectionRect,
110
+ mountPoint: fg('platform_editor_fix_table_menus_jira') ? mountPoint : undefined,
109
111
  boundariesElement: boundariesElement,
110
112
  editorAnalyticsAPI: editorAnalyticsAPI,
111
113
  getEditorContainerWidth: getEditorContainerWidth,
@@ -21,6 +21,7 @@ import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
21
21
  import { TableMap } from '@atlaskit/editor-tables/table-map';
22
22
  import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
23
23
  import PaintBucketIcon from '@atlaskit/icon/core/migration/paint-bucket--editor-background-color';
24
+ import { fg } from '@atlaskit/platform-feature-flags';
24
25
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
25
26
  import { Box, xcss } from '@atlaskit/primitives';
26
27
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
@@ -230,17 +231,48 @@ const DragMenu = /*#__PURE__*/React.memo(({
230
231
  } = convertToDropdownItems(dragMenuConfig, formatMessage, selectionRect);
231
232
  const isToolbarAIFCEnabled = Boolean(api === null || api === void 0 ? void 0 : api.toolbar);
232
233
  const handleSubMenuRef = ref => {
233
- const parent = closestElement(
234
+ let parent = closestElement(
234
235
  // Ignored via go/ees005
235
236
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
236
237
  editorView.dom, '.fabric-editor-popup-scroll-parent');
238
+ if (!parent && fg('platform_editor_fix_table_menus_jira')) {
239
+ parent = closestElement(
240
+ // Ignored via go/ees005
241
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
242
+ editorView.dom, '.ak-editor-content-area');
243
+ }
237
244
  if (!(parent && ref)) {
238
245
  return;
239
246
  }
240
247
  const boundariesRect = parent.getBoundingClientRect();
241
248
  const rect = ref.getBoundingClientRect();
242
- if (rect.left + rect.width > boundariesRect.width) {
243
- ref.style.left = `-${rect.width}px`;
249
+ if (fg('platform_editor_fix_table_menus_jira')) {
250
+ if (!!mountPoint) {
251
+ return;
252
+ }
253
+ const offsetParent = ref === null || ref === void 0 ? void 0 : ref.offsetParent;
254
+ if (!offsetParent) {
255
+ return;
256
+ }
257
+ const offsetParentRect = offsetParent.getBoundingClientRect();
258
+ const rightOverflow = offsetParentRect.right + rect.width - boundariesRect.right;
259
+ const leftOverflow = boundariesRect.left - (offsetParentRect.left - rect.width);
260
+ if (rightOverflow > leftOverflow) {
261
+ ref.style.left = `-${rect.width}px`;
262
+ }
263
+
264
+ // if it overflows regardless of side, let it overlap with the parent menu
265
+ if (leftOverflow > 0 && rightOverflow > 0) {
266
+ if (rightOverflow < leftOverflow) {
267
+ ref.style.left = `${offsetParentRect.width - rightOverflow}px`;
268
+ } else {
269
+ ref.style.left = `-${rect.width - leftOverflow}px`;
270
+ }
271
+ }
272
+ } else {
273
+ if (rect.left + rect.width > boundariesRect.width) {
274
+ ref.style.left = `-${rect.width}px`;
275
+ }
244
276
  }
245
277
  };
246
278
  const setColor = color => {
@@ -40,6 +40,7 @@ import TableRowAddBelowIcon from '@atlaskit/icon/core/table-row-add-below';
40
40
  import TableRowDeleteIcon from '@atlaskit/icon/core/table-row-delete';
41
41
  import CrossCircleIcon from '@atlaskit/icon/glyph/cross-circle';
42
42
  import RemoveIcon from '@atlaskit/icon/glyph/editor/remove';
43
+ import { fg } from '@atlaskit/platform-feature-flags';
43
44
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
44
45
  import { Box, xcss } from '@atlaskit/primitives';
45
46
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
@@ -82,13 +83,44 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
82
83
  // Ignored via go/ees005
83
84
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
84
85
  _this.props.editorView.dom, '.fabric-editor-popup-scroll-parent');
86
+ if (!parent && fg('platform_editor_fix_table_menus_jira')) {
87
+ parent = closestElement(
88
+ // Ignored via go/ees005
89
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
90
+ _this.props.editorView.dom, '.ak-editor-content-area');
91
+ }
85
92
  if (!(parent && ref)) {
86
93
  return;
87
94
  }
88
95
  var boundariesRect = parent.getBoundingClientRect();
89
96
  var rect = ref.getBoundingClientRect();
90
- if (rect.left + rect.width > boundariesRect.width) {
91
- ref.style.left = "-".concat(rect.width, "px");
97
+ if (fg('platform_editor_fix_table_menus_jira')) {
98
+ if (!!_this.props.mountPoint) {
99
+ return;
100
+ }
101
+ var offsetParent = ref === null || ref === void 0 ? void 0 : ref.offsetParent;
102
+ if (!offsetParent) {
103
+ return;
104
+ }
105
+ var offsetParentRect = offsetParent.getBoundingClientRect();
106
+ var rightOverflow = offsetParentRect.right + rect.width - boundariesRect.right;
107
+ var leftOverflow = boundariesRect.left - (offsetParentRect.left - rect.width);
108
+ if (rightOverflow > leftOverflow) {
109
+ ref.style.left = "-".concat(rect.width, "px");
110
+ }
111
+
112
+ // if it overflows regardless of side, let it overlap with the parent menu
113
+ if (leftOverflow > 0 && rightOverflow > 0) {
114
+ if (rightOverflow < leftOverflow) {
115
+ ref.style.left = "".concat(offsetParentRect.width - rightOverflow, "px");
116
+ } else {
117
+ ref.style.left = "-".concat(rect.width - leftOverflow, "px");
118
+ }
119
+ }
120
+ } else {
121
+ if (rect.left + rect.width > boundariesRect.width) {
122
+ ref.style.left = "-".concat(rect.width, "px");
123
+ }
92
124
  }
93
125
  });
94
126
  _defineProperty(_this, "createBackgroundColorItem", function () {
@@ -732,7 +764,7 @@ export var ContextualMenu = /*#__PURE__*/function (_Component) {
732
764
  onMouseLeave: this.closeSubmenu,
733
765
  ref: this.dropdownMenuRef
734
766
  }, jsx(DropdownMenu, {
735
- mountTo: mountPoint
767
+ mountTo: fg('platform_editor_fix_table_menus_jira') ? undefined : mountPoint
736
768
  //This needs be removed when the a11y is completely handled
737
769
  //Disabling key navigation now as it works only partially
738
770
  ,
@@ -8,6 +8,7 @@ import { Popup } from '@atlaskit/editor-common/ui';
8
8
  import { findDomRefAtPos } from '@atlaskit/editor-prosemirror/utils';
9
9
  import { akEditorFloatingDialogZIndex, akEditorFloatingOverlapPanelZIndex } from '@atlaskit/editor-shared-styles';
10
10
  import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
11
+ import { fg } from '@atlaskit/platform-feature-flags';
11
12
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
12
13
  import { getPluginState } from '../../pm-plugins/plugin-factory';
13
14
  import { contextualMenuDropdownWidth, contextualMenuDropdownWidthDnD, contextualMenuTriggerSize, tablePopupMenuFitHeight } from '../consts';
@@ -102,6 +103,7 @@ var FloatingContextualMenu = function FloatingContextualMenu(_ref) {
102
103
  ,
103
104
  allowBackgroundColor: pluginConfig.allowBackgroundColor,
104
105
  selectionRect: selectionRect,
106
+ mountPoint: fg('platform_editor_fix_table_menus_jira') ? mountPoint : undefined,
105
107
  boundariesElement: boundariesElement,
106
108
  editorAnalyticsAPI: editorAnalyticsAPI,
107
109
  getEditorContainerWidth: getEditorContainerWidth,
@@ -23,6 +23,7 @@ import { shortcutStyle } from '@atlaskit/editor-shared-styles/shortcut';
23
23
  import { TableMap } from '@atlaskit/editor-tables/table-map';
24
24
  import { findCellRectClosestToPos, getSelectionRect, isSelectionType } from '@atlaskit/editor-tables/utils';
25
25
  import PaintBucketIcon from '@atlaskit/icon/core/migration/paint-bucket--editor-background-color';
26
+ import { fg } from '@atlaskit/platform-feature-flags';
26
27
  // eslint-disable-next-line @atlaskit/design-system/no-emotion-primitives -- to be migrated to @atlaskit/primitives/compiled – go/akcss
27
28
  import { Box, xcss } from '@atlaskit/primitives';
28
29
  import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
@@ -233,13 +234,44 @@ var DragMenu = /*#__PURE__*/React.memo(function (_ref) {
233
234
  // Ignored via go/ees005
234
235
  // eslint-disable-next-line @atlaskit/editor/no-as-casting
235
236
  editorView.dom, '.fabric-editor-popup-scroll-parent');
237
+ if (!parent && fg('platform_editor_fix_table_menus_jira')) {
238
+ parent = closestElement(
239
+ // Ignored via go/ees005
240
+ // eslint-disable-next-line @atlaskit/editor/no-as-casting
241
+ editorView.dom, '.ak-editor-content-area');
242
+ }
236
243
  if (!(parent && ref)) {
237
244
  return;
238
245
  }
239
246
  var boundariesRect = parent.getBoundingClientRect();
240
247
  var rect = ref.getBoundingClientRect();
241
- if (rect.left + rect.width > boundariesRect.width) {
242
- ref.style.left = "-".concat(rect.width, "px");
248
+ if (fg('platform_editor_fix_table_menus_jira')) {
249
+ if (!!mountPoint) {
250
+ return;
251
+ }
252
+ var offsetParent = ref === null || ref === void 0 ? void 0 : ref.offsetParent;
253
+ if (!offsetParent) {
254
+ return;
255
+ }
256
+ var offsetParentRect = offsetParent.getBoundingClientRect();
257
+ var rightOverflow = offsetParentRect.right + rect.width - boundariesRect.right;
258
+ var leftOverflow = boundariesRect.left - (offsetParentRect.left - rect.width);
259
+ if (rightOverflow > leftOverflow) {
260
+ ref.style.left = "-".concat(rect.width, "px");
261
+ }
262
+
263
+ // if it overflows regardless of side, let it overlap with the parent menu
264
+ if (leftOverflow > 0 && rightOverflow > 0) {
265
+ if (rightOverflow < leftOverflow) {
266
+ ref.style.left = "".concat(offsetParentRect.width - rightOverflow, "px");
267
+ } else {
268
+ ref.style.left = "-".concat(rect.width - leftOverflow, "px");
269
+ }
270
+ }
271
+ } else {
272
+ if (rect.left + rect.width > boundariesRect.width) {
273
+ ref.style.left = "-".concat(rect.width, "px");
274
+ }
243
275
  }
244
276
  };
245
277
  var setColor = function setColor(color) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-table",
3
- "version": "15.3.2",
3
+ "version": "15.3.4",
4
4
  "description": "Table plugin for the @atlaskit/editor",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -28,7 +28,7 @@
28
28
  "singleton": true
29
29
  },
30
30
  "dependencies": {
31
- "@atlaskit/adf-schema": "^51.3.1",
31
+ "@atlaskit/adf-schema": "^51.3.2",
32
32
  "@atlaskit/button": "^23.5.0",
33
33
  "@atlaskit/custom-steps": "^0.16.0",
34
34
  "@atlaskit/editor-palette": "^2.1.0",
@@ -37,7 +37,7 @@
37
37
  "@atlaskit/editor-plugin-batch-attribute-updates": "^6.1.0",
38
38
  "@atlaskit/editor-plugin-content-insertion": "^6.0.0",
39
39
  "@atlaskit/editor-plugin-editor-viewmode": "^8.0.0",
40
- "@atlaskit/editor-plugin-extension": "9.1.2",
40
+ "@atlaskit/editor-plugin-extension": "9.1.3",
41
41
  "@atlaskit/editor-plugin-guideline": "^6.0.0",
42
42
  "@atlaskit/editor-plugin-interaction": "^9.0.0",
43
43
  "@atlaskit/editor-plugin-limited-mode": "^3.0.0",
@@ -157,6 +157,9 @@
157
157
  "platform_editor_fix_confirm_table_removal": {
158
158
  "type": "boolean"
159
159
  },
160
+ "platform_editor_fix_table_menus_jira": {
161
+ "type": "boolean"
162
+ },
160
163
  "platform_editor_content_mode_button_mvp": {
161
164
  "type": "boolean"
162
165
  }