@atlaskit/editor-plugin-block-controls 7.11.0 → 7.11.1

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
+ ## 7.11.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`00c08e3995cb2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/00c08e3995cb2) -
8
+ Clean up platform_editor_block_menu_empty_line
9
+ - Updated dependencies
10
+
3
11
  ## 7.11.0
4
12
 
5
13
  ### Minor Changes
@@ -45,7 +45,7 @@ var moveNodeWithBlockMenu = exports.moveNodeWithBlockMenu = function moveNodeWit
45
45
  (0, _moveNode.moveNode)(api)(currentNodePos, moveToPos, _analytics.INPUT_METHOD.BLOCK_MENU)({
46
46
  tr: tr
47
47
  });
48
- if (tr.selection.empty && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu_empty_line', 'isEnabled', true)) {
48
+ if (tr.selection.empty && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
49
49
  var nodeAtCurrentPos = tr.doc.nodeAt(currentNodePos);
50
50
  var nodeAfter = tr.doc.nodeAt(moveToPos);
51
51
  var isConsecutiveEmptyLineMove = (nodeAtCurrentPos === null || nodeAtCurrentPos === void 0 ? void 0 : nodeAtCurrentPos.content.size) === 0 && (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.content.size) === 0;
@@ -14,7 +14,7 @@ var getCurrentNodePosFromDragHandleSelection = exports.getCurrentNodePosFromDrag
14
14
  schema = _ref.schema,
15
15
  resolve = _ref.resolve;
16
16
  var currentNodePos = -1;
17
- if (selection.empty && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu_empty_line', 'isEnabled', true)) {
17
+ if (selection.empty && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
18
18
  currentNodePos = selection.$from.pos;
19
19
  }
20
20
  if ((0, _utils.isTableSelected)(selection)) {
@@ -57,7 +57,7 @@ var getPosWhenMoveNodeDown = exports.getPosWhenMoveNodeDown = function getPosWhe
57
57
  return -1;
58
58
  }
59
59
  var nodeAfter = tr.doc.nodeAt(nodeAfterPos);
60
- if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu_empty_line', 'isEnabled', true)) {
60
+ if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
61
61
  var nodeAtCurrentPos = tr.doc.nodeAt($currentNodePos.pos);
62
62
  // if move empty line down to another empty line, move to the position of the next empty line
63
63
  if ((nodeAtCurrentPos === null || nodeAtCurrentPos === void 0 ? void 0 : nodeAtCurrentPos.content.size) === 0 && nodeAtCurrentPos.type.name !== 'extension' && (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.content.size) === 0 && nodeAfter.type.name !== 'extension') {
@@ -97,7 +97,7 @@ var newGetSelection = function newGetSelection(tr, start) {
97
97
 
98
98
  // if block menu and empty line format menu are enabled,
99
99
  // we want to set the selection to avoid the selection goes to the top of the document
100
- if ((isParagraphHeadingEmpty || isBlockQuoteEmpty || isListEmpty) && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu_empty_line', 'isEnabled', true)) {
100
+ if ((isParagraphHeadingEmpty || isBlockQuoteEmpty || isListEmpty) && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
101
101
  return _state.TextSelection.create(tr.doc, start + 1, start + 1);
102
102
  }
103
103
  var isBlockQuoteWithMediaOrExtension = nodeName === 'blockquote' && isNodeWithMediaOrExtension(tr, start, nodeSize);
@@ -40,7 +40,7 @@ export const moveNodeWithBlockMenu = (api, direction) => {
40
40
  moveNode(api)(currentNodePos, moveToPos, INPUT_METHOD.BLOCK_MENU)({
41
41
  tr
42
42
  });
43
- if (tr.selection.empty && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_empty_line', 'isEnabled', true)) {
43
+ if (tr.selection.empty && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
44
44
  const nodeAtCurrentPos = tr.doc.nodeAt(currentNodePos);
45
45
  const nodeAfter = tr.doc.nodeAt(moveToPos);
46
46
  const isConsecutiveEmptyLineMove = (nodeAtCurrentPos === null || nodeAtCurrentPos === void 0 ? void 0 : nodeAtCurrentPos.content.size) === 0 && (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.content.size) === 0;
@@ -9,7 +9,7 @@ export const getCurrentNodePosFromDragHandleSelection = ({
9
9
  resolve
10
10
  }) => {
11
11
  let currentNodePos = -1;
12
- if (selection.empty && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_empty_line', 'isEnabled', true)) {
12
+ if (selection.empty && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
13
13
  currentNodePos = selection.$from.pos;
14
14
  }
15
15
  if (isTableSelected(selection)) {
@@ -53,7 +53,7 @@ export const getPosWhenMoveNodeDown = ({
53
53
  return -1;
54
54
  }
55
55
  const nodeAfter = tr.doc.nodeAt(nodeAfterPos);
56
- if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_empty_line', 'isEnabled', true)) {
56
+ if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
57
57
  const nodeAtCurrentPos = tr.doc.nodeAt($currentNodePos.pos);
58
58
  // if move empty line down to another empty line, move to the position of the next empty line
59
59
  if ((nodeAtCurrentPos === null || nodeAtCurrentPos === void 0 ? void 0 : nodeAtCurrentPos.content.size) === 0 && nodeAtCurrentPos.type.name !== 'extension' && (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.content.size) === 0 && nodeAfter.type.name !== 'extension') {
@@ -92,7 +92,7 @@ const newGetSelection = (tr, start) => {
92
92
 
93
93
  // if block menu and empty line format menu are enabled,
94
94
  // we want to set the selection to avoid the selection goes to the top of the document
95
- if ((isParagraphHeadingEmpty || isBlockQuoteEmpty || isListEmpty) && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_empty_line', 'isEnabled', true)) {
95
+ if ((isParagraphHeadingEmpty || isBlockQuoteEmpty || isListEmpty) && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
96
96
  return TextSelection.create(tr.doc, start + 1, start + 1);
97
97
  }
98
98
  const isBlockQuoteWithMediaOrExtension = nodeName === 'blockquote' && isNodeWithMediaOrExtension(tr, start, nodeSize);
@@ -39,7 +39,7 @@ export var moveNodeWithBlockMenu = function moveNodeWithBlockMenu(api, direction
39
39
  moveNode(api)(currentNodePos, moveToPos, INPUT_METHOD.BLOCK_MENU)({
40
40
  tr: tr
41
41
  });
42
- if (tr.selection.empty && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_empty_line', 'isEnabled', true)) {
42
+ if (tr.selection.empty && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
43
43
  var nodeAtCurrentPos = tr.doc.nodeAt(currentNodePos);
44
44
  var nodeAfter = tr.doc.nodeAt(moveToPos);
45
45
  var isConsecutiveEmptyLineMove = (nodeAtCurrentPos === null || nodeAtCurrentPos === void 0 ? void 0 : nodeAtCurrentPos.content.size) === 0 && (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.content.size) === 0;
@@ -8,7 +8,7 @@ export var getCurrentNodePosFromDragHandleSelection = function getCurrentNodePos
8
8
  schema = _ref.schema,
9
9
  resolve = _ref.resolve;
10
10
  var currentNodePos = -1;
11
- if (selection.empty && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_empty_line', 'isEnabled', true)) {
11
+ if (selection.empty && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
12
12
  currentNodePos = selection.$from.pos;
13
13
  }
14
14
  if (isTableSelected(selection)) {
@@ -51,7 +51,7 @@ export var getPosWhenMoveNodeDown = function getPosWhenMoveNodeDown(_ref2) {
51
51
  return -1;
52
52
  }
53
53
  var nodeAfter = tr.doc.nodeAt(nodeAfterPos);
54
- if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_empty_line', 'isEnabled', true)) {
54
+ if (expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
55
55
  var nodeAtCurrentPos = tr.doc.nodeAt($currentNodePos.pos);
56
56
  // if move empty line down to another empty line, move to the position of the next empty line
57
57
  if ((nodeAtCurrentPos === null || nodeAtCurrentPos === void 0 ? void 0 : nodeAtCurrentPos.content.size) === 0 && nodeAtCurrentPos.type.name !== 'extension' && (nodeAfter === null || nodeAfter === void 0 ? void 0 : nodeAfter.content.size) === 0 && nodeAfter.type.name !== 'extension') {
@@ -91,7 +91,7 @@ var newGetSelection = function newGetSelection(tr, start) {
91
91
 
92
92
  // if block menu and empty line format menu are enabled,
93
93
  // we want to set the selection to avoid the selection goes to the top of the document
94
- if ((isParagraphHeadingEmpty || isBlockQuoteEmpty || isListEmpty) && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && expValEqualsNoExposure('platform_editor_block_menu_empty_line', 'isEnabled', true)) {
94
+ if ((isParagraphHeadingEmpty || isBlockQuoteEmpty || isListEmpty) && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
95
95
  return TextSelection.create(tr.doc, start + 1, start + 1);
96
96
  }
97
97
  var isBlockQuoteWithMediaOrExtension = nodeName === 'blockquote' && isNodeWithMediaOrExtension(tr, start, nodeSize);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "7.11.0",
3
+ "version": "7.11.1",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
55
55
  "@atlaskit/primitives": "^16.4.0",
56
56
  "@atlaskit/theme": "^21.0.0",
57
- "@atlaskit/tmp-editor-statsig": "^14.2.0",
57
+ "@atlaskit/tmp-editor-statsig": "^14.4.0",
58
58
  "@atlaskit/tokens": "^8.4.0",
59
59
  "@atlaskit/tooltip": "^20.10.0",
60
60
  "@babel/runtime": "^7.0.0",