@atlaskit/editor-plugin-block-controls 2.13.29 → 2.13.30

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.
Files changed (43) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/pm-plugins/decorations-anchor.js +3 -4
  3. package/dist/cjs/pm-plugins/decorations-drop-target.js +1 -2
  4. package/dist/cjs/pm-plugins/handle-mouse-over.js +2 -3
  5. package/dist/cjs/pm-plugins/main.js +2 -3
  6. package/dist/cjs/pm-plugins/utils/active-anchor-tracker.js +2 -2
  7. package/dist/cjs/pm-plugins/utils/consts.js +2 -2
  8. package/dist/cjs/pm-plugins/utils/inline-drop-target.js +4 -4
  9. package/dist/cjs/pm-plugins/utils/validation.js +1 -2
  10. package/dist/cjs/ui/consts.js +3 -3
  11. package/dist/cjs/ui/drag-handle.js +5 -6
  12. package/dist/cjs/ui/drop-target-v2.js +1 -2
  13. package/dist/cjs/ui/inline-drop-target.js +7 -8
  14. package/dist/es2019/pm-plugins/decorations-anchor.js +3 -4
  15. package/dist/es2019/pm-plugins/decorations-drop-target.js +1 -2
  16. package/dist/es2019/pm-plugins/handle-mouse-over.js +2 -3
  17. package/dist/es2019/pm-plugins/main.js +2 -3
  18. package/dist/es2019/pm-plugins/utils/active-anchor-tracker.js +2 -2
  19. package/dist/es2019/pm-plugins/utils/consts.js +2 -2
  20. package/dist/es2019/pm-plugins/utils/inline-drop-target.js +4 -4
  21. package/dist/es2019/pm-plugins/utils/validation.js +1 -2
  22. package/dist/es2019/ui/consts.js +3 -3
  23. package/dist/es2019/ui/drag-handle.js +5 -6
  24. package/dist/es2019/ui/drop-target-v2.js +1 -2
  25. package/dist/es2019/ui/inline-drop-target.js +7 -8
  26. package/dist/esm/pm-plugins/decorations-anchor.js +3 -4
  27. package/dist/esm/pm-plugins/decorations-drop-target.js +1 -2
  28. package/dist/esm/pm-plugins/handle-mouse-over.js +2 -3
  29. package/dist/esm/pm-plugins/main.js +2 -3
  30. package/dist/esm/pm-plugins/utils/active-anchor-tracker.js +2 -2
  31. package/dist/esm/pm-plugins/utils/consts.js +2 -2
  32. package/dist/esm/pm-plugins/utils/inline-drop-target.js +4 -4
  33. package/dist/esm/pm-plugins/utils/validation.js +1 -2
  34. package/dist/esm/ui/consts.js +3 -3
  35. package/dist/esm/ui/drag-handle.js +5 -6
  36. package/dist/esm/ui/drop-target-v2.js +1 -2
  37. package/dist/esm/ui/inline-drop-target.js +7 -8
  38. package/package.json +1 -10
  39. package/dist/cjs/pm-plugins/utils/advanced-layouts-flags.js +0 -19
  40. package/dist/es2019/pm-plugins/utils/advanced-layouts-flags.js +0 -14
  41. package/dist/esm/pm-plugins/utils/advanced-layouts-flags.js +0 -14
  42. package/dist/types/pm-plugins/utils/advanced-layouts-flags.d.ts +0 -3
  43. package/dist/types-ts4.5/pm-plugins/utils/advanced-layouts-flags.d.ts +0 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 2.13.30
4
+
5
+ ### Patch Changes
6
+
7
+ - [#171014](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/171014)
8
+ [`6163248356c63`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/6163248356c63) -
9
+ [ED-25833] Replace the following FGs with experiment `platform_editor_advanced_layouts`
10
+
11
+ - platform_editor_advanced_layouts_breakout_resizing
12
+ - platform_editor_advanced_layouts_pre_release_1
13
+ - platform_editor_advanced_layouts_pre_release_2
14
+
3
15
  ## 2.13.29
4
16
 
5
17
  ### Patch Changes
@@ -10,7 +10,6 @@ var _view = require("@atlaskit/editor-prosemirror/view");
10
10
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
11
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
12
12
  var _decorationsCommon = require("./decorations-common");
13
- var _advancedLayoutsFlags = require("./utils/advanced-layouts-flags");
14
13
  var IGNORE_NODES = ['tableCell', 'tableHeader', 'tableRow', 'listItem', 'caption', 'layoutColumn'];
15
14
  var IGNORE_NODES_NEXT = ['tableCell', 'tableHeader', 'tableRow', 'listItem', 'caption'];
16
15
  var IGNORE_NODE_DESCENDANTS = ['listItem', 'taskList', 'decisionList', 'mediaSingle'];
@@ -23,7 +22,7 @@ var shouldDescendIntoNode = exports.shouldDescendIntoNode = function shouldDesce
23
22
  return false;
24
23
  }
25
24
  }
26
- if ((0, _advancedLayoutsFlags.isPreRelease1)()) {
25
+ if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
27
26
  return !IGNORE_NODE_DESCENDANTS_ADVANCED_LAYOUT.includes(node.type.name);
28
27
  }
29
28
  return !IGNORE_NODE_DESCENDANTS.includes(node.type.name);
