@atlaskit/editor-plugin-block-controls 2.21.7 → 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,22 @@
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
+
11
+ ## 2.21.8
12
+
13
+ ### Patch Changes
14
+
15
+ - [#107795](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/107795)
16
+ [`ccf90a27dfe6b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/ccf90a27dfe6b) -
17
+ ED-26407 Cleaned-up FG platform_editor_element_drag_and_drop_ed_24321
18
+ - Updated dependencies
19
+
3
20
  ## 2.21.7
4
21
 
5
22
  ### 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;
@@ -52,7 +51,7 @@ var showDragHandleAtSelection = exports.showDragHandleAtSelection = function sho
52
51
  var rootPos = $from.before(1);
53
52
  var dom = view === null || view === void 0 ? void 0 : view.domAtPos(rootPos, 0);
54
53
  var nodeElement = dom === null || dom === void 0 ? void 0 : dom.node.childNodes[dom === null || dom === void 0 ? void 0 : dom.offset];
55
- var rootNode = nodeElement && !nodeElement.hasAttribute('data-drag-handler-anchor-name') && (0, _platformFeatureFlags.fg)('platform_editor_element_drag_and_drop_ed_24321') ? nodeElement.querySelector('[data-drag-handler-anchor-name]') : nodeElement;
54
+ var rootNode = nodeElement && !nodeElement.hasAttribute('data-drag-handler-anchor-name') ? nodeElement.querySelector('[data-drag-handler-anchor-name]') : nodeElement;
56
55
  if (rootNode) {
57
56
  // Ignored via go/ees005
58
57
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -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
@@ -48,7 +47,7 @@ export const showDragHandleAtSelection = (api, shouldFocusParentNode) => (state,
48
47
  const rootPos = $from.before(1);
49
48
  const dom = view === null || view === void 0 ? void 0 : view.domAtPos(rootPos, 0);
50
49
  const nodeElement = dom === null || dom === void 0 ? void 0 : dom.node.childNodes[dom === null || dom === void 0 ? void 0 : dom.offset];
51
- const rootNode = nodeElement && !nodeElement.hasAttribute('data-drag-handler-anchor-name') && fg('platform_editor_element_drag_and_drop_ed_24321') ? nodeElement.querySelector('[data-drag-handler-anchor-name]') : nodeElement;
50
+ const rootNode = nodeElement && !nodeElement.hasAttribute('data-drag-handler-anchor-name') ? nodeElement.querySelector('[data-drag-handler-anchor-name]') : nodeElement;
52
51
  if (rootNode) {
53
52
  // Ignored via go/ees005
54
53
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -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;
@@ -46,7 +45,7 @@ export var showDragHandleAtSelection = function showDragHandleAtSelection(api, s
46
45
  var rootPos = $from.before(1);
47
46
  var dom = view === null || view === void 0 ? void 0 : view.domAtPos(rootPos, 0);
48
47
  var nodeElement = dom === null || dom === void 0 ? void 0 : dom.node.childNodes[dom === null || dom === void 0 ? void 0 : dom.offset];
49
- var rootNode = nodeElement && !nodeElement.hasAttribute('data-drag-handler-anchor-name') && fg('platform_editor_element_drag_and_drop_ed_24321') ? nodeElement.querySelector('[data-drag-handler-anchor-name]') : nodeElement;
48
+ var rootNode = nodeElement && !nodeElement.hasAttribute('data-drag-handler-anchor-name') ? nodeElement.querySelector('[data-drag-handler-anchor-name]') : nodeElement;
50
49
  if (rootNode) {
51
50
  // Ignored via go/ees005
52
51
  // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
@@ -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.7",
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",
@@ -31,26 +31,26 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@atlaskit/adf-schema": "^46.1.0",
34
- "@atlaskit/editor-common": "^99.5.0",
35
- "@atlaskit/editor-plugin-accessibility-utils": "^1.2.0",
34
+ "@atlaskit/editor-common": "^99.7.0",
35
+ "@atlaskit/editor-plugin-accessibility-utils": "^1.3.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.11.0",
37
- "@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
37
+ "@atlaskit/editor-plugin-editor-disabled": "^1.4.0",
38
38
  "@atlaskit/editor-plugin-feature-flags": "^1.2.0",
39
- "@atlaskit/editor-plugin-quick-insert": "^1.8.0",
39
+ "@atlaskit/editor-plugin-quick-insert": "^1.9.0",
40
40
  "@atlaskit/editor-plugin-width": "^2.0.0",
41
41
  "@atlaskit/editor-prosemirror": "6.2.1",
42
42
  "@atlaskit/editor-shared-styles": "^3.2.0",
43
43
  "@atlaskit/editor-tables": "^2.8.0",
44
- "@atlaskit/icon": "^23.4.0",
44
+ "@atlaskit/icon": "^23.5.0",
45
45
  "@atlaskit/platform-feature-flags": "^0.3.0",
46
- "@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
46
+ "@atlaskit/pragmatic-drag-and-drop": "^1.5.0",
47
47
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
48
- "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.1.0",
49
- "@atlaskit/primitives": "^13.3.0",
50
- "@atlaskit/theme": "^14.0.0",
48
+ "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.2.0",
49
+ "@atlaskit/primitives": "^13.4.0",
50
+ "@atlaskit/theme": "^14.1.0",
51
51
  "@atlaskit/tmp-editor-statsig": "^2.41.0",
52
- "@atlaskit/tokens": "^3.2.0",
53
- "@atlaskit/tooltip": "^19.0.0",
52
+ "@atlaskit/tokens": "^3.3.0",
53
+ "@atlaskit/tooltip": "^19.1.0",
54
54
  "@babel/runtime": "^7.0.0",
55
55
  "@emotion/react": "^11.7.1",
56
56
  "bind-event-listener": "^3.0.0",
@@ -112,15 +112,9 @@
112
112
  "platform_editor_element_drag_and_drop_ed_23873": {
113
113
  "type": "boolean"
114
114
  },
115
- "platform_editor_element_drag_and_drop_ed_24321": {
116
- "type": "boolean"
117
- },
118
115
  "platform_editor_element_dnd_nested_fix_patch_6": {
119
116
  "type": "boolean"
120
117
  },
121
- "platform_editor_element_dnd_nested_a11y": {
122
- "type": "boolean"
123
- },
124
118
  "platform_editor_advanced_layouts_redraw_on_drag": {
125
119
  "type": "boolean"
126
120
  },