@atlaskit/editor-plugin-block-controls 7.11.4 → 7.12.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,23 @@
1
1
  # @atlaskit/editor-plugin-block-controls
2
2
 
3
+ ## 7.12.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`79cafe9f09a05`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/79cafe9f09a05) -
8
+ EDITOR-3756 More general approach to support custom preserved selection mapping
9
+
10
+ ## 7.12.0
11
+
12
+ ### Minor Changes
13
+
14
+ - [`ed2e45b56a325`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ed2e45b56a325) -
15
+ ED-29696 fix CSS anchor selector
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies
20
+
3
21
  ## 7.11.4
4
22
 
5
23
  ### Patch Changes
@@ -15,6 +15,7 @@ var _types = require("@atlaskit/editor-common/types");
15
15
  var _utils = require("@atlaskit/editor-common/utils");
16
16
  var _model = require("@atlaskit/editor-prosemirror/model");
17
17
  var _state = require("@atlaskit/editor-prosemirror/state");
18
+ var _transform = require("@atlaskit/editor-prosemirror/transform");
18
19
  var _utils2 = require("@atlaskit/editor-prosemirror/utils");
19
20
  var _utils3 = require("@atlaskit/editor-tables/utils");
20
21
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
@@ -426,7 +427,11 @@ var moveNode = exports.moveNode = function moveNode(api) {
426
427
  if (inputMethod === _analytics.INPUT_METHOD.DRAG_AND_DROP) {
427
428
  tr = (0, _getSelection.setCursorPositionAtMovedNode)(tr, mappedTo, api);
428
429
  } else if (preservedSelection) {
429
- // do nothing here to allow the selection preservation plugin to handle mapping the selection
430
+ var _currMeta = tr.getMeta(_main.key);
431
+ var nodeMovedOffset = mappedTo - sliceFrom;
432
+ tr.setMeta(_main.key, _objectSpread(_objectSpread({}, _currMeta), {}, {
433
+ preservedSelectionMapping: new _transform.Mapping([new _transform.StepMap([0, 0, nodeMovedOffset])])
434
+ }));
430
435
  } else if (isMultiSelect) {
431
436
  var _api$blockControls$co;
432
437
  tr = (_api$blockControls$co = api === null || api === void 0 ? void 0 : api.blockControls.commands.setMultiSelectPositions(mappedTo, mappedTo + sliceSize)({
@@ -437,8 +442,7 @@ var moveNode = exports.moveNode = function moveNode(api) {
437
442
  }
438
443
  var currMeta = tr.getMeta(_main.key);
439
444
  tr.setMeta(_main.key, _objectSpread(_objectSpread({}, currMeta), {}, {
440
- nodeMoved: true,
441
- nodeMovedOffset: mappedTo - sliceFrom
445
+ nodeMoved: true
442
446
  }));
443
447
  api === null || api === void 0 || api.core.actions.focus();
444
448
  var $mappedTo = tr.doc.resolve(mappedTo);
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.mapPreservedSelection = exports.getSelectedSlicePosition = exports.getMultiSelectionIfPosInside = exports.expandSelectionHeadToNodeAtPos = exports.alignAnchorHeadInDirectionOfPos = void 0;
7
7
  var _selection = require("@atlaskit/editor-common/selection");
8
8
  var _state = require("@atlaskit/editor-prosemirror/state");
9
- var _transform = require("@atlaskit/editor-prosemirror/transform");
10
9
  var _main = require("../main");
11
10
  var _getSelection = require("./getSelection");
12
11
  var getMultiSelectionIfPosInside = exports.getMultiSelectionIfPosInside = function getMultiSelectionIfPosInside(api, pos, tr) {
@@ -91,9 +90,8 @@ var alignAnchorHeadInDirectionOfPos = exports.alignAnchorHeadInDirectionOfPos =
91
90
  */
92
91
  var mapPreservedSelection = exports.mapPreservedSelection = function mapPreservedSelection(selection, tr) {
93
92
  var _ref = (0, _main.getBlockControlsMeta)(tr) || {},
94
- nodeMoved = _ref.nodeMoved,
95
- nodeMovedOffset = _ref.nodeMovedOffset;
96
- var mapping = nodeMoved && typeof nodeMovedOffset === 'number' ? new _transform.Mapping([new _transform.StepMap([0, 0, nodeMovedOffset])]) : tr.mapping;
93
+ preservedSelectionMapping = _ref.preservedSelectionMapping;
94
+ var mapping = preservedSelectionMapping || tr.mapping;
97
95
  if (selection instanceof _state.TextSelection) {
98
96
  var from = mapping.map(selection.from);
99
97
  var to = mapping.map(selection.to);
@@ -405,29 +405,27 @@ var blockCardWithoutLayout = (0, _react.css)({
405
405
  '--ak-editor-block-card-width': 'max(var(--ak-editor--legacy-breakout-wide-layout-width), var(--ak-editor--line-length))'
406
406
  }
407
407
  });
408
+ var nextAnchorSelector = ['&[data-node-anchor]',
409
+ // adjacent sibling with anchor
410
+ '&:not([data-node-anchor]) [data-node-anchor]',
411
+ // nested anchor inside adjacent sibling
412
+ '&.ProseMirror-widget + [data-node-anchor]',
413
+ // adjacent sibling with anchor (when next to a widget like gap cursor)
414
+ '&.ProseMirror-widget + :not([data-node-anchor]) [data-node-anchor]' // nested anchor inside adjacent sibling (when next to a widget like gap cursor)
415
+ ].join(', ');
408
416
  var dragHandlerAnchorStyles = (0, _react.css)({
409
417
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
410
418
  '.ProseMirror': {
411
419
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
412
- '[data-testid="block-ctrl-decorator-widget"] + * [data-node-anchor]': {
420
+ '[data-testid="block-ctrl-decorator-widget"] + *': (0, _defineProperty2.default)({}, "".concat(nextAnchorSelector), {
413
421
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
414
422
  anchorName: "var(".concat(_styles.ANCHOR_VARIABLE_NAME, ", attr(data-node-anchor type(<custom-ident>)))")
415
- },
416
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
417
- '[data-testid="block-ctrl-quick-insert-button"] + * [data-node-anchor]': {
418
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
419
- anchorName: "var(".concat(_styles.ANCHOR_VARIABLE_NAME, ", attr(data-node-anchor type(<custom-ident>)))")
420
- },
423
+ }),
421
424
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
422
- '[data-testid="block-ctrl-decorator-widget"] + [data-node-anchor]': {
425
+ '[data-testid="block-ctrl-quick-insert-button"] + *': (0, _defineProperty2.default)({}, "".concat(nextAnchorSelector), {
423
426
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
424
427
  anchorName: "var(".concat(_styles.ANCHOR_VARIABLE_NAME, ", attr(data-node-anchor type(<custom-ident>)))")
425
- },
426
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
427
- '[data-testid="block-ctrl-quick-insert-button"] + [data-node-anchor]': {
428
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
429
- anchorName: "var(".concat(_styles.ANCHOR_VARIABLE_NAME, ", attr(data-node-anchor type(<custom-ident>)))")
430
- }
428
+ })
431
429
  }
432
430
  });
433
431
 
@@ -7,6 +7,7 @@ import { DIRECTION } from '@atlaskit/editor-common/types';
7
7
  import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
8
8
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
9
9
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
10
+ import { Mapping, StepMap } from '@atlaskit/editor-prosemirror/transform';
10
11
  import { findChildrenByType, findParentNodeOfType, findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
11
12
  import { findTable, isInTable, isTableSelected } from '@atlaskit/editor-tables/utils';
12
13
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -426,7 +427,12 @@ export const moveNode = api => (start, to, inputMethod = INPUT_METHOD.DRAG_AND_D
426
427
  if (inputMethod === INPUT_METHOD.DRAG_AND_DROP) {
427
428
  tr = setCursorPositionAtMovedNode(tr, mappedTo, api);
428
429
  } else if (preservedSelection) {
429
- // do nothing here to allow the selection preservation plugin to handle mapping the selection
430
+ const currMeta = tr.getMeta(key);
431
+ const nodeMovedOffset = mappedTo - sliceFrom;
432
+ tr.setMeta(key, {
433
+ ...currMeta,
434
+ preservedSelectionMapping: new Mapping([new StepMap([0, 0, nodeMovedOffset])])
435
+ });
430
436
  } else if (isMultiSelect) {
431
437
  var _api$blockControls$co2;
432
438
  tr = (_api$blockControls$co2 = api === null || api === void 0 ? void 0 : api.blockControls.commands.setMultiSelectPositions(mappedTo, mappedTo + sliceSize)({
@@ -438,8 +444,7 @@ export const moveNode = api => (start, to, inputMethod = INPUT_METHOD.DRAG_AND_D
438
444
  const currMeta = tr.getMeta(key);
439
445
  tr.setMeta(key, {
440
446
  ...currMeta,
441
- nodeMoved: true,
442
- nodeMovedOffset: mappedTo - sliceFrom
447
+ nodeMoved: true
443
448
  });
444
449
  api === null || api === void 0 ? void 0 : api.core.actions.focus();
445
450
  const $mappedTo = tr.doc.resolve(mappedTo);
@@ -1,6 +1,5 @@
1
1
  import { expandToBlockRange } from '@atlaskit/editor-common/selection';
2
2
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
3
- import { Mapping, StepMap } from '@atlaskit/editor-prosemirror/transform';
4
3
  import { getBlockControlsMeta, key } from '../main';
5
4
  import { collapseToSelectionRange } from './getSelection';
6
5
  export const getMultiSelectionIfPosInside = (api, pos, tr) => {
@@ -86,10 +85,9 @@ export const alignAnchorHeadInDirectionOfPos = (selection, pos) => {
86
85
  */
87
86
  export const mapPreservedSelection = (selection, tr) => {
88
87
  const {
89
- nodeMoved,
90
- nodeMovedOffset
88
+ preservedSelectionMapping
91
89
  } = getBlockControlsMeta(tr) || {};
92
- const mapping = nodeMoved && typeof nodeMovedOffset === 'number' ? new Mapping([new StepMap([0, 0, nodeMovedOffset])]) : tr.mapping;
90
+ const mapping = preservedSelectionMapping || tr.mapping;
93
91
  if (selection instanceof TextSelection) {
94
92
  const from = mapping.map(selection.from);
95
93
  const to = mapping.map(selection.to);
@@ -483,28 +483,32 @@ const blockCardWithoutLayout = css({
483
483
  '--ak-editor-block-card-width': 'max(var(--ak-editor--legacy-breakout-wide-layout-width), var(--ak-editor--line-length))'
484
484
  }
485
485
  });
486
+ const nextAnchorSelector = ['&[data-node-anchor]',
487
+ // adjacent sibling with anchor
488
+ '&:not([data-node-anchor]) [data-node-anchor]',
489
+ // nested anchor inside adjacent sibling
490
+ '&.ProseMirror-widget + [data-node-anchor]',
491
+ // adjacent sibling with anchor (when next to a widget like gap cursor)
492
+ '&.ProseMirror-widget + :not([data-node-anchor]) [data-node-anchor]' // nested anchor inside adjacent sibling (when next to a widget like gap cursor)
493
+ ].join(', ');
486
494
  const dragHandlerAnchorStyles = css({
487
495
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
488
496
  '.ProseMirror': {
489
497
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
490
- '[data-testid="block-ctrl-decorator-widget"] + * [data-node-anchor]': {
491
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
492
- anchorName: `var(${ANCHOR_VARIABLE_NAME}, attr(data-node-anchor type(<custom-ident>)))`
493
- },
494
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
495
- '[data-testid="block-ctrl-quick-insert-button"] + * [data-node-anchor]': {
496
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
497
- anchorName: `var(${ANCHOR_VARIABLE_NAME}, attr(data-node-anchor type(<custom-ident>)))`
498
- },
499
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
500
- '[data-testid="block-ctrl-decorator-widget"] + [data-node-anchor]': {
501
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
502
- anchorName: `var(${ANCHOR_VARIABLE_NAME}, attr(data-node-anchor type(<custom-ident>)))`
498
+ '[data-testid="block-ctrl-decorator-widget"] + *': {
499
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
500
+ [`${nextAnchorSelector}`]: {
501
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
502
+ anchorName: `var(${ANCHOR_VARIABLE_NAME}, attr(data-node-anchor type(<custom-ident>)))`
503
+ }
503
504
  },
504
505
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
505
- '[data-testid="block-ctrl-quick-insert-button"] + [data-node-anchor]': {
506
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
507
- anchorName: `var(${ANCHOR_VARIABLE_NAME}, attr(data-node-anchor type(<custom-ident>)))`
506
+ '[data-testid="block-ctrl-quick-insert-button"] + *': {
507
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors, @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
508
+ [`${nextAnchorSelector}`]: {
509
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
510
+ anchorName: `var(${ANCHOR_VARIABLE_NAME}, attr(data-node-anchor type(<custom-ident>)))`
511
+ }
508
512
  }
509
513
  }
510
514
  });
@@ -10,6 +10,7 @@ import { DIRECTION } from '@atlaskit/editor-common/types';
10
10
  import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
11
11
  import { Fragment, Slice } from '@atlaskit/editor-prosemirror/model';
12
12
  import { NodeSelection, Selection } from '@atlaskit/editor-prosemirror/state';
13
+ import { Mapping, StepMap } from '@atlaskit/editor-prosemirror/transform';
13
14
  import { findChildrenByType, findParentNodeOfType, findParentNodeOfTypeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
14
15
  import { findTable, isInTable, isTableSelected } from '@atlaskit/editor-tables/utils';
15
16
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -420,7 +421,11 @@ export var moveNode = function moveNode(api) {
420
421
  if (inputMethod === INPUT_METHOD.DRAG_AND_DROP) {
421
422
  tr = setCursorPositionAtMovedNode(tr, mappedTo, api);
422
423
  } else if (preservedSelection) {
423
- // do nothing here to allow the selection preservation plugin to handle mapping the selection
424
+ var _currMeta = tr.getMeta(key);
425
+ var nodeMovedOffset = mappedTo - sliceFrom;
426
+ tr.setMeta(key, _objectSpread(_objectSpread({}, _currMeta), {}, {
427
+ preservedSelectionMapping: new Mapping([new StepMap([0, 0, nodeMovedOffset])])
428
+ }));
424
429
  } else if (isMultiSelect) {
425
430
  var _api$blockControls$co;
426
431
  tr = (_api$blockControls$co = api === null || api === void 0 ? void 0 : api.blockControls.commands.setMultiSelectPositions(mappedTo, mappedTo + sliceSize)({
@@ -431,8 +436,7 @@ export var moveNode = function moveNode(api) {
431
436
  }
432
437
  var currMeta = tr.getMeta(key);
433
438
  tr.setMeta(key, _objectSpread(_objectSpread({}, currMeta), {}, {
434
- nodeMoved: true,
435
- nodeMovedOffset: mappedTo - sliceFrom
439
+ nodeMoved: true
436
440
  }));
437
441
  api === null || api === void 0 || api.core.actions.focus();
438
442
  var $mappedTo = tr.doc.resolve(mappedTo);
@@ -1,6 +1,5 @@
1
1
  import { expandToBlockRange } from '@atlaskit/editor-common/selection';
2
2
  import { NodeSelection, TextSelection } from '@atlaskit/editor-prosemirror/state';
3
- import { Mapping, StepMap } from '@atlaskit/editor-prosemirror/transform';
4
3
  import { getBlockControlsMeta, key } from '../main';
5
4
  import { collapseToSelectionRange } from './getSelection';
6
5
  export var getMultiSelectionIfPosInside = function getMultiSelectionIfPosInside(api, pos, tr) {
@@ -85,9 +84,8 @@ export var alignAnchorHeadInDirectionOfPos = function alignAnchorHeadInDirection
85
84
  */
86
85
  export var mapPreservedSelection = function mapPreservedSelection(selection, tr) {
87
86
  var _ref = getBlockControlsMeta(tr) || {},
88
- nodeMoved = _ref.nodeMoved,
89
- nodeMovedOffset = _ref.nodeMovedOffset;
90
- var mapping = nodeMoved && typeof nodeMovedOffset === 'number' ? new Mapping([new StepMap([0, 0, nodeMovedOffset])]) : tr.mapping;
87
+ preservedSelectionMapping = _ref.preservedSelectionMapping;
88
+ var mapping = preservedSelectionMapping || tr.mapping;
91
89
  if (selection instanceof TextSelection) {
92
90
  var from = mapping.map(selection.from);
93
91
  var to = mapping.map(selection.to);
@@ -398,29 +398,27 @@ var blockCardWithoutLayout = css({
398
398
  '--ak-editor-block-card-width': 'max(var(--ak-editor--legacy-breakout-wide-layout-width), var(--ak-editor--line-length))'
399
399
  }
400
400
  });
401
+ var nextAnchorSelector = ['&[data-node-anchor]',
402
+ // adjacent sibling with anchor
403
+ '&:not([data-node-anchor]) [data-node-anchor]',
404
+ // nested anchor inside adjacent sibling
405
+ '&.ProseMirror-widget + [data-node-anchor]',
406
+ // adjacent sibling with anchor (when next to a widget like gap cursor)
407
+ '&.ProseMirror-widget + :not([data-node-anchor]) [data-node-anchor]' // nested anchor inside adjacent sibling (when next to a widget like gap cursor)
408
+ ].join(', ');
401
409
  var dragHandlerAnchorStyles = css({
402
410
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
403
411
  '.ProseMirror': {
404
412
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
405
- '[data-testid="block-ctrl-decorator-widget"] + * [data-node-anchor]': {
413
+ '[data-testid="block-ctrl-decorator-widget"] + *': _defineProperty({}, "".concat(nextAnchorSelector), {
406
414
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
407
415
  anchorName: "var(".concat(ANCHOR_VARIABLE_NAME, ", attr(data-node-anchor type(<custom-ident>)))")
408
- },
409
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
410
- '[data-testid="block-ctrl-quick-insert-button"] + * [data-node-anchor]': {
411
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
412
- anchorName: "var(".concat(ANCHOR_VARIABLE_NAME, ", attr(data-node-anchor type(<custom-ident>)))")
413
- },
416
+ }),
414
417
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
415
- '[data-testid="block-ctrl-decorator-widget"] + [data-node-anchor]': {
418
+ '[data-testid="block-ctrl-quick-insert-button"] + *': _defineProperty({}, "".concat(nextAnchorSelector), {
416
419
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
417
420
  anchorName: "var(".concat(ANCHOR_VARIABLE_NAME, ", attr(data-node-anchor type(<custom-ident>)))")
418
- },
419
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
420
- '[data-testid="block-ctrl-quick-insert-button"] + [data-node-anchor]': {
421
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values, @atlaskit/ui-styling-standard/no-imported-style-values
422
- anchorName: "var(".concat(ANCHOR_VARIABLE_NAME, ", attr(data-node-anchor type(<custom-ident>)))")
423
- }
421
+ })
424
422
  }
425
423
  });
426
424
 
@@ -15,6 +15,7 @@ import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
15
15
  import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
16
16
  import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
17
17
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
18
+ import { type Mapping } from '@atlaskit/editor-prosemirror/transform';
18
19
  import { type DecorationSet } from '@atlaskit/editor-prosemirror/view';
19
20
  export type ActiveNode = {
20
21
  anchorName: string;
@@ -162,7 +163,7 @@ export type BlockControlsMeta = {
162
163
  editorBlurred: boolean;
163
164
  editorHeight: number;
164
165
  nodeMoved: boolean;
165
- nodeMovedOffset: number;
166
+ preservedSelectionMapping: Mapping;
166
167
  type: string;
167
168
  };
168
169
  export type MoveNodeMethod = INPUT_METHOD.DRAG_AND_DROP | INPUT_METHOD.SHORTCUT | INPUT_METHOD.BLOCK_MENU;
@@ -15,6 +15,7 @@ import type { TypeAheadPlugin } from '@atlaskit/editor-plugin-type-ahead';
15
15
  import type { UserIntentPlugin } from '@atlaskit/editor-plugin-user-intent';
16
16
  import type { WidthPlugin } from '@atlaskit/editor-plugin-width';
17
17
  import type { Selection } from '@atlaskit/editor-prosemirror/state';
18
+ import { type Mapping } from '@atlaskit/editor-prosemirror/transform';
18
19
  import { type DecorationSet } from '@atlaskit/editor-prosemirror/view';
19
20
  export type ActiveNode = {
20
21
  anchorName: string;
@@ -162,7 +163,7 @@ export type BlockControlsMeta = {
162
163
  editorBlurred: boolean;
163
164
  editorHeight: number;
164
165
  nodeMoved: boolean;
165
- nodeMovedOffset: number;
166
+ preservedSelectionMapping: Mapping;
166
167
  type: string;
167
168
  };
168
169
  export type MoveNodeMethod = INPUT_METHOD.DRAG_AND_DROP | INPUT_METHOD.SHORTCUT | INPUT_METHOD.BLOCK_MENU;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-block-controls",
3
- "version": "7.11.4",
3
+ "version": "7.12.1",
4
4
  "description": "Block controls plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",