@atlaskit/editor-plugin-block-controls 3.5.3 → 3.5.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 +9 -0
- package/dist/cjs/editor-commands/move-node.js +8 -8
- package/dist/cjs/ui/drag-handle.js +3 -5
- package/dist/es2019/editor-commands/move-node.js +8 -8
- package/dist/es2019/ui/drag-handle.js +3 -5
- package/dist/esm/editor-commands/move-node.js +8 -8
- package/dist/esm/ui/drag-handle.js +3 -5
- package/package.json +2 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 3.5.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#131064](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/131064)
|
|
8
|
+
[`24cad3d2de85a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/24cad3d2de85a) -
|
|
9
|
+
ED-27155: Clean up platform_editor_advanced_layouts_accessibility
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
3
12
|
## 3.5.3
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -158,7 +158,7 @@ var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShor
|
|
|
158
158
|
var nodeIndex = $currentNodePos.index();
|
|
159
159
|
var isLayoutColumnSelected = selection instanceof _state.NodeSelection && selection.node.type.name === 'layoutColumn';
|
|
160
160
|
if (direction === _consts.DIRECTION.LEFT && shouldEnableNestedDndA11y) {
|
|
161
|
-
if (isTopLevelNode && (0, _experiments.editorExperiment)('advanced_layouts', true)
|
|
161
|
+
if (isTopLevelNode && (0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
162
162
|
var _api$core, _api$core2;
|
|
163
163
|
var nodeBefore = $currentNodePos.nodeBefore;
|
|
164
164
|
if (nodeBefore) {
|
|
@@ -183,7 +183,7 @@ var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShor
|
|
|
183
183
|
});
|
|
184
184
|
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.focus();
|
|
185
185
|
return true;
|
|
186
|
-
} else if (isLayoutColumnSelected
|
|
186
|
+
} else if (isLayoutColumnSelected) {
|
|
187
187
|
var _$currentNodePos$node, _api$core3, _api$blockControls2;
|
|
188
188
|
moveToPos = selection.from - (((_$currentNodePos$node = $currentNodePos.nodeBefore) === null || _$currentNodePos$node === void 0 ? void 0 : _$currentNodePos$node.nodeSize) || 1);
|
|
189
189
|
api === null || api === void 0 || (_api$core3 = api.core) === null || _api$core3 === void 0 || _api$core3.actions.execute(api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 || (_api$blockControls2 = _api$blockControls2.commands) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.moveToLayout(currentNodePos, moveToPos, {
|
|
@@ -202,7 +202,7 @@ var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShor
|
|
|
202
202
|
moveToPos = $currentNodePos.start() - ((previousNode === null || previousNode === void 0 ? void 0 : previousNode.nodeSize) || 1);
|
|
203
203
|
}
|
|
204
204
|
} else if (direction === _consts.DIRECTION.RIGHT && shouldEnableNestedDndA11y) {
|
|
205
|
-
if (isTopLevelNode && (0, _experiments.editorExperiment)('advanced_layouts', true)
|
|
205
|
+
if (isTopLevelNode && (0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
206
206
|
var _api$core4, _api$core5;
|
|
207
207
|
var endOfDoc = $currentNodePos.end();
|
|
208
208
|
moveToPos = $currentNodePos.posAtIndex($currentNodePos.index() + 1);
|
|
@@ -224,7 +224,7 @@ var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShor
|
|
|
224
224
|
});
|
|
225
225
|
api === null || api === void 0 || (_api$core5 = api.core) === null || _api$core5 === void 0 || _api$core5.actions.focus();
|
|
226
226
|
return true;
|
|
227
|
-
} else if (isLayoutColumnSelected
|
|
227
|
+
} else if (isLayoutColumnSelected) {
|
|
228
228
|
var _api$core6, _api$blockControls4;
|
|
229
229
|
var _index = $currentNodePos.index($currentNodePos.depth);
|
|
230
230
|
var parent = $currentNodePos.node($currentNodePos.depth);
|
|
@@ -250,7 +250,7 @@ var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShor
|
|
|
250
250
|
moveToPos = $currentNodePos.after($currentNodePos.depth) + 1;
|
|
251
251
|
}
|
|
252
252
|
} else if (direction === _consts.DIRECTION.UP) {
|
|
253
|
-
if (isLayoutColumnSelected
|
|
253
|
+
if (isLayoutColumnSelected) {
|
|
254
254
|
moveToPos = $currentNodePos.start() - 1;
|
|
255
255
|
} else {
|
|
256
256
|
var _nodeBefore = $currentNodePos.depth > 1 && nodeIndex === 0 && shouldEnableNestedDndA11y ? $currentNodePos.node($currentNodePos.depth) : $currentNodePos.nodeBefore;
|
|
@@ -263,7 +263,7 @@ var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShor
|
|
|
263
263
|
if (nodeAfterPos > _endOfDoc) {
|
|
264
264
|
return false;
|
|
265
265
|
}
|
|
266
|
-
if (isLayoutColumnSelected
|
|
266
|
+
if (isLayoutColumnSelected) {
|
|
267
267
|
moveToPos = state.selection.$from.end() + 1;
|
|
268
268
|
} else {
|
|
269
269
|
var nodeAfter = state.doc.nodeAt(nodeAfterPos);
|
|
@@ -278,10 +278,10 @@ var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShor
|
|
|
278
278
|
if (moveToPos > -1 && (0, _platformFeatureFlags.fg)('platform_editor_elements_dnd_multi_select_patch_2')) {
|
|
279
279
|
var isDestDepthSameAsSource = $currentNodePos.depth === state.doc.resolve(moveToPos).depth;
|
|
280
280
|
var isSourceLayoutColumn = nodeType === 'layoutColumn';
|
|
281
|
-
shouldMoveNode = (shouldEnableNestedDndA11y ? isDestDepthSameAsSource || isSourceLayoutColumn : true) || isSourceLayoutColumn
|
|
281
|
+
shouldMoveNode = (shouldEnableNestedDndA11y ? isDestDepthSameAsSource || isSourceLayoutColumn : true) || isSourceLayoutColumn;
|
|
282
282
|
} else {
|
|
283
283
|
// only move the node if the destination is at the same depth, not support moving a nested node to a parent node
|
|
284
|
-
shouldMoveNode = (shouldEnableNestedDndA11y ? moveToPos > -1 && $currentNodePos.depth === state.doc.resolve(moveToPos).depth || nodeType === 'layoutColumn' : moveToPos > -1) || nodeType === 'layoutColumn'
|
|
284
|
+
shouldMoveNode = (shouldEnableNestedDndA11y ? moveToPos > -1 && $currentNodePos.depth === state.doc.resolve(moveToPos).depth || nodeType === 'layoutColumn' : moveToPos > -1) || nodeType === 'layoutColumn';
|
|
285
285
|
}
|
|
286
286
|
var _expandSelectionBound = (0, _selection.expandSelectionBounds)($currentNodePos, selection.$to),
|
|
287
287
|
$newAnchor = _expandSelectionBound.$anchor,
|
|
@@ -561,7 +561,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
561
561
|
setDragHandleDisabled(false);
|
|
562
562
|
}
|
|
563
563
|
}, [api === null || api === void 0 ? void 0 : api.blockControls.sharedState, isMultiSelect, isShiftDown, isTopLevelNode, view.state.doc, view.state.selection]);
|
|
564
|
-
var helpDescriptors = isTopLevelNode
|
|
564
|
+
var helpDescriptors = isTopLevelNode ? [{
|
|
565
565
|
description: formatMessage(_messages.blockControlsMessages.dragToMove)
|
|
566
566
|
}, {
|
|
567
567
|
description: formatMessage(_messages.blockControlsMessages.moveUp),
|
|
@@ -585,7 +585,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
585
585
|
keymap: _keymaps.dragToMoveDown
|
|
586
586
|
}];
|
|
587
587
|
var isParentNodeOfTypeLayout;
|
|
588
|
-
if (!isTopLevelNode && (
|
|
588
|
+
if (!isTopLevelNode && (0, _experiments.editorExperiment)('nested-dnd', true)) {
|
|
589
589
|
var pos = getPos();
|
|
590
590
|
if (typeof pos === 'number') {
|
|
591
591
|
var _$pos$parent;
|
|
@@ -605,7 +605,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
605
605
|
|
|
606
606
|
// When advanced layout is on, layout column drag handle show only show 'Drag to move', no shortcuts
|
|
607
607
|
if ((0, _experiments.editorExperiment)('advanced_layouts', true) && nodeType === 'layoutColumn') {
|
|
608
|
-
helpDescriptors =
|
|
608
|
+
helpDescriptors = [{
|
|
609
609
|
description: formatMessage(_messages.blockControlsMessages.dragToRearrange)
|
|
610
610
|
}, {
|
|
611
611
|
description: formatMessage(_messages.blockControlsMessages.moveUp),
|
|
@@ -619,8 +619,6 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
619
619
|
}, {
|
|
620
620
|
description: formatMessage(_messages.blockControlsMessages.moveRight),
|
|
621
621
|
keymap: _keymaps.dragToMoveRight
|
|
622
|
-
}] : [{
|
|
623
|
-
description: formatMessage(_messages.blockControlsMessages.dragToMove)
|
|
624
622
|
}];
|
|
625
623
|
}
|
|
626
624
|
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
@@ -157,7 +157,7 @@ export const moveNodeViaShortcut = (api, direction, formatMessage) => {
|
|
|
157
157
|
const nodeIndex = $currentNodePos.index();
|
|
158
158
|
const isLayoutColumnSelected = selection instanceof NodeSelection && selection.node.type.name === 'layoutColumn';
|
|
159
159
|
if (direction === DIRECTION.LEFT && shouldEnableNestedDndA11y) {
|
|
160
|
-
if (isTopLevelNode && editorExperiment('advanced_layouts', true)
|
|
160
|
+
if (isTopLevelNode && editorExperiment('advanced_layouts', true)) {
|
|
161
161
|
var _api$core, _api$core2;
|
|
162
162
|
const nodeBefore = $currentNodePos.nodeBefore;
|
|
163
163
|
if (nodeBefore) {
|
|
@@ -183,7 +183,7 @@ export const moveNodeViaShortcut = (api, direction, formatMessage) => {
|
|
|
183
183
|
});
|
|
184
184
|
api === null || api === void 0 ? void 0 : (_api$core2 = api.core) === null || _api$core2 === void 0 ? void 0 : _api$core2.actions.focus();
|
|
185
185
|
return true;
|
|
186
|
-
} else if (isLayoutColumnSelected
|
|
186
|
+
} else if (isLayoutColumnSelected) {
|
|
187
187
|
var _$currentNodePos$node, _api$core3, _api$blockControls2, _api$blockControls2$c;
|
|
188
188
|
moveToPos = selection.from - (((_$currentNodePos$node = $currentNodePos.nodeBefore) === null || _$currentNodePos$node === void 0 ? void 0 : _$currentNodePos$node.nodeSize) || 1);
|
|
189
189
|
api === null || api === void 0 ? void 0 : (_api$core3 = api.core) === null || _api$core3 === void 0 ? void 0 : _api$core3.actions.execute(api === null || api === void 0 ? void 0 : (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 ? void 0 : (_api$blockControls2$c = _api$blockControls2.commands) === null || _api$blockControls2$c === void 0 ? void 0 : _api$blockControls2$c.moveToLayout(currentNodePos, moveToPos, {
|
|
@@ -202,7 +202,7 @@ export const moveNodeViaShortcut = (api, direction, formatMessage) => {
|
|
|
202
202
|
moveToPos = $currentNodePos.start() - ((previousNode === null || previousNode === void 0 ? void 0 : previousNode.nodeSize) || 1);
|
|
203
203
|
}
|
|
204
204
|
} else if (direction === DIRECTION.RIGHT && shouldEnableNestedDndA11y) {
|
|
205
|
-
if (isTopLevelNode && editorExperiment('advanced_layouts', true)
|
|
205
|
+
if (isTopLevelNode && editorExperiment('advanced_layouts', true)) {
|
|
206
206
|
var _api$core4, _api$core5;
|
|
207
207
|
const endOfDoc = $currentNodePos.end();
|
|
208
208
|
moveToPos = $currentNodePos.posAtIndex($currentNodePos.index() + 1);
|
|
@@ -225,7 +225,7 @@ export const moveNodeViaShortcut = (api, direction, formatMessage) => {
|
|
|
225
225
|
});
|
|
226
226
|
api === null || api === void 0 ? void 0 : (_api$core5 = api.core) === null || _api$core5 === void 0 ? void 0 : _api$core5.actions.focus();
|
|
227
227
|
return true;
|
|
228
|
-
} else if (isLayoutColumnSelected
|
|
228
|
+
} else if (isLayoutColumnSelected) {
|
|
229
229
|
var _api$core6, _api$blockControls4, _api$blockControls4$c;
|
|
230
230
|
const index = $currentNodePos.index($currentNodePos.depth);
|
|
231
231
|
const parent = $currentNodePos.node($currentNodePos.depth);
|
|
@@ -251,7 +251,7 @@ export const moveNodeViaShortcut = (api, direction, formatMessage) => {
|
|
|
251
251
|
moveToPos = $currentNodePos.after($currentNodePos.depth) + 1;
|
|
252
252
|
}
|
|
253
253
|
} else if (direction === DIRECTION.UP) {
|
|
254
|
-
if (isLayoutColumnSelected
|
|
254
|
+
if (isLayoutColumnSelected) {
|
|
255
255
|
moveToPos = $currentNodePos.start() - 1;
|
|
256
256
|
} else {
|
|
257
257
|
const nodeBefore = $currentNodePos.depth > 1 && nodeIndex === 0 && shouldEnableNestedDndA11y ? $currentNodePos.node($currentNodePos.depth) : $currentNodePos.nodeBefore;
|
|
@@ -264,7 +264,7 @@ export const moveNodeViaShortcut = (api, direction, formatMessage) => {
|
|
|
264
264
|
if (nodeAfterPos > endOfDoc) {
|
|
265
265
|
return false;
|
|
266
266
|
}
|
|
267
|
-
if (isLayoutColumnSelected
|
|
267
|
+
if (isLayoutColumnSelected) {
|
|
268
268
|
moveToPos = state.selection.$from.end() + 1;
|
|
269
269
|
} else {
|
|
270
270
|
const nodeAfter = state.doc.nodeAt(nodeAfterPos);
|
|
@@ -279,10 +279,10 @@ export const moveNodeViaShortcut = (api, direction, formatMessage) => {
|
|
|
279
279
|
if (moveToPos > -1 && fg('platform_editor_elements_dnd_multi_select_patch_2')) {
|
|
280
280
|
const isDestDepthSameAsSource = $currentNodePos.depth === state.doc.resolve(moveToPos).depth;
|
|
281
281
|
const isSourceLayoutColumn = nodeType === 'layoutColumn';
|
|
282
|
-
shouldMoveNode = (shouldEnableNestedDndA11y ? isDestDepthSameAsSource || isSourceLayoutColumn : true) || isSourceLayoutColumn
|
|
282
|
+
shouldMoveNode = (shouldEnableNestedDndA11y ? isDestDepthSameAsSource || isSourceLayoutColumn : true) || isSourceLayoutColumn;
|
|
283
283
|
} else {
|
|
284
284
|
// only move the node if the destination is at the same depth, not support moving a nested node to a parent node
|
|
285
|
-
shouldMoveNode = (shouldEnableNestedDndA11y ? moveToPos > -1 && $currentNodePos.depth === state.doc.resolve(moveToPos).depth || nodeType === 'layoutColumn' : moveToPos > -1) || nodeType === 'layoutColumn'
|
|
285
|
+
shouldMoveNode = (shouldEnableNestedDndA11y ? moveToPos > -1 && $currentNodePos.depth === state.doc.resolve(moveToPos).depth || nodeType === 'layoutColumn' : moveToPos > -1) || nodeType === 'layoutColumn';
|
|
286
286
|
}
|
|
287
287
|
const {
|
|
288
288
|
$anchor: $newAnchor,
|
|
@@ -547,7 +547,7 @@ export const DragHandle = ({
|
|
|
547
547
|
setDragHandleDisabled(false);
|
|
548
548
|
}
|
|
549
549
|
}, [api === null || api === void 0 ? void 0 : api.blockControls.sharedState, isMultiSelect, isShiftDown, isTopLevelNode, view.state.doc, view.state.selection]);
|
|
550
|
-
let helpDescriptors = isTopLevelNode
|
|
550
|
+
let helpDescriptors = isTopLevelNode ? [{
|
|
551
551
|
description: formatMessage(blockControlsMessages.dragToMove)
|
|
552
552
|
}, {
|
|
553
553
|
description: formatMessage(blockControlsMessages.moveUp),
|
|
@@ -571,7 +571,7 @@ export const DragHandle = ({
|
|
|
571
571
|
keymap: dragToMoveDown
|
|
572
572
|
}];
|
|
573
573
|
let isParentNodeOfTypeLayout;
|
|
574
|
-
if (!isTopLevelNode &&
|
|
574
|
+
if (!isTopLevelNode && editorExperiment('nested-dnd', true)) {
|
|
575
575
|
const pos = getPos();
|
|
576
576
|
if (typeof pos === 'number') {
|
|
577
577
|
var _$pos$parent;
|
|
@@ -591,7 +591,7 @@ export const DragHandle = ({
|
|
|
591
591
|
|
|
592
592
|
// When advanced layout is on, layout column drag handle show only show 'Drag to move', no shortcuts
|
|
593
593
|
if (editorExperiment('advanced_layouts', true) && nodeType === 'layoutColumn') {
|
|
594
|
-
helpDescriptors =
|
|
594
|
+
helpDescriptors = [{
|
|
595
595
|
description: formatMessage(blockControlsMessages.dragToRearrange)
|
|
596
596
|
}, {
|
|
597
597
|
description: formatMessage(blockControlsMessages.moveUp),
|
|
@@ -605,8 +605,6 @@ export const DragHandle = ({
|
|
|
605
605
|
}, {
|
|
606
606
|
description: formatMessage(blockControlsMessages.moveRight),
|
|
607
607
|
keymap: dragToMoveRight
|
|
608
|
-
}] : [{
|
|
609
|
-
description: formatMessage(blockControlsMessages.dragToMove)
|
|
610
608
|
}];
|
|
611
609
|
}
|
|
612
610
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
@@ -152,7 +152,7 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
|
|
|
152
152
|
var nodeIndex = $currentNodePos.index();
|
|
153
153
|
var isLayoutColumnSelected = selection instanceof NodeSelection && selection.node.type.name === 'layoutColumn';
|
|
154
154
|
if (direction === DIRECTION.LEFT && shouldEnableNestedDndA11y) {
|
|
155
|
-
if (isTopLevelNode && editorExperiment('advanced_layouts', true)
|
|
155
|
+
if (isTopLevelNode && editorExperiment('advanced_layouts', true)) {
|
|
156
156
|
var _api$core, _api$core2;
|
|
157
157
|
var nodeBefore = $currentNodePos.nodeBefore;
|
|
158
158
|
if (nodeBefore) {
|
|
@@ -177,7 +177,7 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
|
|
|
177
177
|
});
|
|
178
178
|
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.focus();
|
|
179
179
|
return true;
|
|
180
|
-
} else if (isLayoutColumnSelected
|
|
180
|
+
} else if (isLayoutColumnSelected) {
|
|
181
181
|
var _$currentNodePos$node, _api$core3, _api$blockControls2;
|
|
182
182
|
moveToPos = selection.from - (((_$currentNodePos$node = $currentNodePos.nodeBefore) === null || _$currentNodePos$node === void 0 ? void 0 : _$currentNodePos$node.nodeSize) || 1);
|
|
183
183
|
api === null || api === void 0 || (_api$core3 = api.core) === null || _api$core3 === void 0 || _api$core3.actions.execute(api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 || (_api$blockControls2 = _api$blockControls2.commands) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.moveToLayout(currentNodePos, moveToPos, {
|
|
@@ -196,7 +196,7 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
|
|
|
196
196
|
moveToPos = $currentNodePos.start() - ((previousNode === null || previousNode === void 0 ? void 0 : previousNode.nodeSize) || 1);
|
|
197
197
|
}
|
|
198
198
|
} else if (direction === DIRECTION.RIGHT && shouldEnableNestedDndA11y) {
|
|
199
|
-
if (isTopLevelNode && editorExperiment('advanced_layouts', true)
|
|
199
|
+
if (isTopLevelNode && editorExperiment('advanced_layouts', true)) {
|
|
200
200
|
var _api$core4, _api$core5;
|
|
201
201
|
var endOfDoc = $currentNodePos.end();
|
|
202
202
|
moveToPos = $currentNodePos.posAtIndex($currentNodePos.index() + 1);
|
|
@@ -218,7 +218,7 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
|
|
|
218
218
|
});
|
|
219
219
|
api === null || api === void 0 || (_api$core5 = api.core) === null || _api$core5 === void 0 || _api$core5.actions.focus();
|
|
220
220
|
return true;
|
|
221
|
-
} else if (isLayoutColumnSelected
|
|
221
|
+
} else if (isLayoutColumnSelected) {
|
|
222
222
|
var _api$core6, _api$blockControls4;
|
|
223
223
|
var _index = $currentNodePos.index($currentNodePos.depth);
|
|
224
224
|
var parent = $currentNodePos.node($currentNodePos.depth);
|
|
@@ -244,7 +244,7 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
|
|
|
244
244
|
moveToPos = $currentNodePos.after($currentNodePos.depth) + 1;
|
|
245
245
|
}
|
|
246
246
|
} else if (direction === DIRECTION.UP) {
|
|
247
|
-
if (isLayoutColumnSelected
|
|
247
|
+
if (isLayoutColumnSelected) {
|
|
248
248
|
moveToPos = $currentNodePos.start() - 1;
|
|
249
249
|
} else {
|
|
250
250
|
var _nodeBefore = $currentNodePos.depth > 1 && nodeIndex === 0 && shouldEnableNestedDndA11y ? $currentNodePos.node($currentNodePos.depth) : $currentNodePos.nodeBefore;
|
|
@@ -257,7 +257,7 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
|
|
|
257
257
|
if (nodeAfterPos > _endOfDoc) {
|
|
258
258
|
return false;
|
|
259
259
|
}
|
|
260
|
-
if (isLayoutColumnSelected
|
|
260
|
+
if (isLayoutColumnSelected) {
|
|
261
261
|
moveToPos = state.selection.$from.end() + 1;
|
|
262
262
|
} else {
|
|
263
263
|
var nodeAfter = state.doc.nodeAt(nodeAfterPos);
|
|
@@ -272,10 +272,10 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
|
|
|
272
272
|
if (moveToPos > -1 && fg('platform_editor_elements_dnd_multi_select_patch_2')) {
|
|
273
273
|
var isDestDepthSameAsSource = $currentNodePos.depth === state.doc.resolve(moveToPos).depth;
|
|
274
274
|
var isSourceLayoutColumn = nodeType === 'layoutColumn';
|
|
275
|
-
shouldMoveNode = (shouldEnableNestedDndA11y ? isDestDepthSameAsSource || isSourceLayoutColumn : true) || isSourceLayoutColumn
|
|
275
|
+
shouldMoveNode = (shouldEnableNestedDndA11y ? isDestDepthSameAsSource || isSourceLayoutColumn : true) || isSourceLayoutColumn;
|
|
276
276
|
} else {
|
|
277
277
|
// only move the node if the destination is at the same depth, not support moving a nested node to a parent node
|
|
278
|
-
shouldMoveNode = (shouldEnableNestedDndA11y ? moveToPos > -1 && $currentNodePos.depth === state.doc.resolve(moveToPos).depth || nodeType === 'layoutColumn' : moveToPos > -1) || nodeType === 'layoutColumn'
|
|
278
|
+
shouldMoveNode = (shouldEnableNestedDndA11y ? moveToPos > -1 && $currentNodePos.depth === state.doc.resolve(moveToPos).depth || nodeType === 'layoutColumn' : moveToPos > -1) || nodeType === 'layoutColumn';
|
|
279
279
|
}
|
|
280
280
|
var _expandSelectionBound = expandSelectionBounds($currentNodePos, selection.$to),
|
|
281
281
|
$newAnchor = _expandSelectionBound.$anchor,
|
|
@@ -558,7 +558,7 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
558
558
|
setDragHandleDisabled(false);
|
|
559
559
|
}
|
|
560
560
|
}, [api === null || api === void 0 ? void 0 : api.blockControls.sharedState, isMultiSelect, isShiftDown, isTopLevelNode, view.state.doc, view.state.selection]);
|
|
561
|
-
var helpDescriptors = isTopLevelNode
|
|
561
|
+
var helpDescriptors = isTopLevelNode ? [{
|
|
562
562
|
description: formatMessage(blockControlsMessages.dragToMove)
|
|
563
563
|
}, {
|
|
564
564
|
description: formatMessage(blockControlsMessages.moveUp),
|
|
@@ -582,7 +582,7 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
582
582
|
keymap: dragToMoveDown
|
|
583
583
|
}];
|
|
584
584
|
var isParentNodeOfTypeLayout;
|
|
585
|
-
if (!isTopLevelNode &&
|
|
585
|
+
if (!isTopLevelNode && editorExperiment('nested-dnd', true)) {
|
|
586
586
|
var pos = getPos();
|
|
587
587
|
if (typeof pos === 'number') {
|
|
588
588
|
var _$pos$parent;
|
|
@@ -602,7 +602,7 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
602
602
|
|
|
603
603
|
// When advanced layout is on, layout column drag handle show only show 'Drag to move', no shortcuts
|
|
604
604
|
if (editorExperiment('advanced_layouts', true) && nodeType === 'layoutColumn') {
|
|
605
|
-
helpDescriptors =
|
|
605
|
+
helpDescriptors = [{
|
|
606
606
|
description: formatMessage(blockControlsMessages.dragToRearrange)
|
|
607
607
|
}, {
|
|
608
608
|
description: formatMessage(blockControlsMessages.moveUp),
|
|
@@ -616,8 +616,6 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
616
616
|
}, {
|
|
617
617
|
description: formatMessage(blockControlsMessages.moveRight),
|
|
618
618
|
keymap: dragToMoveRight
|
|
619
|
-
}] : [{
|
|
620
|
-
description: formatMessage(blockControlsMessages.dragToMove)
|
|
621
619
|
}];
|
|
622
620
|
}
|
|
623
621
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.4",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
47
47
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
48
48
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
49
|
-
"@atlaskit/icon": "^25.
|
|
49
|
+
"@atlaskit/icon": "^25.1.0",
|
|
50
50
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
51
51
|
"@atlaskit/pragmatic-drag-and-drop": "^1.5.0",
|
|
52
52
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
@@ -129,9 +129,6 @@
|
|
|
129
129
|
"platform_editor_dnd_handle_highlight_fix_firefox": {
|
|
130
130
|
"type": "boolean"
|
|
131
131
|
},
|
|
132
|
-
"platform_editor_advanced_layouts_accessibility": {
|
|
133
|
-
"type": "boolean"
|
|
134
|
-
},
|
|
135
132
|
"platform_editor_track_node_types": {
|
|
136
133
|
"type": "boolean"
|
|
137
134
|
},
|