@@ -33,7 +32,7 @@ var shouldIgnoreNode = function shouldIgnoreNode(node, ignore_nodes, depth, pare
33
32
 
34
33
  // TODO use isWrappedMedia when clean up the feature flag
35
34
  var isMediaSingle = 'mediaSingle' === node.type.name && (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_1');
36
- var isFirstTableRow = (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'table' && depth === 1 && node === parent.firstChild && 'tableRow' === node.type.name && (0, _advancedLayoutsFlags.isPreRelease1)();
35
+ var isFirstTableRow = (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'table' && depth === 1 && node === parent.firstChild && 'tableRow' === node.type.name && (0, _experiments.editorExperiment)('advanced_layouts', true);
37
36
  if (isFirstTableRow) {
38
37
  return false;
39
38
  }
@@ -73,7 +72,7 @@ var nodeDecorations = exports.nodeDecorations = function nodeDecorations(newStat
73
72
  var decs = [];
74
73
  var docFrom = from === undefined || from < 0 ? 0 : from;
75
74
  var docTo = to === undefined || to > newState.doc.nodeSize - 2 ? newState.doc.nodeSize - 2 : to;
76
- var ignore_nodes = (0, _advancedLayoutsFlags.isPreRelease2)() ? IGNORE_NODES_NEXT : IGNORE_NODES;
75
+ var ignore_nodes = (0, _experiments.editorExperiment)('advanced_layouts', true) ? IGNORE_NODES_NEXT : IGNORE_NODES;
77
76
  newState.doc.nodesBetween(docFrom, docTo, function (node, pos, parent, index) {
78
77
  var _Decoration$node;
79
78
  var depth = 0;
@@ -18,7 +18,6 @@ var _dropTarget = require("../ui/drop-target");
18
18
  var _dropTargetLayout = require("../ui/drop-target-layout");
19
19
  var _dropTargetV = require("../ui/drop-target-v2");
20
20
  var _decorationsCommon = require("./decorations-common");
21
- var _advancedLayoutsFlags = require("./utils/advanced-layouts-flags");
22
21
  var _consts2 = require("./utils/consts");
23
22
  var _dragTargetDebug = require("./utils/drag-target-debug");
24
23
  var _validation = require("./utils/validation");
@@ -186,7 +185,7 @@ var dropTargetDecorations = exports.dropTargetDecorations = function dropTargetD
186
185
  popNodeStack(depth);
187
186
  prevNodeStack.push(node);
188
187
  };
189
- var isAdvancedLayoutsPreRelease2 = (0, _advancedLayoutsFlags.isPreRelease2)();
188
+ var isAdvancedLayoutsPreRelease2 = (0, _experiments.editorExperiment)('advanced_layouts', true);
190
189
  newState.doc.nodesBetween(docFrom, docTo, function (node, pos, parent, index) {
191
190
  var depth = 0;
192
191
  // drop target deco at the end position
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.handleMouseOver = void 0;
7
7
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
8
8
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
9
- var _advancedLayoutsFlags = require("./utils/advanced-layouts-flags");
10
9
  var isEmptyNestedParagraphOrHeading = function isEmptyNestedParagraphOrHeading(target) {
11
10
  if (target instanceof HTMLHeadingElement || target instanceof HTMLParagraphElement) {
12
11
  var _target$parentElement;
@@ -56,7 +55,7 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
56
55
  if ((0, _experiments.editorExperiment)('nested-dnd', true) && isEmptyNestedParagraphOrHeading(rootElement)) {
57
56
  return false;
58
57
  }
59
- if (rootElement.getAttribute('data-drag-handler-node-type') === 'media' && (0, _advancedLayoutsFlags.isPreRelease1)()) {
58
+ if (rootElement.getAttribute('data-drag-handler-node-type') === 'media' && (0, _experiments.editorExperiment)('advanced_layouts', true)) {
60
59
  rootElement = rootElement.closest('[data-drag-handler-anchor-name][data-drag-handler-node-type="mediaSingle"]');
61
60
  if (!rootElement) {
62
61
  return false;
@@ -100,7 +99,7 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
100
99
  pos = view.posAtDOM(rootElement, 0);
101
100
  }
102
101
  var node = view.state.doc.nodeAt(pos);
103
- if ((0, _advancedLayoutsFlags.isPreRelease2)() && node && isLayoutColumnWithoutContent(node)) {
102
+ if ((0, _experiments.editorExperiment)('advanced_layouts', true) && node && isLayoutColumnWithoutContent(node)) {
104
103
  // Don't show drag handle when there is no content/only placeholder in layout column
105
104
  return false;
106
105
  }
@@ -25,7 +25,6 @@ var _decorationsDropTarget = require("./decorations-drop-target");
25
25
  var _handleMouseOver = require("./handle-mouse-over");
26
26
  var _keymap = require("./keymap");
27
27
  var _activeAnchorTracker = require("./utils/active-anchor-tracker");
28
- var _advancedLayoutsFlags = require("./utils/advanced-layouts-flags");
29
28
  var _anchorUtils = require("./utils/anchor-utils");
30
29
  var _dragTargetDebug = require("./utils/drag-target-debug");
31
30
  var _transactions = require("./utils/transactions");
@@ -502,7 +501,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api, getIntl, no
502
501
  return false;
503
502
  },
504
503
  dragenter: function dragenter(_view, event) {
505
- if ((0, _advancedLayoutsFlags.isPreRelease2)()) {
504
+ if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
506
505
  if (isHTMLElement(event.target)) {
507
506
  var closestParentElement = event.target.closest('[data-drag-handler-anchor-depth="0"]');
508
507
  if (closestParentElement) {
@@ -516,7 +515,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api, getIntl, no
516
515
  },
517
516
  dragstart: function dragstart(view) {
518
517
  var _anchorRectCache;
519
- if ((0, _advancedLayoutsFlags.isPreRelease2)()) {
518
+ if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
520
519
  _activeAnchorTracker.defaultActiveAnchorTracker.reset();
521
520
  }
522
521
  (_anchorRectCache = anchorRectCache) === null || _anchorRectCache === void 0 || _anchorRectCache.setEditorView(view);
@@ -11,7 +11,7 @@ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/creat
11
11
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
12
12
  var _events = require("events");
13
13
  var _react = require("react");
14
- var _advancedLayoutsFlags = require("./advanced-layouts-flags");
14
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
15
15
  var ActiveAnchorTracker = exports.ActiveAnchorTracker = /*#__PURE__*/function () {
16
16
  function ActiveAnchorTracker() {
17
17
  (0, _classCallCheck2.default)(this, ActiveAnchorTracker);
@@ -67,7 +67,7 @@ var useActiveAnchorTracker = exports.useActiveAnchorTracker = function useActive
67
67
  setIsActive(eventIsActive);
68
68
  };
69
69
  (0, _react.useEffect)(function () {
70
- if (activeAnchorTracker && anchorName && (0, _advancedLayoutsFlags.isPreRelease2)()) {
70
+ if (activeAnchorTracker && anchorName && (0, _experiments.editorExperiment)('advanced_layouts', true)) {
71
71
  activeAnchorTracker.subscribe(anchorName, onActive);
72
72
  var unsubscribe = function unsubscribe() {
73
73
  activeAnchorTracker.unsubscribe(anchorName, onActive);
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.maxLayoutColumnSupported = exports.MIN_LAYOUT_COLUMN = exports.DIRECTION = void 0;
7
- var _advancedLayoutsFlags = require("./advanced-layouts-flags");
7
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
8
8
  var DIRECTION = exports.DIRECTION = /*#__PURE__*/function (DIRECTION) {
9
9
  DIRECTION["UP"] = "up";
10
10
  DIRECTION["DOWN"] = "down";
@@ -13,6 +13,6 @@ var DIRECTION = exports.DIRECTION = /*#__PURE__*/function (DIRECTION) {
13
13
  return DIRECTION;
14
14
  }({});
15
15
  var maxLayoutColumnSupported = exports.maxLayoutColumnSupported = function maxLayoutColumnSupported() {
16
- return (0, _advancedLayoutsFlags.isPreRelease2)() ? 5 : 3;
16
+ return (0, _experiments.editorExperiment)('advanced_layouts', true) ? 5 : 3;
17
17
  };
18
18
  var MIN_LAYOUT_COLUMN = exports.MIN_LAYOUT_COLUMN = 2;
@@ -5,23 +5,23 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.shouldAllowInlineDropTarget = void 0;
7
7
  var _utils = require("@atlaskit/editor-common/utils");
8
- var _advancedLayoutsFlags = require("./advanced-layouts-flags");
8
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
9
9
  var _checkMediaLayout = require("./check-media-layout");
10
10
  var _consts = require("./consts");
11
11
  var shouldAllowInlineDropTarget = exports.shouldAllowInlineDropTarget = function shouldAllowInlineDropTarget(isNested, node) {
12
12
  var isSameLayout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
13
13
  var activeNode = arguments.length > 3 ? arguments[3] : undefined;
14
- if (!(0, _advancedLayoutsFlags.isPreRelease1)() || isNested) {
14
+ if ((0, _experiments.editorExperiment)('advanced_layouts', false) || isNested) {
15
15
  return false;
16
16
  }
17
17
  if ((0, _checkMediaLayout.isWrappedMedia)(node)) {
18
18
  return false;
19
19
  }
20
- if ((0, _advancedLayoutsFlags.isPreRelease2)() && (activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) === 'layoutSection') {
20
+ if ((activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) === 'layoutSection') {
21
21
  return false;
22
22
  }
23
23
  if ((node === null || node === void 0 ? void 0 : node.type.name) === 'layoutSection') {
24
- return node.childCount < (0, _consts.maxLayoutColumnSupported)() || (0, _advancedLayoutsFlags.isPreRelease2)() && isSameLayout;
24
+ return node.childCount < (0, _consts.maxLayoutColumnSupported)() || isSameLayout;
25
25
  }
26
26
  return !(0, _utils.isEmptyParagraph)(node);
27
27
  };
@@ -9,7 +9,6 @@ exports.transformSliceExpandToNestedExpand = exports.transformExpandToNestedExpa
9
9
  var _memoizeOne = _interopRequireDefault(require("memoize-one"));
10
10
  var _model = require("@atlaskit/editor-prosemirror/model");
11
11
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
12
- var _advancedLayoutsFlags = require("./advanced-layouts-flags");
13
12
  var isInsideTable = exports.isInsideTable = function isInsideTable(nodeType) {
14
13
  var _nodeType$schema$node = nodeType.schema.nodes,
15
14
  tableCell = _nodeType$schema$node.tableCell,
@@ -81,7 +80,7 @@ function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, destNode) {
81
80
  var srcNodeType = srcNode.type;
82
81
  var parentNodeType = destParent === null || destParent === void 0 ? void 0 : destParent.type.name;
83
82
  var activeNodeType = srcNode === null || srcNode === void 0 ? void 0 : srcNode.type.name;
84
- if ((0, _advancedLayoutsFlags.isPreRelease2)() && activeNodeType === 'layoutColumn') {
83
+ if (activeNodeType === 'layoutColumn' && (0, _experiments.editorExperiment)('advanced_layouts', true)) {
85
84
  // Allow drag layout column and drop into layout section
86
85
  if ((destNode === null || destNode === void 0 ? void 0 : destNode.type.name) === 'layoutSection' || parentNodeType === 'doc') {
87
86
  return true;
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.topPositionAdjustment = exports.spaceLookupMap = exports.nodeMargins = exports.getNestedNodeLeftPaddingMargin = exports.dropTargetMarginMap = exports.dragHandleGap = exports.DRAG_HANDLE_ZINDEX = exports.DRAG_HANDLE_WIDTH = exports.DRAG_HANDLE_NARROW_GAP = exports.DRAG_HANDLE_MAX_WIDTH_PLUS_GAP = exports.DRAG_HANDLE_MAX_GAP = exports.DRAG_HANDLE_HEIGHT = exports.DRAG_HANDLE_H6_TOP_ADJUSTMENT = exports.DRAG_HANDLE_H5_TOP_ADJUSTMENT = exports.DRAG_HANDLE_H4_TOP_ADJUSTMENT = exports.DRAG_HANDLE_H3_TOP_ADJUSTMENT = exports.DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT = exports.DRAG_HANDLE_DEFAULT_GAP = exports.DRAG_HANDLE_BORDER_RADIUS = exports.DEFAULT_COLUMN_DISTRIBUTIONS = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
10
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
11
11
  var _dropTargetMarginMap;
12
12
  var DRAG_HANDLE_HEIGHT = exports.DRAG_HANDLE_HEIGHT = 24;
13
13
  var DRAG_HANDLE_WIDTH = exports.DRAG_HANDLE_WIDTH = 12;
@@ -27,7 +27,7 @@ var dragHandleGap = exports.dragHandleGap = function dragHandleGap(nodeType, par
27
27
  if (parentNodeType && parentNodeType !== 'doc') {
28
28
  return DRAG_HANDLE_NARROW_GAP;
29
29
  }
30
- if (nodeType === 'layoutSection' && (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_breakout_resizing')) {
30
+ if (nodeType === 'layoutSection' && (0, _experiments.editorExperiment)('advanced_layouts', true)) {
31
31
  return DRAG_HANDLE_MAX_GAP + 12;
32
32
  }
33
33
  if (nodeTypeExcludeList.includes(nodeType)) {
@@ -55,7 +55,7 @@ var getNestedNodeLeftPaddingMargin = exports.getNestedNodeLeftPaddingMargin = fu
55
55
  }
56
56
  };
57
57
  var topPositionAdjustment = exports.topPositionAdjustment = function topPositionAdjustment(nodeType) {
58
- if ((0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_breakout_resizing')) {
58
+ if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
59
59
  switch (nodeType) {
60
60
  case 'rule':
61
61
  return -DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT;
@@ -23,7 +23,6 @@ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
23
23
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
24
24
  var _main = require("../pm-plugins/main");
25
25
  var _utils = require("../pm-plugins/utils");
26
- var _advancedLayoutsFlags = require("../pm-plugins/utils/advanced-layouts-flags");
27
26
  var _dragHandlePositions = require("../pm-plugins/utils/drag-handle-positions");
28
27
  var _consts = require("./consts");
29
28
  var _dragPreview = require("./drag-preview");
@@ -147,7 +146,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
147
146
  // but ensures the preview is generated correctly.
148
147
  var handleMouseDown = (0, _react.useCallback)(function () {
149
148
  var _api$core3;
150
- if (!(isLayoutColumn && (0, _advancedLayoutsFlags.isPreRelease2)()) && (0, _platformFeatureFlags.fg)('platform_editor_element_drag_and_drop_ed_24885')) {
149
+ if (!(isLayoutColumn && (0, _experiments.editorExperiment)('advanced_layouts', true)) && (0, _platformFeatureFlags.fg)('platform_editor_element_drag_and_drop_ed_24885')) {
151
150
  return undefined;
152
151
  }
153
152
  api === null || api === void 0 || (_api$core3 = api.core) === null || _api$core3 === void 0 || _api$core3.actions.execute(function (_ref3) {
@@ -161,7 +160,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
161
160
  return tr;
162
161
  }
163
162
  var selection;
164
- if (isLayoutColumn && (0, _advancedLayoutsFlags.isPreRelease2)()) {
163
+ if (isLayoutColumn && (0, _experiments.editorExperiment)('advanced_layouts', true)) {
165
164
  selection = new _state.NodeSelection(tr.doc.resolve(startPos));
166
165
  } else {
167
166
  var $startPos = tr.doc.resolve(startPos + node.nodeSize);
@@ -294,8 +293,8 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
294
293
  var isEdgeCase = (hasResizer || isExtension || isEmbedCard || isBlockCard) && innerContainer;
295
294
  if (supportsAnchor) {
296
295
  return {
297
- left: isEdgeCase ? "calc(anchor(".concat(anchorName, " start) + ").concat((0, _dragHandlePositions.getLeftPosition)(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType), ")") : (0, _advancedLayoutsFlags.isPreRelease2)() && isLayoutColumn ? "calc((anchor(".concat(anchorName, " right) + anchor(").concat(anchorName, " left))/2 - ").concat(_consts.DRAG_HANDLE_HEIGHT / 2, "px)") : "calc(anchor(".concat(anchorName, " start) - ").concat(_consts.DRAG_HANDLE_WIDTH, "px - ").concat((0, _consts.dragHandleGap)(nodeType, parentNodeType), "px)"),
298
- top: (0, _advancedLayoutsFlags.isPreRelease2)() && isLayoutColumn ? "calc(anchor(".concat(anchorName, " top) - ").concat(_consts.DRAG_HANDLE_WIDTH, "px)") : (0, _platformFeatureFlags.fg)('platform_editor_elements_dnd_ed_23674') ? "calc(anchor(".concat(anchorName, " start) + ").concat((0, _consts.topPositionAdjustment)(nodeType), "px)") : anchorName.includes('table') ? "calc(anchor(".concat(anchorName, " start) + ").concat(_consts.DRAG_HANDLE_HEIGHT, "px)") : "anchor(".concat(anchorName, " start)")
296
+ left: isEdgeCase ? "calc(anchor(".concat(anchorName, " start) + ").concat((0, _dragHandlePositions.getLeftPosition)(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType), ")") : (0, _experiments.editorExperiment)('advanced_layouts', true) && isLayoutColumn ? "calc((anchor(".concat(anchorName, " right) + anchor(").concat(anchorName, " left))/2 - ").concat(_consts.DRAG_HANDLE_HEIGHT / 2, "px)") : "calc(anchor(".concat(anchorName, " start) - ").concat(_consts.DRAG_HANDLE_WIDTH, "px - ").concat((0, _consts.dragHandleGap)(nodeType, parentNodeType), "px)"),
297
+ top: (0, _experiments.editorExperiment)('advanced_layouts', true) && isLayoutColumn ? "calc(anchor(".concat(anchorName, " top) - ").concat(_consts.DRAG_HANDLE_WIDTH, "px)") : (0, _platformFeatureFlags.fg)('platform_editor_elements_dnd_ed_23674') ? "calc(anchor(".concat(anchorName, " start) + ").concat((0, _consts.topPositionAdjustment)(nodeType), "px)") : anchorName.includes('table') ? "calc(anchor(".concat(anchorName, " start) + ").concat(_consts.DRAG_HANDLE_HEIGHT, "px)") : "anchor(".concat(anchorName, " start)")
299
298
  };
300
299
  }
301
300
  return {
@@ -418,7 +417,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
418
417
  // eslint-disable-next-line @atlaskit/design-system/no-html-button
419
418
  (0, _react2.jsx)("button", {
420
419
  type: "button",
421
- css: [dragHandleButtonStyles, (0, _advancedLayoutsFlags.isPreRelease2)() && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && selectedStyles],
420
+ css: [dragHandleButtonStyles, (0, _experiments.editorExperiment)('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && selectedStyles],
422
421
  ref: buttonRef
423
422
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
424
423
  ,
@@ -17,7 +17,6 @@ var _constants = require("@atlaskit/theme/constants");
17
17
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
18
18
  var _decorationsCommon = require("../pm-plugins/decorations-common");
19
19
  var _activeAnchorTracker = require("../pm-plugins/utils/active-anchor-tracker");
20
- var _advancedLayoutsFlags = require("../pm-plugins/utils/advanced-layouts-flags");
21
20
  var _anchorUtils = require("../pm-plugins/utils/anchor-utils");
22
21
  var _dragTargetDebug = require("../pm-plugins/utils/drag-target-debug");
23
22
  var _inlineDropTarget = require("../pm-plugins/utils/inline-drop-target");
@@ -97,7 +96,7 @@ var HoverZone = function HoverZone(_ref) {
97
96
  return (0, _adapter.dropTargetForElements)({
98
97
  element: ref.current,
99
98
  onDragEnter: function onDragEnter() {
100
- if (!isNestedDropTarget && (0, _advancedLayoutsFlags.isPreRelease2)()) {
99
+ if (!isNestedDropTarget && (0, _experiments.editorExperiment)('advanced_layouts', true)) {
101
100
  setActiveAnchor();
102
101
  }
103
102
  _onDragEnter();
@@ -12,9 +12,9 @@ var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
12
12
  var _box = require("@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box");
13
13
  var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
14
14
  var _colors = require("@atlaskit/theme/colors");
15
+ var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
15
16
  var _decorationsCommon = require("../pm-plugins/decorations-common");
16
17
  var _activeAnchorTracker = require("../pm-plugins/utils/active-anchor-tracker");
17
- var _advancedLayoutsFlags = require("../pm-plugins/utils/advanced-layouts-flags");
18
18
  var _anchorUtils = require("../pm-plugins/utils/anchor-utils");
19
19
  var _dragTargetDebug = require("../pm-plugins/utils/drag-target-debug");
20
20
  /* eslint-disable @atlaskit/design-system/consistent-css-prop-usage */
@@ -85,7 +85,6 @@ var InlineDropTarget = exports.InlineDropTarget = function InlineDropTarget(_ref
85
85
  _useActiveAnchorTrack2 = (0, _slicedToArray2.default)(_useActiveAnchorTrack, 1),
86
86
  isActiveAnchor = _useActiveAnchorTrack2[0];
87
87
  var isLeftPosition = position === 'left';
88
- var shouldShowResponsiveLayout = (0, _advancedLayoutsFlags.showResponsiveLayout)();
89
88
  var nodeDimension = (0, _react.useMemo)(function () {
90
89
  if (!nextNode) {
91
90
  return defaultNodeDimension;
@@ -126,7 +125,7 @@ var InlineDropTarget = exports.InlineDropTarget = function InlineDropTarget(_ref
126
125
 
127
126
  // Set the height target anchor name to the first or last column of the layout section so that it also works for stacked layout
128
127
  var heightTargetAnchorName = targetAnchorName;
129
- if (shouldShowResponsiveLayout && nextNode.type.name === 'layoutSection' && nextNode.firstChild && nextNode.lastChild) {
128
+ if ((0, _experiments.editorExperiment)('advanced_layouts', true) && nextNode.type.name === 'layoutSection' && nextNode.firstChild && nextNode.lastChild) {
130
129
  heightTargetAnchorName = isLeftPosition ? (0, _decorationsCommon.getNodeAnchor)(nextNode.firstChild) : (0, _decorationsCommon.getNodeAnchor)(nextNode.lastChild);
131
130
  }
132
131
  if ((0, _anchorUtils.isAnchorSupported)()) {
@@ -159,7 +158,7 @@ var InlineDropTarget = exports.InlineDropTarget = function InlineDropTarget(_ref
159
158
  };
160
159
  }
161
160
  return defaultNodeDimension;
162
- }, [anchorName, anchorRectCache, nextNode, position, isLeftPosition, shouldShowResponsiveLayout]);
161
+ }, [anchorName, anchorRectCache, nextNode, position, isLeftPosition]);
163
162
  var onDrop = (0, _react.useCallback)(function () {
164
163
  var _api$blockControls;
165
164
  var _ref2 = (api === null || api === void 0 || (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 ? void 0 : _api$blockControls.sharedState.currentState()) || {},
@@ -177,8 +176,8 @@ var InlineDropTarget = exports.InlineDropTarget = function InlineDropTarget(_ref
177
176
  }
178
177
  }, [api, getPos, position]);
179
178
  var inlineHoverZoneRectStyle = (0, _react.useMemo)(function () {
180
- var isLayoutNode = (nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name) === 'layoutSection';
181
- var layoutAdjustment = isLayoutNode && shouldShowResponsiveLayout ? {
179
+ var isLayoutNode = (0, _experiments.editorExperiment)('advanced_layouts', true) && (nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name) === 'layoutSection';
180
+ var layoutAdjustment = isLayoutNode ? {
182
181
  width: 11,
183
182
  height: 4,
184
183
  top: 6,
@@ -192,11 +191,11 @@ var InlineDropTarget = exports.InlineDropTarget = function InlineDropTarget(_ref
192
191
  top: "calc(anchor(top))",
193
192
  width: nodeDimension.widthOffset ? "calc((100% - ".concat(nodeDimension.width, ")/2 - ").concat(GAP, "px + ").concat(nodeDimension.widthOffset, " - ").concat((layoutAdjustment === null || layoutAdjustment === void 0 ? void 0 : layoutAdjustment.width) || 0, "px)") : "calc((100% - ".concat(nodeDimension.width, ")/2 - ").concat(GAP, "px - ").concat((layoutAdjustment === null || layoutAdjustment === void 0 ? void 0 : layoutAdjustment.width) || 0, "px)"),
194
193
  height: "calc(".concat(nodeDimension.height, " + ").concat((layoutAdjustment === null || layoutAdjustment === void 0 ? void 0 : layoutAdjustment.height) || 0, "px)")
195
- }, isLayoutNode && shouldShowResponsiveLayout && {
194
+ }, isLayoutNode && {
196
195
  top: isLeftPosition ? "calc(".concat(nodeDimension.top, " + ").concat((layoutAdjustment === null || layoutAdjustment === void 0 ? void 0 : layoutAdjustment.top) || 0, "px)") : 'unset',
197
196
  bottom: isLeftPosition ? 'unset' : "calc(".concat(nodeDimension.bottom, " - ").concat((layoutAdjustment === null || layoutAdjustment === void 0 ? void 0 : layoutAdjustment.bottom) || 0, "px)")
198
197
  });
199
- }, [anchorName, isLeftPosition, nodeDimension, nextNode, shouldShowResponsiveLayout]);
198
+ }, [nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name, anchorName, isLeftPosition, nodeDimension]);
200
199
  var dropIndicatorPos = (0, _react.useMemo)(function () {
201
200
  return isLeftPosition ? 'right' : 'left';
202
201
  }, [isLeftPosition]);
@@ -2,7 +2,6 @@ import { Decoration } from '@atlaskit/editor-prosemirror/view';
2
2
  import { fg } from '@atlaskit/platform-feature-flags';
3
3
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
4
  import { getNestedDepth, getNodeAnchor, TYPE_NODE_DEC } from './decorations-common';
5
- import { isPreRelease1, isPreRelease2 } from './utils/advanced-layouts-flags';
6
5
  const IGNORE_NODES = ['tableCell', 'tableHeader', 'tableRow', 'listItem', 'caption', 'layoutColumn'];
7
6
  const IGNORE_NODES_NEXT = ['tableCell', 'tableHeader', 'tableRow', 'listItem', 'caption'];
8
7
  const IGNORE_NODE_DESCENDANTS = ['listItem', 'taskList', 'decisionList', 'mediaSingle'];
@@ -15,7 +14,7 @@ export const shouldDescendIntoNode = node => {
15
14
  return false;
16
15
  }
17
16
  }
18
- if (isPreRelease1()) {
17
+ if (editorExperiment('advanced_layouts', true)) {
19
18
  return !IGNORE_NODE_DESCENDANTS_ADVANCED_LAYOUT.includes(node.type.name);
20
19
  }
21
20
  return !IGNORE_NODE_DESCENDANTS.includes(node.type.name);
@@ -25,7 +24,7 @@ const shouldIgnoreNode = (node, ignore_nodes, depth, parent) => {
25
24
 
26
25
  // TODO use isWrappedMedia when clean up the feature flag
27
26
  const isMediaSingle = 'mediaSingle' === node.type.name && fg('platform_editor_element_dnd_nested_fix_patch_1');
28
- const isFirstTableRow = (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'table' && depth === 1 && node === parent.firstChild && 'tableRow' === node.type.name && isPreRelease1();
27
+ const isFirstTableRow = (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'table' && depth === 1 && node === parent.firstChild && 'tableRow' === node.type.name && editorExperiment('advanced_layouts', true);
29
28
  if (isFirstTableRow) {
30
29
  return false;
31
30
  }
@@ -63,7 +62,7 @@ export const nodeDecorations = (newState, from, to) => {
63
62
  const decs = [];
64
63
  const docFrom = from === undefined || from < 0 ? 0 : from;
65
64
  const docTo = to === undefined || to > newState.doc.nodeSize - 2 ? newState.doc.nodeSize - 2 : to;
66
- const ignore_nodes = isPreRelease2() ? IGNORE_NODES_NEXT : IGNORE_NODES;
65
+ const ignore_nodes = editorExperiment('advanced_layouts', true) ? IGNORE_NODES_NEXT : IGNORE_NODES;
67
66
  newState.doc.nodesBetween(docFrom, docTo, (node, pos, parent, index) => {
68
67
  let depth = 0;
69
68
  let anchorName;
@@ -10,7 +10,6 @@ import { DropTarget } from '../ui/drop-target';
10
10
  import { DropTargetLayout } from '../ui/drop-target-layout';
11
11
  import { DropTargetV2, EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_GAP, EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_OFFSET } from '../ui/drop-target-v2';
12
12
  import { getNestedDepth, TYPE_DROP_TARGET_DEC, unmountDecorations } from './decorations-common';
13
- import { isPreRelease2 } from './utils/advanced-layouts-flags';
14
13
  import { maxLayoutColumnSupported } from './utils/consts';
15
14
  import { isBlocksDragTargetDebug } from './utils/drag-target-debug';
16
15
  import { canMoveNodeToIndex, isInSameLayout } from './utils/validation';
@@ -175,7 +174,7 @@ export const dropTargetDecorations = (newState, api, formatMessage, nodeViewPort
175
174
  popNodeStack(depth);
176
175
  prevNodeStack.push(node);
177
176
  };
178
- const isAdvancedLayoutsPreRelease2 = isPreRelease2();
177
+ const isAdvancedLayoutsPreRelease2 = editorExperiment('advanced_layouts', true);
179
178
  newState.doc.nodesBetween(docFrom, docTo, (node, pos, parent, index) => {
180
179
  let depth = 0;
181
180
  // drop target deco at the end position
@@ -1,6 +1,5 @@
1
1
  import { fg } from '@atlaskit/platform-feature-flags';
2
2
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
- import { isPreRelease1, isPreRelease2 } from './utils/advanced-layouts-flags';
4
3
  const isEmptyNestedParagraphOrHeading = target => {
5
4
  if (target instanceof HTMLHeadingElement || target instanceof HTMLParagraphElement) {
6
5
  var _target$parentElement;
@@ -51,7 +50,7 @@ export const handleMouseOver = (view, event, api) => {
51
50
  if (editorExperiment('nested-dnd', true) && isEmptyNestedParagraphOrHeading(rootElement)) {
52
51
  return false;
53
52
  }
54
- if (rootElement.getAttribute('data-drag-handler-node-type') === 'media' && isPreRelease1()) {
53
+ if (rootElement.getAttribute('data-drag-handler-node-type') === 'media' && editorExperiment('advanced_layouts', true)) {
55
54
  rootElement = rootElement.closest('[data-drag-handler-anchor-name][data-drag-handler-node-type="mediaSingle"]');
56
55
  if (!rootElement) {
57
56
  return false;
@@ -95,7 +94,7 @@ export const handleMouseOver = (view, event, api) => {
95
94
  pos = view.posAtDOM(rootElement, 0);
96
95
  }
97
96
  const node = view.state.doc.nodeAt(pos);
98
- if (isPreRelease2() && node && isLayoutColumnWithoutContent(node)) {
97
+ if (editorExperiment('advanced_layouts', true) && node && isLayoutColumnWithoutContent(node)) {
99
98
  // Don't show drag handle when there is no content/only placeholder in layout column
100
99
  return false;
101
100
  }
@@ -17,7 +17,6 @@ import { dropTargetDecorations, findDropTargetDecs } from './decorations-drop-ta
17
17
  import { handleMouseOver } from './handle-mouse-over';
18
18
  import { boundKeydownHandler } from './keymap';
19
19
  import { defaultActiveAnchorTracker } from './utils/active-anchor-tracker';
20
- import { isPreRelease2 } from './utils/advanced-layouts-flags';
21
20
  import { AnchorRectCache, isAnchorSupported } from './utils/anchor-utils';
22
21
  import { isBlocksDragTargetDebug } from './utils/drag-target-debug';
23
22
  import { getTrMetadata } from './utils/transactions';
@@ -479,7 +478,7 @@ export const createPlugin = (api, getIntl, nodeViewPortalProviderAPI) => {
479
478
  return false;
480
479
  },
481
480
  dragenter(_view, event) {
482
- if (isPreRelease2()) {
481
+ if (editorExperiment('advanced_layouts', true)) {
483
482
  if (isHTMLElement(event.target)) {
484
483
  const closestParentElement = event.target.closest('[data-drag-handler-anchor-depth="0"]');
485
484
  if (closestParentElement) {
@@ -493,7 +492,7 @@ export const createPlugin = (api, getIntl, nodeViewPortalProviderAPI) => {
493
492
  },
494
493
  dragstart(view) {
495
494
  var _anchorRectCache;
496
- if (isPreRelease2()) {
495
+ if (editorExperiment('advanced_layouts', true)) {
497
496
  defaultActiveAnchorTracker.reset();
498
497
  }
499
498
  (_anchorRectCache = anchorRectCache) === null || _anchorRectCache === void 0 ? void 0 : _anchorRectCache.setEditorView(view);
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  import { EventEmitter } from 'events';
3
3
  import { useCallback, useEffect, useState } from 'react';
4
- import { isPreRelease2 } from './advanced-layouts-flags';
4
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
5
  export class ActiveAnchorTracker {
6
6
  constructor() {
7
7
  _defineProperty(this, "lastActiveAnchor", '');
@@ -44,7 +44,7 @@ export const useActiveAnchorTracker = (anchorName, activeAnchorTracker = default
44
44
  setIsActive(eventIsActive);
45
45
  };
46
46
  useEffect(() => {
47
- if (activeAnchorTracker && anchorName && isPreRelease2()) {
47
+ if (activeAnchorTracker && anchorName && editorExperiment('advanced_layouts', true)) {
48
48
  activeAnchorTracker.subscribe(anchorName, onActive);
49
49
  const unsubscribe = () => {
50
50
  activeAnchorTracker.unsubscribe(anchorName, onActive);
@@ -1,4 +1,4 @@
1
- import { isPreRelease2 } from './advanced-layouts-flags';
1
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
2
2
  export let DIRECTION = /*#__PURE__*/function (DIRECTION) {
3
3
  DIRECTION["UP"] = "up";
4
4
  DIRECTION["DOWN"] = "down";
@@ -7,6 +7,6 @@ export let DIRECTION = /*#__PURE__*/function (DIRECTION) {
7
7
  return DIRECTION;
8
8
  }({});
9
9
  export const maxLayoutColumnSupported = () => {
10
- return isPreRelease2() ? 5 : 3;
10
+ return editorExperiment('advanced_layouts', true) ? 5 : 3;
11
11
  };
12
12
  export const MIN_LAYOUT_COLUMN = 2;
@@ -1,5 +1,5 @@
1
1
  import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
2
- import { isPreRelease1, isPreRelease2 } from './advanced-layouts-flags';
2
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
3
  import { isWrappedMedia } from './check-media-layout';
4
4
  import { maxLayoutColumnSupported } from './consts';
5
5
  export const shouldAllowInlineDropTarget = (isNested, node,
@@ -7,17 +7,17 @@ export const shouldAllowInlineDropTarget = (isNested, node,
7
7
  * Is the active node in the same layout as the target node
8
8
  */
9
9
  isSameLayout = false, activeNode) => {
10
- if (!isPreRelease1() || isNested) {
10
+ if (editorExperiment('advanced_layouts', false) || isNested) {
11
11
  return false;
12
12
  }
13
13
  if (isWrappedMedia(node)) {
14
14
  return false;
15
15
  }
16
- if (isPreRelease2() && (activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) === 'layoutSection') {
16
+ if ((activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) === 'layoutSection') {
17
17
  return false;
18
18
  }
19
19
  if ((node === null || node === void 0 ? void 0 : node.type.name) === 'layoutSection') {
20
- return node.childCount < maxLayoutColumnSupported() || isPreRelease2() && isSameLayout;
20
+ return node.childCount < maxLayoutColumnSupported() || isSameLayout;
21
21
  }
22
22
  return !isEmptyParagraph(node);
23
23
  };
@@ -1,7 +1,6 @@
1
1
  import memoizeOne from 'memoize-one';
2
2
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
3
3
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
- import { isPreRelease2 } from './advanced-layouts-flags';
5
4
  export const isInsideTable = nodeType => {
6
5
  const {
7
6
  tableCell,
@@ -75,7 +74,7 @@ export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, destNod
75
74
  let srcNodeType = srcNode.type;
76
75
  const parentNodeType = destParent === null || destParent === void 0 ? void 0 : destParent.type.name;
77
76
  const activeNodeType = srcNode === null || srcNode === void 0 ? void 0 : srcNode.type.name;
78
- if (isPreRelease2() && activeNodeType === 'layoutColumn') {
77
+ if (activeNodeType === 'layoutColumn' && editorExperiment('advanced_layouts', true)) {
79
78
  // Allow drag layout column and drop into layout section
80
79
  if ((destNode === null || destNode === void 0 ? void 0 : destNode.type.name) === 'layoutSection' || parentNodeType === 'doc') {
81
80
  return true;
@@ -1,5 +1,5 @@
1
1
  import { akEditorUnitZIndex, akRichMediaResizeZIndex } from '@atlaskit/editor-shared-styles';
2
- import { fg } from '@atlaskit/platform-feature-flags';
2
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
3
  export const DRAG_HANDLE_HEIGHT = 24;
4
4
  export const DRAG_HANDLE_WIDTH = 12;
5
5
  export const DRAG_HANDLE_BORDER_RADIUS = 4;
@@ -18,7 +18,7 @@ export const dragHandleGap = (nodeType, parentNodeType) => {
18
18
  if (parentNodeType && parentNodeType !== 'doc') {
19
19
  return DRAG_HANDLE_NARROW_GAP;
20
20
  }
21
- if (nodeType === 'layoutSection' && fg('platform_editor_advanced_layouts_breakout_resizing')) {
21
+ if (nodeType === 'layoutSection' && editorExperiment('advanced_layouts', true)) {
22
22
  return DRAG_HANDLE_MAX_GAP + 12;
23
23
  }
24
24
  if (nodeTypeExcludeList.includes(nodeType)) {
@@ -46,7 +46,7 @@ export const getNestedNodeLeftPaddingMargin = nodeType => {
46
46
  }
47
47
  };
48
48
  export const topPositionAdjustment = nodeType => {
49
- if (fg('platform_editor_advanced_layouts_breakout_resizing')) {
49
+ if (editorExperiment('advanced_layouts', true)) {
50
50
  switch (nodeType) {
51
51
  case 'rule':
52
52
  return -DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT;
@@ -19,7 +19,6 @@ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
19
19
  import Tooltip from '@atlaskit/tooltip';
20
20
  import { key } from '../pm-plugins/main';
21
21
  import { getNestedNodePosition, selectNode } from '../pm-plugins/utils';
22
- import { isPreRelease2 } from '../pm-plugins/utils/advanced-layouts-flags';
23
22
  import { getLeftPosition, getTopPosition } from '../pm-plugins/utils/drag-handle-positions';
24
23
  import { DRAG_HANDLE_BORDER_RADIUS, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_WIDTH, DRAG_HANDLE_ZINDEX, dragHandleGap, topPositionAdjustment } from './consts';
25
24
  import { dragPreview } from './drag-preview';
@@ -130,7 +129,7 @@ export const DragHandle = ({
130
129
  // but ensures the preview is generated correctly.
131
130
  const handleMouseDown = useCallback(() => {
132
131
  var _api$core3;
133
- if (!(isLayoutColumn && isPreRelease2()) && fg('platform_editor_element_drag_and_drop_ed_24885')) {
132
+ if (!(isLayoutColumn && editorExperiment('advanced_layouts', true)) && fg('platform_editor_element_drag_and_drop_ed_24885')) {
134
133
  return undefined;
135
134
  }
136
135
  api === null || api === void 0 ? void 0 : (_api$core3 = api.core) === null || _api$core3 === void 0 ? void 0 : _api$core3.actions.execute(({
@@ -145,7 +144,7 @@ export const DragHandle = ({
145
144
  return tr;
146
145
  }
147
146
  let selection;
148
- if (isLayoutColumn && isPreRelease2()) {
147
+ if (isLayoutColumn && editorExperiment('advanced_layouts', true)) {
149
148
  selection = new NodeSelection(tr.doc.resolve(startPos));
150
149
  } else {
151
150
  const $startPos = tr.doc.resolve(startPos + node.nodeSize);
@@ -278,8 +277,8 @@ export const DragHandle = ({
278
277
  const isEdgeCase = (hasResizer || isExtension || isEmbedCard || isBlockCard) && innerContainer;
279
278
  if (supportsAnchor) {
280
279
  return {
281
- left: isEdgeCase ? `calc(anchor(${anchorName} start) + ${getLeftPosition(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType)})` : isPreRelease2() && isLayoutColumn ? `calc((anchor(${anchorName} right) + anchor(${anchorName} left))/2 - ${DRAG_HANDLE_HEIGHT / 2}px)` : `calc(anchor(${anchorName} start) - ${DRAG_HANDLE_WIDTH}px - ${dragHandleGap(nodeType, parentNodeType)}px)`,
282
- top: isPreRelease2() && isLayoutColumn ? `calc(anchor(${anchorName} top) - ${DRAG_HANDLE_WIDTH}px)` : fg('platform_editor_elements_dnd_ed_23674') ? `calc(anchor(${anchorName} start) + ${topPositionAdjustment(nodeType)}px)` : anchorName.includes('table') ? `calc(anchor(${anchorName} start) + ${DRAG_HANDLE_HEIGHT}px)` : `anchor(${anchorName} start)`
280
+ left: isEdgeCase ? `calc(anchor(${anchorName} start) + ${getLeftPosition(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType)})` : editorExperiment('advanced_layouts', true) && isLayoutColumn ? `calc((anchor(${anchorName} right) + anchor(${anchorName} left))/2 - ${DRAG_HANDLE_HEIGHT / 2}px)` : `calc(anchor(${anchorName} start) - ${DRAG_HANDLE_WIDTH}px - ${dragHandleGap(nodeType, parentNodeType)}px)`,
281
+ top: editorExperiment('advanced_layouts', true) && isLayoutColumn ? `calc(anchor(${anchorName} top) - ${DRAG_HANDLE_WIDTH}px)` : fg('platform_editor_elements_dnd_ed_23674') ? `calc(anchor(${anchorName} start) + ${topPositionAdjustment(nodeType)}px)` : anchorName.includes('table') ? `calc(anchor(${anchorName} start) + ${DRAG_HANDLE_HEIGHT}px)` : `anchor(${anchorName} start)`
283
282
  };
284
283
  }
285
284
  return {
@@ -398,7 +397,7 @@ export const DragHandle = ({
398
397
  // eslint-disable-next-line @atlaskit/design-system/no-html-button
399
398
  jsx("button", {
400
399
  type: "button",
401
- css: [dragHandleButtonStyles, isPreRelease2() && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && selectedStyles],
400
+ css: [dragHandleButtonStyles, editorExperiment('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && selectedStyles],
402
401
  ref: buttonRef
403
402
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
404
403
  ,
@@ -14,7 +14,6 @@ import { layers } from '@atlaskit/theme/constants';
14
14
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
15
15
  import { getNodeAnchor } from '../pm-plugins/decorations-common';
16
16
  import { useActiveAnchorTracker } from '../pm-plugins/utils/active-anchor-tracker';
17
- import { isPreRelease2 } from '../pm-plugins/utils/advanced-layouts-flags';
18
17
  import { isAnchorSupported } from '../pm-plugins/utils/anchor-utils';
19
18
  import { isBlocksDragTargetDebug } from '../pm-plugins/utils/drag-target-debug';
20
19
  import { shouldAllowInlineDropTarget } from '../pm-plugins/utils/inline-drop-target';
@@ -85,7 +84,7 @@ const HoverZone = ({
85
84
  return dropTargetForElements({
86
85
  element: ref.current,
87
86
  onDragEnter: () => {
88
- if (!isNestedDropTarget && isPreRelease2()) {
87
+ if (!isNestedDropTarget && editorExperiment('advanced_layouts', true)) {
89
88
  setActiveAnchor();
90
89
  }
91
90
  onDragEnter();
@@ -12,9 +12,9 @@ import { akEditorBreakoutPadding } from '@atlaskit/editor-shared-styles';
12
12
  import { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';
13
13
  import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
14
14
  import { B200 } from '@atlaskit/theme/colors';
15
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
15
16
  import { getNodeAnchor } from '../pm-plugins/decorations-common';
16
17
  import { useActiveAnchorTracker } from '../pm-plugins/utils/active-anchor-tracker';
17
- import { showResponsiveLayout } from '../pm-plugins/utils/advanced-layouts-flags';
18
18
  import { isAnchorSupported } from '../pm-plugins/utils/anchor-utils';
19
19
  import { isBlocksDragTargetDebug } from '../pm-plugins/utils/drag-target-debug';
20
20
  const hoverZoneCommonStyle = css({
@@ -72,7 +72,6 @@ export const InlineDropTarget = ({
72
72
  }, [nextNode]);
73
73
  const [isActiveAnchor] = useActiveAnchorTracker(anchorName);
74
74
  const isLeftPosition = position === 'left';
75
- const shouldShowResponsiveLayout = showResponsiveLayout();
76
75
  const nodeDimension = useMemo(() => {
77
76
  if (!nextNode) {
78
77
  return defaultNodeDimension;
@@ -113,7 +112,7 @@ export const InlineDropTarget = ({
113
112
 
114
113
  // Set the height target anchor name to the first or last column of the layout section so that it also works for stacked layout
115
114
  let heightTargetAnchorName = targetAnchorName;
116
- if (shouldShowResponsiveLayout && nextNode.type.name === 'layoutSection' && nextNode.firstChild && nextNode.lastChild) {
115
+ if (editorExperiment('advanced_layouts', true) && nextNode.type.name === 'layoutSection' && nextNode.firstChild && nextNode.lastChild) {
117
116
  heightTargetAnchorName = isLeftPosition ? getNodeAnchor(nextNode.firstChild) : getNodeAnchor(nextNode.lastChild);
118
117
  }
119
118
  if (isAnchorSupported()) {
@@ -146,7 +145,7 @@ export const InlineDropTarget = ({
146
145
  };
147
146
  }
148
147
  return defaultNodeDimension;
149
- }, [anchorName, anchorRectCache, nextNode, position, isLeftPosition, shouldShowResponsiveLayout]);
148
+ }, [anchorName, anchorRectCache, nextNode, position, isLeftPosition]);
150
149
  const onDrop = useCallback(() => {
151
150
  var _api$blockControls;
152
151
  const {
@@ -167,8 +166,8 @@ export const InlineDropTarget = ({
167
166
  }
168
167
  }, [api, getPos, position]);
169
168
  const inlineHoverZoneRectStyle = useMemo(() => {
170
- const isLayoutNode = (nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name) === 'layoutSection';
171
- const layoutAdjustment = isLayoutNode && shouldShowResponsiveLayout ? {
169
+ const isLayoutNode = editorExperiment('advanced_layouts', true) && (nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name) === 'layoutSection';
170
+ const layoutAdjustment = isLayoutNode ? {
172
171
  width: 11,
173
172
  height: 4,
174
173
  top: 6,
@@ -182,11 +181,11 @@ export const InlineDropTarget = ({
182
181
  top: `calc(anchor(top))`,
183
182
  width: nodeDimension.widthOffset ? `calc((100% - ${nodeDimension.width})/2 - ${GAP}px + ${nodeDimension.widthOffset} - ${(layoutAdjustment === null || layoutAdjustment === void 0 ? void 0 : layoutAdjustment.width) || 0}px)` : `calc((100% - ${nodeDimension.width})/2 - ${GAP}px - ${(layoutAdjustment === null || layoutAdjustment === void 0 ? void 0 : layoutAdjustment.width) || 0}px)`,
184
183
  height: `calc(${nodeDimension.height} + ${(layoutAdjustment === null || layoutAdjustment === void 0 ? void 0 : layoutAdjustment.height) || 0}px)`
185
- }, isLayoutNode && shouldShowResponsiveLayout && {
184
+ }, isLayoutNode && {
186
185
  top: isLeftPosition ? `calc(${nodeDimension.top} + ${(layoutAdjustment === null || layoutAdjustment === void 0 ? void 0 : layoutAdjustment.top) || 0}px)` : 'unset',
187
186
  bottom: isLeftPosition ? 'unset' : `calc(${nodeDimension.bottom} - ${(layoutAdjustment === null || layoutAdjustment === void 0 ? void 0 : layoutAdjustment.bottom) || 0}px)`
188
187
  });
189
- }, [anchorName, isLeftPosition, nodeDimension, nextNode, shouldShowResponsiveLayout]);
188
+ }, [nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name, anchorName, isLeftPosition, nodeDimension]);
190
189
  const dropIndicatorPos = useMemo(() => {
191
190
  return isLeftPosition ? 'right' : 'left';
192
191
  }, [isLeftPosition]);
@@ -3,7 +3,6 @@ import { Decoration } from '@atlaskit/editor-prosemirror/view';
3
3
  import { fg } from '@atlaskit/platform-feature-flags';
4
4
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
5
  import { getNestedDepth, getNodeAnchor, TYPE_NODE_DEC } from './decorations-common';
6
- import { isPreRelease1, isPreRelease2 } from './utils/advanced-layouts-flags';
7
6
  var IGNORE_NODES = ['tableCell', 'tableHeader', 'tableRow', 'listItem', 'caption', 'layoutColumn'];
8
7
  var IGNORE_NODES_NEXT = ['tableCell', 'tableHeader', 'tableRow', 'listItem', 'caption'];
9
8
  var IGNORE_NODE_DESCENDANTS = ['listItem', 'taskList', 'decisionList', 'mediaSingle'];
@@ -16,7 +15,7 @@ export var shouldDescendIntoNode = function shouldDescendIntoNode(node) {
16
15
  return false;
17
16
  }
18
17
  }
19
- if (isPreRelease1()) {
18
+ if (editorExperiment('advanced_layouts', true)) {
20
19
  return !IGNORE_NODE_DESCENDANTS_ADVANCED_LAYOUT.includes(node.type.name);
21
20
  }
22
21
  return !IGNORE_NODE_DESCENDANTS.includes(node.type.name);
@@ -26,7 +25,7 @@ var shouldIgnoreNode = function shouldIgnoreNode(node, ignore_nodes, depth, pare
26
25
 
27
26
  // TODO use isWrappedMedia when clean up the feature flag
28
27
  var isMediaSingle = 'mediaSingle' === node.type.name && fg('platform_editor_element_dnd_nested_fix_patch_1');
29
- var isFirstTableRow = (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'table' && depth === 1 && node === parent.firstChild && 'tableRow' === node.type.name && isPreRelease1();
28
+ var isFirstTableRow = (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'table' && depth === 1 && node === parent.firstChild && 'tableRow' === node.type.name && editorExperiment('advanced_layouts', true);
30
29
  if (isFirstTableRow) {
31
30
  return false;
32
31
  }
@@ -66,7 +65,7 @@ export var nodeDecorations = function nodeDecorations(newState, from, to) {
66
65
  var decs = [];
67
66
  var docFrom = from === undefined || from < 0 ? 0 : from;
68
67
  var docTo = to === undefined || to > newState.doc.nodeSize - 2 ? newState.doc.nodeSize - 2 : to;
69
- var ignore_nodes = isPreRelease2() ? IGNORE_NODES_NEXT : IGNORE_NODES;
68
+ var ignore_nodes = editorExperiment('advanced_layouts', true) ? IGNORE_NODES_NEXT : IGNORE_NODES;
70
69
  newState.doc.nodesBetween(docFrom, docTo, function (node, pos, parent, index) {
71
70
  var _Decoration$node;
72
71
  var depth = 0;
@@ -13,7 +13,6 @@ import { DropTarget } from '../ui/drop-target';
13
13
  import { DropTargetLayout } from '../ui/drop-target-layout';
14
14
  import { DropTargetV2, EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_GAP, EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_OFFSET } from '../ui/drop-target-v2';
15
15
  import { getNestedDepth, TYPE_DROP_TARGET_DEC, unmountDecorations } from './decorations-common';
16
- import { isPreRelease2 } from './utils/advanced-layouts-flags';
17
16
  import { maxLayoutColumnSupported } from './utils/consts';
18
17
  import { isBlocksDragTargetDebug } from './utils/drag-target-debug';
19
18
  import { canMoveNodeToIndex, isInSameLayout } from './utils/validation';
@@ -179,7 +178,7 @@ export var dropTargetDecorations = function dropTargetDecorations(newState, api,
179
178
  popNodeStack(depth);
180
179
  prevNodeStack.push(node);
181
180
  };
182
- var isAdvancedLayoutsPreRelease2 = isPreRelease2();
181
+ var isAdvancedLayoutsPreRelease2 = editorExperiment('advanced_layouts', true);
183
182
  newState.doc.nodesBetween(docFrom, docTo, function (node, pos, parent, index) {
184
183
  var depth = 0;
185
184
  // drop target deco at the end position
@@ -1,6 +1,5 @@
1
1
  import { fg } from '@atlaskit/platform-feature-flags';
2
2
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
- import { isPreRelease1, isPreRelease2 } from './utils/advanced-layouts-flags';
4
3
  var isEmptyNestedParagraphOrHeading = function isEmptyNestedParagraphOrHeading(target) {
5
4
  if (target instanceof HTMLHeadingElement || target instanceof HTMLParagraphElement) {
6
5
  var _target$parentElement;
@@ -50,7 +49,7 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
50
49
  if (editorExperiment('nested-dnd', true) && isEmptyNestedParagraphOrHeading(rootElement)) {
51
50
  return false;
52
51
  }
53
- if (rootElement.getAttribute('data-drag-handler-node-type') === 'media' && isPreRelease1()) {
52
+ if (rootElement.getAttribute('data-drag-handler-node-type') === 'media' && editorExperiment('advanced_layouts', true)) {
54
53
  rootElement = rootElement.closest('[data-drag-handler-anchor-name][data-drag-handler-node-type="mediaSingle"]');
55
54
  if (!rootElement) {
56
55
  return false;
@@ -94,7 +93,7 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
94
93
  pos = view.posAtDOM(rootElement, 0);
95
94
  }
96
95
  var node = view.state.doc.nodeAt(pos);
97
- if (isPreRelease2() && node && isLayoutColumnWithoutContent(node)) {
96
+ if (editorExperiment('advanced_layouts', true) && node && isLayoutColumnWithoutContent(node)) {
98
97
  // Don't show drag handle when there is no content/only placeholder in layout column
99
98
  return false;
100
99
  }
@@ -18,7 +18,6 @@ import { dropTargetDecorations, findDropTargetDecs } from './decorations-drop-ta
18
18
  import { handleMouseOver } from './handle-mouse-over';
19
19
  import { boundKeydownHandler } from './keymap';
20
20
  import { defaultActiveAnchorTracker } from './utils/active-anchor-tracker';
21
- import { isPreRelease2 } from './utils/advanced-layouts-flags';
22
21
  import { AnchorRectCache, isAnchorSupported } from './utils/anchor-utils';
23
22
  import { isBlocksDragTargetDebug } from './utils/drag-target-debug';
24
23
  import { getTrMetadata } from './utils/transactions';
@@ -495,7 +494,7 @@ export var createPlugin = function createPlugin(api, getIntl, nodeViewPortalProv
495
494
  return false;
496
495
  },
497
496
  dragenter: function dragenter(_view, event) {
498
- if (isPreRelease2()) {
497
+ if (editorExperiment('advanced_layouts', true)) {
499
498
  if (isHTMLElement(event.target)) {
500
499
  var closestParentElement = event.target.closest('[data-drag-handler-anchor-depth="0"]');
501
500
  if (closestParentElement) {
@@ -509,7 +508,7 @@ export var createPlugin = function createPlugin(api, getIntl, nodeViewPortalProv
509
508
  },
510
509
  dragstart: function dragstart(view) {
511
510
  var _anchorRectCache;
512
- if (isPreRelease2()) {
511
+ if (editorExperiment('advanced_layouts', true)) {
513
512
  defaultActiveAnchorTracker.reset();
514
513
  }
515
514
  (_anchorRectCache = anchorRectCache) === null || _anchorRectCache === void 0 || _anchorRectCache.setEditorView(view);
@@ -4,7 +4,7 @@ import _createClass from "@babel/runtime/helpers/createClass";
4
4
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
5
5
  import { EventEmitter } from 'events';
6
6
  import { useCallback, useEffect, useState } from 'react';
7
- import { isPreRelease2 } from './advanced-layouts-flags';
7
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
8
8
  export var ActiveAnchorTracker = /*#__PURE__*/function () {
9
9
  function ActiveAnchorTracker() {
10
10
  _classCallCheck(this, ActiveAnchorTracker);
@@ -62,7 +62,7 @@ export var useActiveAnchorTracker = function useActiveAnchorTracker(anchorName)
62
62
  setIsActive(eventIsActive);
63
63
  };
64
64
  useEffect(function () {
65
- if (activeAnchorTracker && anchorName && isPreRelease2()) {
65
+ if (activeAnchorTracker && anchorName && editorExperiment('advanced_layouts', true)) {
66
66
  activeAnchorTracker.subscribe(anchorName, onActive);
67
67
  var unsubscribe = function unsubscribe() {
68
68
  activeAnchorTracker.unsubscribe(anchorName, onActive);
@@ -1,4 +1,4 @@
1
- import { isPreRelease2 } from './advanced-layouts-flags';
1
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
2
2
  export var DIRECTION = /*#__PURE__*/function (DIRECTION) {
3
3
  DIRECTION["UP"] = "up";
4
4
  DIRECTION["DOWN"] = "down";
@@ -7,6 +7,6 @@ export var DIRECTION = /*#__PURE__*/function (DIRECTION) {
7
7
  return DIRECTION;
8
8
  }({});
9
9
  export var maxLayoutColumnSupported = function maxLayoutColumnSupported() {
10
- return isPreRelease2() ? 5 : 3;
10
+ return editorExperiment('advanced_layouts', true) ? 5 : 3;
11
11
  };
12
12
  export var MIN_LAYOUT_COLUMN = 2;
@@ -1,21 +1,21 @@
1
1
  import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
2
- import { isPreRelease1, isPreRelease2 } from './advanced-layouts-flags';
2
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
3
  import { isWrappedMedia } from './check-media-layout';
4
4
  import { maxLayoutColumnSupported } from './consts';
5
5
  export var shouldAllowInlineDropTarget = function shouldAllowInlineDropTarget(isNested, node) {
6
6
  var isSameLayout = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
7
7
  var activeNode = arguments.length > 3 ? arguments[3] : undefined;
8
- if (!isPreRelease1() || isNested) {
8
+ if (editorExperiment('advanced_layouts', false) || isNested) {
9
9
  return false;
10
10
  }
11
11
  if (isWrappedMedia(node)) {
12
12
  return false;
13
13
  }
14
- if (isPreRelease2() && (activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) === 'layoutSection') {
14
+ if ((activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) === 'layoutSection') {
15
15
  return false;
16
16
  }
17
17
  if ((node === null || node === void 0 ? void 0 : node.type.name) === 'layoutSection') {
18
- return node.childCount < maxLayoutColumnSupported() || isPreRelease2() && isSameLayout;
18
+ return node.childCount < maxLayoutColumnSupported() || isSameLayout;
19
19
  }
20
20
  return !isEmptyParagraph(node);
21
21
  };
@@ -1,7 +1,6 @@
1
1
  import memoizeOne from 'memoize-one';
2
2
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
3
3
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
- import { isPreRelease2 } from './advanced-layouts-flags';
5
4
  export var isInsideTable = function isInsideTable(nodeType) {
6
5
  var _nodeType$schema$node = nodeType.schema.nodes,
7
6
  tableCell = _nodeType$schema$node.tableCell,
@@ -73,7 +72,7 @@ export function canMoveNodeToIndex(destParent, indexIntoParent, srcNode, destNod
73
72
  var srcNodeType = srcNode.type;
74
73
  var parentNodeType = destParent === null || destParent === void 0 ? void 0 : destParent.type.name;
75
74
  var activeNodeType = srcNode === null || srcNode === void 0 ? void 0 : srcNode.type.name;
76
- if (isPreRelease2() && activeNodeType === 'layoutColumn') {
75
+ if (activeNodeType === 'layoutColumn' && editorExperiment('advanced_layouts', true)) {
77
76
  // Allow drag layout column and drop into layout section
78
77
  if ((destNode === null || destNode === void 0 ? void 0 : destNode.type.name) === 'layoutSection' || parentNodeType === 'doc') {
79
78
  return true;
@@ -1,7 +1,7 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
2
  var _dropTargetMarginMap;
3
3
  import { akEditorUnitZIndex, akRichMediaResizeZIndex } from '@atlaskit/editor-shared-styles';
4
- import { fg } from '@atlaskit/platform-feature-flags';
4
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
5
  export var DRAG_HANDLE_HEIGHT = 24;
6
6
  export var DRAG_HANDLE_WIDTH = 12;
7
7
  export var DRAG_HANDLE_BORDER_RADIUS = 4;
@@ -20,7 +20,7 @@ export var dragHandleGap = function dragHandleGap(nodeType, parentNodeType) {
20
20
  if (parentNodeType && parentNodeType !== 'doc') {
21
21
  return DRAG_HANDLE_NARROW_GAP;
22
22
  }
23
- if (nodeType === 'layoutSection' && fg('platform_editor_advanced_layouts_breakout_resizing')) {
23
+ if (nodeType === 'layoutSection' && editorExperiment('advanced_layouts', true)) {
24
24
  return DRAG_HANDLE_MAX_GAP + 12;
25
25
  }
26
26
  if (nodeTypeExcludeList.includes(nodeType)) {
@@ -48,7 +48,7 @@ export var getNestedNodeLeftPaddingMargin = function getNestedNodeLeftPaddingMar
48
48
  }
49
49
  };
50
50
  export var topPositionAdjustment = function topPositionAdjustment(nodeType) {
51
- if (fg('platform_editor_advanced_layouts_breakout_resizing')) {
51
+ if (editorExperiment('advanced_layouts', true)) {
52
52
  switch (nodeType) {
53
53
  case 'rule':
54
54
  return -DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT;
@@ -21,7 +21,6 @@ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
21
21
  import Tooltip from '@atlaskit/tooltip';
22
22
  import { key } from '../pm-plugins/main';
23
23
  import { getNestedNodePosition, selectNode } from '../pm-plugins/utils';
24
- import { isPreRelease2 } from '../pm-plugins/utils/advanced-layouts-flags';
25
24
  import { getLeftPosition, getTopPosition } from '../pm-plugins/utils/drag-handle-positions';
26
25
  import { DRAG_HANDLE_BORDER_RADIUS, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_WIDTH, DRAG_HANDLE_ZINDEX, dragHandleGap, topPositionAdjustment } from './consts';
27
26
  import { dragPreview } from './drag-preview';
@@ -138,7 +137,7 @@ export var DragHandle = function DragHandle(_ref) {
138
137
  // but ensures the preview is generated correctly.
139
138
  var handleMouseDown = useCallback(function () {
140
139
  var _api$core3;
141
- if (!(isLayoutColumn && isPreRelease2()) && fg('platform_editor_element_drag_and_drop_ed_24885')) {
140
+ if (!(isLayoutColumn && editorExperiment('advanced_layouts', true)) && fg('platform_editor_element_drag_and_drop_ed_24885')) {
142
141
  return undefined;
143
142
  }
144
143
  api === null || api === void 0 || (_api$core3 = api.core) === null || _api$core3 === void 0 || _api$core3.actions.execute(function (_ref3) {
@@ -152,7 +151,7 @@ export var DragHandle = function DragHandle(_ref) {
152
151
  return tr;
153
152
  }
154
153
  var selection;
155
- if (isLayoutColumn && isPreRelease2()) {
154
+ if (isLayoutColumn && editorExperiment('advanced_layouts', true)) {
156
155
  selection = new NodeSelection(tr.doc.resolve(startPos));
157
156
  } else {
158
157
  var $startPos = tr.doc.resolve(startPos + node.nodeSize);
@@ -285,8 +284,8 @@ export var DragHandle = function DragHandle(_ref) {
285
284
  var isEdgeCase = (hasResizer || isExtension || isEmbedCard || isBlockCard) && innerContainer;
286
285
  if (supportsAnchor) {
287
286
  return {
288
- left: isEdgeCase ? "calc(anchor(".concat(anchorName, " start) + ").concat(getLeftPosition(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType), ")") : isPreRelease2() && isLayoutColumn ? "calc((anchor(".concat(anchorName, " right) + anchor(").concat(anchorName, " left))/2 - ").concat(DRAG_HANDLE_HEIGHT / 2, "px)") : "calc(anchor(".concat(anchorName, " start) - ").concat(DRAG_HANDLE_WIDTH, "px - ").concat(dragHandleGap(nodeType, parentNodeType), "px)"),
289
- top: isPreRelease2() && isLayoutColumn ? "calc(anchor(".concat(anchorName, " top) - ").concat(DRAG_HANDLE_WIDTH, "px)") : fg('platform_editor_elements_dnd_ed_23674') ? "calc(anchor(".concat(anchorName, " start) + ").concat(topPositionAdjustment(nodeType), "px)") : anchorName.includes('table') ? "calc(anchor(".concat(anchorName, " start) + ").concat(DRAG_HANDLE_HEIGHT, "px)") : "anchor(".concat(anchorName, " start)")
287
+ left: isEdgeCase ? "calc(anchor(".concat(anchorName, " start) + ").concat(getLeftPosition(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType), ")") : editorExperiment('advanced_layouts', true) && isLayoutColumn ? "calc((anchor(".concat(anchorName, " right) + anchor(").concat(anchorName, " left))/2 - ").concat(DRAG_HANDLE_HEIGHT / 2, "px)") : "calc(anchor(".concat(anchorName, " start) - ").concat(DRAG_HANDLE_WIDTH, "px - ").concat(dragHandleGap(nodeType, parentNodeType), "px)"),
288
+ top: editorExperiment('advanced_layouts', true) && isLayoutColumn ? "calc(anchor(".concat(anchorName, " top) - ").concat(DRAG_HANDLE_WIDTH, "px)") : fg('platform_editor_elements_dnd_ed_23674') ? "calc(anchor(".concat(anchorName, " start) + ").concat(topPositionAdjustment(nodeType), "px)") : anchorName.includes('table') ? "calc(anchor(".concat(anchorName, " start) + ").concat(DRAG_HANDLE_HEIGHT, "px)") : "anchor(".concat(anchorName, " start)")
290
289
  };
291
290
  }
292
291
  return {
@@ -409,7 +408,7 @@ export var DragHandle = function DragHandle(_ref) {
409
408
  // eslint-disable-next-line @atlaskit/design-system/no-html-button
410
409
  jsx("button", {
411
410
  type: "button",
412
- css: [dragHandleButtonStyles, isPreRelease2() && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && selectedStyles],
411
+ css: [dragHandleButtonStyles, editorExperiment('advanced_layouts', true) && isLayoutColumn && layoutColumnDragHandleStyles, dragHandleSelected && selectedStyles],
413
412
  ref: buttonRef
414
413
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
415
414
  ,
@@ -16,7 +16,6 @@ import { layers } from '@atlaskit/theme/constants';
16
16
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
17
17
  import { getNodeAnchor } from '../pm-plugins/decorations-common';
18
18
  import { useActiveAnchorTracker } from '../pm-plugins/utils/active-anchor-tracker';
19
- import { isPreRelease2 } from '../pm-plugins/utils/advanced-layouts-flags';
20
19
  import { isAnchorSupported } from '../pm-plugins/utils/anchor-utils';
21
20
  import { isBlocksDragTargetDebug } from '../pm-plugins/utils/drag-target-debug';
22
21
  import { shouldAllowInlineDropTarget } from '../pm-plugins/utils/inline-drop-target';
@@ -89,7 +88,7 @@ var HoverZone = function HoverZone(_ref) {
89
88
  return dropTargetForElements({
90
89
  element: ref.current,
91
90
  onDragEnter: function onDragEnter() {
92
- if (!isNestedDropTarget && isPreRelease2()) {
91
+ if (!isNestedDropTarget && editorExperiment('advanced_layouts', true)) {
93
92
  setActiveAnchor();
94
93
  }
95
94
  _onDragEnter();
@@ -13,9 +13,9 @@ import { akEditorBreakoutPadding } from '@atlaskit/editor-shared-styles';
13
13
  import { DropIndicator } from '@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box';
14
14
  import { dropTargetForElements } from '@atlaskit/pragmatic-drag-and-drop/element/adapter';
15
15
  import { B200 } from '@atlaskit/theme/colors';
16
+ import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
16
17
  import { getNodeAnchor } from '../pm-plugins/decorations-common';
17
18
  import { useActiveAnchorTracker } from '../pm-plugins/utils/active-anchor-tracker';
18
- import { showResponsiveLayout } from '../pm-plugins/utils/advanced-layouts-flags';
19
19
  import { isAnchorSupported } from '../pm-plugins/utils/anchor-utils';
20
20
  import { isBlocksDragTargetDebug } from '../pm-plugins/utils/drag-target-debug';
21
21
  var hoverZoneCommonStyle = css({
@@ -77,7 +77,6 @@ export var InlineDropTarget = function InlineDropTarget(_ref) {
77
77
  _useActiveAnchorTrack2 = _slicedToArray(_useActiveAnchorTrack, 1),
78
78
  isActiveAnchor = _useActiveAnchorTrack2[0];
79
79
  var isLeftPosition = position === 'left';
80
- var shouldShowResponsiveLayout = showResponsiveLayout();
81
80
  var nodeDimension = useMemo(function () {
82
81
  if (!nextNode) {
83
82
  return defaultNodeDimension;
@@ -118,7 +117,7 @@ export var InlineDropTarget = function InlineDropTarget(_ref) {
118
117
 
119
118
  // Set the height target anchor name to the first or last column of the layout section so that it also works for stacked layout
120
119
  var heightTargetAnchorName = targetAnchorName;
121
- if (shouldShowResponsiveLayout && nextNode.type.name === 'layoutSection' && nextNode.firstChild && nextNode.lastChild) {
120
+ if (editorExperiment('advanced_layouts', true) && nextNode.type.name === 'layoutSection' && nextNode.firstChild && nextNode.lastChild) {
122
121
  heightTargetAnchorName = isLeftPosition ? getNodeAnchor(nextNode.firstChild) : getNodeAnchor(nextNode.lastChild);
123
122
  }
124
123
  if (isAnchorSupported()) {
@@ -151,7 +150,7 @@ export var InlineDropTarget = function InlineDropTarget(_ref) {
151
150
  };
152
151
  }
153
152
  return defaultNodeDimension;
154
- }, [anchorName, anchorRectCache, nextNode, position, isLeftPosition, shouldShowResponsiveLayout]);
153
+ }, [anchorName, anchorRectCache, nextNode, position, isLeftPosition]);
155
154
  var onDrop = useCallback(function () {
156
155
  var _api$blockControls;
157
156
  var _ref2 = (api === null || api === void 0 || (_api$blockControls = api.blockControls) === null || _api$blockControls === void 0 ? void 0 : _api$blockControls.sharedState.currentState()) || {},
@@ -169,8 +168,8 @@ export var InlineDropTarget = function InlineDropTarget(_ref) {
169
168
  }
170
169
  }, [api, getPos, position]);
171
170
  var inlineHoverZoneRectStyle = useMemo(function () {
172
- var isLayoutNode = (nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name) === 'layoutSection';
173
- var layoutAdjustment = isLayoutNode && shouldShowResponsiveLayout ? {
171
+ var isLayoutNode = editorExperiment('advanced_layouts', true) && (nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name) === 'layoutSection';
172
+ var layoutAdjustment = isLayoutNode ? {
174
173
  width: 11,
175
174
  height: 4,
176
175
  top: 6,
@@ -184,11 +183,11 @@ export var InlineDropTarget = function InlineDropTarget(_ref) {
184
183
  top: "calc(anchor(top))",
185
184
  width: nodeDimension.widthOffset ? "calc((100% - ".concat(nodeDimension.width, ")/2 - ").concat(GAP, "px + ").concat(nodeDimension.widthOffset, " - ").concat((layoutAdjustment === null || layoutAdjustment === void 0 ? void 0 : layoutAdjustment.width) || 0, "px)") : "calc((100% - ".concat(nodeDimension.width, ")/2 - ").concat(GAP, "px - ").concat((layoutAdjustment === null || layoutAdjustment === void 0 ? void 0 : layoutAdjustment.width) || 0, "px)"),
186
185
  height: "calc(".concat(nodeDimension.height, " + ").concat((layoutAdjustment === null || layoutAdjustment === void 0 ? void 0 : layoutAdjustment.height) || 0, "px)")
187
- }, isLayoutNode && shouldShowResponsiveLayout && {
186
+ }, isLayoutNode && {
188
187
  top: isLeftPosition ? "calc(".concat(nodeDimension.top, " + ").concat((layoutAdjustment === null || layoutAdjustment === void 0 ? void 0 : layoutAdjustment.top) || 0, "px)") : 'unset',
189
188
  bottom: isLeftPosition ? 'unset' : "calc(".concat(nodeDimension.bottom, " - ").concat((layoutAdjustment === null || layoutAdjustment === void 0 ? void 0 : layoutAdjustment.bottom) || 0, "px)")
190
189
  });
191
- }, [anchorName, isLeftPosition, nodeDimension, nextNode, shouldShowResponsiveLayout]);
190
+ }, [nextNode === null || nextNode === void 0 ? void 0 : nextNode.type.name, anchorName, isLeftPosition, nodeDimension]);
192
191
  var dropIndicatorPos = useMemo(function () {
193
192
  return isLeftPosition ? 'right' : 'left';
194
193
  }, [isLeftPosition]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "2.13.29",
3
+ "version": "2.13.30",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -157,18 +157,9 @@
157
157
  "platform_editor_drag_and_drop_target_v2": {
158
158
  "type": "boolean"
159
159
  },
160
- "platform_editor_advanced_layouts_pre_release_1": {
161
- "type": "boolean"
162
- },
163
- "platform_editor_advanced_layouts_pre_release_2": {
164
- "type": "boolean"
165
- },
166
160
  "platform_editor_advanced_layouts_redraw_on_drag": {
167
161
  "type": "boolean"
168
162
  },
169
- "platform_editor_advanced_layouts_breakout_resizing": {
170
- "type": "boolean"
171
- },
172
163
  "platform_editor_react18_plugin_portalprovider": {
173
164
  "type": "boolean"
174
165
  }
@@ -1,19 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.showResponsiveLayout = exports.isPreRelease2 = exports.isPreRelease1 = void 0;
7
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
8
- var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
9
- // When we turn on re-release 2, will also turn on pre-release 1
10
- // but not vice-versa
11
- var isPreRelease1 = exports.isPreRelease1 = function isPreRelease1() {
12
- return (0, _experiments.editorExperiment)('advanced_layouts', true) || (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_pre_release_1') || (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_pre_release_2');
13
- };
14
- var isPreRelease2 = exports.isPreRelease2 = function isPreRelease2() {
15
- return (0, _experiments.editorExperiment)('advanced_layouts', true) || (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_pre_release_2');
16
- };
17
- var showResponsiveLayout = exports.showResponsiveLayout = function showResponsiveLayout() {
18
- return (0, _experiments.editorExperiment)('advanced_layouts', true) && (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_breakout_resizing');
19
- };
@@ -1,14 +0,0 @@
1
- import { fg } from '@atlaskit/platform-feature-flags';
2
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
-
4
- // When we turn on re-release 2, will also turn on pre-release 1
5
- // but not vice-versa
6
- export const isPreRelease1 = () => {
7
- return editorExperiment('advanced_layouts', true) || fg('platform_editor_advanced_layouts_pre_release_1') || fg('platform_editor_advanced_layouts_pre_release_2');
8
- };
9
- export const isPreRelease2 = () => {
10
- return editorExperiment('advanced_layouts', true) || fg('platform_editor_advanced_layouts_pre_release_2');
11
- };
12
- export const showResponsiveLayout = () => {
13
- return editorExperiment('advanced_layouts', true) && fg('platform_editor_advanced_layouts_breakout_resizing');
14
- };
@@ -1,14 +0,0 @@
1
- import { fg } from '@atlaskit/platform-feature-flags';
2
- import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
-
4
- // When we turn on re-release 2, will also turn on pre-release 1
5
- // but not vice-versa
6
- export var isPreRelease1 = function isPreRelease1() {
7
- return editorExperiment('advanced_layouts', true) || fg('platform_editor_advanced_layouts_pre_release_1') || fg('platform_editor_advanced_layouts_pre_release_2');
8
- };
9
- export var isPreRelease2 = function isPreRelease2() {
10
- return editorExperiment('advanced_layouts', true) || fg('platform_editor_advanced_layouts_pre_release_2');
11
- };
12
- export var showResponsiveLayout = function showResponsiveLayout() {
13
- return editorExperiment('advanced_layouts', true) && fg('platform_editor_advanced_layouts_breakout_resizing');
14
- };
@@ -1,3 +0,0 @@
1
- export declare const isPreRelease1: () => boolean;
2
- export declare const isPreRelease2: () => boolean;
3
- export declare const showResponsiveLayout: () => boolean;
@@ -1,3 +0,0 @@
1
- export declare const isPreRelease1: () => boolean;
2
- export declare const isPreRelease2: () => boolean;
3
- export declare const showResponsiveLayout: () => boolean;