@atlaskit/editor-plugin-block-controls 2.21.8 → 2.21.9

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,13 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 2.21.9
4
+
5
+ ### Patch Changes
6
+
7
+ - [#107812](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107812)
8
+ [`ddd7c48c0b504`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ddd7c48c0b504) -
9
+ ED-26408 Cleaned-up FG platform_editor_element_dnd_nested_a11y
10
+
3
11
  ## 2.21.8
4
12
 
5
13
  ### Patch Changes
@@ -79,7 +79,7 @@ var getCurrentNodePos = function getCurrentNodePos(state, isParentNodeOfTypeLayo
79
79
  // 2. caret cursor is inside the node
80
80
  // 3. the start of the selection is inside the node
81
81
  currentNodePos = selection.$from.before(1);
82
- if (selection.$from.depth > 0 && (0, _experiments.editorExperiment)('nested-dnd', true) && (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_a11y')) {
82
+ if (selection.$from.depth > 0 && (0, _experiments.editorExperiment)('nested-dnd', true)) {
83
83
  currentNodePos = (0, _getNestedNodePosition.getNestedNodePosition)(state);
84
84
  }
85
85
  }
@@ -88,7 +88,7 @@ var getCurrentNodePos = function getCurrentNodePos(state, isParentNodeOfTypeLayo
88
88
  var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, formatMessage) {
89
89
  return function (state) {
90
90
  var isParentNodeOfTypeLayout;
91
- var shouldEnableNestedDndA11y = (0, _experiments.editorExperiment)('nested-dnd', true) && (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_a11y');
91
+ var shouldEnableNestedDndA11y = (0, _experiments.editorExperiment)('nested-dnd', true);
92
92
  if (shouldEnableNestedDndA11y) {
93
93
  isParentNodeOfTypeLayout = !!(0, _utils2.findParentNodeOfType)([state.schema.nodes.layoutSection])(state.selection);
94
94
  }
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.showDragHandleAtSelection = void 0;
7
7
  var _utils = require("@atlaskit/editor-tables/utils");
8
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
9
8
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
10
9
  var _main = require("../pm-plugins/main");
11
10
  var _getNestedNodePosition = require("../pm-plugins/utils/getNestedNodePosition");
@@ -13,7 +12,7 @@ var showDragHandleAtSelection = exports.showDragHandleAtSelection = function sho
13
12
  return function (state, _, view) {
14
13
  var $from = state.selection.$from;
15
14
  var shouldFocusParentNode;
16
- if ($from.depth > 1 && (0, _experiments.editorExperiment)('nested-dnd', true) && (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_a11y')) {
15
+ if ($from.depth > 1 && (0, _experiments.editorExperiment)('nested-dnd', true)) {
17
16
  var _activeNode$handleOpt, _view$domAtPos;
18
17
  var _ref = _main.key.getState(state) || {},
19
18
  activeNode = _ref.activeNode;
@@ -30,7 +30,7 @@ function keymapList(api, formatMessage) {
30
30
  // Ignored via go/ees005
31
31
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
32
32
  _keymaps.dragToMoveDown.common, (0, _moveNode.moveNodeViaShortcut)(api, _consts.DIRECTION.DOWN, formatMessage), keymapList);
33
- if ((0, _experiments.editorExperiment)('nested-dnd', true) && (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_a11y')) {
33
+ if ((0, _experiments.editorExperiment)('nested-dnd', true)) {
34
34
  (0, _keymaps.bindKeymapWithCommand)(
35
35
  // Ignored via go/ees005
36
36
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -408,7 +408,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
408
408
  keymap: _keymaps.dragToMoveDown
409
409
  }];
410
410
  var isParentNodeOfTypeLayout;
411
- if (!isTopLevelNode && handleOptions !== null && handleOptions !== void 0 && handleOptions.isFocused && (0, _experiments.editorExperiment)('nested-dnd', true) && (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_a11y')) {
411
+ if (!isTopLevelNode && handleOptions !== null && handleOptions !== void 0 && handleOptions.isFocused && (0, _experiments.editorExperiment)('nested-dnd', true)) {
412
412
  isParentNodeOfTypeLayout = nodeType === 'layoutSection' || view.state.doc.resolve((0, _getNestedNodePosition.getNestedNodePosition)(view.state)).node().type.name === 'layoutColumn';
413
413
  if (isParentNodeOfTypeLayout) {
414
414
  helpDescriptors = [].concat((0, _toConsumableArray2.default)(helpDescriptors), [{
@@ -74,7 +74,7 @@ const getCurrentNodePos = (state, isParentNodeOfTypeLayout) => {
74
74
  // 2. caret cursor is inside the node
75
75
  // 3. the start of the selection is inside the node
76
76
  currentNodePos = selection.$from.before(1);
77
- if (selection.$from.depth > 0 && editorExperiment('nested-dnd', true) && fg('platform_editor_element_dnd_nested_a11y')) {
77
+ if (selection.$from.depth > 0 && editorExperiment('nested-dnd', true)) {
78
78
  currentNodePos = getNestedNodePosition(state);
79
79
  }
80
80
  }
@@ -83,7 +83,7 @@ const getCurrentNodePos = (state, isParentNodeOfTypeLayout) => {
83
83
  export const moveNodeViaShortcut = (api, direction, formatMessage) => {
84
84
  return state => {
85
85
  let isParentNodeOfTypeLayout;
86
- const shouldEnableNestedDndA11y = editorExperiment('nested-dnd', true) && fg('platform_editor_element_dnd_nested_a11y');
86
+ const shouldEnableNestedDndA11y = editorExperiment('nested-dnd', true);
87
87
  if (shouldEnableNestedDndA11y) {
88
88
  isParentNodeOfTypeLayout = !!findParentNodeOfType([state.schema.nodes.layoutSection])(state.selection);
89
89
  }
@@ -1,5 +1,4 @@
1
1
  import { isInTable } from '@atlaskit/editor-tables/utils';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
3
  import { key } from '../pm-plugins/main';
5
4
  import { getNestedNodePosition } from '../pm-plugins/utils/getNestedNodePosition';
@@ -8,7 +7,7 @@ export const showDragHandleAtSelection = (api, shouldFocusParentNode) => (state,
8
7
  $from
9
8
  } = state.selection;
10
9
  let shouldFocusParentNode;
11
- if ($from.depth > 1 && editorExperiment('nested-dnd', true) && fg('platform_editor_element_dnd_nested_a11y')) {
10
+ if ($from.depth > 1 && editorExperiment('nested-dnd', true)) {
12
11
  var _activeNode$handleOpt, _view$domAtPos;
13
12
  const {
14
13
  activeNode
@@ -24,7 +24,7 @@ function keymapList(api, formatMessage) {
24
24
  // Ignored via go/ees005
25
25
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
26
26
  dragToMoveDown.common, moveNodeViaShortcut(api, DIRECTION.DOWN, formatMessage), keymapList);
27
- if (editorExperiment('nested-dnd', true) && fg('platform_editor_element_dnd_nested_a11y')) {
27
+ if (editorExperiment('nested-dnd', true)) {
28
28
  bindKeymapWithCommand(
29
29
  // Ignored via go/ees005
30
30
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -388,7 +388,7 @@ export const DragHandle = ({
388
388
  keymap: dragToMoveDown
389
389
  }];
390
390
  let isParentNodeOfTypeLayout;
391
- if (!isTopLevelNode && handleOptions !== null && handleOptions !== void 0 && handleOptions.isFocused && editorExperiment('nested-dnd', true) && fg('platform_editor_element_dnd_nested_a11y')) {
391
+ if (!isTopLevelNode && handleOptions !== null && handleOptions !== void 0 && handleOptions.isFocused && editorExperiment('nested-dnd', true)) {
392
392
  isParentNodeOfTypeLayout = nodeType === 'layoutSection' || view.state.doc.resolve(getNestedNodePosition(view.state)).node().type.name === 'layoutColumn';
393
393
  if (isParentNodeOfTypeLayout) {
394
394
  helpDescriptors = [...helpDescriptors, {
@@ -73,7 +73,7 @@ var getCurrentNodePos = function getCurrentNodePos(state, isParentNodeOfTypeLayo
73
73
  // 2. caret cursor is inside the node
74
74
  // 3. the start of the selection is inside the node
75
75
  currentNodePos = selection.$from.before(1);
76
- if (selection.$from.depth > 0 && editorExperiment('nested-dnd', true) && fg('platform_editor_element_dnd_nested_a11y')) {
76
+ if (selection.$from.depth > 0 && editorExperiment('nested-dnd', true)) {
77
77
  currentNodePos = getNestedNodePosition(state);
78
78
  }
79
79
  }
@@ -82,7 +82,7 @@ var getCurrentNodePos = function getCurrentNodePos(state, isParentNodeOfTypeLayo
82
82
  export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, formatMessage) {
83
83
  return function (state) {
84
84
  var isParentNodeOfTypeLayout;
85
- var shouldEnableNestedDndA11y = editorExperiment('nested-dnd', true) && fg('platform_editor_element_dnd_nested_a11y');
85
+ var shouldEnableNestedDndA11y = editorExperiment('nested-dnd', true);
86
86
  if (shouldEnableNestedDndA11y) {
87
87
  isParentNodeOfTypeLayout = !!findParentNodeOfType([state.schema.nodes.layoutSection])(state.selection);
88
88
  }
@@ -1,5 +1,4 @@
1
1
  import { isInTable } from '@atlaskit/editor-tables/utils';
2
- import { fg } from '@atlaskit/platform-feature-flags';
3
2
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
4
3
  import { key } from '../pm-plugins/main';
5
4
  import { getNestedNodePosition } from '../pm-plugins/utils/getNestedNodePosition';
@@ -7,7 +6,7 @@ export var showDragHandleAtSelection = function showDragHandleAtSelection(api, s
7
6
  return function (state, _, view) {
8
7
  var $from = state.selection.$from;
9
8
  var shouldFocusParentNode;
10
- if ($from.depth > 1 && editorExperiment('nested-dnd', true) && fg('platform_editor_element_dnd_nested_a11y')) {
9
+ if ($from.depth > 1 && editorExperiment('nested-dnd', true)) {
11
10
  var _activeNode$handleOpt, _view$domAtPos;
12
11
  var _ref = key.getState(state) || {},
13
12
  activeNode = _ref.activeNode;
@@ -24,7 +24,7 @@ function keymapList(api, formatMessage) {
24
24
  // Ignored via go/ees005
25
25
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
26
26
  dragToMoveDown.common, moveNodeViaShortcut(api, DIRECTION.DOWN, formatMessage), keymapList);
27
- if (editorExperiment('nested-dnd', true) && fg('platform_editor_element_dnd_nested_a11y')) {
27
+ if (editorExperiment('nested-dnd', true)) {
28
28
  bindKeymapWithCommand(
29
29
  // Ignored via go/ees005
30
30
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -399,7 +399,7 @@ export var DragHandle = function DragHandle(_ref) {
399
399
  keymap: dragToMoveDown
400
400
  }];
401
401
  var isParentNodeOfTypeLayout;
402
- if (!isTopLevelNode && handleOptions !== null && handleOptions !== void 0 && handleOptions.isFocused && editorExperiment('nested-dnd', true) && fg('platform_editor_element_dnd_nested_a11y')) {
402
+ if (!isTopLevelNode && handleOptions !== null && handleOptions !== void 0 && handleOptions.isFocused && editorExperiment('nested-dnd', true)) {
403
403
  isParentNodeOfTypeLayout = nodeType === 'layoutSection' || view.state.doc.resolve(getNestedNodePosition(view.state)).node().type.name === 'layoutColumn';
404
404
  if (isParentNodeOfTypeLayout) {
405
405
  helpDescriptors = [].concat(_toConsumableArray(helpDescriptors), [{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "2.21.8",
3
+ "version": "2.21.9",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -115,9 +115,6 @@
115
115
  "platform_editor_element_dnd_nested_fix_patch_6": {
116
116
  "type": "boolean"
117
117
  },
118
- "platform_editor_element_dnd_nested_a11y": {
119
- "type": "boolean"
120
- },
121
118
  "platform_editor_advanced_layouts_redraw_on_drag": {
122
119
  "type": "boolean"
123
120
  },