@atlaskit/editor-plugin-block-controls 2.17.2 → 2.17.4

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,21 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 2.17.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [#101861](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/101861)
8
+ [`c936775aa003c`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c936775aa003c) -
9
+ [ED-26173] clean up FG platform_editor_element_dnd_nested_fix_patch_5
10
+
11
+ ## 2.17.3
12
+
13
+ ### Patch Changes
14
+
15
+ - [#101344](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/101344)
16
+ [`8e96b4a88757b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8e96b4a88757b) -
17
+ [ED-26175] clean up FG platform_editor_elements_dnd_ed_23674
18
+
3
19
  ## 2.17.2
4
20
 
5
21
  ### Patch Changes
@@ -34,6 +34,8 @@ var getTopPosition = exports.getTopPosition = function getTopPosition(dom, type)
34
34
  return "".concat(dom.offsetTop - _consts.DRAG_HANDLE_H5_TOP_ADJUSTMENT, "px");
35
35
  } else if (type === 'heading-6') {
36
36
  return "".concat(dom.offsetTop - _consts.DRAG_HANDLE_H6_TOP_ADJUSTMENT, "px");
37
+ } else if (type === 'paragraph') {
38
+ return "".concat(dom.offsetTop + _consts.DRAG_HANDLE_PARAGRAPH_TOP_ADJUSTMENT, "px");
37
39
  } else {
38
40
  return "".concat(dom.offsetTop, "px");
39
41
  }
@@ -287,7 +287,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
287
287
  var isExtension = nodeType === 'extension' || nodeType === 'bodiedExtension';
288
288
  var isBlockCard = nodeType === 'blockCard' && !!blockCardWidth;
289
289
  var isEmbedCard = nodeType === 'embedCard';
290
- var isMacroInteractionUpdates = (0, _platformFeatureFlags.fg)('platform_editor_element_dnd_nested_fix_patch_5') ? macroInteractionUpdates && isExtension : macroInteractionUpdates;
290
+ var isMacroInteractionUpdates = macroInteractionUpdates && isExtension;
291
291
  var innerContainer = null;
292
292
  if (dom) {
293
293
  if (isEmbedCard) {
@@ -305,12 +305,12 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
305
305
  if (supportsAnchor) {
306
306
  return {
307
307
  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)"),
308
- 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)")
308
+ top: (0, _experiments.editorExperiment)('advanced_layouts', true) && isLayoutColumn ? "calc(anchor(".concat(anchorName, " top) - ").concat(_consts.DRAG_HANDLE_WIDTH, "px)") : "calc(anchor(".concat(anchorName, " start) + ").concat((0, _consts.topPositionAdjustment)(nodeType), "px)")
309
309
  };
310
310
  }
311
311
  return {
312
312
  left: isEdgeCase ? "calc(".concat((dom === null || dom === void 0 ? void 0 : dom.offsetLeft) || 0, "px + ").concat((0, _dragHandlePositions.getLeftPosition)(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType), ")") : (0, _dragHandlePositions.getLeftPosition)(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType),
313
- top: (0, _platformFeatureFlags.fg)('platform_editor_elements_dnd_ed_23674') ? (0, _dragHandlePositions.getTopPosition)(dom, nodeType) : (0, _dragHandlePositions.getTopPosition)(dom)
313
+ top: (0, _dragHandlePositions.getTopPosition)(dom, nodeType)
314
314
  };
315
315
  }, [anchorName, nodeType, view, blockCardWidth, macroInteractionUpdates, getPos, isLayoutColumn]);
316
316
  var _useState5 = (0, _react.useState)({
@@ -1,5 +1,5 @@
1
1
  import { fg } from '@atlaskit/platform-feature-flags';
2
- import { DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT, DRAG_HANDLE_H1_TOP_ADJUSTMENT, DRAG_HANDLE_H2_TOP_ADJUSTMENT, DRAG_HANDLE_H4_TOP_ADJUSTMENT, DRAG_HANDLE_H5_TOP_ADJUSTMENT, DRAG_HANDLE_H6_TOP_ADJUSTMENT, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_WIDTH, dragHandleGap } from '../../ui/consts';
2
+ import { DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT, DRAG_HANDLE_H1_TOP_ADJUSTMENT, DRAG_HANDLE_H2_TOP_ADJUSTMENT, DRAG_HANDLE_H4_TOP_ADJUSTMENT, DRAG_HANDLE_H5_TOP_ADJUSTMENT, DRAG_HANDLE_H6_TOP_ADJUSTMENT, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_PARAGRAPH_TOP_ADJUSTMENT, DRAG_HANDLE_WIDTH, dragHandleGap } from '../../ui/consts';
3
3
  export const getTopPosition = (dom, type) => {
4
4
  if (!dom) {
5
5
  return 'auto';
@@ -28,6 +28,8 @@ export const getTopPosition = (dom, type) => {
28
28
  return `${dom.offsetTop - DRAG_HANDLE_H5_TOP_ADJUSTMENT}px`;
29
29
  } else if (type === 'heading-6') {
30
30
  return `${dom.offsetTop - DRAG_HANDLE_H6_TOP_ADJUSTMENT}px`;
31
+ } else if (type === 'paragraph') {
32
+ return `${dom.offsetTop + DRAG_HANDLE_PARAGRAPH_TOP_ADJUSTMENT}px`;
31
33
  } else {
32
34
  return `${dom.offsetTop}px`;
33
35
  }
@@ -271,7 +271,7 @@ export const DragHandle = ({
271
271
  const isExtension = nodeType === 'extension' || nodeType === 'bodiedExtension';
272
272
  const isBlockCard = nodeType === 'blockCard' && !!blockCardWidth;
273
273
  const isEmbedCard = nodeType === 'embedCard';
274
- const isMacroInteractionUpdates = fg('platform_editor_element_dnd_nested_fix_patch_5') ? macroInteractionUpdates && isExtension : macroInteractionUpdates;
274
+ const isMacroInteractionUpdates = macroInteractionUpdates && isExtension;
275
275
  let innerContainer = null;
276
276
  if (dom) {
277
277
  if (isEmbedCard) {
@@ -289,12 +289,12 @@ export const DragHandle = ({
289
289
  if (supportsAnchor) {
290
290
  return {
291
291
  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)`,
292
- 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)`
292
+ top: editorExperiment('advanced_layouts', true) && isLayoutColumn ? `calc(anchor(${anchorName} top) - ${DRAG_HANDLE_WIDTH}px)` : `calc(anchor(${anchorName} start) + ${topPositionAdjustment(nodeType)}px)`
293
293
  };
294
294
  }
295
295
  return {
296
296
  left: isEdgeCase ? `calc(${(dom === null || dom === void 0 ? void 0 : dom.offsetLeft) || 0}px + ${getLeftPosition(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType)})` : getLeftPosition(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType),
297
- top: fg('platform_editor_elements_dnd_ed_23674') ? getTopPosition(dom, nodeType) : getTopPosition(dom)
297
+ top: getTopPosition(dom, nodeType)
298
298
  };
299
299
  }, [anchorName, nodeType, view, blockCardWidth, macroInteractionUpdates, getPos, isLayoutColumn]);
300
300
  const [positionStyles, setPositionStyles] = useState({
@@ -1,5 +1,5 @@
1
1
  import { fg } from '@atlaskit/platform-feature-flags';
2
- import { DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT, DRAG_HANDLE_H1_TOP_ADJUSTMENT, DRAG_HANDLE_H2_TOP_ADJUSTMENT, DRAG_HANDLE_H4_TOP_ADJUSTMENT, DRAG_HANDLE_H5_TOP_ADJUSTMENT, DRAG_HANDLE_H6_TOP_ADJUSTMENT, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_WIDTH, dragHandleGap } from '../../ui/consts';
2
+ import { DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT, DRAG_HANDLE_H1_TOP_ADJUSTMENT, DRAG_HANDLE_H2_TOP_ADJUSTMENT, DRAG_HANDLE_H4_TOP_ADJUSTMENT, DRAG_HANDLE_H5_TOP_ADJUSTMENT, DRAG_HANDLE_H6_TOP_ADJUSTMENT, DRAG_HANDLE_HEIGHT, DRAG_HANDLE_PARAGRAPH_TOP_ADJUSTMENT, DRAG_HANDLE_WIDTH, dragHandleGap } from '../../ui/consts';
3
3
  export var getTopPosition = function getTopPosition(dom, type) {
4
4
  if (!dom) {
5
5
  return 'auto';
@@ -28,6 +28,8 @@ export var getTopPosition = function getTopPosition(dom, type) {
28
28
  return "".concat(dom.offsetTop - DRAG_HANDLE_H5_TOP_ADJUSTMENT, "px");
29
29
  } else if (type === 'heading-6') {
30
30
  return "".concat(dom.offsetTop - DRAG_HANDLE_H6_TOP_ADJUSTMENT, "px");
31
+ } else if (type === 'paragraph') {
32
+ return "".concat(dom.offsetTop + DRAG_HANDLE_PARAGRAPH_TOP_ADJUSTMENT, "px");
31
33
  } else {
32
34
  return "".concat(dom.offsetTop, "px");
33
35
  }
@@ -278,7 +278,7 @@ export var DragHandle = function DragHandle(_ref) {
278
278
  var isExtension = nodeType === 'extension' || nodeType === 'bodiedExtension';
279
279
  var isBlockCard = nodeType === 'blockCard' && !!blockCardWidth;
280
280
  var isEmbedCard = nodeType === 'embedCard';
281
- var isMacroInteractionUpdates = fg('platform_editor_element_dnd_nested_fix_patch_5') ? macroInteractionUpdates && isExtension : macroInteractionUpdates;
281
+ var isMacroInteractionUpdates = macroInteractionUpdates && isExtension;
282
282
  var innerContainer = null;
283
283
  if (dom) {
284
284
  if (isEmbedCard) {
@@ -296,12 +296,12 @@ export var DragHandle = function DragHandle(_ref) {
296
296
  if (supportsAnchor) {
297
297
  return {
298
298
  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)"),
299
- 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)")
299
+ top: editorExperiment('advanced_layouts', true) && isLayoutColumn ? "calc(anchor(".concat(anchorName, " top) - ").concat(DRAG_HANDLE_WIDTH, "px)") : "calc(anchor(".concat(anchorName, " start) + ").concat(topPositionAdjustment(nodeType), "px)")
300
300
  };
301
301
  }
302
302
  return {
303
303
  left: isEdgeCase ? "calc(".concat((dom === null || dom === void 0 ? void 0 : dom.offsetLeft) || 0, "px + ").concat(getLeftPosition(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType), ")") : getLeftPosition(dom, nodeType, innerContainer, isMacroInteractionUpdates, parentNodeType),
304
- top: fg('platform_editor_elements_dnd_ed_23674') ? getTopPosition(dom, nodeType) : getTopPosition(dom)
304
+ top: getTopPosition(dom, nodeType)
305
305
  };
306
306
  }, [anchorName, nodeType, view, blockCardWidth, macroInteractionUpdates, getPos, isLayoutColumn]);
307
307
  var _useState5 = useState({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "2.17.2",
3
+ "version": "2.17.4",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -41,14 +41,14 @@
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.2.0",
44
+ "@atlaskit/icon": "^23.3.0",
45
45
  "@atlaskit/platform-feature-flags": "^0.3.0",
46
46
  "@atlaskit/pragmatic-drag-and-drop": "^1.4.0",
47
47
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
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.32.0",
51
+ "@atlaskit/tmp-editor-statsig": "^2.33.0",
52
52
  "@atlaskit/tokens": "^2.5.0",
53
53
  "@atlaskit/tooltip": "^19.0.0",
54
54
  "@babel/runtime": "^7.0.0",
@@ -109,9 +109,6 @@
109
109
  "platform_editor_elements_drag_and_drop_ed_23189": {
110
110
  "type": "boolean"
111
111
  },
112
- "platform_editor_elements_dnd_ed_23674": {
113
- "type": "boolean"
114
- },
115
112
  "platform_editor_element_drag_and_drop_ed_23873": {
116
113
  "type": "boolean"
117
114
  },
@@ -127,9 +124,6 @@
127
124
  "platform_editor_element_dnd_nested_fix_patch_3": {
128
125
  "type": "boolean"
129
126
  },
130
- "platform_editor_element_dnd_nested_fix_patch_5": {
131
- "type": "boolean"
132
- },
133
127
  "platform_editor_element_dnd_nested_type_error_fix": {
134
128
  "type": "boolean"
135
129
  },