@atlaskit/editor-plugin-block-controls 7.12.1 → 7.13.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 +19 -0
- package/dist/cjs/editor-commands/move-node-with-block-menu.js +30 -5
- package/dist/cjs/editor-commands/move-node.js +5 -1
- package/dist/cjs/pm-plugins/handle-mouse-over.js +1 -1
- package/dist/cjs/ui/global-styles.js +3 -3
- package/dist/es2019/editor-commands/move-node-with-block-menu.js +31 -6
- package/dist/es2019/editor-commands/move-node.js +5 -1
- package/dist/es2019/pm-plugins/handle-mouse-over.js +1 -1
- package/dist/es2019/ui/global-styles.js +3 -3
- package/dist/esm/editor-commands/move-node-with-block-menu.js +30 -6
- package/dist/esm/editor-commands/move-node.js +5 -1
- package/dist/esm/pm-plugins/handle-mouse-over.js +1 -1
- package/dist/esm/ui/global-styles.js +3 -3
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 7.13.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`fdcaf17b021af`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fdcaf17b021af) -
|
|
8
|
+
Editor-2676: keep block menu open when move up down clicked
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 7.13.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`b3a509f727a0f`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/b3a509f727a0f) -
|
|
16
|
+
ED-29696 update CSS anchor selector to enable less anchors
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 7.12.1
|
|
4
23
|
|
|
5
24
|
### Patch Changes
|
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
7
|
exports.moveNodeWithBlockMenu = void 0;
|
|
8
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
7
9
|
var _analytics = require("@atlaskit/editor-common/analytics");
|
|
8
10
|
var _types = require("@atlaskit/editor-common/types");
|
|
9
11
|
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
12
|
+
var _main = require("../pm-plugins/main");
|
|
13
|
+
var _selection = require("../pm-plugins/utils/selection");
|
|
10
14
|
var _moveNode = require("./move-node");
|
|
11
15
|
var _moveNodeUtils = require("./utils/move-node-utils");
|
|
16
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
17
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
12
18
|
var getSelectionToIndex = function getSelectionToIndex(fromIndex, $to, depth) {
|
|
13
19
|
var toIndex = $to.index(depth);
|
|
14
20
|
var toIndexAfter = $to.indexAfter(depth);
|
|
@@ -40,12 +46,13 @@ var moveNodeWithBlockMenu = exports.moveNodeWithBlockMenu = function moveNodeWit
|
|
|
40
46
|
$to = selection.$to;
|
|
41
47
|
var depth = tr.doc.resolve(currentNodePos).depth;
|
|
42
48
|
var fromIndex = $from.index(depth);
|
|
49
|
+
var trAfterNodeMove = tr;
|
|
43
50
|
if (direction === _types.DIRECTION.UP) {
|
|
44
51
|
if (fromIndex > 0) {
|
|
45
52
|
var moveToPos = $from.posAtIndex(fromIndex - 1, depth);
|
|
46
|
-
|
|
53
|
+
trAfterNodeMove = (0, _moveNode.moveNode)(api)(currentNodePos, moveToPos, _analytics.INPUT_METHOD.BLOCK_MENU)({
|
|
47
54
|
tr: tr
|
|
48
|
-
});
|
|
55
|
+
}) || tr;
|
|
49
56
|
}
|
|
50
57
|
} else {
|
|
51
58
|
// selectionToIndex is the index of the last node in the selection
|
|
@@ -54,11 +61,29 @@ var moveNodeWithBlockMenu = exports.moveNodeWithBlockMenu = function moveNodeWit
|
|
|
54
61
|
var moveToIndex = selectionToIndex + 2;
|
|
55
62
|
if (moveToIndex <= $to.node(depth).childCount) {
|
|
56
63
|
var _moveToPos = $to.posAtIndex(moveToIndex, depth);
|
|
57
|
-
|
|
64
|
+
trAfterNodeMove = (0, _moveNode.moveNode)(api)(currentNodePos, _moveToPos, _analytics.INPUT_METHOD.BLOCK_MENU)({
|
|
58
65
|
tr: tr
|
|
59
|
-
});
|
|
66
|
+
}) || tr;
|
|
60
67
|
}
|
|
61
68
|
}
|
|
62
|
-
|
|
69
|
+
|
|
70
|
+
// map selection
|
|
71
|
+
var mappedSelection = (0, _selection.mapPreservedSelection)(selection, trAfterNodeMove);
|
|
72
|
+
if (mappedSelection) {
|
|
73
|
+
trAfterNodeMove.setSelection(mappedSelection);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
//recalculate canMoveUp and canMoveDown
|
|
77
|
+
var _canMoveNodeUpOrDown = (0, _moveNodeUtils.canMoveNodeUpOrDown)(trAfterNodeMove),
|
|
78
|
+
moveUp = _canMoveNodeUpOrDown.moveUp,
|
|
79
|
+
moveDown = _canMoveNodeUpOrDown.moveDown;
|
|
80
|
+
var currentMeta = trAfterNodeMove.getMeta(_main.key);
|
|
81
|
+
var newMeta = _objectSpread(_objectSpread({}, currentMeta), {
|
|
82
|
+
toggleMenu: {
|
|
83
|
+
moveUp: moveUp,
|
|
84
|
+
moveDown: moveDown
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
return trAfterNodeMove.setMeta(_main.key, newMeta);
|
|
63
88
|
};
|
|
64
89
|
};
|
|
@@ -444,7 +444,11 @@ var moveNode = exports.moveNode = function moveNode(api) {
|
|
|
444
444
|
tr.setMeta(_main.key, _objectSpread(_objectSpread({}, currMeta), {}, {
|
|
445
445
|
nodeMoved: true
|
|
446
446
|
}));
|
|
447
|
-
|
|
447
|
+
if (
|
|
448
|
+
// when move node via block menu, we need to keep the focus on block menu popup, so don't move focus to editor in this scenario
|
|
449
|
+
!(inputMethod === _analytics.INPUT_METHOD.BLOCK_MENU && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_editor_block_menu', 'isEnabled', true))) {
|
|
450
|
+
api === null || api === void 0 || api.core.actions.focus();
|
|
451
|
+
}
|
|
448
452
|
var $mappedTo = tr.doc.resolve(mappedTo);
|
|
449
453
|
var expandAncestor = (0, _utils2.findParentNodeOfTypeClosestToPos)($to, [expand, nestedExpand]);
|
|
450
454
|
if (expandAncestor) {
|
|
@@ -32,7 +32,7 @@ var getNodeSelector = function getNodeSelector(ignoreNodes, ignoreNodeDescendant
|
|
|
32
32
|
var ignoreNodeDescendantsSelectorList = ignoreNodeDescendants.map(function (node) {
|
|
33
33
|
if (node === 'table') {
|
|
34
34
|
// Special case for table to exclude its direct descendants
|
|
35
|
-
return ["[data-prosemirror-node-name=\"tableCell\"] > [data-node-anchor]", "[data-prosemirror-node-name=\"tableHeader\"] > [data-node-anchor]"];
|
|
35
|
+
return ["[data-prosemirror-node-name=\"tableCell\"] > [data-node-anchor]", "[data-prosemirror-node-name=\"tableCell\"] > *:not([data-node-anchor]) > [data-node-anchor]", "[data-prosemirror-node-name=\"tableHeader\"] > [data-node-anchor]", "[data-prosemirror-node-name=\"tableHeader\"] > *:not([data-node-anchor]) > [data-node-anchor]"];
|
|
36
36
|
}
|
|
37
37
|
return "[data-prosemirror-node-name=\"".concat(node, "\"] [data-node-anchor]");
|
|
38
38
|
});
|
|
@@ -407,11 +407,11 @@ var blockCardWithoutLayout = (0, _react.css)({
|
|
|
407
407
|
});
|
|
408
408
|
var nextAnchorSelector = ['&[data-node-anchor]',
|
|
409
409
|
// adjacent sibling with anchor
|
|
410
|
-
'&:not([data-node-anchor]) [data-node-anchor]',
|
|
411
|
-
// nested anchor inside adjacent sibling
|
|
410
|
+
'&:not([data-node-anchor]) [data-node-anchor]:first-of-type',
|
|
411
|
+
// first nested anchor inside adjacent sibling
|
|
412
412
|
'&.ProseMirror-widget + [data-node-anchor]',
|
|
413
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)
|
|
414
|
+
'&.ProseMirror-widget + :not([data-node-anchor]) [data-node-anchor]:first-of-type' // first nested anchor inside adjacent sibling (when next to a widget like gap cursor)
|
|
415
415
|
].join(', ');
|
|
416
416
|
var dragHandlerAnchorStyles = (0, _react.css)({
|
|
417
417
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
2
|
import { DIRECTION } from '@atlaskit/editor-common/types';
|
|
3
3
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
4
|
+
import { key } from '../pm-plugins/main';
|
|
5
|
+
import { mapPreservedSelection } from '../pm-plugins/utils/selection';
|
|
4
6
|
import { moveNode } from './move-node';
|
|
5
|
-
import { getCurrentNodePosFromDragHandleSelection } from './utils/move-node-utils';
|
|
7
|
+
import { canMoveNodeUpOrDown, getCurrentNodePosFromDragHandleSelection } from './utils/move-node-utils';
|
|
6
8
|
const getSelectionToIndex = (fromIndex, $to, depth) => {
|
|
7
9
|
const toIndex = $to.index(depth);
|
|
8
10
|
const toIndexAfter = $to.indexAfter(depth);
|
|
@@ -37,12 +39,13 @@ export const moveNodeWithBlockMenu = (api, direction) => {
|
|
|
37
39
|
} = selection;
|
|
38
40
|
const depth = tr.doc.resolve(currentNodePos).depth;
|
|
39
41
|
const fromIndex = $from.index(depth);
|
|
42
|
+
let trAfterNodeMove = tr;
|
|
40
43
|
if (direction === DIRECTION.UP) {
|
|
41
44
|
if (fromIndex > 0) {
|
|
42
45
|
const moveToPos = $from.posAtIndex(fromIndex - 1, depth);
|
|
43
|
-
|
|
46
|
+
trAfterNodeMove = moveNode(api)(currentNodePos, moveToPos, INPUT_METHOD.BLOCK_MENU)({
|
|
44
47
|
tr
|
|
45
|
-
});
|
|
48
|
+
}) || tr;
|
|
46
49
|
}
|
|
47
50
|
} else {
|
|
48
51
|
// selectionToIndex is the index of the last node in the selection
|
|
@@ -51,11 +54,33 @@ export const moveNodeWithBlockMenu = (api, direction) => {
|
|
|
51
54
|
const moveToIndex = selectionToIndex + 2;
|
|
52
55
|
if (moveToIndex <= $to.node(depth).childCount) {
|
|
53
56
|
const moveToPos = $to.posAtIndex(moveToIndex, depth);
|
|
54
|
-
|
|
57
|
+
trAfterNodeMove = moveNode(api)(currentNodePos, moveToPos, INPUT_METHOD.BLOCK_MENU)({
|
|
55
58
|
tr
|
|
56
|
-
});
|
|
59
|
+
}) || tr;
|
|
57
60
|
}
|
|
58
61
|
}
|
|
59
|
-
|
|
62
|
+
|
|
63
|
+
// map selection
|
|
64
|
+
const mappedSelection = mapPreservedSelection(selection, trAfterNodeMove);
|
|
65
|
+
if (mappedSelection) {
|
|
66
|
+
trAfterNodeMove.setSelection(mappedSelection);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
//recalculate canMoveUp and canMoveDown
|
|
70
|
+
const {
|
|
71
|
+
moveUp,
|
|
72
|
+
moveDown
|
|
73
|
+
} = canMoveNodeUpOrDown(trAfterNodeMove);
|
|
74
|
+
const currentMeta = trAfterNodeMove.getMeta(key);
|
|
75
|
+
const newMeta = {
|
|
76
|
+
...currentMeta,
|
|
77
|
+
...{
|
|
78
|
+
toggleMenu: {
|
|
79
|
+
moveUp,
|
|
80
|
+
moveDown
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
return trAfterNodeMove.setMeta(key, newMeta);
|
|
60
85
|
};
|
|
61
86
|
};
|
|
@@ -446,7 +446,11 @@ export const moveNode = api => (start, to, inputMethod = INPUT_METHOD.DRAG_AND_D
|
|
|
446
446
|
...currMeta,
|
|
447
447
|
nodeMoved: true
|
|
448
448
|
});
|
|
449
|
-
|
|
449
|
+
if (
|
|
450
|
+
// when move node via block menu, we need to keep the focus on block menu popup, so don't move focus to editor in this scenario
|
|
451
|
+
!(inputMethod === INPUT_METHOD.BLOCK_MENU && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true))) {
|
|
452
|
+
api === null || api === void 0 ? void 0 : api.core.actions.focus();
|
|
453
|
+
}
|
|
450
454
|
const $mappedTo = tr.doc.resolve(mappedTo);
|
|
451
455
|
const expandAncestor = findParentNodeOfTypeClosestToPos($to, [expand, nestedExpand]);
|
|
452
456
|
if (expandAncestor) {
|
|
@@ -22,7 +22,7 @@ const getNodeSelector = (ignoreNodes, ignoreNodeDescendants) => {
|
|
|
22
22
|
const ignoreNodeDescendantsSelectorList = ignoreNodeDescendants.map(node => {
|
|
23
23
|
if (node === 'table') {
|
|
24
24
|
// Special case for table to exclude its direct descendants
|
|
25
|
-
return [`[data-prosemirror-node-name="tableCell"] > [data-node-anchor]`, `[data-prosemirror-node-name="tableHeader"] > [data-node-anchor]`];
|
|
25
|
+
return [`[data-prosemirror-node-name="tableCell"] > [data-node-anchor]`, `[data-prosemirror-node-name="tableCell"] > *:not([data-node-anchor]) > [data-node-anchor]`, `[data-prosemirror-node-name="tableHeader"] > [data-node-anchor]`, `[data-prosemirror-node-name="tableHeader"] > *:not([data-node-anchor]) > [data-node-anchor]`];
|
|
26
26
|
}
|
|
27
27
|
return `[data-prosemirror-node-name="${node}"] [data-node-anchor]`;
|
|
28
28
|
});
|
|
@@ -485,11 +485,11 @@ const blockCardWithoutLayout = css({
|
|
|
485
485
|
});
|
|
486
486
|
const nextAnchorSelector = ['&[data-node-anchor]',
|
|
487
487
|
// adjacent sibling with anchor
|
|
488
|
-
'&:not([data-node-anchor]) [data-node-anchor]',
|
|
489
|
-
// nested anchor inside adjacent sibling
|
|
488
|
+
'&:not([data-node-anchor]) [data-node-anchor]:first-of-type',
|
|
489
|
+
// first nested anchor inside adjacent sibling
|
|
490
490
|
'&.ProseMirror-widget + [data-node-anchor]',
|
|
491
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)
|
|
492
|
+
'&.ProseMirror-widget + :not([data-node-anchor]) [data-node-anchor]:first-of-type' // first nested anchor inside adjacent sibling (when next to a widget like gap cursor)
|
|
493
493
|
].join(', ');
|
|
494
494
|
const dragHandlerAnchorStyles = css({
|
|
495
495
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
|
@@ -1,8 +1,13 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
1
4
|
import { INPUT_METHOD } from '@atlaskit/editor-common/analytics';
|
|
2
5
|
import { DIRECTION } from '@atlaskit/editor-common/types';
|
|
3
6
|
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
7
|
+
import { key } from '../pm-plugins/main';
|
|
8
|
+
import { mapPreservedSelection } from '../pm-plugins/utils/selection';
|
|
4
9
|
import { moveNode } from './move-node';
|
|
5
|
-
import { getCurrentNodePosFromDragHandleSelection } from './utils/move-node-utils';
|
|
10
|
+
import { canMoveNodeUpOrDown, getCurrentNodePosFromDragHandleSelection } from './utils/move-node-utils';
|
|
6
11
|
var getSelectionToIndex = function getSelectionToIndex(fromIndex, $to, depth) {
|
|
7
12
|
var toIndex = $to.index(depth);
|
|
8
13
|
var toIndexAfter = $to.indexAfter(depth);
|
|
@@ -34,12 +39,13 @@ export var moveNodeWithBlockMenu = function moveNodeWithBlockMenu(api, direction
|
|
|
34
39
|
$to = selection.$to;
|
|
35
40
|
var depth = tr.doc.resolve(currentNodePos).depth;
|
|
36
41
|
var fromIndex = $from.index(depth);
|
|
42
|
+
var trAfterNodeMove = tr;
|
|
37
43
|
if (direction === DIRECTION.UP) {
|
|
38
44
|
if (fromIndex > 0) {
|
|
39
45
|
var moveToPos = $from.posAtIndex(fromIndex - 1, depth);
|
|
40
|
-
|
|
46
|
+
trAfterNodeMove = moveNode(api)(currentNodePos, moveToPos, INPUT_METHOD.BLOCK_MENU)({
|
|
41
47
|
tr: tr
|
|
42
|
-
});
|
|
48
|
+
}) || tr;
|
|
43
49
|
}
|
|
44
50
|
} else {
|
|
45
51
|
// selectionToIndex is the index of the last node in the selection
|
|
@@ -48,11 +54,29 @@ export var moveNodeWithBlockMenu = function moveNodeWithBlockMenu(api, direction
|
|
|
48
54
|
var moveToIndex = selectionToIndex + 2;
|
|
49
55
|
if (moveToIndex <= $to.node(depth).childCount) {
|
|
50
56
|
var _moveToPos = $to.posAtIndex(moveToIndex, depth);
|
|
51
|
-
|
|
57
|
+
trAfterNodeMove = moveNode(api)(currentNodePos, _moveToPos, INPUT_METHOD.BLOCK_MENU)({
|
|
52
58
|
tr: tr
|
|
53
|
-
});
|
|
59
|
+
}) || tr;
|
|
54
60
|
}
|
|
55
61
|
}
|
|
56
|
-
|
|
62
|
+
|
|
63
|
+
// map selection
|
|
64
|
+
var mappedSelection = mapPreservedSelection(selection, trAfterNodeMove);
|
|
65
|
+
if (mappedSelection) {
|
|
66
|
+
trAfterNodeMove.setSelection(mappedSelection);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
//recalculate canMoveUp and canMoveDown
|
|
70
|
+
var _canMoveNodeUpOrDown = canMoveNodeUpOrDown(trAfterNodeMove),
|
|
71
|
+
moveUp = _canMoveNodeUpOrDown.moveUp,
|
|
72
|
+
moveDown = _canMoveNodeUpOrDown.moveDown;
|
|
73
|
+
var currentMeta = trAfterNodeMove.getMeta(key);
|
|
74
|
+
var newMeta = _objectSpread(_objectSpread({}, currentMeta), {
|
|
75
|
+
toggleMenu: {
|
|
76
|
+
moveUp: moveUp,
|
|
77
|
+
moveDown: moveDown
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
return trAfterNodeMove.setMeta(key, newMeta);
|
|
57
81
|
};
|
|
58
82
|
};
|
|
@@ -438,7 +438,11 @@ export var moveNode = function moveNode(api) {
|
|
|
438
438
|
tr.setMeta(key, _objectSpread(_objectSpread({}, currMeta), {}, {
|
|
439
439
|
nodeMoved: true
|
|
440
440
|
}));
|
|
441
|
-
|
|
441
|
+
if (
|
|
442
|
+
// when move node via block menu, we need to keep the focus on block menu popup, so don't move focus to editor in this scenario
|
|
443
|
+
!(inputMethod === INPUT_METHOD.BLOCK_MENU && expValEqualsNoExposure('platform_editor_block_menu', 'isEnabled', true))) {
|
|
444
|
+
api === null || api === void 0 || api.core.actions.focus();
|
|
445
|
+
}
|
|
442
446
|
var $mappedTo = tr.doc.resolve(mappedTo);
|
|
443
447
|
var expandAncestor = findParentNodeOfTypeClosestToPos($to, [expand, nestedExpand]);
|
|
444
448
|
if (expandAncestor) {
|
|
@@ -25,7 +25,7 @@ var getNodeSelector = function getNodeSelector(ignoreNodes, ignoreNodeDescendant
|
|
|
25
25
|
var ignoreNodeDescendantsSelectorList = ignoreNodeDescendants.map(function (node) {
|
|
26
26
|
if (node === 'table') {
|
|
27
27
|
// Special case for table to exclude its direct descendants
|
|
28
|
-
return ["[data-prosemirror-node-name=\"tableCell\"] > [data-node-anchor]", "[data-prosemirror-node-name=\"tableHeader\"] > [data-node-anchor]"];
|
|
28
|
+
return ["[data-prosemirror-node-name=\"tableCell\"] > [data-node-anchor]", "[data-prosemirror-node-name=\"tableCell\"] > *:not([data-node-anchor]) > [data-node-anchor]", "[data-prosemirror-node-name=\"tableHeader\"] > [data-node-anchor]", "[data-prosemirror-node-name=\"tableHeader\"] > *:not([data-node-anchor]) > [data-node-anchor]"];
|
|
29
29
|
}
|
|
30
30
|
return "[data-prosemirror-node-name=\"".concat(node, "\"] [data-node-anchor]");
|
|
31
31
|
});
|
|
@@ -400,11 +400,11 @@ var blockCardWithoutLayout = css({
|
|
|
400
400
|
});
|
|
401
401
|
var nextAnchorSelector = ['&[data-node-anchor]',
|
|
402
402
|
// adjacent sibling with anchor
|
|
403
|
-
'&:not([data-node-anchor]) [data-node-anchor]',
|
|
404
|
-
// nested anchor inside adjacent sibling
|
|
403
|
+
'&:not([data-node-anchor]) [data-node-anchor]:first-of-type',
|
|
404
|
+
// first nested anchor inside adjacent sibling
|
|
405
405
|
'&.ProseMirror-widget + [data-node-anchor]',
|
|
406
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)
|
|
407
|
+
'&.ProseMirror-widget + :not([data-node-anchor]) [data-node-anchor]:first-of-type' // first nested anchor inside adjacent sibling (when next to a widget like gap cursor)
|
|
408
408
|
].join(', ');
|
|
409
409
|
var dragHandlerAnchorStyles = css({
|
|
410
410
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.13.1",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -54,9 +54,9 @@
|
|
|
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.
|
|
57
|
+
"@atlaskit/tmp-editor-statsig": "^14.9.0",
|
|
58
58
|
"@atlaskit/tokens": "^8.4.0",
|
|
59
|
-
"@atlaskit/tooltip": "^20.
|
|
59
|
+
"@atlaskit/tooltip": "^20.11.0",
|
|
60
60
|
"@babel/runtime": "^7.0.0",
|
|
61
61
|
"@emotion/react": "^11.7.1",
|
|
62
62
|
"@popperjs/core": "^2.11.8",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"uuid": "^3.1.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
|
-
"@atlaskit/editor-common": "^110.
|
|
69
|
+
"@atlaskit/editor-common": "^110.40.0",
|
|
70
70
|
"react": "^18.2.0",
|
|
71
71
|
"react-dom": "^18.2.0",
|
|
72
72
|
"react-intl-next": "npm:react-intl@^5.18.1"
|