@atlaskit/editor-plugin-block-controls 4.2.4 → 4.2.6

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,18 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 4.2.6
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 4.2.5
10
+
11
+ ### Patch Changes
12
+
13
+ - [`6ae99901c8e16`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6ae99901c8e16) -
14
+ [ux] ED-29018 Fix block menu not opening when task list drag handle is clicked
15
+
3
16
  ## 4.2.4
4
17
 
5
18
  ### Patch Changes
@@ -18,6 +18,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
18
18
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
19
19
  var _utils3 = require("@atlaskit/editor-tables/utils");
20
20
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
21
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
21
22
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
22
23
  var _main = require("../pm-plugins/main");
23
24
  var _analytics2 = require("../pm-plugins/utils/analytics");
@@ -410,7 +411,12 @@ var moveNode = exports.moveNode = function moveNode(api) {
410
411
  if (!convertedNode) {
411
412
  return tr;
412
413
  }
413
- tr.delete(sliceFrom, sliceTo); // delete the content from the original position
414
+ if ((sourceNode === null || sourceNode === void 0 ? void 0 : sourceNode.type.name) === 'taskList' && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true)) {
415
+ sliceFrom = sliceFrom - 1;
416
+ }
417
+
418
+ // delete the content from the original position
419
+ tr.delete(sliceFrom, sliceTo);
414
420
  var mappedTo = tr.mapping.map(to);
415
421
  var isDestNestedLoneEmptyParagraph = destParent.type.name !== 'doc' && destParent.childCount === 1 && (0, _utils.isEmptyParagraph)($to.nodeAfter);
