@atlaskit/editor-plugin-block-controls 1.5.6 → 1.5.8
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 +20 -0
- package/dist/cjs/pm-plugins/main.js +42 -15
- package/dist/cjs/ui/drag-handle.js +5 -2
- package/dist/es2019/pm-plugins/main.js +32 -6
- package/dist/es2019/ui/drag-handle.js +5 -2
- package/dist/esm/pm-plugins/main.js +42 -15
- package/dist/esm/ui/drag-handle.js +5 -2
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 1.5.8
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#116058](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116058)
|
|
8
|
+
[`1a8435d9dbaf0`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/1a8435d9dbaf0) -
|
|
9
|
+
fix position of drag handle on block card nodes
|
|
10
|
+
|
|
11
|
+
## 1.5.7
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`2f20977ad803d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2f20977ad803d) -
|
|
16
|
+
Fix paragraph to blockquotes with refactor
|
|
17
|
+
platform.editor.elements.drag-and-drop-remove-wrapper_fyqr2 FF off
|
|
18
|
+
- [#114548](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/114548)
|
|
19
|
+
[`8b2d47bffb50e`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/8b2d47bffb50e) -
|
|
20
|
+
bump adf-schema version
|
|
21
|
+
- Updated dependencies
|
|
22
|
+
|
|
3
23
|
## 1.5.6
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
|
@@ -109,6 +109,7 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
|
|
|
109
109
|
isResizerResizing = currentState.isResizerResizing,
|
|
110
110
|
isDragging = currentState.isDragging,
|
|
111
111
|
isPMDragging = currentState.isPMDragging;
|
|
112
|
+
var activeNodeWithNewNodeType = null;
|
|
112
113
|
var meta = tr.getMeta(key);
|
|
113
114
|
// when creating analytics during drag/drop events, PM thinks the doc has changed
|
|
114
115
|
// so tr.docChange is true and causes some decorations to not render
|
|
@@ -184,6 +185,11 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
|
|
|
184
185
|
if (newActiveNode && (newActiveNode === null || newActiveNode === void 0 ? void 0 : newActiveNode.type.name) !== activeNode.nodeType) {
|
|
185
186
|
nodeType = newActiveNode.type.name;
|
|
186
187
|
anchorName = activeNode.anchorName.replace(activeNode.nodeType, nodeType);
|
|
188
|
+
activeNodeWithNewNodeType = {
|
|
189
|
+
pos: prevMappedPos,
|
|
190
|
+
nodeType: nodeType,
|
|
191
|
+
anchorName: anchorName
|
|
192
|
+
};
|
|
187
193
|
}
|
|
188
194
|
var draghandleDec = (0, _decorations.dragHandleDecoration)(activeNode.pos, anchorName, nodeType, api);
|
|
189
195
|
decorations = decorations.add(newState.doc, [draghandleDec]);
|
|
@@ -200,21 +206,33 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
|
|
|
200
206
|
var decs = (0, _decorations.dragHandleDecoration)(meta.activeNode.pos, meta.activeNode.anchorName, meta.activeNode.nodeType, api);
|
|
201
207
|
decorations = decorations.add(newState.doc, [decs]);
|
|
202
208
|
}
|
|
203
|
-
|
|
209
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.elements.drag-and-drop-ed-23816')) {
|
|
210
|
+
var _activeNodeWithNewNod;
|
|
211
|
+
// Remove previous drag handle widget and draw new drag handle widget when node type changes
|
|
212
|
+
if (activeNodeWithNewNodeType && ((_activeNodeWithNewNod = activeNodeWithNewNodeType) === null || _activeNodeWithNewNod === void 0 ? void 0 : _activeNodeWithNewNod.nodeType) !== (activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) && api) {
|
|
213
|
+
var _oldHandle2 = decorations.find().filter(function (_ref9) {
|
|
214
|
+
var spec = _ref9.spec;
|
|
215
|
+
return spec.id === 'drag-handle';
|
|
216
|
+
});
|
|
217
|
+
decorations = decorations.remove(_oldHandle2);
|
|
218
|
+
var _decs = (0, _decorations.dragHandleDecoration)(activeNodeWithNewNodeType.pos, activeNodeWithNewNodeType.anchorName, activeNodeWithNewNodeType.nodeType, api);
|
|
219
|
+
decorations = decorations.add(newState.doc, [_decs]);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
204
222
|
// Add drop targets when node is being dragged
|
|
205
223
|
// if the transaction is only for analytics and user is dragging, continue to draw drop targets
|
|
206
224
|
if (meta !== null && meta !== void 0 && meta.isDragging && (!tr.docChanged || tr.docChanged && isAnalyticTr) && api) {
|
|
207
225
|
var _dropTargetDecoration = (0, _decorations.dropTargetDecorations)(oldState, newState, api),
|
|
208
|
-
|
|
226
|
+
_decs2 = _dropTargetDecoration.decs,
|
|
209
227
|
updatedDecorationState = _dropTargetDecoration.decorationState;
|
|
210
228
|
decorationState = updatedDecorationState;
|
|
211
|
-
decorations = decorations.add(newState.doc,
|
|
229
|
+
decorations = decorations.add(newState.doc, _decs2);
|
|
212
230
|
}
|
|
213
231
|
|
|
214
232
|
// Remove drop target decoration when dragging stops
|
|
215
233
|
if ((meta === null || meta === void 0 ? void 0 : meta.isDragging) === false && !tr.docChanged) {
|
|
216
|
-
var dropTargetDecs = decorations.find().filter(function (
|
|
217
|
-
var spec =
|
|
234
|
+
var dropTargetDecs = decorations.find().filter(function (_ref10) {
|
|
235
|
+
var spec = _ref10.spec;
|
|
218
236
|
return spec.type === 'drop-target-decoration';
|
|
219
237
|
});
|
|
220
238
|
decorations = decorations.remove(dropTargetDecs);
|
|
@@ -222,9 +240,9 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
|
|
|
222
240
|
|
|
223
241
|
// Map drop target decoration positions when the document changes
|
|
224
242
|
if (tr.docChanged && isDragging) {
|
|
225
|
-
decorationState = decorationState.map(function (
|
|
226
|
-
var index =
|
|
227
|
-
pos =
|
|
243
|
+
decorationState = decorationState.map(function (_ref11) {
|
|
244
|
+
var index = _ref11.index,
|
|
245
|
+
pos = _ref11.pos;
|
|
228
246
|
return {
|
|
229
247
|
index: index,
|
|
230
248
|
pos: tr.mapping.map(pos)
|
|
@@ -237,8 +255,8 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
|
|
|
237
255
|
decorations = decorations.map(tr.mapping, tr.doc);
|
|
238
256
|
}
|
|
239
257
|
var isEmptyDoc = newState.doc.childCount === 1 && newState.doc.nodeSize <= 4;
|
|
240
|
-
var hasNodeDecoration = decorations.find().some(function (
|
|
241
|
-
var spec =
|
|
258
|
+
var hasNodeDecoration = decorations.find().some(function (_ref12) {
|
|
259
|
+
var spec = _ref12.spec;
|
|
242
260
|
return spec.type === 'node-decoration';
|
|
243
261
|
});
|
|
244
262
|
if (!hasNodeDecoration && isEmptyDoc) {
|
|
@@ -246,11 +264,20 @@ var createPlugin = exports.createPlugin = function createPlugin(api) {
|
|
|
246
264
|
}
|
|
247
265
|
|
|
248
266
|
// Map active node position when the document changes
|
|
249
|
-
var mappedActiveNodePos
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
267
|
+
var mappedActiveNodePos;
|
|
268
|
+
if ((0, _platformFeatureFlags.getBooleanFF)('platform.editor.elements.drag-and-drop-ed-23816')) {
|
|
269
|
+
mappedActiveNodePos = tr.docChanged && activeNode ? activeNodeWithNewNodeType || {
|
|
270
|
+
pos: tr.mapping.map(activeNode.pos),
|
|
271
|
+
anchorName: activeNode.anchorName,
|
|
272
|
+
nodeType: activeNode.nodeType
|
|
273
|
+
} : activeNode;
|
|
274
|
+
} else {
|
|
275
|
+
mappedActiveNodePos = tr.docChanged && activeNode ? {
|
|
276
|
+
pos: tr.mapping.map(activeNode.pos),
|
|
277
|
+
anchorName: activeNode.anchorName,
|
|
278
|
+
nodeType: activeNode.nodeType
|
|
279
|
+
} : activeNode;
|
|
280
|
+
}
|
|
254
281
|
return {
|
|
255
282
|
decorations: decorations,
|
|
256
283
|
decorationState: decorationState,
|
|
@@ -242,8 +242,11 @@ var DragHandle = exports.DragHandle = function DragHandle(_ref) {
|
|
|
242
242
|
}
|
|
243
243
|
}
|
|
244
244
|
if (supportsAnchor) {
|
|
245
|
-
return {
|
|
246
|
-
left: hasResizer || isExtension ||
|
|
245
|
+
return (0, _platformFeatureFlags.getBooleanFF)('platform.editor.elements.drag-and-drop-remove-wrapper_fyqr2') ? {
|
|
246
|
+
left: hasResizer || isExtension || isEmbedCard ? "calc(anchor(".concat(anchorName, " start) + ").concat((0, _dragHandlePositions.getLeftPosition)(dom, nodeType, innerContainer, macroInteractionUpdates), ")") : "calc(anchor(".concat(anchorName, " start) - ").concat(_consts.DRAG_HANDLE_WIDTH, "px - ").concat((0, _consts.dragHandleGap)(nodeType), "px)"),
|
|
247
|
+
top: anchorName.includes('table') ? "calc(anchor(".concat(anchorName, " start) + ").concat(_consts.DRAG_HANDLE_HEIGHT, "px)") : "anchor(".concat(anchorName, " start)")
|
|
248
|
+
} : {
|
|
249
|
+
left: hasResizer || isExtension || isBlockCard || isEmbedCard ? (0, _dragHandlePositions.getLeftPosition)(dom, nodeType, innerContainer, macroInteractionUpdates) : "calc(anchor(".concat(anchorName, " start) - ").concat(_consts.DRAG_HANDLE_WIDTH, "px - ").concat((0, _consts.dragHandleGap)(nodeType), "px)"),
|
|
247
250
|
top: anchorName.includes('table') ? "calc(anchor(".concat(anchorName, " start) + ").concat(_consts.DRAG_HANDLE_HEIGHT, "px)") : "anchor(".concat(anchorName, " start)")
|
|
248
251
|
};
|
|
249
252
|
}
|
|
@@ -105,6 +105,7 @@ export const createPlugin = api => {
|
|
|
105
105
|
isDragging,
|
|
106
106
|
isPMDragging
|
|
107
107
|
} = currentState;
|
|
108
|
+
let activeNodeWithNewNodeType = null;
|
|
108
109
|
const meta = tr.getMeta(key);
|
|
109
110
|
// when creating analytics during drag/drop events, PM thinks the doc has changed
|
|
110
111
|
// so tr.docChange is true and causes some decorations to not render
|
|
@@ -175,6 +176,11 @@ export const createPlugin = api => {
|
|
|
175
176
|
if (newActiveNode && (newActiveNode === null || newActiveNode === void 0 ? void 0 : newActiveNode.type.name) !== activeNode.nodeType) {
|
|
176
177
|
nodeType = newActiveNode.type.name;
|
|
177
178
|
anchorName = activeNode.anchorName.replace(activeNode.nodeType, nodeType);
|
|
179
|
+
activeNodeWithNewNodeType = {
|
|
180
|
+
pos: prevMappedPos,
|
|
181
|
+
nodeType,
|
|
182
|
+
anchorName
|
|
183
|
+
};
|
|
178
184
|
}
|
|
179
185
|
const draghandleDec = dragHandleDecoration(activeNode.pos, anchorName, nodeType, api);
|
|
180
186
|
decorations = decorations.add(newState.doc, [draghandleDec]);
|
|
@@ -190,7 +196,18 @@ export const createPlugin = api => {
|
|
|
190
196
|
const decs = dragHandleDecoration(meta.activeNode.pos, meta.activeNode.anchorName, meta.activeNode.nodeType, api);
|
|
191
197
|
decorations = decorations.add(newState.doc, [decs]);
|
|
192
198
|
}
|
|
193
|
-
|
|
199
|
+
if (getBooleanFF('platform.editor.elements.drag-and-drop-ed-23816')) {
|
|
200
|
+
var _activeNodeWithNewNod;
|
|
201
|
+
// Remove previous drag handle widget and draw new drag handle widget when node type changes
|
|
202
|
+
if (activeNodeWithNewNodeType && ((_activeNodeWithNewNod = activeNodeWithNewNodeType) === null || _activeNodeWithNewNod === void 0 ? void 0 : _activeNodeWithNewNod.nodeType) !== (activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) && api) {
|
|
203
|
+
const oldHandle = decorations.find().filter(({
|
|
204
|
+
spec
|
|
205
|
+
}) => spec.id === 'drag-handle');
|
|
206
|
+
decorations = decorations.remove(oldHandle);
|
|
207
|
+
const decs = dragHandleDecoration(activeNodeWithNewNodeType.pos, activeNodeWithNewNodeType.anchorName, activeNodeWithNewNodeType.nodeType, api);
|
|
208
|
+
decorations = decorations.add(newState.doc, [decs]);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
194
211
|
// Add drop targets when node is being dragged
|
|
195
212
|
// if the transaction is only for analytics and user is dragging, continue to draw drop targets
|
|
196
213
|
if (meta !== null && meta !== void 0 && meta.isDragging && (!tr.docChanged || tr.docChanged && isAnalyticTr) && api) {
|
|
@@ -236,11 +253,20 @@ export const createPlugin = api => {
|
|
|
236
253
|
}
|
|
237
254
|
|
|
238
255
|
// Map active node position when the document changes
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
256
|
+
let mappedActiveNodePos;
|
|
257
|
+
if (getBooleanFF('platform.editor.elements.drag-and-drop-ed-23816')) {
|
|
258
|
+
mappedActiveNodePos = tr.docChanged && activeNode ? activeNodeWithNewNodeType || {
|
|
259
|
+
pos: tr.mapping.map(activeNode.pos),
|
|
260
|
+
anchorName: activeNode.anchorName,
|
|
261
|
+
nodeType: activeNode.nodeType
|
|
262
|
+
} : activeNode;
|
|
263
|
+
} else {
|
|
264
|
+
mappedActiveNodePos = tr.docChanged && activeNode ? {
|
|
265
|
+
pos: tr.mapping.map(activeNode.pos),
|
|
266
|
+
anchorName: activeNode.anchorName,
|
|
267
|
+
nodeType: activeNode.nodeType
|
|
268
|
+
} : activeNode;
|
|
269
|
+
}
|
|
244
270
|
return {
|
|
245
271
|
decorations,
|
|
246
272
|
decorationState,
|
|
@@ -231,8 +231,11 @@ export const DragHandle = ({
|
|
|
231
231
|
}
|
|
232
232
|
}
|
|
233
233
|
if (supportsAnchor) {
|
|
234
|
-
return {
|
|
235
|
-
left: hasResizer || isExtension ||
|
|
234
|
+
return getBooleanFF('platform.editor.elements.drag-and-drop-remove-wrapper_fyqr2') ? {
|
|
235
|
+
left: hasResizer || isExtension || isEmbedCard ? `calc(anchor(${anchorName} start) + ${getLeftPosition(dom, nodeType, innerContainer, macroInteractionUpdates)})` : `calc(anchor(${anchorName} start) - ${DRAG_HANDLE_WIDTH}px - ${dragHandleGap(nodeType)}px)`,
|
|
236
|
+
top: anchorName.includes('table') ? `calc(anchor(${anchorName} start) + ${DRAG_HANDLE_HEIGHT}px)` : `anchor(${anchorName} start)`
|
|
237
|
+
} : {
|
|
238
|
+
left: hasResizer || isExtension || isBlockCard || isEmbedCard ? getLeftPosition(dom, nodeType, innerContainer, macroInteractionUpdates) : `calc(anchor(${anchorName} start) - ${DRAG_HANDLE_WIDTH}px - ${dragHandleGap(nodeType)}px)`,
|
|
236
239
|
top: anchorName.includes('table') ? `calc(anchor(${anchorName} start) + ${DRAG_HANDLE_HEIGHT}px)` : `anchor(${anchorName} start)`
|
|
237
240
|
};
|
|
238
241
|
}
|
|
@@ -102,6 +102,7 @@ export var createPlugin = function createPlugin(api) {
|
|
|
102
102
|
isResizerResizing = currentState.isResizerResizing,
|
|
103
103
|
isDragging = currentState.isDragging,
|
|
104
104
|
isPMDragging = currentState.isPMDragging;
|
|
105
|
+
var activeNodeWithNewNodeType = null;
|
|
105
106
|
var meta = tr.getMeta(key);
|
|
106
107
|
// when creating analytics during drag/drop events, PM thinks the doc has changed
|
|
107
108
|
// so tr.docChange is true and causes some decorations to not render
|
|
@@ -177,6 +178,11 @@ export var createPlugin = function createPlugin(api) {
|
|
|
177
178
|
if (newActiveNode && (newActiveNode === null || newActiveNode === void 0 ? void 0 : newActiveNode.type.name) !== activeNode.nodeType) {
|
|
178
179
|
nodeType = newActiveNode.type.name;
|
|
179
180
|
anchorName = activeNode.anchorName.replace(activeNode.nodeType, nodeType);
|
|
181
|
+
activeNodeWithNewNodeType = {
|
|
182
|
+
pos: prevMappedPos,
|
|
183
|
+
nodeType: nodeType,
|
|
184
|
+
anchorName: anchorName
|
|
185
|
+
};
|
|
180
186
|
}
|
|
181
187
|
var draghandleDec = dragHandleDecoration(activeNode.pos, anchorName, nodeType, api);
|
|
182
188
|
decorations = decorations.add(newState.doc, [draghandleDec]);
|
|
@@ -193,21 +199,33 @@ export var createPlugin = function createPlugin(api) {
|
|
|
193
199
|
var decs = dragHandleDecoration(meta.activeNode.pos, meta.activeNode.anchorName, meta.activeNode.nodeType, api);
|
|
194
200
|
decorations = decorations.add(newState.doc, [decs]);
|
|
195
201
|
}
|
|
196
|
-
|
|
202
|
+
if (getBooleanFF('platform.editor.elements.drag-and-drop-ed-23816')) {
|
|
203
|
+
var _activeNodeWithNewNod;
|
|
204
|
+
// Remove previous drag handle widget and draw new drag handle widget when node type changes
|
|
205
|
+
if (activeNodeWithNewNodeType && ((_activeNodeWithNewNod = activeNodeWithNewNodeType) === null || _activeNodeWithNewNod === void 0 ? void 0 : _activeNodeWithNewNod.nodeType) !== (activeNode === null || activeNode === void 0 ? void 0 : activeNode.nodeType) && api) {
|
|
206
|
+
var _oldHandle2 = decorations.find().filter(function (_ref9) {
|
|
207
|
+
var spec = _ref9.spec;
|
|
208
|
+
return spec.id === 'drag-handle';
|
|
209
|
+
});
|
|
210
|
+
decorations = decorations.remove(_oldHandle2);
|
|
211
|
+
var _decs = dragHandleDecoration(activeNodeWithNewNodeType.pos, activeNodeWithNewNodeType.anchorName, activeNodeWithNewNodeType.nodeType, api);
|
|
212
|
+
decorations = decorations.add(newState.doc, [_decs]);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
197
215
|
// Add drop targets when node is being dragged
|
|
198
216
|
// if the transaction is only for analytics and user is dragging, continue to draw drop targets
|
|
199
217
|
if (meta !== null && meta !== void 0 && meta.isDragging && (!tr.docChanged || tr.docChanged && isAnalyticTr) && api) {
|
|
200
218
|
var _dropTargetDecoration = dropTargetDecorations(oldState, newState, api),
|
|
201
|
-
|
|
219
|
+
_decs2 = _dropTargetDecoration.decs,
|
|
202
220
|
updatedDecorationState = _dropTargetDecoration.decorationState;
|
|
203
221
|
decorationState = updatedDecorationState;
|
|
204
|
-
decorations = decorations.add(newState.doc,
|
|
222
|
+
decorations = decorations.add(newState.doc, _decs2);
|
|
205
223
|
}
|
|
206
224
|
|
|
207
225
|
// Remove drop target decoration when dragging stops
|
|
208
226
|
if ((meta === null || meta === void 0 ? void 0 : meta.isDragging) === false && !tr.docChanged) {
|
|
209
|
-
var dropTargetDecs = decorations.find().filter(function (
|
|
210
|
-
var spec =
|
|
227
|
+
var dropTargetDecs = decorations.find().filter(function (_ref10) {
|
|
228
|
+
var spec = _ref10.spec;
|
|
211
229
|
return spec.type === 'drop-target-decoration';
|
|
212
230
|
});
|
|
213
231
|
decorations = decorations.remove(dropTargetDecs);
|
|
@@ -215,9 +233,9 @@ export var createPlugin = function createPlugin(api) {
|
|
|
215
233
|
|
|
216
234
|
// Map drop target decoration positions when the document changes
|
|
217
235
|
if (tr.docChanged && isDragging) {
|
|
218
|
-
decorationState = decorationState.map(function (
|
|
219
|
-
var index =
|
|
220
|
-
pos =
|
|
236
|
+
decorationState = decorationState.map(function (_ref11) {
|
|
237
|
+
var index = _ref11.index,
|
|
238
|
+
pos = _ref11.pos;
|
|
221
239
|
return {
|
|
222
240
|
index: index,
|
|
223
241
|
pos: tr.mapping.map(pos)
|
|
@@ -230,8 +248,8 @@ export var createPlugin = function createPlugin(api) {
|
|
|
230
248
|
decorations = decorations.map(tr.mapping, tr.doc);
|
|
231
249
|
}
|
|
232
250
|
var isEmptyDoc = newState.doc.childCount === 1 && newState.doc.nodeSize <= 4;
|
|
233
|
-
var hasNodeDecoration = decorations.find().some(function (
|
|
234
|
-
var spec =
|
|
251
|
+
var hasNodeDecoration = decorations.find().some(function (_ref12) {
|
|
252
|
+
var spec = _ref12.spec;
|
|
235
253
|
return spec.type === 'node-decoration';
|
|
236
254
|
});
|
|
237
255
|
if (!hasNodeDecoration && isEmptyDoc) {
|
|
@@ -239,11 +257,20 @@ export var createPlugin = function createPlugin(api) {
|
|
|
239
257
|
}
|
|
240
258
|
|
|
241
259
|
// Map active node position when the document changes
|
|
242
|
-
var mappedActiveNodePos
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
260
|
+
var mappedActiveNodePos;
|
|
261
|
+
if (getBooleanFF('platform.editor.elements.drag-and-drop-ed-23816')) {
|
|
262
|
+
mappedActiveNodePos = tr.docChanged && activeNode ? activeNodeWithNewNodeType || {
|
|
263
|
+
pos: tr.mapping.map(activeNode.pos),
|
|
264
|
+
anchorName: activeNode.anchorName,
|
|
265
|
+
nodeType: activeNode.nodeType
|
|
266
|
+
} : activeNode;
|
|
267
|
+
} else {
|
|
268
|
+
mappedActiveNodePos = tr.docChanged && activeNode ? {
|
|
269
|
+
pos: tr.mapping.map(activeNode.pos),
|
|
270
|
+
anchorName: activeNode.anchorName,
|
|
271
|
+
nodeType: activeNode.nodeType
|
|
272
|
+
} : activeNode;
|
|
273
|
+
}
|
|
247
274
|
return {
|
|
248
275
|
decorations: decorations,
|
|
249
276
|
decorationState: decorationState,
|
|
@@ -234,8 +234,11 @@ export var DragHandle = function DragHandle(_ref) {
|
|
|
234
234
|
}
|
|
235
235
|
}
|
|
236
236
|
if (supportsAnchor) {
|
|
237
|
-
return {
|
|
238
|
-
left: hasResizer || isExtension ||
|
|
237
|
+
return getBooleanFF('platform.editor.elements.drag-and-drop-remove-wrapper_fyqr2') ? {
|
|
238
|
+
left: hasResizer || isExtension || isEmbedCard ? "calc(anchor(".concat(anchorName, " start) + ").concat(getLeftPosition(dom, nodeType, innerContainer, macroInteractionUpdates), ")") : "calc(anchor(".concat(anchorName, " start) - ").concat(DRAG_HANDLE_WIDTH, "px - ").concat(dragHandleGap(nodeType), "px)"),
|
|
239
|
+
top: anchorName.includes('table') ? "calc(anchor(".concat(anchorName, " start) + ").concat(DRAG_HANDLE_HEIGHT, "px)") : "anchor(".concat(anchorName, " start)")
|
|
240
|
+
} : {
|
|
241
|
+
left: hasResizer || isExtension || isBlockCard || isEmbedCard ? getLeftPosition(dom, nodeType, innerContainer, macroInteractionUpdates) : "calc(anchor(".concat(anchorName, " start) - ").concat(DRAG_HANDLE_WIDTH, "px - ").concat(dragHandleGap(nodeType), "px)"),
|
|
239
242
|
top: anchorName.includes('table') ? "calc(anchor(".concat(anchorName, " start) + ").concat(DRAG_HANDLE_HEIGHT, "px)") : "anchor(".concat(anchorName, " start)")
|
|
240
243
|
};
|
|
241
244
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.8",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
".": "./src/index.ts"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@atlaskit/adf-schema": "^
|
|
35
|
-
"@atlaskit/editor-common": "^83.
|
|
34
|
+
"@atlaskit/adf-schema": "^39.0.3",
|
|
35
|
+
"@atlaskit/editor-common": "^83.5.0",
|
|
36
36
|
"@atlaskit/editor-plugin-analytics": "^1.4.0",
|
|
37
37
|
"@atlaskit/editor-plugin-editor-disabled": "^1.1.5",
|
|
38
38
|
"@atlaskit/editor-plugin-feature-flags": "^1.1.0",
|
|
@@ -110,6 +110,9 @@
|
|
|
110
110
|
},
|
|
111
111
|
"platform.editor.elements.drag-and-drop-ed-23892": {
|
|
112
112
|
"type": "boolean"
|
|
113
|
+
},
|
|
114
|
+
"platform.editor.elements.drag-and-drop-ed-23816": {
|
|
115
|
+
"type": "boolean"
|
|
113
116
|
}
|
|
114
117
|
}
|
|
115
118
|
}
|