@atlaskit/editor-plugin-block-controls 3.5.2 → 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 +24 -0
- package/dist/cjs/editor-commands/move-node.js +9 -10
- package/dist/cjs/editor-commands/show-drag-handle.js +1 -2
- package/dist/cjs/pm-plugins/handle-mouse-over.js +2 -2
- package/dist/cjs/pm-plugins/utils/remove-from-source.js +1 -2
- package/dist/cjs/ui/drag-handle.js +4 -6
- package/dist/es2019/editor-commands/move-node.js +8 -8
- package/dist/es2019/editor-commands/show-drag-handle.js +1 -2
- package/dist/es2019/pm-plugins/utils/remove-from-source.js +1 -2
- package/dist/es2019/ui/drag-handle.js +4 -6
- package/dist/esm/editor-commands/move-node.js +9 -10
- package/dist/esm/editor-commands/show-drag-handle.js +1 -2
- package/dist/esm/pm-plugins/handle-mouse-over.js +2 -2
- package/dist/esm/pm-plugins/utils/remove-from-source.js +1 -2
- package/dist/esm/ui/drag-handle.js +4 -6
- package/package.json +6 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,29 @@
|
|
|
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
|
+
|
|
12
|
+
## 3.5.3
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#131048](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/131048)
|
|
17
|
+
[`40f0ae20820a0`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/40f0ae20820a0) -
|
|
18
|
+
Clean up platform_editor_advanced_layouts_a11y
|
|
19
|
+
- [#128309](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/128309)
|
|
20
|
+
[`5668591816f6a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5668591816f6a) -
|
|
21
|
+
Clean up platform_editor_advanced_layouts_dnd_remove_layout
|
|
22
|
+
- [#130397](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/130397)
|
|
23
|
+
[`632086ddddec2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/632086ddddec2) -
|
|
24
|
+
[ux] fix drag handlers for multibodied extensions
|
|
25
|
+
- Updated dependencies
|
|
26
|
+
|
|
3
27
|
## 3.5.2
|
|
4
28
|
|
|
5
29
|
### Patch Changes
|
|
@@ -131,7 +131,6 @@ var getFocusedHandle = function getFocusedHandle(state) {
|
|
|
131
131
|
};
|
|
132
132
|
var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, formatMessage) {
|
|
133
133
|
return function (state) {
|
|
134
|
-
var _hoistedPos;
|
|
135
134
|
var isParentNodeOfTypeLayout;
|
|
136
135
|
var shouldEnableNestedDndA11y = (0, _experiments.editorExperiment)('nested-dnd', true);
|
|
137
136
|
var selection = state.selection;
|
|
@@ -149,7 +148,7 @@ var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShor
|
|
|
149
148
|
var LAYOUT_COL_DEPTH = 3;
|
|
150
149
|
hoistedPos = state.doc.resolve(from).before(LAYOUT_COL_DEPTH);
|
|
151
150
|
}
|
|
152
|
-
var currentNodePos = isMultiSelectEnabled && !getFocusedHandle(state) && !selection.empty ?
|
|
151
|
+
var currentNodePos = isMultiSelectEnabled && !getFocusedHandle(state) && !selection.empty ? hoistedPos !== null && hoistedPos !== void 0 ? hoistedPos : from : getCurrentNodePos(state);
|
|
153
152
|
if (currentNodePos > -1) {
|
|
154
153
|
var _state$doc$nodeAt;
|
|
155
154
|
var $currentNodePos = state.doc.resolve(currentNodePos);
|
|
@@ -159,7 +158,7 @@ var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShor
|
|
|
159
158
|
var nodeIndex = $currentNodePos.index();
|
|
160
159
|
var isLayoutColumnSelected = selection instanceof _state.NodeSelection && selection.node.type.name === 'layoutColumn';
|
|
161
160
|
if (direction === _consts.DIRECTION.LEFT && shouldEnableNestedDndA11y) {
|
|
162
|
-
if (isTopLevelNode && (0, _experiments.editorExperiment)('advanced_layouts', true)
|
|
161
|
+
if (isTopLevelNode && (0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
163
162
|
var _api$core, _api$core2;
|
|
164
163
|
var nodeBefore = $currentNodePos.nodeBefore;
|
|
165
164
|
if (nodeBefore) {
|
|
@@ -184,7 +183,7 @@ var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShor
|
|
|
184
183
|
});
|
|
185
184
|
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.focus();
|
|
186
185
|
return true;
|
|
187
|
-
} else if (isLayoutColumnSelected
|
|
186
|
+
} else if (isLayoutColumnSelected) {
|
|
188
187
|
var _$currentNodePos$node, _api$core3, _api$blockControls2;
|
|
189
188
|
moveToPos = selection.from - (((_$currentNodePos$node = $currentNodePos.nodeBefore) === null || _$currentNodePos$node === void 0 ? void 0 : _$currentNodePos$node.nodeSize) || 1);
|
|
190
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, {
|
|
@@ -203,7 +202,7 @@ var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShor
|
|
|
203
202
|
moveToPos = $currentNodePos.start() - ((previousNode === null || previousNode === void 0 ? void 0 : previousNode.nodeSize) || 1);
|
|
204
203
|
}
|
|
205
204
|
} else if (direction === _consts.DIRECTION.RIGHT && shouldEnableNestedDndA11y) {
|
|
206
|
-
if (isTopLevelNode && (0, _experiments.editorExperiment)('advanced_layouts', true)
|
|
205
|
+
if (isTopLevelNode && (0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
207
206
|
var _api$core4, _api$core5;
|
|
208
207
|
var endOfDoc = $currentNodePos.end();
|
|
209
208
|
moveToPos = $currentNodePos.posAtIndex($currentNodePos.index() + 1);
|
|
@@ -225,7 +224,7 @@ var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShor
|
|
|
225
224
|
});
|
|
226
225
|
api === null || api === void 0 || (_api$core5 = api.core) === null || _api$core5 === void 0 || _api$core5.actions.focus();
|
|
227
226
|
return true;
|
|
228
|
-
} else if (isLayoutColumnSelected
|
|
227
|
+
} else if (isLayoutColumnSelected) {
|
|
229
228
|
var _api$core6, _api$blockControls4;
|
|
230
229
|
var _index = $currentNodePos.index($currentNodePos.depth);
|
|
231
230
|
var parent = $currentNodePos.node($currentNodePos.depth);
|
|
@@ -251,7 +250,7 @@ var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShor
|
|
|
251
250
|
moveToPos = $currentNodePos.after($currentNodePos.depth) + 1;
|
|
252
251
|
}
|
|
253
252
|
} else if (direction === _consts.DIRECTION.UP) {
|
|
254
|
-
if (isLayoutColumnSelected
|
|
253
|
+
if (isLayoutColumnSelected) {
|
|
255
254
|
moveToPos = $currentNodePos.start() - 1;
|
|
256
255
|
} else {
|
|
257
256
|
var _nodeBefore = $currentNodePos.depth > 1 && nodeIndex === 0 && shouldEnableNestedDndA11y ? $currentNodePos.node($currentNodePos.depth) : $currentNodePos.nodeBefore;
|
|
@@ -264,7 +263,7 @@ var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShor
|
|
|
264
263
|
if (nodeAfterPos > _endOfDoc) {
|
|
265
264
|
return false;
|
|
266
265
|
}
|
|
267
|
-
if (isLayoutColumnSelected
|
|
266
|
+
if (isLayoutColumnSelected) {
|
|
268
267
|
moveToPos = state.selection.$from.end() + 1;
|
|
269
268
|
} else {
|
|
270
269
|
var nodeAfter = state.doc.nodeAt(nodeAfterPos);
|
|
@@ -279,10 +278,10 @@ var moveNodeViaShortcut = exports.moveNodeViaShortcut = function moveNodeViaShor
|
|
|
279
278
|
if (moveToPos > -1 && (0, _platformFeatureFlags.fg)('platform_editor_elements_dnd_multi_select_patch_2')) {
|
|
280
279
|
var isDestDepthSameAsSource = $currentNodePos.depth === state.doc.resolve(moveToPos).depth;
|
|
281
280
|
var isSourceLayoutColumn = nodeType === 'layoutColumn';
|
|
282
|
-
shouldMoveNode = (shouldEnableNestedDndA11y ? isDestDepthSameAsSource || isSourceLayoutColumn : true) || isSourceLayoutColumn
|
|
281
|
+
shouldMoveNode = (shouldEnableNestedDndA11y ? isDestDepthSameAsSource || isSourceLayoutColumn : true) || isSourceLayoutColumn;
|
|
283
282
|
} else {
|
|
284
283
|
// 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'
|
|
284
|
+
shouldMoveNode = (shouldEnableNestedDndA11y ? moveToPos > -1 && $currentNodePos.depth === state.doc.resolve(moveToPos).depth || nodeType === 'layoutColumn' : moveToPos > -1) || nodeType === 'layoutColumn';
|
|
286
285
|
}
|
|
287
286
|
var _expandSelectionBound = (0, _selection.expandSelectionBounds)($currentNodePos, selection.$to),
|
|
288
287
|
$newAnchor = _expandSelectionBound.$anchor,
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.showDragHandleAtSelection = void 0;
|
|
7
7
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
8
8
|
var _utils2 = require("@atlaskit/editor-tables/utils");
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
9
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
11
10
|
var _decorationsAnchor = require("../pm-plugins/decorations-anchor");
|
|
12
11
|
var _main = require("../pm-plugins/main");
|
|
@@ -152,6 +151,6 @@ var showDragHandleAtSelectionNew = function showDragHandleAtSelectionNew(api) {
|
|
|
152
151
|
};
|
|
153
152
|
var showDragHandleAtSelection = exports.showDragHandleAtSelection = function showDragHandleAtSelection(api) {
|
|
154
153
|
return function (state, dispatch, view) {
|
|
155
|
-
return (0, _experiments.editorExperiment)('nested-dnd', true)
|
|
154
|
+
return (0, _experiments.editorExperiment)('nested-dnd', true) ? showDragHandleAtSelectionNew(api)(state) : showDragHandleAtSelectionOld(api)(state, dispatch, view);
|
|
156
155
|
};
|
|
157
156
|
};
|
|
@@ -114,8 +114,8 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
|
|
|
114
114
|
var nodeType = rootElement.getAttribute('data-drag-handler-node-type');
|
|
115
115
|
if (nodeType) {
|
|
116
116
|
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
117
|
-
var _api$core, _api$blockControls2
|
|
118
|
-
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.commands.showDragHandleAt(targetPos, anchorName, nodeType, undefined,
|
|
117
|
+
var _api$core, _api$blockControls2;
|
|
118
|
+
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.commands.showDragHandleAt(targetPos, anchorName, nodeType, undefined, rootPos !== null && rootPos !== void 0 ? rootPos : targetPos, rootAnchorName !== null && rootAnchorName !== void 0 ? rootAnchorName : anchorName, rootNodeType !== null && rootNodeType !== void 0 ? rootNodeType : nodeType));
|
|
119
119
|
} else {
|
|
120
120
|
var _api$core2, _api$blockControls3;
|
|
121
121
|
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute(api === null || api === void 0 || (_api$blockControls3 = api.blockControls) === null || _api$blockControls3 === void 0 ? void 0 : _api$blockControls3.commands.showDragHandleAt(targetPos, anchorName, nodeType));
|
|
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.removeFromSource = void 0;
|
|
7
7
|
var _model = require("@atlaskit/editor-prosemirror/model");
|
|
8
8
|
var _utils = require("@atlaskit/editor-prosemirror/utils");
|
|
9
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
10
9
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
11
10
|
var _checkFragment = require("./check-fragment");
|
|
12
11
|
var _consts = require("./consts");
|
|
@@ -31,7 +30,7 @@ var removeFromSource = exports.removeFromSource = function removeFromSource(tr,
|
|
|
31
30
|
|
|
32
31
|
// Currently, we assume that the MIN_LAYOUT_COLUMN is set to 2.
|
|
33
32
|
// This value may require an update when we introduce support for a single-column layout.
|
|
34
|
-
if (sourceParent.childCount === 2
|
|
33
|
+
if (sourceParent.childCount === 2) {
|
|
35
34
|
var _$from$parent$lastChi, _$from$parent$firstCh;
|
|
36
35
|
var layoutContentFragment = $from.parentOffset === 0 ? _model.Fragment.from((_$from$parent$lastChi = $from.parent.lastChild) === null || _$from$parent$lastChi === void 0 ? void 0 : _$from$parent$lastChi.content) : _model.Fragment.from((_$from$parent$firstCh = $from.parent.firstChild) === null || _$from$parent$firstCh === void 0 ? void 0 : _$from$parent$firstCh.content);
|
|
37
36
|
var parent = (0, _utils.findParentNodeClosestToPos)($from, function (node) {
|
|
@@ -472,7 +472,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
472
472
|
var supportsAnchor = CSS.supports('top', "anchor(".concat(anchorName, " start)")) && CSS.supports('left', "anchor(".concat(anchorName, " start)"));
|
|
473
473
|
var dom = view.dom.querySelector("[data-drag-handler-anchor-name=\"".concat(anchorName, "\"]"));
|
|
474
474
|
var hasResizer = nodeType === 'table' || nodeType === 'mediaSingle';
|
|
475
|
-
var isExtension = nodeType === 'extension' || nodeType === 'bodiedExtension';
|
|
475
|
+
var isExtension = nodeType === 'extension' || nodeType === 'bodiedExtension' || nodeType === 'multiBodiedExtension' && (0, _platformFeatureFlags.fg)('platform_editor_multi_body_extension_extensibility');
|
|
476
476
|
var isBlockCard = nodeType === 'blockCard' && !!blockCardWidth;
|
|
477
477
|
var isEmbedCard = nodeType === 'embedCard';
|
|
478
478
|
var isMacroInteractionUpdates = macroInteractionUpdates && isExtension;
|
|
@@ -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,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
2
2
|
import { isInTable } from '@atlaskit/editor-tables/utils';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
4
|
import { findNodeDecs } from '../pm-plugins/decorations-anchor';
|
|
6
5
|
import { getDecorations, key } from '../pm-plugins/main';
|
|
@@ -148,4 +147,4 @@ const showDragHandleAtSelectionNew = api => state => {
|
|
|
148
147
|
}
|
|
149
148
|
return false;
|
|
150
149
|
};
|
|
151
|
-
export const showDragHandleAtSelection = api => (state, dispatch, view) => editorExperiment('nested-dnd', true)
|
|
150
|
+
export const showDragHandleAtSelection = api => (state, dispatch, view) => editorExperiment('nested-dnd', true) ? showDragHandleAtSelectionNew(api)(state) : showDragHandleAtSelectionOld(api)(state, dispatch, view);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { findParentNodeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
4
|
import { isFragmentOfType } from './check-fragment';
|
|
6
5
|
import { MIN_LAYOUT_COLUMN } from './consts';
|
|
@@ -25,7 +24,7 @@ export const removeFromSource = (tr, $from, to) => {
|
|
|
25
24
|
|
|
26
25
|
// Currently, we assume that the MIN_LAYOUT_COLUMN is set to 2.
|
|
27
26
|
// This value may require an update when we introduce support for a single-column layout.
|
|
28
|
-
if (sourceParent.childCount === 2
|
|
27
|
+
if (sourceParent.childCount === 2) {
|
|
29
28
|
var _$from$parent$lastChi, _$from$parent$firstCh;
|
|
30
29
|
const layoutContentFragment = $from.parentOffset === 0 ? Fragment.from((_$from$parent$lastChi = $from.parent.lastChild) === null || _$from$parent$lastChi === void 0 ? void 0 : _$from$parent$lastChi.content) : Fragment.from((_$from$parent$firstCh = $from.parent.firstChild) === null || _$from$parent$firstCh === void 0 ? void 0 : _$from$parent$firstCh.content);
|
|
31
30
|
const parent = findParentNodeClosestToPos($from, node => {
|
|
@@ -461,7 +461,7 @@ export const DragHandle = ({
|
|
|
461
461
|
const supportsAnchor = CSS.supports('top', `anchor(${anchorName} start)`) && CSS.supports('left', `anchor(${anchorName} start)`);
|
|
462
462
|
const dom = view.dom.querySelector(`[data-drag-handler-anchor-name="${anchorName}"]`);
|
|
463
463
|
const hasResizer = nodeType === 'table' || nodeType === 'mediaSingle';
|
|
464
|
-
const isExtension = nodeType === 'extension' || nodeType === 'bodiedExtension';
|
|
464
|
+
const isExtension = nodeType === 'extension' || nodeType === 'bodiedExtension' || nodeType === 'multiBodiedExtension' && fg('platform_editor_multi_body_extension_extensibility');
|
|
465
465
|
const isBlockCard = nodeType === 'blockCard' && !!blockCardWidth;
|
|
466
466
|
const isEmbedCard = nodeType === 'embedCard';
|
|
467
467
|
const isMacroInteractionUpdates = macroInteractionUpdates && isExtension;
|
|
@@ -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')) {
|
|
@@ -125,7 +125,6 @@ var getFocusedHandle = function getFocusedHandle(state) {
|
|
|
125
125
|
};
|
|
126
126
|
export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, formatMessage) {
|
|
127
127
|
return function (state) {
|
|
128
|
-
var _hoistedPos;
|
|
129
128
|
var isParentNodeOfTypeLayout;
|
|
130
129
|
var shouldEnableNestedDndA11y = editorExperiment('nested-dnd', true);
|
|
131
130
|
var selection = state.selection;
|
|
@@ -143,7 +142,7 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
|
|
|
143
142
|
var LAYOUT_COL_DEPTH = 3;
|
|
144
143
|
hoistedPos = state.doc.resolve(from).before(LAYOUT_COL_DEPTH);
|
|
145
144
|
}
|
|
146
|
-
var currentNodePos = isMultiSelectEnabled && !getFocusedHandle(state) && !selection.empty ?
|
|
145
|
+
var currentNodePos = isMultiSelectEnabled && !getFocusedHandle(state) && !selection.empty ? hoistedPos !== null && hoistedPos !== void 0 ? hoistedPos : from : getCurrentNodePos(state);
|
|
147
146
|
if (currentNodePos > -1) {
|
|
148
147
|
var _state$doc$nodeAt;
|
|
149
148
|
var $currentNodePos = state.doc.resolve(currentNodePos);
|
|
@@ -153,7 +152,7 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
|
|
|
153
152
|
var nodeIndex = $currentNodePos.index();
|
|
154
153
|
var isLayoutColumnSelected = selection instanceof NodeSelection && selection.node.type.name === 'layoutColumn';
|
|
155
154
|
if (direction === DIRECTION.LEFT && shouldEnableNestedDndA11y) {
|
|
156
|
-
if (isTopLevelNode && editorExperiment('advanced_layouts', true)
|
|
155
|
+
if (isTopLevelNode && editorExperiment('advanced_layouts', true)) {
|
|
157
156
|
var _api$core, _api$core2;
|
|
158
157
|
var nodeBefore = $currentNodePos.nodeBefore;
|
|
159
158
|
if (nodeBefore) {
|
|
@@ -178,7 +177,7 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
|
|
|
178
177
|
});
|
|
179
178
|
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.focus();
|
|
180
179
|
return true;
|
|
181
|
-
} else if (isLayoutColumnSelected
|
|
180
|
+
} else if (isLayoutColumnSelected) {
|
|
182
181
|
var _$currentNodePos$node, _api$core3, _api$blockControls2;
|
|
183
182
|
moveToPos = selection.from - (((_$currentNodePos$node = $currentNodePos.nodeBefore) === null || _$currentNodePos$node === void 0 ? void 0 : _$currentNodePos$node.nodeSize) || 1);
|
|
184
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, {
|
|
@@ -197,7 +196,7 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
|
|
|
197
196
|
moveToPos = $currentNodePos.start() - ((previousNode === null || previousNode === void 0 ? void 0 : previousNode.nodeSize) || 1);
|
|
198
197
|
}
|
|
199
198
|
} else if (direction === DIRECTION.RIGHT && shouldEnableNestedDndA11y) {
|
|
200
|
-
if (isTopLevelNode && editorExperiment('advanced_layouts', true)
|
|
199
|
+
if (isTopLevelNode && editorExperiment('advanced_layouts', true)) {
|
|
201
200
|
var _api$core4, _api$core5;
|
|
202
201
|
var endOfDoc = $currentNodePos.end();
|
|
203
202
|
moveToPos = $currentNodePos.posAtIndex($currentNodePos.index() + 1);
|
|
@@ -219,7 +218,7 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
|
|
|
219
218
|
});
|
|
220
219
|
api === null || api === void 0 || (_api$core5 = api.core) === null || _api$core5 === void 0 || _api$core5.actions.focus();
|
|
221
220
|
return true;
|
|
222
|
-
} else if (isLayoutColumnSelected
|
|
221
|
+
} else if (isLayoutColumnSelected) {
|
|
223
222
|
var _api$core6, _api$blockControls4;
|
|
224
223
|
var _index = $currentNodePos.index($currentNodePos.depth);
|
|
225
224
|
var parent = $currentNodePos.node($currentNodePos.depth);
|
|
@@ -245,7 +244,7 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
|
|
|
245
244
|
moveToPos = $currentNodePos.after($currentNodePos.depth) + 1;
|
|
246
245
|
}
|
|
247
246
|
} else if (direction === DIRECTION.UP) {
|
|
248
|
-
if (isLayoutColumnSelected
|
|
247
|
+
if (isLayoutColumnSelected) {
|
|
249
248
|
moveToPos = $currentNodePos.start() - 1;
|
|
250
249
|
} else {
|
|
251
250
|
var _nodeBefore = $currentNodePos.depth > 1 && nodeIndex === 0 && shouldEnableNestedDndA11y ? $currentNodePos.node($currentNodePos.depth) : $currentNodePos.nodeBefore;
|
|
@@ -258,7 +257,7 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
|
|
|
258
257
|
if (nodeAfterPos > _endOfDoc) {
|
|
259
258
|
return false;
|
|
260
259
|
}
|
|
261
|
-
if (isLayoutColumnSelected
|
|
260
|
+
if (isLayoutColumnSelected) {
|
|
262
261
|
moveToPos = state.selection.$from.end() + 1;
|
|
263
262
|
} else {
|
|
264
263
|
var nodeAfter = state.doc.nodeAt(nodeAfterPos);
|
|
@@ -273,10 +272,10 @@ export var moveNodeViaShortcut = function moveNodeViaShortcut(api, direction, fo
|
|
|
273
272
|
if (moveToPos > -1 && fg('platform_editor_elements_dnd_multi_select_patch_2')) {
|
|
274
273
|
var isDestDepthSameAsSource = $currentNodePos.depth === state.doc.resolve(moveToPos).depth;
|
|
275
274
|
var isSourceLayoutColumn = nodeType === 'layoutColumn';
|
|
276
|
-
shouldMoveNode = (shouldEnableNestedDndA11y ? isDestDepthSameAsSource || isSourceLayoutColumn : true) || isSourceLayoutColumn
|
|
275
|
+
shouldMoveNode = (shouldEnableNestedDndA11y ? isDestDepthSameAsSource || isSourceLayoutColumn : true) || isSourceLayoutColumn;
|
|
277
276
|
} else {
|
|
278
277
|
// only move the node if the destination is at the same depth, not support moving a nested node to a parent node
|
|
279
|
-
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';
|
|
280
279
|
}
|
|
281
280
|
var _expandSelectionBound = expandSelectionBounds($currentNodePos, selection.$to),
|
|
282
281
|
$newAnchor = _expandSelectionBound.$anchor,
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { findParentNodeOfType } from '@atlaskit/editor-prosemirror/utils';
|
|
2
2
|
import { isInTable } from '@atlaskit/editor-tables/utils';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
4
|
import { findNodeDecs } from '../pm-plugins/decorations-anchor';
|
|
6
5
|
import { getDecorations, key } from '../pm-plugins/main';
|
|
@@ -146,6 +145,6 @@ var showDragHandleAtSelectionNew = function showDragHandleAtSelectionNew(api) {
|
|
|
146
145
|
};
|
|
147
146
|
export var showDragHandleAtSelection = function showDragHandleAtSelection(api) {
|
|
148
147
|
return function (state, dispatch, view) {
|
|
149
|
-
return editorExperiment('nested-dnd', true)
|
|
148
|
+
return editorExperiment('nested-dnd', true) ? showDragHandleAtSelectionNew(api)(state) : showDragHandleAtSelectionOld(api)(state, dispatch, view);
|
|
150
149
|
};
|
|
151
150
|
};
|
|
@@ -108,8 +108,8 @@ export var handleMouseOver = function handleMouseOver(view, event, api) {
|
|
|
108
108
|
var nodeType = rootElement.getAttribute('data-drag-handler-node-type');
|
|
109
109
|
if (nodeType) {
|
|
110
110
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
111
|
-
var _api$core, _api$blockControls2
|
|
112
|
-
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.commands.showDragHandleAt(targetPos, anchorName, nodeType, undefined,
|
|
111
|
+
var _api$core, _api$blockControls2;
|
|
112
|
+
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 ? void 0 : _api$blockControls2.commands.showDragHandleAt(targetPos, anchorName, nodeType, undefined, rootPos !== null && rootPos !== void 0 ? rootPos : targetPos, rootAnchorName !== null && rootAnchorName !== void 0 ? rootAnchorName : anchorName, rootNodeType !== null && rootNodeType !== void 0 ? rootNodeType : nodeType));
|
|
113
113
|
} else {
|
|
114
114
|
var _api$core2, _api$blockControls3;
|
|
115
115
|
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute(api === null || api === void 0 || (_api$blockControls3 = api.blockControls) === null || _api$blockControls3 === void 0 ? void 0 : _api$blockControls3.commands.showDragHandleAt(targetPos, anchorName, nodeType));
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Fragment } from '@atlaskit/editor-prosemirror/model';
|
|
2
2
|
import { findParentNodeClosestToPos } from '@atlaskit/editor-prosemirror/utils';
|
|
3
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
3
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
5
4
|
import { isFragmentOfType } from './check-fragment';
|
|
6
5
|
import { MIN_LAYOUT_COLUMN } from './consts';
|
|
@@ -25,7 +24,7 @@ export var removeFromSource = function removeFromSource(tr, $from, to) {
|
|
|
25
24
|
|
|
26
25
|
// Currently, we assume that the MIN_LAYOUT_COLUMN is set to 2.
|
|
27
26
|
// This value may require an update when we introduce support for a single-column layout.
|
|
28
|
-
if (sourceParent.childCount === 2
|
|
27
|
+
if (sourceParent.childCount === 2) {
|
|
29
28
|
var _$from$parent$lastChi, _$from$parent$firstCh;
|
|
30
29
|
var layoutContentFragment = $from.parentOffset === 0 ? Fragment.from((_$from$parent$lastChi = $from.parent.lastChild) === null || _$from$parent$lastChi === void 0 ? void 0 : _$from$parent$lastChi.content) : Fragment.from((_$from$parent$firstCh = $from.parent.firstChild) === null || _$from$parent$firstCh === void 0 ? void 0 : _$from$parent$firstCh.content);
|
|
31
30
|
var parent = findParentNodeClosestToPos($from, function (node) {
|
|
@@ -469,7 +469,7 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
469
469
|
var supportsAnchor = CSS.supports('top', "anchor(".concat(anchorName, " start)")) && CSS.supports('left', "anchor(".concat(anchorName, " start)"));
|
|
470
470
|
var dom = view.dom.querySelector("[data-drag-handler-anchor-name=\"".concat(anchorName, "\"]"));
|
|
471
471
|
var hasResizer = nodeType === 'table' || nodeType === 'mediaSingle';
|
|
472
|
-
var isExtension = nodeType === 'extension' || nodeType === 'bodiedExtension';
|
|
472
|
+
var isExtension = nodeType === 'extension' || nodeType === 'bodiedExtension' || nodeType === 'multiBodiedExtension' && fg('platform_editor_multi_body_extension_extensibility');
|
|
473
473
|
var isBlockCard = nodeType === 'blockCard' && !!blockCardWidth;
|
|
474
474
|
var isEmbedCard = nodeType === 'embedCard';
|
|
475
475
|
var isMacroInteractionUpdates = macroInteractionUpdates && isExtension;
|
|
@@ -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,14 +46,14 @@
|
|
|
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",
|
|
53
53
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.0.0",
|
|
54
54
|
"@atlaskit/primitives": "^14.2.0",
|
|
55
55
|
"@atlaskit/theme": "^18.0.0",
|
|
56
|
-
"@atlaskit/tmp-editor-statsig": "^4.
|
|
56
|
+
"@atlaskit/tmp-editor-statsig": "^4.4.0",
|
|
57
57
|
"@atlaskit/tokens": "^4.5.0",
|
|
58
58
|
"@atlaskit/tooltip": "^20.0.0",
|
|
59
59
|
"@babel/runtime": "^7.0.0",
|
|
@@ -123,21 +123,12 @@
|
|
|
123
123
|
"platform_editor_use_nested_table_pm_nodes": {
|
|
124
124
|
"type": "boolean"
|
|
125
125
|
},
|
|
126
|
-
"platform_editor_advanced_layouts_dnd_remove_layout": {
|
|
127
|
-
"type": "boolean"
|
|
128
|
-
},
|
|
129
126
|
"platform_editor_dnd_update_drag_start_target": {
|
|
130
127
|
"type": "boolean"
|
|
131
128
|
},
|
|
132
129
|
"platform_editor_dnd_handle_highlight_fix_firefox": {
|
|
133
130
|
"type": "boolean"
|
|
134
131
|
},
|
|
135
|
-
"platform_editor_advanced_layouts_accessibility": {
|
|
136
|
-
"type": "boolean"
|
|
137
|
-
},
|
|
138
|
-
"platform_editor_advanced_layouts_a11y": {
|
|
139
|
-
"type": "boolean"
|
|
140
|
-
},
|
|
141
132
|
"platform_editor_track_node_types": {
|
|
142
133
|
"type": "boolean"
|
|
143
134
|
},
|
|
@@ -167,6 +158,9 @@
|
|
|
167
158
|
},
|
|
168
159
|
"platform_editor_elements_dnd_multi_select_patch_2": {
|
|
169
160
|
"type": "boolean"
|
|
161
|
+
},
|
|
162
|
+
"platform_editor_multi_body_extension_extensibility": {
|
|
163
|
+
"type": "boolean"
|
|
170
164
|
}
|
|
171
165
|
}
|
|
172
166
|
}
|