@atlaskit/editor-plugin-block-controls 7.0.0 → 7.1.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,16 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 7.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`f4c0936dc05fe`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f4c0936dc05fe) -
|
|
8
|
+
ED-29391 Add keyboard support for block menu
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies
|
|
13
|
+
|
|
3
14
|
## 7.0.0
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -446,7 +446,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
446
446
|
e.stopPropagation();
|
|
447
447
|
setDragHandleSelected(!dragHandleSelected);
|
|
448
448
|
api === null || api === void 0 || (_api$core4 = api.core) === null || _api$core4 === void 0 || _api$core4.actions.execute(function (_ref4) {
|
|
449
|
-
var _api$blockControls5, _api$userIntent;
|
|
449
|
+
var _api$blockControls5, _api$userIntent, _api$blockControls6;
|
|
450
450
|
var tr = _ref4.tr;
|
|
451
451
|
var startPos = getPos();
|
|
452
452
|
if (startPos === undefined) {
|
|
@@ -461,7 +461,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
461
461
|
api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || _api$userIntent.commands.setCurrentUserIntent('blockMenuOpen')({
|
|
462
462
|
tr: tr
|
|
463
463
|
});
|
|
464
|
-
api === null || api === void 0 || api.blockControls.commands.setSelectedViaDragHandle(true)({
|
|
464
|
+
api === null || api === void 0 || (_api$blockControls6 = api.blockControls) === null || _api$blockControls6 === void 0 || _api$blockControls6.commands.setSelectedViaDragHandle(true)({
|
|
465
465
|
tr: tr
|
|
466
466
|
});
|
|
467
467
|
return tr;
|
|
@@ -501,8 +501,8 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
501
501
|
var oldHandlePosCheck = handlePos >= tr.selection.$from.start() - 1 && handlePos <= tr.selection.to;
|
|
502
502
|
var newHandlePosCheck = (0, _getSelection.isHandleCorrelatedToSelection)(view.state, tr.selection, handlePos);
|
|
503
503
|
if (!tr.selection.empty && ((0, _platformFeatureFlags.fg)('platform_editor_elements_dnd_multi_select_patch_1') ? newHandlePosCheck : oldHandlePosCheck)) {
|
|
504
|
-
var _api$
|
|
505
|
-
api === null || api === void 0 || (_api$
|
|
504
|
+
var _api$blockControls7;
|
|
505
|
+
api === null || api === void 0 || (_api$blockControls7 = api.blockControls) === null || _api$blockControls7 === void 0 || _api$blockControls7.commands.setMultiSelectPositions()({
|
|
506
506
|
tr: tr
|
|
507
507
|
});
|
|
508
508
|
} else if ((0, _platformFeatureFlags.fg)('platform_editor_elements_dnd_select_node_on_drag')) {
|
|
@@ -610,7 +610,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
610
610
|
return;
|
|
611
611
|
}
|
|
612
612
|
api === null || api === void 0 || (_api$core7 = api.core) === null || _api$core7 === void 0 || _api$core7.actions.execute(function (_ref8) {
|
|
613
|
-
var _api$blockControls$sh3, _api$
|
|
613
|
+
var _api$blockControls$sh3, _api$blockControls8, _api$analytics3;
|
|
614
614
|
var tr = _ref8.tr;
|
|
615
615
|
var nodeTypes, hasSelectedMultipleNodes;
|
|
616
616
|
var resolvedMovingNode = tr.doc.resolve(start);
|
|
@@ -624,7 +624,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
624
624
|
nodeTypes = maybeNode === null || maybeNode === void 0 ? void 0 : maybeNode.type.name;
|
|
625
625
|
hasSelectedMultipleNodes = false;
|
|
626
626
|
}
|
|
627
|
-
api === null || api === void 0 || (_api$
|
|
627
|
+
api === null || api === void 0 || (_api$blockControls8 = api.blockControls) === null || _api$blockControls8 === void 0 || _api$blockControls8.commands.setNodeDragged(getPos, anchorName, nodeType)({
|
|
628
628
|
tr: tr
|
|
629
629
|
});
|
|
630
630
|
tr.setMeta('scrollIntoView', false);
|
|
@@ -429,7 +429,7 @@ export const DragHandle = ({
|
|
|
429
429
|
api === null || api === void 0 ? void 0 : (_api$core4 = api.core) === null || _api$core4 === void 0 ? void 0 : _api$core4.actions.execute(({
|
|
430
430
|
tr
|
|
431
431
|
}) => {
|
|
432
|
-
var _api$blockControls5, _api$userIntent;
|
|
432
|
+
var _api$blockControls5, _api$userIntent, _api$blockControls6;
|
|
433
433
|
const startPos = getPos();
|
|
434
434
|
if (startPos === undefined) {
|
|
435
435
|
return tr;
|
|
@@ -443,7 +443,7 @@ export const DragHandle = ({
|
|
|
443
443
|
api === null || api === void 0 ? void 0 : (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 ? void 0 : _api$userIntent.commands.setCurrentUserIntent('blockMenuOpen')({
|
|
444
444
|
tr
|
|
445
445
|
});
|
|
446
|
-
api === null || api === void 0 ? void 0 : api.blockControls.commands.setSelectedViaDragHandle(true)({
|
|
446
|
+
api === null || api === void 0 ? void 0 : (_api$blockControls6 = api.blockControls) === null || _api$blockControls6 === void 0 ? void 0 : _api$blockControls6.commands.setSelectedViaDragHandle(true)({
|
|
447
447
|
tr
|
|
448
448
|
});
|
|
449
449
|
return tr;
|
|
@@ -481,8 +481,8 @@ export const DragHandle = ({
|
|
|
481
481
|
const oldHandlePosCheck = handlePos >= tr.selection.$from.start() - 1 && handlePos <= tr.selection.to;
|
|
482
482
|
const newHandlePosCheck = isHandleCorrelatedToSelection(view.state, tr.selection, handlePos);
|
|
483
483
|
if (!tr.selection.empty && (fg('platform_editor_elements_dnd_multi_select_patch_1') ? newHandlePosCheck : oldHandlePosCheck)) {
|
|
484
|
-
var _api$
|
|
485
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
484
|
+
var _api$blockControls7;
|
|
485
|
+
api === null || api === void 0 ? void 0 : (_api$blockControls7 = api.blockControls) === null || _api$blockControls7 === void 0 ? void 0 : _api$blockControls7.commands.setMultiSelectPositions()({
|
|
486
486
|
tr
|
|
487
487
|
});
|
|
488
488
|
} else if (fg('platform_editor_elements_dnd_select_node_on_drag')) {
|
|
@@ -597,7 +597,7 @@ export const DragHandle = ({
|
|
|
597
597
|
api === null || api === void 0 ? void 0 : (_api$core7 = api.core) === null || _api$core7 === void 0 ? void 0 : _api$core7.actions.execute(({
|
|
598
598
|
tr
|
|
599
599
|
}) => {
|
|
600
|
-
var _api$blockControls$sh3, _api$
|
|
600
|
+
var _api$blockControls$sh3, _api$blockControls8, _api$analytics3;
|
|
601
601
|
let nodeTypes, hasSelectedMultipleNodes;
|
|
602
602
|
const resolvedMovingNode = tr.doc.resolve(start);
|
|
603
603
|
const maybeNode = resolvedMovingNode.nodeAfter;
|
|
@@ -610,7 +610,7 @@ export const DragHandle = ({
|
|
|
610
610
|
nodeTypes = maybeNode === null || maybeNode === void 0 ? void 0 : maybeNode.type.name;
|
|
611
611
|
hasSelectedMultipleNodes = false;
|
|
612
612
|
}
|
|
613
|
-
api === null || api === void 0 ? void 0 : (_api$
|
|
613
|
+
api === null || api === void 0 ? void 0 : (_api$blockControls8 = api.blockControls) === null || _api$blockControls8 === void 0 ? void 0 : _api$blockControls8.commands.setNodeDragged(getPos, anchorName, nodeType)({
|
|
614
614
|
tr
|
|
615
615
|
});
|
|
616
616
|
tr.setMeta('scrollIntoView', false);
|
|
@@ -443,7 +443,7 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
443
443
|
e.stopPropagation();
|
|
444
444
|
setDragHandleSelected(!dragHandleSelected);
|
|
445
445
|
api === null || api === void 0 || (_api$core4 = api.core) === null || _api$core4 === void 0 || _api$core4.actions.execute(function (_ref4) {
|
|
446
|
-
var _api$blockControls5, _api$userIntent;
|
|
446
|
+
var _api$blockControls5, _api$userIntent, _api$blockControls6;
|
|
447
447
|
var tr = _ref4.tr;
|
|
448
448
|
var startPos = getPos();
|
|
449
449
|
if (startPos === undefined) {
|
|
@@ -458,7 +458,7 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
458
458
|
api === null || api === void 0 || (_api$userIntent = api.userIntent) === null || _api$userIntent === void 0 || _api$userIntent.commands.setCurrentUserIntent('blockMenuOpen')({
|
|
459
459
|
tr: tr
|
|
460
460
|
});
|
|
461
|
-
api === null || api === void 0 || api.blockControls.commands.setSelectedViaDragHandle(true)({
|
|
461
|
+
api === null || api === void 0 || (_api$blockControls6 = api.blockControls) === null || _api$blockControls6 === void 0 || _api$blockControls6.commands.setSelectedViaDragHandle(true)({
|
|
462
462
|
tr: tr
|
|
463
463
|
});
|
|
464
464
|
return tr;
|
|
@@ -498,8 +498,8 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
498
498
|
var oldHandlePosCheck = handlePos >= tr.selection.$from.start() - 1 && handlePos <= tr.selection.to;
|
|
499
499
|
var newHandlePosCheck = isHandleCorrelatedToSelection(view.state, tr.selection, handlePos);
|
|
500
500
|
if (!tr.selection.empty && (fg('platform_editor_elements_dnd_multi_select_patch_1') ? newHandlePosCheck : oldHandlePosCheck)) {
|
|
501
|
-
var _api$
|
|
502
|
-
api === null || api === void 0 || (_api$
|
|
501
|
+
var _api$blockControls7;
|
|
502
|
+
api === null || api === void 0 || (_api$blockControls7 = api.blockControls) === null || _api$blockControls7 === void 0 || _api$blockControls7.commands.setMultiSelectPositions()({
|
|
503
503
|
tr: tr
|
|
504
504
|
});
|
|
505
505
|
} else if (fg('platform_editor_elements_dnd_select_node_on_drag')) {
|
|
@@ -607,7 +607,7 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
607
607
|
return;
|
|
608
608
|
}
|
|
609
609
|
api === null || api === void 0 || (_api$core7 = api.core) === null || _api$core7 === void 0 || _api$core7.actions.execute(function (_ref8) {
|
|
610
|
-
var _api$blockControls$sh3, _api$
|
|
610
|
+
var _api$blockControls$sh3, _api$blockControls8, _api$analytics3;
|
|
611
611
|
var tr = _ref8.tr;
|
|
612
612
|
var nodeTypes, hasSelectedMultipleNodes;
|
|
613
613
|
var resolvedMovingNode = tr.doc.resolve(start);
|
|
@@ -621,7 +621,7 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
621
621
|
nodeTypes = maybeNode === null || maybeNode === void 0 ? void 0 : maybeNode.type.name;
|
|
622
622
|
hasSelectedMultipleNodes = false;
|
|
623
623
|
}
|
|
624
|
-
api === null || api === void 0 || (_api$
|
|
624
|
+
api === null || api === void 0 || (_api$blockControls8 = api.blockControls) === null || _api$blockControls8 === void 0 || _api$blockControls8.commands.setNodeDragged(getPos, anchorName, nodeType)({
|
|
625
625
|
tr: tr
|
|
626
626
|
});
|
|
627
627
|
tr.setMeta('scrollIntoView', false);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.1.0",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.2.0",
|
|
53
53
|
"@atlaskit/primitives": "^14.15.0",
|
|
54
54
|
"@atlaskit/theme": "^21.0.0",
|
|
55
|
-
"@atlaskit/tmp-editor-statsig": "^12.
|
|
55
|
+
"@atlaskit/tmp-editor-statsig": "^12.32.0",
|
|
56
56
|
"@atlaskit/tokens": "^6.3.0",
|
|
57
57
|
"@atlaskit/tooltip": "^20.4.0",
|
|
58
58
|
"@babel/runtime": "^7.0.0",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"uuid": "^3.1.0"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
|
-
"@atlaskit/editor-common": "^110.
|
|
67
|
+
"@atlaskit/editor-common": "^110.1.0",
|
|
68
68
|
"react": "^18.2.0",
|
|
69
69
|
"react-dom": "^18.2.0",
|
|
70
70
|
"react-intl-next": "npm:react-intl@^5.18.1"
|