416
422
  if (convertedNodeSlice && isDestNestedLoneEmptyParagraph) {
@@ -9,6 +9,7 @@ var _state = require("@atlaskit/editor-prosemirror/state");
9
9
  var _utils = require("@atlaskit/editor-prosemirror/utils");
10
10
  var _utils2 = require("@atlaskit/editor-tables/utils");
11
11
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
+ var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
12
13
  var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
13
14
  var getInlineNodePos = exports.getInlineNodePos = function getInlineNodePos(tr, start, nodeSize) {
14
15
  var $startPos = tr.doc.resolve(start);
@@ -94,7 +95,7 @@ var newGetSelection = function newGetSelection(tr, start) {
94
95
  var $mediaStartPos = tr.doc.resolve(start + 1);
95
96
  return new _state.NodeSelection($mediaStartPos);
96
97
  }
97
- if (nodeName === 'taskList' && (0, _platformFeatureFlags.fg)('platform_editor_elements_dnd_multi_select_patch_1')) {
98
+ if (nodeName === 'taskList' && !(0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true) && (0, _platformFeatureFlags.fg)('platform_editor_elements_dnd_multi_select_patch_1')) {
98
99
  return _state.TextSelection.create(tr.doc, start, start + nodeSize);
99
100
  }
100
101
  var _getInlineNodePos2 = getInlineNodePos(tr, start, nodeSize),
@@ -10,6 +10,7 @@ import { Selection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
10
10
  import { findChildrenByType, findParentNodeOfType, findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
11
11
  import { findTable, isInTable, isTableSelected } from '@atlaskit/editor-tables/utils';
12
12
  import { fg } from '@atlaskit/platform-feature-flags';
13
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
13
14
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
14
15
  import { key } from '../pm-plugins/main';
15
16
  import { attachMoveNodeAnalytics, getMultiSelectAnalyticsAttributes } from '../pm-plugins/utils/analytics';
@@ -413,7 +414,12 @@ export const moveNode = api => (start, to, inputMethod = INPUT_METHOD.DRAG_AND_D
413
414
  if (!convertedNode) {
414
415
  return tr;
415
416
  }
416
- tr.delete(sliceFrom, sliceTo); // delete the content from the original position
417
+ if ((sourceNode === null || sourceNode === void 0 ? void 0 : sourceNode.type.name) === 'taskList' && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
418
+ sliceFrom = sliceFrom - 1;
419
+ }
420
+
421
+ // delete the content from the original position
422
+ tr.delete(sliceFrom, sliceTo);
417
423
  const mappedTo = tr.mapping.map(to);
418
424
  const isDestNestedLoneEmptyParagraph = destParent.type.name !== 'doc' && destParent.childCount === 1 && isEmptyParagraph($to.nodeAfter);
419
425
  if (convertedNodeSlice && isDestNestedLoneEmptyParagraph) {
@@ -3,6 +3,7 @@ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state
3
3
  import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
4
4
  import { selectTableClosestToPos } from '@atlaskit/editor-tables/utils';
5
5
  import { fg } from '@atlaskit/platform-feature-flags';
6
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
6
7
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
8
  export const getInlineNodePos = (tr, start, nodeSize) => {
8
9
  const $startPos = tr.doc.resolve(start);
@@ -89,7 +90,7 @@ const newGetSelection = (tr, start) => {
89
90
  const $mediaStartPos = tr.doc.resolve(start + 1);
90
91
  return new NodeSelection($mediaStartPos);
91
92
  }
92
- if (nodeName === 'taskList' && fg('platform_editor_elements_dnd_multi_select_patch_1')) {
93
+ if (nodeName === 'taskList' && !expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_elements_dnd_multi_select_patch_1')) {
93
94
  return TextSelection.create(tr.doc, start, start + nodeSize);
94
95
  }
95
96
  const {
@@ -13,6 +13,7 @@ import { Selection, NodeSelection } from '@atlaskit/editor-prosemirror/state';
13
13
  import { findChildrenByType, findParentNodeOfType, findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
14
14
  import { findTable, isInTable, isTableSelected } from '@atlaskit/editor-tables/utils';
15
15
  import { fg } from '@atlaskit/platform-feature-flags';
16
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
16
17
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
17
18
  import { key } from '../pm-plugins/main';
18
19
  import { attachMoveNodeAnalytics, getMultiSelectAnalyticsAttributes } from '../pm-plugins/utils/analytics';
@@ -404,7 +405,12 @@ export var moveNode = function moveNode(api) {
404
405
  if (!convertedNode) {
405
406
  return tr;
406
407
  }
407
- tr.delete(sliceFrom, sliceTo); // delete the content from the original position
408
+ if ((sourceNode === null || sourceNode === void 0 ? void 0 : sourceNode.type.name) === 'taskList' && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true)) {
409
+ sliceFrom = sliceFrom - 1;
410
+ }
411
+
412
+ // delete the content from the original position
413
+ tr.delete(sliceFrom, sliceTo);
408
414
  var mappedTo = tr.mapping.map(to);
409
415
  var isDestNestedLoneEmptyParagraph = destParent.type.name !== 'doc' && destParent.childCount === 1 && isEmptyParagraph($to.nodeAfter);
410
416
  if (convertedNodeSlice && isDestNestedLoneEmptyParagraph) {
@@ -3,6 +3,7 @@ import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state
3
3
  import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
4
4
  import { selectTableClosestToPos } from '@atlaskit/editor-tables/utils';
5
5
  import { fg } from '@atlaskit/platform-feature-flags';
6
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
6
7
  import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
7
8
  export var getInlineNodePos = function getInlineNodePos(tr, start, nodeSize) {
8
9
  var $startPos = tr.doc.resolve(start);
@@ -88,7 +89,7 @@ var newGetSelection = function newGetSelection(tr, start) {
88
89
  var $mediaStartPos = tr.doc.resolve(start + 1);
89
90
  return new NodeSelection($mediaStartPos);
90
91
  }
91
- if (nodeName === 'taskList' && fg('platform_editor_elements_dnd_multi_select_patch_1')) {
92
+ if (nodeName === 'taskList' && !expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true) && fg('platform_editor_elements_dnd_multi_select_patch_1')) {
92
93
  return TextSelection.create(tr.doc, start, start + nodeSize);
93
94
  }
94
95
  var _getInlineNodePos2 = getInlineNodePos(tr, start, nodeSize),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "4.2.4",
3
+ "version": "4.2.6",
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
  ".": "./src/index.ts"
32
32
  },
33
33
  "dependencies": {
34
- "@atlaskit/adf-schema": "^50.2.1",
34
+ "@atlaskit/adf-schema": "^50.2.2",
35
35
  "@atlaskit/editor-plugin-accessibility-utils": "^3.0.0",
36
36
  "@atlaskit/editor-plugin-analytics": "^3.0.0",
37
37
  "@atlaskit/editor-plugin-editor-disabled": "^3.0.0",
@@ -47,16 +47,16 @@
47
47
  "@atlaskit/editor-prosemirror": "7.0.0",
48
48
  "@atlaskit/editor-shared-styles": "^3.6.0",
49
49
  "@atlaskit/editor-tables": "^2.9.0",
50
- "@atlaskit/icon": "^28.0.0",
50
+ "@atlaskit/icon": "^28.1.0",
51
51
  "@atlaskit/link": "^3.2.0",
52
52
  "@atlaskit/platform-feature-flags": "^1.1.0",
53
53
  "@atlaskit/pragmatic-drag-and-drop": "^1.7.0",
54
54
  "@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
55
55
  "@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
56
- "@atlaskit/primitives": "^14.11.0",
57
- "@atlaskit/theme": "^19.0.0",
58
- "@atlaskit/tmp-editor-statsig": "^11.5.0",
59
- "@atlaskit/tokens": "^6.0.0",
56
+ "@atlaskit/primitives": "^14.12.0",
57
+ "@atlaskit/theme": "^20.0.0",
58
+ "@atlaskit/tmp-editor-statsig": "^11.8.0",
59
+ "@atlaskit/tokens": "^6.1.0",
60
60
  "@atlaskit/tooltip": "^20.4.0",
61
61
  "@babel/runtime": "^7.0.0",
62
62
  "@emotion/react": "^11.7.1",
@@ -67,7 +67,7 @@
67
67
  "uuid": "^3.1.0"
68
68
  },
69
69
  "peerDependencies": {
70
- "@atlaskit/editor-common": "^107.28.0",
70
+ "@atlaskit/editor-common": "^107.31.0",
71
71
  "react": "^18.2.0",
72
72
  "react-dom": "^18.2.0",
73
73
  "react-intl-next": "npm:react-intl@^5.18.1"