@atlaskit/editor-plugin-block-controls 3.3.11 → 3.3.13
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 +18 -0
- package/dist/cjs/editor-commands/move-node.js +1 -3
- package/dist/cjs/editor-commands/move-to-layout.js +17 -63
- package/dist/cjs/pm-plugins/decorations-drop-target.js +1 -3
- package/dist/cjs/pm-plugins/handle-mouse-over.js +1 -1
- package/dist/cjs/pm-plugins/main.js +4 -2
- package/dist/cjs/pm-plugins/utils/drag-handle-positions.js +2 -7
- package/dist/cjs/ui/drag-handle.js +3 -7
- package/dist/cjs/ui/drag-preview.js +8 -19
- package/dist/cjs/ui/drop-target-layout.js +9 -15
- package/dist/cjs/ui/global-styles.js +1 -2
- package/dist/cjs/ui/inline-drop-target.js +9 -15
- package/dist/es2019/editor-commands/move-node.js +1 -3
- package/dist/es2019/editor-commands/move-to-layout.js +6 -54
- package/dist/es2019/pm-plugins/decorations-drop-target.js +1 -3
- package/dist/es2019/pm-plugins/handle-mouse-over.js +1 -1
- package/dist/es2019/pm-plugins/main.js +4 -2
- package/dist/es2019/pm-plugins/utils/drag-handle-positions.js +2 -7
- package/dist/es2019/ui/drag-handle.js +3 -7
- package/dist/es2019/ui/drag-preview.js +9 -20
- package/dist/es2019/ui/drop-target-layout.js +10 -16
- package/dist/es2019/ui/global-styles.js +1 -2
- package/dist/es2019/ui/inline-drop-target.js +10 -16
- package/dist/esm/editor-commands/move-node.js +1 -3
- package/dist/esm/editor-commands/move-to-layout.js +19 -65
- package/dist/esm/pm-plugins/decorations-drop-target.js +1 -3
- package/dist/esm/pm-plugins/handle-mouse-over.js +1 -1
- package/dist/esm/pm-plugins/main.js +4 -2
- package/dist/esm/pm-plugins/utils/drag-handle-positions.js +2 -7
- package/dist/esm/ui/drag-handle.js +3 -7
- package/dist/esm/ui/drag-preview.js +9 -20
- package/dist/esm/ui/drop-target-layout.js +9 -15
- package/dist/esm/ui/global-styles.js +1 -2
- package/dist/esm/ui/inline-drop-target.js +9 -15
- package/package.json +4 -10
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 3.3.13
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#126772](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/126772)
|
|
8
|
+
[`c64847bdf13d4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c64847bdf13d4) -
|
|
9
|
+
[ED-27001] This change is cleaning up the feature gate for a drag and drop bugfix to update the
|
|
10
|
+
drag preview for extensions with iFrames.
|
|
11
|
+
- Updated dependencies
|
|
12
|
+
|
|
13
|
+
## 3.3.12
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- [#126796](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/126796)
|
|
18
|
+
[`5ca66e248d850`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5ca66e248d850) -
|
|
19
|
+
Change experiment exposure point
|
|
20
|
+
|
|
3
21
|
## 3.3.11
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -347,9 +347,7 @@ var moveNode = exports.moveNode = function moveNode(api) {
|
|
|
347
347
|
var sliceTo;
|
|
348
348
|
var mappedTo;
|
|
349
349
|
var sourceNodeTypes, hasSelectedMultipleNodes;
|
|
350
|
-
var isMultiSelect = (0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true
|
|
351
|
-
exposure: true
|
|
352
|
-
});
|
|
350
|
+
var isMultiSelect = (0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true);
|
|
353
351
|
if ((0, _platformFeatureFlags.fg)('platform_editor_ease_of_use_metrics')) {
|
|
354
352
|
var _api$metrics;
|
|
355
353
|
api === null || api === void 0 || (_api$metrics = api.metrics) === null || _api$metrics === void 0 || _api$metrics.commands.setContentMoved()({
|
|
@@ -15,7 +15,6 @@ var _checkFragment = require("../pm-plugins/utils/check-fragment");
|
|
|
15
15
|
var _consts = require("../pm-plugins/utils/consts");
|
|
16
16
|
var _removeFromSource = require("../pm-plugins/utils/remove-from-source");
|
|
17
17
|
var _selection = require("../pm-plugins/utils/selection");
|
|
18
|
-
var _updateColumnWidths = require("../pm-plugins/utils/update-column-widths");
|
|
19
18
|
var _validation = require("../pm-plugins/utils/validation");
|
|
20
19
|
var _consts2 = require("../ui/consts");
|
|
21
20
|
var createNewLayout = function createNewLayout(schema, layoutContents) {
|
|
@@ -70,20 +69,14 @@ var moveToExistingLayout = function moveToExistingLayout(toLayout, toLayoutPos,
|
|
|
70
69
|
tr.delete(from, sourceContentEndPos);
|
|
71
70
|
var mappedTo = tr.mapping.map(to);
|
|
72
71
|
tr.insert(mappedTo, sourceContent);
|
|
73
|
-
if (
|
|
72
|
+
if (selectMovedNode) {
|
|
74
73
|
tr.setSelection(new _state.NodeSelection(tr.doc.resolve(mappedTo))).scrollIntoView();
|
|
75
74
|
}
|
|
76
75
|
(0, _analytics2.attachMoveNodeAnalytics)(tr, _analytics.INPUT_METHOD.DRAG_AND_DROP, $originalFrom.depth, ((_$originalFrom$nodeAf = $originalFrom.nodeAfter) === null || _$originalFrom$nodeAf === void 0 ? void 0 : _$originalFrom$nodeAf.type.name) || '', 1, 'layoutSection', true, api, sourceNodeTypes, hasSelectedMultipleNodes);
|
|
77
76
|
} else if (toLayout.childCount < (0, _consts.maxLayoutColumnSupported)()) {
|
|
78
77
|
var _$originalFrom$nodeAf2;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
insertToDestinationNoWidthUpdate(tr, tr.mapping.map(to), sourceContent);
|
|
82
|
-
} else {
|
|
83
|
-
insertToDestination(tr, to, sourceContent, toLayout, toLayoutPos);
|
|
84
|
-
var mappedFrom = tr.mapping.map(from);
|
|
85
|
-
(0, _removeFromSource.removeFromSource)(tr, tr.doc.resolve(mappedFrom), tr.mapping.map(sourceContentEndPos));
|
|
86
|
-
}
|
|
78
|
+
(0, _removeFromSource.removeFromSource)(tr, tr.doc.resolve(from), sourceContentEndPos);
|
|
79
|
+
insertToDestinationNoWidthUpdate(tr, tr.mapping.map(to), sourceContent);
|
|
87
80
|
(0, _analytics2.attachMoveNodeAnalytics)(tr, _analytics.INPUT_METHOD.DRAG_AND_DROP, $originalFrom.depth, ((_$originalFrom$nodeAf2 = $originalFrom.nodeAfter) === null || _$originalFrom$nodeAf2 === void 0 ? void 0 : _$originalFrom$nodeAf2.type.name) || '', 1, 'layoutSection', false, api, sourceNodeTypes, hasSelectedMultipleNodes);
|
|
88
81
|
}
|
|
89
82
|
return tr;
|
|
@@ -128,40 +121,6 @@ var insertToDestinationNoWidthUpdate = function insertToDestinationNoWidthUpdate
|
|
|
128
121
|
}
|
|
129
122
|
return tr;
|
|
130
123
|
};
|
|
131
|
-
var insertToDestination = function insertToDestination(tr, to, sourceContent, toLayout, toLayoutPos) {
|
|
132
|
-
var _ref3 = (0, _updateColumnWidths.updateColumnWidths)(tr, toLayout, toLayoutPos, toLayout.childCount + 1) || {},
|
|
133
|
-
newColumnWidth = _ref3.newColumnWidth;
|
|
134
|
-
var _ref4 = tr.doc.type.schema.nodes || {},
|
|
135
|
-
layoutColumn = _ref4.layoutColumn;
|
|
136
|
-
var content = null;
|
|
137
|
-
try {
|
|
138
|
-
if ((0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true)) {
|
|
139
|
-
if (sourceContent instanceof _model.Fragment) {
|
|
140
|
-
var _sourceContent$firstC;
|
|
141
|
-
content = layoutColumn.createChecked({
|
|
142
|
-
width: newColumnWidth
|
|
143
|
-
}, (0, _checkFragment.isFragmentOfType)(sourceContent, 'layoutColumn') ? (_sourceContent$firstC = sourceContent.firstChild) === null || _sourceContent$firstC === void 0 ? void 0 : _sourceContent$firstC.content : sourceContent);
|
|
144
|
-
}
|
|
145
|
-
} else {
|
|
146
|
-
if (sourceContent instanceof _model.Node) {
|
|
147
|
-
content = layoutColumn.createChecked({
|
|
148
|
-
width: newColumnWidth
|
|
149
|
-
}, sourceContent.type.name === 'layoutColumn' ? sourceContent.content : sourceContent);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
} catch (error) {
|
|
153
|
-
(0, _monitoring.logException)(error, {
|
|
154
|
-
location: 'editor-plugin-block-controls/move-to-layout'
|
|
155
|
-
});
|
|
156
|
-
}
|
|
157
|
-
if (content) {
|
|
158
|
-
tr.insert(to, content);
|
|
159
|
-
}
|
|
160
|
-
if (!(0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_post_fix_patch_1')) {
|
|
161
|
-
tr.setSelection(new _state.NodeSelection(tr.doc.resolve(to))).scrollIntoView();
|
|
162
|
-
}
|
|
163
|
-
return tr;
|
|
164
|
-
};
|
|
165
124
|
|
|
166
125
|
/**
|
|
167
126
|
* Check if the node at `from` can be moved to node at `to` to create/expand a layout.
|
|
@@ -171,10 +130,10 @@ var canMoveToLayout = function canMoveToLayout(api, from, to, tr, moveNodeAtCurs
|
|
|
171
130
|
if (from === to) {
|
|
172
131
|
return;
|
|
173
132
|
}
|
|
174
|
-
var
|
|
175
|
-
layoutSection =
|
|
176
|
-
layoutColumn =
|
|
177
|
-
doc =
|
|
133
|
+
var _ref3 = tr.doc.type.schema.nodes || {},
|
|
134
|
+
layoutSection = _ref3.layoutSection,
|
|
135
|
+
layoutColumn = _ref3.layoutColumn,
|
|
136
|
+
doc = _ref3.doc;
|
|
178
137
|
|
|
179
138
|
// layout plugin does not exist
|
|
180
139
|
if (!layoutSection || !layoutColumn) {
|
|
@@ -187,9 +146,7 @@ var canMoveToLayout = function canMoveToLayout(api, from, to, tr, moveNodeAtCurs
|
|
|
187
146
|
return;
|
|
188
147
|
}
|
|
189
148
|
var $from = tr.doc.resolve(from);
|
|
190
|
-
var isMultiSelect = (0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true
|
|
191
|
-
exposure: true
|
|
192
|
-
});
|
|
149
|
+
var isMultiSelect = (0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true);
|
|
193
150
|
|
|
194
151
|
// invalid from position or dragging a layout
|
|
195
152
|
if (!$from.nodeAfter || $from.nodeAfter.type === layoutSection) {
|
|
@@ -226,8 +183,8 @@ var canMoveToLayout = function canMoveToLayout(api, from, to, tr, moveNodeAtCurs
|
|
|
226
183
|
};
|
|
227
184
|
var removeBreakoutMarks = function removeBreakoutMarks(tr, $from, to) {
|
|
228
185
|
var fromContentWithoutBreakout = $from.nodeAfter;
|
|
229
|
-
var
|
|
230
|
-
breakout =
|
|
186
|
+
var _ref4 = tr.doc.type.schema.marks || {},
|
|
187
|
+
breakout = _ref4.breakout;
|
|
231
188
|
if ((0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true)) {
|
|
232
189
|
tr.doc.nodesBetween($from.pos, to, function (node, pos, parent) {
|
|
233
190
|
// breakout doesn't exist on nested nodes
|
|
@@ -290,8 +247,8 @@ var getBreakoutMode = function getBreakoutMode(content, breakout) {
|
|
|
290
247
|
// source content variable that has type of `PMNode | Fragment` should be updated to `Fragment` only
|
|
291
248
|
var moveToLayout = exports.moveToLayout = function moveToLayout(api) {
|
|
292
249
|
return function (from, to, options) {
|
|
293
|
-
return function (
|
|
294
|
-
var tr =
|
|
250
|
+
return function (_ref5) {
|
|
251
|
+
var tr = _ref5.tr;
|
|
295
252
|
if (!api) {
|
|
296
253
|
return tr;
|
|
297
254
|
}
|
|
@@ -304,11 +261,11 @@ var moveToLayout = exports.moveToLayout = function moveToLayout(api) {
|
|
|
304
261
|
sourceContent = canMove.sourceContent,
|
|
305
262
|
$sourceFrom = canMove.$sourceFrom,
|
|
306
263
|
sourceTo = canMove.sourceTo;
|
|
307
|
-
var
|
|
308
|
-
layoutSection =
|
|
309
|
-
layoutColumn =
|
|
310
|
-
var
|
|
311
|
-
breakout =
|
|
264
|
+
var _ref6 = tr.doc.type.schema.nodes || {},
|
|
265
|
+
layoutSection = _ref6.layoutSection,
|
|
266
|
+
layoutColumn = _ref6.layoutColumn;
|
|
267
|
+
var _ref7 = tr.doc.type.schema.marks || {},
|
|
268
|
+
breakout = _ref7.breakout;
|
|
312
269
|
|
|
313
270
|
// get breakout mode from destination node,
|
|
314
271
|
// if not found, get from source node,
|
|
@@ -366,9 +323,6 @@ var moveToLayout = exports.moveToLayout = function moveToLayout(api) {
|
|
|
366
323
|
tr = (0, _removeFromSource.removeFromSource)(tr, $sourceFrom, sourceTo);
|
|
367
324
|
var mappedTo = tr.mapping.map(to);
|
|
368
325
|
tr.delete(mappedTo, mappedTo + toNodeWithoutBreakout.nodeSize).insert(mappedTo, newLayout);
|
|
369
|
-
if (!(0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_post_fix_patch_1')) {
|
|
370
|
-
tr.setSelection(new _state.NodeSelection(tr.doc.resolve(mappedTo))).scrollIntoView();
|
|
371
|
-
}
|
|
372
326
|
breakoutMode && tr.setNodeMarkup(mappedTo, newLayout.type, newLayout.attrs, [breakout.create({
|
|
373
327
|
mode: breakoutMode
|
|
374
328
|
})]);
|
|
@@ -149,9 +149,7 @@ var dropTargetDecorations = exports.dropTargetDecorations = function dropTargetD
|
|
|
149
149
|
var activeNodePos = activeNode === null || activeNode === void 0 ? void 0 : activeNode.pos;
|
|
150
150
|
var $activeNodePos = typeof activeNodePos === 'number' && newState.doc.resolve(activeNodePos);
|
|
151
151
|
var activePMNode = $activeNodePos && $activeNodePos.nodeAfter;
|
|
152
|
-
var isMultiSelect = (0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true
|
|
153
|
-
exposure: true
|
|
154
|
-
});
|
|
152
|
+
var isMultiSelect = (0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true);
|
|
155
153
|
anchorRectCache === null || anchorRectCache === void 0 || anchorRectCache.clear();
|
|
156
154
|
var prevNodeStack = [];
|
|
157
155
|
var popNodeStack = function popNodeStack(depth) {
|
|
@@ -46,7 +46,7 @@ var handleMouseOver = exports.handleMouseOver = function handleMouseOver(view, e
|
|
|
46
46
|
}
|
|
47
47
|
var parentElement = (_rootElement$parentEl = rootElement.parentElement) === null || _rootElement$parentEl === void 0 ? void 0 : _rootElement$parentEl.closest('[data-drag-handler-anchor-name]');
|
|
48
48
|
var parentElementType = parentElement === null || parentElement === void 0 ? void 0 : parentElement.getAttribute('data-drag-handler-node-type');
|
|
49
|
-
if ((0, _experiments.editorExperiment)('advanced_layouts', true)
|
|
49
|
+
if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
50
50
|
// We want to exclude handles from showing for direct descendant of table nodes (i.e. nodes in cells)
|
|
51
51
|
if (parentElement && (parentElementType === 'table' || parentElementType === 'tableRow') && (0, _experiments.editorExperiment)('nested-dnd', true)) {
|
|
52
52
|
rootElement = parentElement;
|
|
@@ -580,7 +580,9 @@ var createPlugin = exports.createPlugin = function createPlugin(api, getIntl, no
|
|
|
580
580
|
var isAdvancedLayoutEnabled = (0, _experiments.editorExperiment)('advanced_layouts', true, {
|
|
581
581
|
exposure: true
|
|
582
582
|
});
|
|
583
|
-
var isMultiSelectEnabled = (0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true
|
|
583
|
+
var isMultiSelectEnabled = (0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true, {
|
|
584
|
+
exposure: true
|
|
585
|
+
});
|
|
584
586
|
var flags = {
|
|
585
587
|
isNestedEnabled: isNestedEnabled,
|
|
586
588
|
isMultiSelectEnabled: isMultiSelectEnabled
|
|
@@ -640,7 +642,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api, getIntl, no
|
|
|
640
642
|
// Currently we can only drag one node at a time
|
|
641
643
|
// so we only need to check first child
|
|
642
644
|
var draggable = dragging === null || dragging === void 0 ? void 0 : dragging.slice.content.firstChild;
|
|
643
|
-
if (dndDragCancelled && isMultiSelectEnabled || (draggable === null || draggable === void 0 ? void 0 : draggable.type.name) === 'layoutColumn'
|
|
645
|
+
if (dndDragCancelled && isMultiSelectEnabled || (draggable === null || draggable === void 0 ? void 0 : draggable.type.name) === 'layoutColumn') {
|
|
644
646
|
// we prevent native DnD for layoutColumn to prevent single column layout.
|
|
645
647
|
event.preventDefault();
|
|
646
648
|
return false;
|
|
@@ -4,24 +4,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.getTopPosition = exports.getLeftPosition = void 0;
|
|
7
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
7
|
var _consts = require("../../ui/consts");
|
|
9
8
|
var getTopPosition = exports.getTopPosition = function getTopPosition(dom, type) {
|
|
10
9
|
if (!dom) {
|
|
11
10
|
return 'auto';
|
|
12
11
|
}
|
|
13
12
|
var table = dom.querySelector('table');
|
|
14
|
-
var isTable =
|
|
13
|
+
var isTable = table && (!type || type === 'table');
|
|
15
14
|
if (isTable) {
|
|
16
15
|
return "".concat(dom.offsetTop + ((table === null || table === void 0 ? void 0 : table.offsetTop) || 0), "px");
|
|
17
16
|
} else if (type === 'rule') {
|
|
18
17
|
return "".concat(dom.offsetTop - _consts.DRAG_HANDLE_DIVIDER_TOP_ADJUSTMENT, "px");
|
|
19
18
|
} else if (type === 'layoutColumn') {
|
|
20
|
-
|
|
21
|
-
return "".concat(-dom.offsetTop / 2, "px");
|
|
22
|
-
} else {
|
|
23
|
-
return "".concat(-_consts.DRAG_HANDLE_WIDTH, "px");
|
|
24
|
-
}
|
|
19
|
+
return "".concat(-dom.offsetTop / 2, "px");
|
|
25
20
|
} else if (type === 'heading-1') {
|
|
26
21
|
return "".concat(dom.offsetTop + _consts.DRAG_HANDLE_H1_TOP_ADJUSTMENT, "px");
|
|
27
22
|
} else if (type === 'heading-2') {
|
|
@@ -164,9 +164,7 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
164
164
|
var selection = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'selection.selection');
|
|
165
165
|
var isShiftDown = (0, _useSharedPluginStateSelector.useSharedPluginStateSelector)(api, 'blockControls.isShiftDown');
|
|
166
166
|
var isLayoutColumn = nodeType === 'layoutColumn';
|
|
167
|
-
var isMultiSelect = (0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true
|
|
168
|
-
exposure: true
|
|
169
|
-
});
|
|
167
|
+
var isMultiSelect = (0, _experiments.editorExperiment)('platform_editor_element_drag_and_drop_multiselect', true);
|
|
170
168
|
(0, _react.useEffect)(function () {
|
|
171
169
|
// blockCard/datasource width is rendered correctly after this decoraton does. We need to observe for changes.
|
|
172
170
|
if (nodeType === 'blockCard') {
|
|
@@ -241,11 +239,9 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
241
239
|
// but ensures the preview is generated correctly.
|
|
242
240
|
var handleMouseDown = (0, _react.useCallback)(function () {
|
|
243
241
|
if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
242
|
+
var _buttonRef$current;
|
|
244
243
|
// prevent native drag and drop.
|
|
245
|
-
|
|
246
|
-
var _buttonRef$current;
|
|
247
|
-
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 || _buttonRef$current.focus();
|
|
248
|
-
}
|
|
244
|
+
(_buttonRef$current = buttonRef.current) === null || _buttonRef$current === void 0 || _buttonRef$current.focus();
|
|
249
245
|
if (!isLayoutColumn) {
|
|
250
246
|
return undefined;
|
|
251
247
|
}
|
|
@@ -7,31 +7,21 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.dragPreview = void 0;
|
|
8
8
|
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
9
9
|
var _browser = require("@atlaskit/editor-common/browser");
|
|
10
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
10
|
var _colors = require("@atlaskit/theme/colors");
|
|
12
|
-
var
|
|
11
|
+
var previewStyle = {
|
|
13
12
|
borderColor: "var(--ds-border, ".concat(_colors.N30, ")"),
|
|
14
13
|
borderStyle: 'solid',
|
|
15
14
|
borderRadius: "var(--ds-border-radius-100, 3px)",
|
|
16
15
|
borderWidth: "var(--ds-border-width-outline, 2px)",
|
|
17
16
|
backgroundColor: "var(--ds-skeleton-subtle, ".concat(_colors.N20, ")")
|
|
18
17
|
};
|
|
19
|
-
var previewStyleOld = {
|
|
20
|
-
borderColor: "var(--ds-border-focused, ".concat(_colors.B200, ")"),
|
|
21
|
-
borderStyle: 'solid',
|
|
22
|
-
borderRadius: "var(--ds-border-radius-100, 3px)",
|
|
23
|
-
borderWidth: "var(--ds-border-width-outline, 2px)",
|
|
24
|
-
backgroundColor: "var(--ds-blanket-selected, #388BFF14)"
|
|
25
|
-
};
|
|
26
18
|
var getPreviewContainerDimensionsForSingle = function getPreviewContainerDimensionsForSingle(dom, nodeType) {
|
|
27
19
|
var nodeContainer = dom;
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
nodeContainer = iframeContainer;
|
|
34
|
-
}
|
|
20
|
+
var iframeContainer = dom.querySelector('iframe');
|
|
21
|
+
if (nodeType === 'embedCard') {
|
|
22
|
+
nodeContainer = dom.querySelector('.rich-media-item') || dom;
|
|
23
|
+
} else if (nodeType === 'extension' && iframeContainer) {
|
|
24
|
+
nodeContainer = iframeContainer;
|
|
35
25
|
}
|
|
36
26
|
var nodeContainerRect = nodeContainer.getBoundingClientRect();
|
|
37
27
|
return {
|
|
@@ -61,7 +51,6 @@ var createGenericPreview = function createGenericPreview() {
|
|
|
61
51
|
var generalPreview = document.createElement('div');
|
|
62
52
|
// ProseMirror class is required to make sure the cloned dom is styled correctly
|
|
63
53
|
generalPreview.classList.add('ProseMirror', 'block-ctrl-drag-preview');
|
|
64
|
-
var previewStyle = (0, _platformFeatureFlags.fg)('platform_editor_elements_drag_and_drop_ed_23189') ? previewStyleNew : previewStyleOld;
|
|
65
54
|
generalPreview.style.border = "".concat(previewStyle.borderWidth, " ").concat(previewStyle.borderStyle, " ").concat(previewStyle.borderColor);
|
|
66
55
|
generalPreview.style.borderRadius = previewStyle.borderRadius;
|
|
67
56
|
generalPreview.style.backgroundColor = previewStyle.backgroundColor;
|
|
@@ -85,13 +74,13 @@ var createContentPreviewElement = function createContentPreviewElement(dom, node
|
|
|
85
74
|
clonedDom.style.marginRight = '0';
|
|
86
75
|
clonedDom.style.marginBottom = nodeSpacing ? "".concat(nodeSpacing.bottom) : '0';
|
|
87
76
|
clonedDom.style.boxShadow = 'none';
|
|
88
|
-
clonedDom.style.opacity = _browser.browser.windows ? '1' :
|
|
77
|
+
clonedDom.style.opacity = _browser.browser.windows ? '1' : '0.31';
|
|
89
78
|
contentPreviewOneElement.appendChild(clonedDom);
|
|
90
79
|
return contentPreviewOneElement;
|
|
91
80
|
};
|
|
92
81
|
var isGenericPreview = function isGenericPreview(dom, nodeType) {
|
|
93
82
|
var embedCard = dom.querySelector('.embedCardView-content-wrap');
|
|
94
|
-
return
|
|
83
|
+
return nodeType === 'embedCard' || !!embedCard || nodeType === 'extension' && !!dom.querySelector('iframe');
|
|
95
84
|
};
|
|
96
85
|
var createPreviewForElement = function createPreviewForElement(dom, nodeType, nodeSpacing) {
|
|
97
86
|
var shouldBeGenericPreview = isGenericPreview(dom, nodeType);
|
|
@@ -10,7 +10,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _box = require("@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box");
|
|
15
14
|
var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
16
15
|
var _colors = require("@atlaskit/theme/colors");
|
|
@@ -81,7 +80,7 @@ var DropTargetLayout = exports.DropTargetLayout = function DropTargetLayout(prop
|
|
|
81
80
|
var to = getPos();
|
|
82
81
|
var mappedTo;
|
|
83
82
|
if (to !== undefined) {
|
|
84
|
-
var _api$core;
|
|
83
|
+
var _api$core, _api$core2;
|
|
85
84
|
var from = activeNode.pos;
|
|
86
85
|
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function (_ref2) {
|
|
87
86
|
var _api$blockControls2;
|
|
@@ -89,22 +88,17 @@ var DropTargetLayout = exports.DropTargetLayout = function DropTargetLayout(prop
|
|
|
89
88
|
api === null || api === void 0 || (_api$blockControls2 = api.blockControls) === null || _api$blockControls2 === void 0 || (_api$blockControls2 = _api$blockControls2.commands) === null || _api$blockControls2 === void 0 || _api$blockControls2.moveToLayout(from, to)({
|
|
90
89
|
tr: tr
|
|
91
90
|
});
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
91
|
+
var insertColumnStep = (0, _updateSelection.getInsertLayoutStep)(tr);
|
|
92
|
+
mappedTo = insertColumnStep === null || insertColumnStep === void 0 ? void 0 : insertColumnStep.from;
|
|
93
|
+
return tr;
|
|
94
|
+
});
|
|
95
|
+
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute(function (_ref3) {
|
|
96
|
+
var tr = _ref3.tr;
|
|
97
|
+
if (mappedTo !== undefined) {
|
|
98
|
+
(0, _updateSelection.updateSelection)(tr, mappedTo);
|
|
95
99
|
}
|
|
96
100
|
return tr;
|
|
97
101
|
});
|
|
98
|
-
if ((0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_post_fix_patch_1')) {
|
|
99
|
-
var _api$core2;
|
|
100
|
-
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute(function (_ref3) {
|
|
101
|
-
var tr = _ref3.tr;
|
|
102
|
-
if (mappedTo !== undefined) {
|
|
103
|
-
(0, _updateSelection.updateSelection)(tr, mappedTo);
|
|
104
|
-
}
|
|
105
|
-
return tr;
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
102
|
}
|
|
109
103
|
}, [api, getPos, activeNode]);
|
|
110
104
|
(0, _react.useEffect)(function () {
|
|
@@ -8,7 +8,6 @@ exports.GlobalStylesWrapper = void 0;
|
|
|
8
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
11
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
11
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
13
12
|
var _consts = require("./consts");
|
|
14
13
|
/**
|
|
@@ -216,6 +215,6 @@ var blockCardWithoutLayout = (0, _react.css)({
|
|
|
216
215
|
});
|
|
217
216
|
var GlobalStylesWrapper = exports.GlobalStylesWrapper = function GlobalStylesWrapper() {
|
|
218
217
|
return (0, _react.jsx)(_react.Global, {
|
|
219
|
-
styles: [globalStyles(),
|
|
218
|
+
styles: [globalStyles(), globalDnDStyle, (0, _experiments.editorExperiment)('nested-dnd', true) ? extendedHoverZoneNested() : extendedHoverZone(), withInlineNodeStyle, withDeleteLinesStyleFix, withMediaSingleStyleFix, legacyBreakoutWideLayoutStyle, headingWithIndentationInLayoutStyleFix, (0, _experiments.editorExperiment)('advanced_layouts', true) ? blockCardWithoutLayout : undefined, withDividerInPanelStyleFix, withFormatInLayoutStyleFix, withRelativePosStyle, topLevelNodeMarginStyles, (0, _experiments.editorExperiment)('nested-dnd', true) ? withAnchorNameZindexNestedStyle : withAnchorNameZindexStyle,,]
|
|
220
219
|
});
|
|
221
220
|
};
|
|
@@ -10,7 +10,6 @@ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/sli
|
|
|
10
10
|
var _react = require("react");
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _box = require("@atlaskit/pragmatic-drag-and-drop-react-drop-indicator/box");
|
|
15
14
|
var _adapter = require("@atlaskit/pragmatic-drag-and-drop/element/adapter");
|
|
16
15
|
var _colors = require("@atlaskit/theme/colors");
|
|
@@ -191,7 +190,7 @@ var InlineDropTarget = exports.InlineDropTarget = function InlineDropTarget(_ref
|
|
|
191
190
|
var toPos = getPos();
|
|
192
191
|
var mappedTo;
|
|
193
192
|
if (activeNode && toPos !== undefined) {
|
|
194
|
-
var _api$core;
|
|
193
|
+
var _api$core, _api$core2;
|
|
195
194
|
var start = activeNode.pos;
|
|
196
195
|
var moveToEnd = position === 'right';
|
|
197
196
|
api === null || api === void 0 || (_api$core = api.core) === null || _api$core === void 0 || _api$core.actions.execute(function (_ref3) {
|
|
@@ -202,22 +201,17 @@ var InlineDropTarget = exports.InlineDropTarget = function InlineDropTarget(_ref
|
|
|
202
201
|
})({
|
|
203
202
|
tr: tr
|
|
204
203
|
});
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
204
|
+
var insertLayoutStep = (0, _updateSelection.getInsertLayoutStep)(tr);
|
|
205
|
+
mappedTo = insertLayoutStep === null || insertLayoutStep === void 0 ? void 0 : insertLayoutStep.from;
|
|
206
|
+
return tr;
|
|
207
|
+
});
|
|
208
|
+
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute(function (_ref4) {
|
|
209
|
+
var tr = _ref4.tr;
|
|
210
|
+
if (mappedTo !== undefined) {
|
|
211
|
+
(0, _updateSelection.updateSelection)(tr, mappedTo, moveToEnd);
|
|
208
212
|
}
|
|
209
213
|
return tr;
|
|
210
214
|
});
|
|
211
|
-
if ((0, _platformFeatureFlags.fg)('platform_editor_advanced_layouts_post_fix_patch_1')) {
|
|
212
|
-
var _api$core2;
|
|
213
|
-
api === null || api === void 0 || (_api$core2 = api.core) === null || _api$core2 === void 0 || _api$core2.actions.execute(function (_ref4) {
|
|
214
|
-
var tr = _ref4.tr;
|
|
215
|
-
if (mappedTo !== undefined) {
|
|
216
|
-
(0, _updateSelection.updateSelection)(tr, mappedTo, moveToEnd);
|
|
217
|
-
}
|
|
218
|
-
return tr;
|
|
219
|
-
});
|
|
220
|
-
}
|
|
221
215
|
}
|
|
222
216
|
}, [api, getPos, position]);
|
|
223
217
|
var hoverZoneRectStyle = (0, _react.useMemo)(function () {
|
|
@@ -348,9 +348,7 @@ export const moveNode = api => (start, to, inputMethod = INPUT_METHOD.DRAG_AND_D
|
|
|
348
348
|
let sliceTo;
|
|
349
349
|
let mappedTo;
|
|
350
350
|
let sourceNodeTypes, hasSelectedMultipleNodes;
|
|
351
|
-
const isMultiSelect = editorExperiment('platform_editor_element_drag_and_drop_multiselect', true
|
|
352
|
-
exposure: true
|
|
353
|
-
});
|
|
351
|
+
const isMultiSelect = editorExperiment('platform_editor_element_drag_and_drop_multiselect', true);
|
|
354
352
|
if (fg('platform_editor_ease_of_use_metrics')) {
|
|
355
353
|
var _api$metrics;
|
|
356
354
|
api === null || api === void 0 ? void 0 : (_api$metrics = api.metrics) === null || _api$metrics === void 0 ? void 0 : _api$metrics.commands.setContentMoved()({
|
|
@@ -4,12 +4,11 @@ import { Fragment, Node as PMNode } from '@atlaskit/editor-prosemirror/model';
|
|
|
4
4
|
import { NodeSelection } from '@atlaskit/editor-prosemirror/state';
|
|
5
5
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
6
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { attachMoveNodeAnalytics, fireInsertLayoutAnalytics, getMultiSelectAnalyticsAttributes } from '../pm-plugins/utils/analytics';
|
|
8
|
+
import { containsNodeOfType, isFragmentOfType } from '../pm-plugins/utils/check-fragment';
|
|
9
9
|
import { maxLayoutColumnSupported } from '../pm-plugins/utils/consts';
|
|
10
10
|
import { removeFromSource } from '../pm-plugins/utils/remove-from-source';
|
|
11
11
|
import { getMultiSelectionIfPosInside } from '../pm-plugins/utils/selection';
|
|
12
|
-
import { updateColumnWidths } from '../pm-plugins/utils/update-column-widths';
|
|
13
12
|
import { isInSameLayout } from '../pm-plugins/utils/validation';
|
|
14
13
|
import { DEFAULT_COLUMN_DISTRIBUTIONS } from '../ui/consts';
|
|
15
14
|
const createNewLayout = (schema, layoutContents) => {
|
|
@@ -65,20 +64,14 @@ const moveToExistingLayout = (toLayout, toLayoutPos, sourceContent, from, to, tr
|
|
|
65
64
|
tr.delete(from, sourceContentEndPos);
|
|
66
65
|
const mappedTo = tr.mapping.map(to);
|
|
67
66
|
tr.insert(mappedTo, sourceContent);
|
|
68
|
-
if (
|
|
67
|
+
if (selectMovedNode) {
|
|
69
68
|
tr.setSelection(new NodeSelection(tr.doc.resolve(mappedTo))).scrollIntoView();
|
|
70
69
|
}
|
|
71
70
|
attachMoveNodeAnalytics(tr, INPUT_METHOD.DRAG_AND_DROP, $originalFrom.depth, ((_$originalFrom$nodeAf = $originalFrom.nodeAfter) === null || _$originalFrom$nodeAf === void 0 ? void 0 : _$originalFrom$nodeAf.type.name) || '', 1, 'layoutSection', true, api, sourceNodeTypes, hasSelectedMultipleNodes);
|
|
72
71
|
} else if (toLayout.childCount < maxLayoutColumnSupported()) {
|
|
73
72
|
var _$originalFrom$nodeAf2;
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
insertToDestinationNoWidthUpdate(tr, tr.mapping.map(to), sourceContent);
|
|
77
|
-
} else {
|
|
78
|
-
insertToDestination(tr, to, sourceContent, toLayout, toLayoutPos);
|
|
79
|
-
const mappedFrom = tr.mapping.map(from);
|
|
80
|
-
removeFromSource(tr, tr.doc.resolve(mappedFrom), tr.mapping.map(sourceContentEndPos));
|
|
81
|
-
}
|
|
73
|
+
removeFromSource(tr, tr.doc.resolve(from), sourceContentEndPos);
|
|
74
|
+
insertToDestinationNoWidthUpdate(tr, tr.mapping.map(to), sourceContent);
|
|
82
75
|
attachMoveNodeAnalytics(tr, INPUT_METHOD.DRAG_AND_DROP, $originalFrom.depth, ((_$originalFrom$nodeAf2 = $originalFrom.nodeAfter) === null || _$originalFrom$nodeAf2 === void 0 ? void 0 : _$originalFrom$nodeAf2.type.name) || '', 1, 'layoutSection', false, api, sourceNodeTypes, hasSelectedMultipleNodes);
|
|
83
76
|
}
|
|
84
77
|
return tr;
|
|
@@ -124,42 +117,6 @@ const insertToDestinationNoWidthUpdate = (tr, to, sourceContent) => {
|
|
|
124
117
|
}
|
|
125
118
|
return tr;
|
|
126
119
|
};
|
|
127
|
-
const insertToDestination = (tr, to, sourceContent, toLayout, toLayoutPos) => {
|
|
128
|
-
const {
|
|
129
|
-
newColumnWidth
|
|
130
|
-
} = updateColumnWidths(tr, toLayout, toLayoutPos, toLayout.childCount + 1) || {};
|
|
131
|
-
const {
|
|
132
|
-
layoutColumn
|
|
133
|
-
} = tr.doc.type.schema.nodes || {};
|
|
134
|
-
let content = null;
|
|
135
|
-
try {
|
|
136
|
-
if (editorExperiment('platform_editor_element_drag_and_drop_multiselect', true)) {
|
|
137
|
-
if (sourceContent instanceof Fragment) {
|
|
138
|
-
var _sourceContent$firstC;
|
|
139
|
-
content = layoutColumn.createChecked({
|
|
140
|
-
width: newColumnWidth
|
|
141
|
-
}, isFragmentOfType(sourceContent, 'layoutColumn') ? (_sourceContent$firstC = sourceContent.firstChild) === null || _sourceContent$firstC === void 0 ? void 0 : _sourceContent$firstC.content : sourceContent);
|
|
142
|
-
}
|
|
143
|
-
} else {
|
|
144
|
-
if (sourceContent instanceof PMNode) {
|
|
145
|
-
content = layoutColumn.createChecked({
|
|
146
|
-
width: newColumnWidth
|
|
147
|
-
}, sourceContent.type.name === 'layoutColumn' ? sourceContent.content : sourceContent);
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
} catch (error) {
|
|
151
|
-
logException(error, {
|
|
152
|
-
location: 'editor-plugin-block-controls/move-to-layout'
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
if (content) {
|
|
156
|
-
tr.insert(to, content);
|
|
157
|
-
}
|
|
158
|
-
if (!fg('platform_editor_advanced_layouts_post_fix_patch_1')) {
|
|
159
|
-
tr.setSelection(new NodeSelection(tr.doc.resolve(to))).scrollIntoView();
|
|
160
|
-
}
|
|
161
|
-
return tr;
|
|
162
|
-
};
|
|
163
120
|
|
|
164
121
|
/**
|
|
165
122
|
* Check if the node at `from` can be moved to node at `to` to create/expand a layout.
|
|
@@ -186,9 +143,7 @@ const canMoveToLayout = (api, from, to, tr, moveNodeAtCursorPos) => {
|
|
|
186
143
|
return;
|
|
187
144
|
}
|
|
188
145
|
const $from = tr.doc.resolve(from);
|
|
189
|
-
const isMultiSelect = editorExperiment('platform_editor_element_drag_and_drop_multiselect', true
|
|
190
|
-
exposure: true
|
|
191
|
-
});
|
|
146
|
+
const isMultiSelect = editorExperiment('platform_editor_element_drag_and_drop_multiselect', true);
|
|
192
147
|
|
|
193
148
|
// invalid from position or dragging a layout
|
|
194
149
|
if (!$from.nodeAfter || $from.nodeAfter.type === layoutSection) {
|
|
@@ -358,9 +313,6 @@ export const moveToLayout = api => (from, to, options) => ({
|
|
|
358
313
|
tr = removeFromSource(tr, $sourceFrom, sourceTo);
|
|
359
314
|
const mappedTo = tr.mapping.map(to);
|
|
360
315
|
tr.delete(mappedTo, mappedTo + toNodeWithoutBreakout.nodeSize).insert(mappedTo, newLayout);
|
|
361
|
-
if (!fg('platform_editor_advanced_layouts_post_fix_patch_1')) {
|
|
362
|
-
tr.setSelection(new NodeSelection(tr.doc.resolve(mappedTo))).scrollIntoView();
|
|
363
|
-
}
|
|
364
316
|
breakoutMode && tr.setNodeMarkup(mappedTo, newLayout.type, newLayout.attrs, [breakout.create({
|
|
365
317
|
mode: breakoutMode
|
|
366
318
|
})]);
|
|
@@ -136,9 +136,7 @@ export const dropTargetDecorations = (newState, api, formatMessage, nodeViewPort
|
|
|
136
136
|
const activeNodePos = activeNode === null || activeNode === void 0 ? void 0 : activeNode.pos;
|
|
137
137
|
const $activeNodePos = typeof activeNodePos === 'number' && newState.doc.resolve(activeNodePos);
|
|
138
138
|
const activePMNode = $activeNodePos && $activeNodePos.nodeAfter;
|
|
139
|
-
const isMultiSelect = editorExperiment('platform_editor_element_drag_and_drop_multiselect', true
|
|
140
|
-
exposure: true
|
|
141
|
-
});
|
|
139
|
+
const isMultiSelect = editorExperiment('platform_editor_element_drag_and_drop_multiselect', true);
|
|
142
140
|
anchorRectCache === null || anchorRectCache === void 0 ? void 0 : anchorRectCache.clear();
|
|
143
141
|
const prevNodeStack = [];
|
|
144
142
|
const popNodeStack = depth => {
|
|
@@ -41,7 +41,7 @@ export const handleMouseOver = (view, event, api) => {
|
|
|
41
41
|
}
|
|
42
42
|
const parentElement = (_rootElement$parentEl = rootElement.parentElement) === null || _rootElement$parentEl === void 0 ? void 0 : _rootElement$parentEl.closest('[data-drag-handler-anchor-name]');
|
|
43
43
|
const parentElementType = parentElement === null || parentElement === void 0 ? void 0 : parentElement.getAttribute('data-drag-handler-node-type');
|
|
44
|
-
if (editorExperiment('advanced_layouts', true)
|
|
44
|
+
if (editorExperiment('advanced_layouts', true)) {
|
|
45
45
|
// We want to exclude handles from showing for direct descendant of table nodes (i.e. nodes in cells)
|
|
46
46
|
if (parentElement && (parentElementType === 'table' || parentElementType === 'tableRow') && editorExperiment('nested-dnd', true)) {
|
|
47
47
|
rootElement = parentElement;
|
|
@@ -559,7 +559,9 @@ export const createPlugin = (api, getIntl, nodeViewPortalProviderAPI) => {
|
|
|
559
559
|
const isAdvancedLayoutEnabled = editorExperiment('advanced_layouts', true, {
|
|
560
560
|
exposure: true
|
|
561
561
|
});
|
|
562
|
-
const isMultiSelectEnabled = editorExperiment('platform_editor_element_drag_and_drop_multiselect', true
|
|
562
|
+
const isMultiSelectEnabled = editorExperiment('platform_editor_element_drag_and_drop_multiselect', true, {
|
|
563
|
+
exposure: true
|
|
564
|
+
});
|
|
563
565
|
const flags = {
|
|
564
566
|
isNestedEnabled,
|
|
565
567
|
isMultiSelectEnabled
|
|
@@ -622,7 +624,7 @@ export const createPlugin = (api, getIntl, nodeViewPortalProviderAPI) => {
|
|
|
622
624
|
// Currently we can only drag one node at a time
|
|
623
625
|
// so we only need to check first child
|
|
624
626
|
const draggable = dragging === null || dragging === void 0 ? void 0 : dragging.slice.content.firstChild;
|
|
625
|
-
if (dndDragCancelled && isMultiSelectEnabled || (draggable === null || draggable === void 0 ? void 0 : draggable.type.name) === 'layoutColumn'
|
|
627
|
+
if (dndDragCancelled && isMultiSelectEnabled || (draggable === null || draggable === void 0 ? void 0 : draggable.type.name) === 'layoutColumn') {
|
|
626
628
|
// we prevent native DnD for layoutColumn to prevent single column layout.
|
|
627
629
|
event.preventDefault();
|
|
628
630
|
return false;
|