@atlaskit/editor-plugin-block-controls 2.15.12 → 2.16.0

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,25 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 2.16.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#180960](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/180960)
8
+ [`3ee72a54bc1bb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/3ee72a54bc1bb) -
9
+ ED-26040 fix editor layout padding issue
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 2.15.13
16
+
17
+ ### Patch Changes
18
+
19
+ - [#178794](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/178794)
20
+ [`a8c669da6eb60`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/a8c669da6eb60) -
21
+ ED-25991 Cleaned up "platform_editor_element_drag_and_drop_ed_24304" feature gate
22
+
3
23
  ## 2.15.12
4
24
 
5
25
  ### Patch Changes
@@ -491,7 +491,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api, getIntl, no
491
491
  }
492
492
 
493
493
  // TODO: Review usage of posAtDOM here
494
- var domPos = (0, _platformFeatureFlags.fg)('platform_editor_element_drag_and_drop_ed_24304') ? Math.max(view.posAtDOM(nodeElement, 0) - 1, 0) : view.posAtDOM(nodeElement, 0) - 1;
494
+ var domPos = Math.max(view.posAtDOM(nodeElement, 0) - 1, 0);
495
495
  var nodeTarget = state.doc.nodeAt(domPos);
496
496
  var isSameNode = !!(nodeTarget && draggable !== null && draggable !== void 0 && draggable.eq(nodeTarget));
497
497
  if (isSameNode) {
@@ -552,7 +552,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api, getIntl, no
552
552
  return true;
553
553
  }
554
554
  }
555
- if (event.shiftKey && event.ctrlKey && (0, _platformFeatureFlags.fg)('platform_editor_element_drag_and_drop_ed_23873')) {
555
+ if (event.shiftKey && event.ctrlKey) {
556
556
  //prevent holding down key combo from firing repeatedly
557
557
  if (!event.repeat && (0, _keymap.boundKeydownHandler)(api, formatMessage)(view, event)) {
558
558
  event.preventDefault();
@@ -7,6 +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_PARAGRAPH_TOP_ADJUSTMENT = exports.DRAG_HANDLE_NARROW_GAP = exports.DRAG_HANDLE_MAX_WIDTH_PLUS_GAP = exports.DRAG_HANDLE_MAX_GAP = exports.DRAG_HANDLE_LAYOUT_SECTION_TOP_ADJUSTMENT = 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_H2_TOP_ADJUSTMENT = exports.DRAG_HANDLE_H1_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
11
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
11
12
  var _dropTargetMarginMap;
12
13
  var DRAG_HANDLE_HEIGHT = exports.DRAG_HANDLE_HEIGHT = 24;
@@ -28,6 +29,9 @@ var DRAG_HANDLE_LAYOUT_SECTION_TOP_ADJUSTMENT = exports.DRAG_HANDLE_LAYOUT_SECTI
28
29
  var DRAG_HANDLE_PARAGRAPH_TOP_ADJUSTMENT = exports.DRAG_HANDLE_PARAGRAPH_TOP_ADJUSTMENT = 2;
29
30
  var nodeTypeExcludeList = ['embedCard', 'mediaSingle', 'table'];
30
31
  var dragHandleGap = exports.dragHandleGap = function dragHandleGap(nodeType, parentNodeType) {
32
+ if (nodeType === 'layoutSection' && (0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_post_fix_patch_2')) {
33
+ return DRAG_HANDLE_DEFAULT_GAP + 20;
34
+ }
31
35
  if (parentNodeType && parentNodeType !== 'doc') {
32
36
  return DRAG_HANDLE_NARROW_GAP;
33
37
  }
@@ -468,7 +468,7 @@ export const createPlugin = (api, getIntl, nodeViewPortalProviderAPI) => {
468
468
  }
469
469
 
470
470
  // TODO: Review usage of posAtDOM here
471
- const domPos = fg('platform_editor_element_drag_and_drop_ed_24304') ? Math.max(view.posAtDOM(nodeElement, 0) - 1, 0) : view.posAtDOM(nodeElement, 0) - 1;
471
+ const domPos = Math.max(view.posAtDOM(nodeElement, 0) - 1, 0);
472
472
  const nodeTarget = state.doc.nodeAt(domPos);
473
473
  const isSameNode = !!(nodeTarget && draggable !== null && draggable !== void 0 && draggable.eq(nodeTarget));
474
474
  if (isSameNode) {
@@ -532,7 +532,7 @@ export const createPlugin = (api, getIntl, nodeViewPortalProviderAPI) => {
532
532
  return true;
533
533
  }
534
534
  }
535
- if (event.shiftKey && event.ctrlKey && fg('platform_editor_element_drag_and_drop_ed_23873')) {
535
+ if (event.shiftKey && event.ctrlKey) {
536
536
  //prevent holding down key combo from firing repeatedly
537
537
  if (!event.repeat && boundKeydownHandler(api, formatMessage)(view, event)) {
538
538
  event.preventDefault();
@@ -1,4 +1,5 @@
1
1
  import { akEditorUnitZIndex, akRichMediaResizeZIndex } from '@atlaskit/editor-shared-styles';
2
+ import { fg } from '@atlaskit/platform-feature-flags';
2
3
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
3
4
  export const DRAG_HANDLE_HEIGHT = 24;
4
5
  export const DRAG_HANDLE_WIDTH = 12;
@@ -19,6 +20,9 @@ export const DRAG_HANDLE_LAYOUT_SECTION_TOP_ADJUSTMENT = 8;
19
20
  export const DRAG_HANDLE_PARAGRAPH_TOP_ADJUSTMENT = 2;
20
21
  const nodeTypeExcludeList = ['embedCard', 'mediaSingle', 'table'];
21
22
  export const dragHandleGap = (nodeType, parentNodeType) => {
23
+ if (nodeType === 'layoutSection' && fg('platform_editor_advanced_layouts_post_fix_patch_2')) {
24
+ return DRAG_HANDLE_DEFAULT_GAP + 20;
25
+ }
22
26
  if (parentNodeType && parentNodeType !== 'doc') {
23
27
  return DRAG_HANDLE_NARROW_GAP;
24
28
  }
@@ -484,7 +484,7 @@ export var createPlugin = function createPlugin(api, getIntl, nodeViewPortalProv
484
484
  }
485
485
 
486
486
  // TODO: Review usage of posAtDOM here
487
- var domPos = fg('platform_editor_element_drag_and_drop_ed_24304') ? Math.max(view.posAtDOM(nodeElement, 0) - 1, 0) : view.posAtDOM(nodeElement, 0) - 1;
487
+ var domPos = Math.max(view.posAtDOM(nodeElement, 0) - 1, 0);
488
488
  var nodeTarget = state.doc.nodeAt(domPos);
489
489
  var isSameNode = !!(nodeTarget && draggable !== null && draggable !== void 0 && draggable.eq(nodeTarget));
490
490
  if (isSameNode) {
@@ -545,7 +545,7 @@ export var createPlugin = function createPlugin(api, getIntl, nodeViewPortalProv
545
545
  return true;
546
546
  }
547
547
  }
548
- if (event.shiftKey && event.ctrlKey && fg('platform_editor_element_drag_and_drop_ed_23873')) {
548
+ if (event.shiftKey && event.ctrlKey) {
549
549
  //prevent holding down key combo from firing repeatedly
550
550
  if (!event.repeat && boundKeydownHandler(api, formatMessage)(view, event)) {
551
551
  event.preventDefault();
@@ -1,6 +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
5
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
5
6
  export var DRAG_HANDLE_HEIGHT = 24;
6
7
  export var DRAG_HANDLE_WIDTH = 12;
@@ -21,6 +22,9 @@ export var DRAG_HANDLE_LAYOUT_SECTION_TOP_ADJUSTMENT = 8;
21
22
  export var DRAG_HANDLE_PARAGRAPH_TOP_ADJUSTMENT = 2;
22
23
  var nodeTypeExcludeList = ['embedCard', 'mediaSingle', 'table'];
23
24
  export var dragHandleGap = function dragHandleGap(nodeType, parentNodeType) {
25
+ if (nodeType === 'layoutSection' && fg('platform_editor_advanced_layouts_post_fix_patch_2')) {
26
+ return DRAG_HANDLE_DEFAULT_GAP + 20;
27
+ }
24
28
  if (parentNodeType && parentNodeType !== 'doc') {
25
29
  return DRAG_HANDLE_NARROW_GAP;
26
30
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "2.15.12",
3
+ "version": "2.16.0",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@atlaskit/adf-schema": "^46.1.0",
34
- "@atlaskit/editor-common": "^96.5.0",
34
+ "@atlaskit/editor-common": "^96.8.0",
35
35
  "@atlaskit/editor-plugin-accessibility-utils": "^1.2.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^1.10.0",
37
37
  "@atlaskit/editor-plugin-editor-disabled": "^1.3.0",
@@ -48,7 +48,7 @@
48
48
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^1.1.0",
49
49
  "@atlaskit/primitives": "^13.3.0",
50
50
  "@atlaskit/theme": "^14.0.0",
51
- "@atlaskit/tmp-editor-statsig": "^2.27.0",
51
+ "@atlaskit/tmp-editor-statsig": "^2.29.0",
52
52
  "@atlaskit/tokens": "^2.5.0",
53
53
  "@atlaskit/tooltip": "^19.0.0",
54
54
  "@babel/runtime": "^7.0.0",
@@ -124,9 +124,6 @@
124
124
  "platform_editor_element_drag_and_drop_ed_24227": {
125
125
  "type": "boolean"
126
126
  },
127
- "platform_editor_element_drag_and_drop_ed_24304": {
128
- "type": "boolean"
129
- },
130
127
  "platform_editor_element_drag_and_drop_debug": {
131
128
  "type": "boolean"
132
129
  },
@@ -168,6 +165,9 @@
168
165
  },
169
166
  "platform_editor_advanced_layouts_post_fix_patch_1": {
170
167
  "type": "boolean"
168
+ },
169
+ "platform_editor_advanced_layouts_post_fix_patch_2": {
170
+ "type": "boolean"
171
171
  }
172
172
  }
173
173
  }