@atlaskit/editor-plugin-block-controls 3.3.9 → 3.3.11
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 +14 -0
- package/dist/cjs/pm-plugins/main.js +26 -10
- package/dist/es2019/pm-plugins/main.js +26 -10
- package/dist/esm/pm-plugins/main.js +26 -10
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 3.3.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies
|
|
8
|
+
|
|
9
|
+
## 3.3.10
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#124761](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/124761)
|
|
14
|
+
[`349f09baaea6d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/349f09baaea6d) -
|
|
15
|
+
[ED-26782] Fix drag handle removal and add type safety for block controls plugin
|
|
16
|
+
|
|
3
17
|
## 3.3.9
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -187,7 +187,7 @@ var getDecorationAtPos = function getDecorationAtPos(decorations, pos, to) {
|
|
|
187
187
|
return nodeDecAtActivePos;
|
|
188
188
|
};
|
|
189
189
|
var newApply = exports.newApply = function newApply(api, formatMessage, tr, currentState, newState, flags, nodeViewPortalProviderAPI, anchorRectCache) {
|
|
190
|
-
var _meta$multiSelectDnD,
|
|
190
|
+
var _meta$multiSelectDnD, _activeNode, _activeNode2, _meta$activeNode$hand, _meta$isDragging, _latestActiveNode11, _latestActiveNode12, _meta$isDragging2, _meta$toggleMenu, _meta$editorHeight, _meta$editorWidthLeft, _meta$editorWidthRigh, _meta$isPMDragging, _meta$isShiftDown, _meta$lastDragCancell;
|
|
191
191
|
var activeNode = currentState.activeNode,
|
|
192
192
|
decorations = currentState.decorations,
|
|
193
193
|
isResizerResizing = currentState.isResizerResizing,
|
|
@@ -250,7 +250,16 @@ var newApply = exports.newApply = function newApply(api, formatMessage, tr, curr
|
|
|
250
250
|
numReplaceSteps = _getTrMetadata.numReplaceSteps,
|
|
251
251
|
isAllText = _getTrMetadata.isAllText;
|
|
252
252
|
var maybeNodeCountChanged = !isAllText && numReplaceSteps > 0;
|
|
253
|
-
var latestActiveNode
|
|
253
|
+
var latestActiveNode;
|
|
254
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_remove_drag_handle_fix')) {
|
|
255
|
+
latestActiveNode = meta === null || meta === void 0 ? void 0 : meta.activeNode;
|
|
256
|
+
if (!latestActiveNode && !isActiveNodeDeleted) {
|
|
257
|
+
latestActiveNode = activeNode;
|
|
258
|
+
}
|
|
259
|
+
} else {
|
|
260
|
+
var _meta$activeNode;
|
|
261
|
+
latestActiveNode = (_meta$activeNode = meta === null || meta === void 0 ? void 0 : meta.activeNode) !== null && _meta$activeNode !== void 0 ? _meta$activeNode : activeNode;
|
|
262
|
+
}
|
|
254
263
|
|
|
255
264
|
// Re-create node decorations
|
|
256
265
|
var isDecSetEmpty = decorations === _view2.DecorationSet.empty;
|
|
@@ -312,9 +321,14 @@ var newApply = exports.newApply = function newApply(api, formatMessage, tr, curr
|
|
|
312
321
|
|
|
313
322
|
// Create/recreate handle dec when the active node is missing/changes, or the editor viewport has changed (non-anchor pos workaround)
|
|
314
323
|
var shouldRecreateHandle = latestActiveNode && (activeNodeChanged || isActiveNodeModified || editorSizeChanged || handleNeedsRedraw);
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
324
|
+
var shouldRemoveHandle = false;
|
|
325
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_remove_drag_handle_fix')) {
|
|
326
|
+
// If the active node is missing, we need to remove the handle
|
|
327
|
+
shouldRemoveHandle = latestActiveNode ? isResizerResizing || isActiveNodeDeleted || (meta === null || meta === void 0 ? void 0 : meta.nodeMoved) : true;
|
|
328
|
+
} else {
|
|
329
|
+
// Remove handle dec when explicitly hidden, a node is resizing, activeNode pos was deleted, or DnD moved a node
|
|
330
|
+
shouldRemoveHandle = latestActiveNode && (isResizerResizing || isActiveNodeDeleted || (meta === null || meta === void 0 ? void 0 : meta.nodeMoved));
|
|
331
|
+
}
|
|
318
332
|
if (shouldRemoveHandle) {
|
|
319
333
|
var _activeNode3, _activeNode4;
|
|
320
334
|
var oldHandle = (0, _decorationsDragHandle.findHandleDec)(decorations, (_activeNode3 = activeNode) === null || _activeNode3 === void 0 ? void 0 : _activeNode3.pos, (_activeNode4 = activeNode) === null || _activeNode4 === void 0 ? void 0 : _activeNode4.pos);
|
|
@@ -324,15 +338,17 @@ var newApply = exports.newApply = function newApply(api, formatMessage, tr, curr
|
|
|
324
338
|
decorations = decorations.remove(oldQuickInsertButton);
|
|
325
339
|
}
|
|
326
340
|
} else if (api && shouldRecreateHandle) {
|
|
327
|
-
var _activeNode5, _activeNode6;
|
|
341
|
+
var _activeNode5, _activeNode6, _latestActiveNode, _latestActiveNode2, _latestActiveNode3, _latestActiveNode4;
|
|
328
342
|
var _oldHandle = (0, _decorationsDragHandle.findHandleDec)(decorations, (_activeNode5 = activeNode) === null || _activeNode5 === void 0 ? void 0 : _activeNode5.pos, (_activeNode6 = activeNode) === null || _activeNode6 === void 0 ? void 0 : _activeNode6.pos);
|
|
329
343
|
decorations = decorations.remove(_oldHandle);
|
|
330
|
-
var handleDec = (0, _decorationsDragHandle.dragHandleDecoration)(api, formatMessage, latestActiveNode === null ||
|
|
344
|
+
var handleDec = (0, _decorationsDragHandle.dragHandleDecoration)(api, formatMessage, (_latestActiveNode = latestActiveNode) === null || _latestActiveNode === void 0 ? void 0 : _latestActiveNode.pos, (_latestActiveNode2 = latestActiveNode) === null || _latestActiveNode2 === void 0 ? void 0 : _latestActiveNode2.anchorName, (_latestActiveNode3 = latestActiveNode) === null || _latestActiveNode3 === void 0 ? void 0 : _latestActiveNode3.nodeType, nodeViewPortalProviderAPI, (_latestActiveNode4 = latestActiveNode) === null || _latestActiveNode4 === void 0 ? void 0 : _latestActiveNode4.handleOptions);
|
|
331
345
|
if ((0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
332
|
-
|
|
346
|
+
var _latestActiveNode5;
|
|
347
|
+
if (((_latestActiveNode5 = latestActiveNode) === null || _latestActiveNode5 === void 0 ? void 0 : _latestActiveNode5.rootPos) !== undefined) {
|
|
348
|
+
var _latestActiveNode6, _latestActiveNode7, _latestActiveNode8, _latestActiveNode9, _latestActiveNode10;
|
|
333
349
|
var _oldQuickInsertButton = (0, _decorationsQuickInsertButton.findQuickInsertInsertButtonDecoration)(decorations);
|
|
334
350
|
decorations = decorations.remove(_oldQuickInsertButton);
|
|
335
|
-
var quickInsertButton = (0, _decorationsQuickInsertButton.quickInsertButtonDecoration)(api, formatMessage, latestActiveNode === null ||
|
|
351
|
+
var quickInsertButton = (0, _decorationsQuickInsertButton.quickInsertButtonDecoration)(api, formatMessage, (_latestActiveNode6 = latestActiveNode) === null || _latestActiveNode6 === void 0 ? void 0 : _latestActiveNode6.rootPos, (_latestActiveNode7 = latestActiveNode) === null || _latestActiveNode7 === void 0 ? void 0 : _latestActiveNode7.anchorName, (_latestActiveNode8 = latestActiveNode) === null || _latestActiveNode8 === void 0 ? void 0 : _latestActiveNode8.nodeType, nodeViewPortalProviderAPI, (_latestActiveNode9 = latestActiveNode) === null || _latestActiveNode9 === void 0 ? void 0 : _latestActiveNode9.rootAnchorName, (_latestActiveNode10 = latestActiveNode) === null || _latestActiveNode10 === void 0 ? void 0 : _latestActiveNode10.rootNodeType);
|
|
336
352
|
decorations = decorations.add(newState.doc, [quickInsertButton]);
|
|
337
353
|
}
|
|
338
354
|
}
|
|
@@ -362,7 +378,7 @@ var newApply = exports.newApply = function newApply(api, formatMessage, tr, curr
|
|
|
362
378
|
decorations = decorations.add(newState.doc, [(0, _decorationsDragHandle.emptyParagraphNodeDecorations)()]);
|
|
363
379
|
}
|
|
364
380
|
}
|
|
365
|
-
var newActiveNode = isEmptyDoc || !(meta !== null && meta !== void 0 && meta.activeNode) && (0, _decorationsDragHandle.findHandleDec)(decorations, latestActiveNode === null ||
|
|
381
|
+
var newActiveNode = isEmptyDoc || !(meta !== null && meta !== void 0 && meta.activeNode) && (0, _decorationsDragHandle.findHandleDec)(decorations, (_latestActiveNode11 = latestActiveNode) === null || _latestActiveNode11 === void 0 ? void 0 : _latestActiveNode11.pos, (_latestActiveNode12 = latestActiveNode) === null || _latestActiveNode12 === void 0 ? void 0 : _latestActiveNode12.pos).length === 0 ? null : latestActiveNode;
|
|
366
382
|
var isMenuOpenNew = isMenuOpen;
|
|
367
383
|
if (_consts.BLOCK_MENU_ENABLED && (0, _experiments.editorExperiment)('platform_editor_controls', 'variant1')) {
|
|
368
384
|
if (meta !== null && meta !== void 0 && meta.closeMenu) {
|
|
@@ -181,7 +181,7 @@ const getDecorationAtPos = (decorations, pos, to) => {
|
|
|
181
181
|
return nodeDecAtActivePos;
|
|
182
182
|
};
|
|
183
183
|
export const newApply = (api, formatMessage, tr, currentState, newState, flags, nodeViewPortalProviderAPI, anchorRectCache) => {
|
|
184
|
-
var _meta$multiSelectDnD,
|
|
184
|
+
var _meta$multiSelectDnD, _activeNode, _activeNode2, _meta$activeNode$hand, _meta$isDragging, _latestActiveNode11, _latestActiveNode12, _meta$isDragging2, _meta$toggleMenu, _meta$editorHeight, _meta$editorWidthLeft, _meta$editorWidthRigh, _meta$isPMDragging, _meta$isShiftDown, _meta$lastDragCancell;
|
|
185
185
|
let {
|
|
186
186
|
activeNode,
|
|
187
187
|
decorations,
|
|
@@ -249,7 +249,16 @@ export const newApply = (api, formatMessage, tr, currentState, newState, flags,
|
|
|
249
249
|
isAllText
|
|
250
250
|
} = getTrMetadata(tr);
|
|
251
251
|
const maybeNodeCountChanged = !isAllText && numReplaceSteps > 0;
|
|
252
|
-
|
|
252
|
+
let latestActiveNode;
|
|
253
|
+
if (fg('platform_editor_remove_drag_handle_fix')) {
|
|
254
|
+
latestActiveNode = meta === null || meta === void 0 ? void 0 : meta.activeNode;
|
|
255
|
+
if (!latestActiveNode && !isActiveNodeDeleted) {
|
|
256
|
+
latestActiveNode = activeNode;
|
|
257
|
+
}
|
|
258
|
+
} else {
|
|
259
|
+
var _meta$activeNode;
|
|
260
|
+
latestActiveNode = (_meta$activeNode = meta === null || meta === void 0 ? void 0 : meta.activeNode) !== null && _meta$activeNode !== void 0 ? _meta$activeNode : activeNode;
|
|
261
|
+
}
|
|
253
262
|
|
|
254
263
|
// Re-create node decorations
|
|
255
264
|
const isDecSetEmpty = decorations === DecorationSet.empty;
|
|
@@ -309,9 +318,14 @@ export const newApply = (api, formatMessage, tr, currentState, newState, flags,
|
|
|
309
318
|
|
|
310
319
|
// Create/recreate handle dec when the active node is missing/changes, or the editor viewport has changed (non-anchor pos workaround)
|
|
311
320
|
const shouldRecreateHandle = latestActiveNode && (activeNodeChanged || isActiveNodeModified || editorSizeChanged || handleNeedsRedraw);
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
321
|
+
let shouldRemoveHandle = false;
|
|
322
|
+
if (fg('platform_editor_remove_drag_handle_fix')) {
|
|
323
|
+
// If the active node is missing, we need to remove the handle
|
|
324
|
+
shouldRemoveHandle = latestActiveNode ? isResizerResizing || isActiveNodeDeleted || (meta === null || meta === void 0 ? void 0 : meta.nodeMoved) : true;
|
|
325
|
+
} else {
|
|
326
|
+
// Remove handle dec when explicitly hidden, a node is resizing, activeNode pos was deleted, or DnD moved a node
|
|
327
|
+
shouldRemoveHandle = latestActiveNode && (isResizerResizing || isActiveNodeDeleted || (meta === null || meta === void 0 ? void 0 : meta.nodeMoved));
|
|
328
|
+
}
|
|
315
329
|
if (shouldRemoveHandle) {
|
|
316
330
|
var _activeNode3, _activeNode4;
|
|
317
331
|
const oldHandle = findHandleDec(decorations, (_activeNode3 = activeNode) === null || _activeNode3 === void 0 ? void 0 : _activeNode3.pos, (_activeNode4 = activeNode) === null || _activeNode4 === void 0 ? void 0 : _activeNode4.pos);
|
|
@@ -321,15 +335,17 @@ export const newApply = (api, formatMessage, tr, currentState, newState, flags,
|
|
|
321
335
|
decorations = decorations.remove(oldQuickInsertButton);
|
|
322
336
|
}
|
|
323
337
|
} else if (api && shouldRecreateHandle) {
|
|
324
|
-
var _activeNode5, _activeNode6;
|
|
338
|
+
var _activeNode5, _activeNode6, _latestActiveNode, _latestActiveNode2, _latestActiveNode3, _latestActiveNode4;
|
|
325
339
|
const oldHandle = findHandleDec(decorations, (_activeNode5 = activeNode) === null || _activeNode5 === void 0 ? void 0 : _activeNode5.pos, (_activeNode6 = activeNode) === null || _activeNode6 === void 0 ? void 0 : _activeNode6.pos);
|
|
326
340
|
decorations = decorations.remove(oldHandle);
|
|
327
|
-
const handleDec = dragHandleDecoration(api, formatMessage, latestActiveNode === null ||
|
|
341
|
+
const handleDec = dragHandleDecoration(api, formatMessage, (_latestActiveNode = latestActiveNode) === null || _latestActiveNode === void 0 ? void 0 : _latestActiveNode.pos, (_latestActiveNode2 = latestActiveNode) === null || _latestActiveNode2 === void 0 ? void 0 : _latestActiveNode2.anchorName, (_latestActiveNode3 = latestActiveNode) === null || _latestActiveNode3 === void 0 ? void 0 : _latestActiveNode3.nodeType, nodeViewPortalProviderAPI, (_latestActiveNode4 = latestActiveNode) === null || _latestActiveNode4 === void 0 ? void 0 : _latestActiveNode4.handleOptions);
|
|
328
342
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
329
|
-
|
|
343
|
+
var _latestActiveNode5;
|
|
344
|
+
if (((_latestActiveNode5 = latestActiveNode) === null || _latestActiveNode5 === void 0 ? void 0 : _latestActiveNode5.rootPos) !== undefined) {
|
|
345
|
+
var _latestActiveNode6, _latestActiveNode7, _latestActiveNode8, _latestActiveNode9, _latestActiveNode10;
|
|
330
346
|
const oldQuickInsertButton = findQuickInsertInsertButtonDecoration(decorations);
|
|
331
347
|
decorations = decorations.remove(oldQuickInsertButton);
|
|
332
|
-
const quickInsertButton = quickInsertButtonDecoration(api, formatMessage, latestActiveNode === null ||
|
|
348
|
+
const quickInsertButton = quickInsertButtonDecoration(api, formatMessage, (_latestActiveNode6 = latestActiveNode) === null || _latestActiveNode6 === void 0 ? void 0 : _latestActiveNode6.rootPos, (_latestActiveNode7 = latestActiveNode) === null || _latestActiveNode7 === void 0 ? void 0 : _latestActiveNode7.anchorName, (_latestActiveNode8 = latestActiveNode) === null || _latestActiveNode8 === void 0 ? void 0 : _latestActiveNode8.nodeType, nodeViewPortalProviderAPI, (_latestActiveNode9 = latestActiveNode) === null || _latestActiveNode9 === void 0 ? void 0 : _latestActiveNode9.rootAnchorName, (_latestActiveNode10 = latestActiveNode) === null || _latestActiveNode10 === void 0 ? void 0 : _latestActiveNode10.rootNodeType);
|
|
333
349
|
decorations = decorations.add(newState.doc, [quickInsertButton]);
|
|
334
350
|
}
|
|
335
351
|
}
|
|
@@ -359,7 +375,7 @@ export const newApply = (api, formatMessage, tr, currentState, newState, flags,
|
|
|
359
375
|
decorations = decorations.add(newState.doc, [emptyParagraphNodeDecorations()]);
|
|
360
376
|
}
|
|
361
377
|
}
|
|
362
|
-
const newActiveNode = isEmptyDoc || !(meta !== null && meta !== void 0 && meta.activeNode) && findHandleDec(decorations, latestActiveNode === null ||
|
|
378
|
+
const newActiveNode = isEmptyDoc || !(meta !== null && meta !== void 0 && meta.activeNode) && findHandleDec(decorations, (_latestActiveNode11 = latestActiveNode) === null || _latestActiveNode11 === void 0 ? void 0 : _latestActiveNode11.pos, (_latestActiveNode12 = latestActiveNode) === null || _latestActiveNode12 === void 0 ? void 0 : _latestActiveNode12.pos).length === 0 ? null : latestActiveNode;
|
|
363
379
|
let isMenuOpenNew = isMenuOpen;
|
|
364
380
|
if (BLOCK_MENU_ENABLED && editorExperiment('platform_editor_controls', 'variant1')) {
|
|
365
381
|
if (meta !== null && meta !== void 0 && meta.closeMenu) {
|
|
@@ -180,7 +180,7 @@ var getDecorationAtPos = function getDecorationAtPos(decorations, pos, to) {
|
|
|
180
180
|
return nodeDecAtActivePos;
|
|
181
181
|
};
|
|
182
182
|
export var newApply = function newApply(api, formatMessage, tr, currentState, newState, flags, nodeViewPortalProviderAPI, anchorRectCache) {
|
|
183
|
-
var _meta$multiSelectDnD,
|
|
183
|
+
var _meta$multiSelectDnD, _activeNode, _activeNode2, _meta$activeNode$hand, _meta$isDragging, _latestActiveNode11, _latestActiveNode12, _meta$isDragging2, _meta$toggleMenu, _meta$editorHeight, _meta$editorWidthLeft, _meta$editorWidthRigh, _meta$isPMDragging, _meta$isShiftDown, _meta$lastDragCancell;
|
|
184
184
|
var activeNode = currentState.activeNode,
|
|
185
185
|
decorations = currentState.decorations,
|
|
186
186
|
isResizerResizing = currentState.isResizerResizing,
|
|
@@ -243,7 +243,16 @@ export var newApply = function newApply(api, formatMessage, tr, currentState, ne
|
|
|
243
243
|
numReplaceSteps = _getTrMetadata.numReplaceSteps,
|
|
244
244
|
isAllText = _getTrMetadata.isAllText;
|
|
245
245
|
var maybeNodeCountChanged = !isAllText && numReplaceSteps > 0;
|
|
246
|
-
var latestActiveNode
|
|
246
|
+
var latestActiveNode;
|
|
247
|
+
if (fg('platform_editor_remove_drag_handle_fix')) {
|
|
248
|
+
latestActiveNode = meta === null || meta === void 0 ? void 0 : meta.activeNode;
|
|
249
|
+
if (!latestActiveNode && !isActiveNodeDeleted) {
|
|
250
|
+
latestActiveNode = activeNode;
|
|
251
|
+
}
|
|
252
|
+
} else {
|
|
253
|
+
var _meta$activeNode;
|
|
254
|
+
latestActiveNode = (_meta$activeNode = meta === null || meta === void 0 ? void 0 : meta.activeNode) !== null && _meta$activeNode !== void 0 ? _meta$activeNode : activeNode;
|
|
255
|
+
}
|
|
247
256
|
|
|
248
257
|
// Re-create node decorations
|
|
249
258
|
var isDecSetEmpty = decorations === DecorationSet.empty;
|
|
@@ -305,9 +314,14 @@ export var newApply = function newApply(api, formatMessage, tr, currentState, ne
|
|
|
305
314
|
|
|
306
315
|
// Create/recreate handle dec when the active node is missing/changes, or the editor viewport has changed (non-anchor pos workaround)
|
|
307
316
|
var shouldRecreateHandle = latestActiveNode && (activeNodeChanged || isActiveNodeModified || editorSizeChanged || handleNeedsRedraw);
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
317
|
+
var shouldRemoveHandle = false;
|
|
318
|
+
if (fg('platform_editor_remove_drag_handle_fix')) {
|
|
319
|
+
// If the active node is missing, we need to remove the handle
|
|
320
|
+
shouldRemoveHandle = latestActiveNode ? isResizerResizing || isActiveNodeDeleted || (meta === null || meta === void 0 ? void 0 : meta.nodeMoved) : true;
|
|
321
|
+
} else {
|
|
322
|
+
// Remove handle dec when explicitly hidden, a node is resizing, activeNode pos was deleted, or DnD moved a node
|
|
323
|
+
shouldRemoveHandle = latestActiveNode && (isResizerResizing || isActiveNodeDeleted || (meta === null || meta === void 0 ? void 0 : meta.nodeMoved));
|
|
324
|
+
}
|
|
311
325
|
if (shouldRemoveHandle) {
|
|
312
326
|
var _activeNode3, _activeNode4;
|
|
313
327
|
var oldHandle = findHandleDec(decorations, (_activeNode3 = activeNode) === null || _activeNode3 === void 0 ? void 0 : _activeNode3.pos, (_activeNode4 = activeNode) === null || _activeNode4 === void 0 ? void 0 : _activeNode4.pos);
|
|
@@ -317,15 +331,17 @@ export var newApply = function newApply(api, formatMessage, tr, currentState, ne
|
|
|
317
331
|
decorations = decorations.remove(oldQuickInsertButton);
|
|
318
332
|
}
|
|
319
333
|
} else if (api && shouldRecreateHandle) {
|
|
320
|
-
var _activeNode5, _activeNode6;
|
|
334
|
+
var _activeNode5, _activeNode6, _latestActiveNode, _latestActiveNode2, _latestActiveNode3, _latestActiveNode4;
|
|
321
335
|
var _oldHandle = findHandleDec(decorations, (_activeNode5 = activeNode) === null || _activeNode5 === void 0 ? void 0 : _activeNode5.pos, (_activeNode6 = activeNode) === null || _activeNode6 === void 0 ? void 0 : _activeNode6.pos);
|
|
322
336
|
decorations = decorations.remove(_oldHandle);
|
|
323
|
-
var handleDec = dragHandleDecoration(api, formatMessage, latestActiveNode === null ||
|
|
337
|
+
var handleDec = dragHandleDecoration(api, formatMessage, (_latestActiveNode = latestActiveNode) === null || _latestActiveNode === void 0 ? void 0 : _latestActiveNode.pos, (_latestActiveNode2 = latestActiveNode) === null || _latestActiveNode2 === void 0 ? void 0 : _latestActiveNode2.anchorName, (_latestActiveNode3 = latestActiveNode) === null || _latestActiveNode3 === void 0 ? void 0 : _latestActiveNode3.nodeType, nodeViewPortalProviderAPI, (_latestActiveNode4 = latestActiveNode) === null || _latestActiveNode4 === void 0 ? void 0 : _latestActiveNode4.handleOptions);
|
|
324
338
|
if (editorExperiment('platform_editor_controls', 'variant1')) {
|
|
325
|
-
|
|
339
|
+
var _latestActiveNode5;
|
|
340
|
+
if (((_latestActiveNode5 = latestActiveNode) === null || _latestActiveNode5 === void 0 ? void 0 : _latestActiveNode5.rootPos) !== undefined) {
|
|
341
|
+
var _latestActiveNode6, _latestActiveNode7, _latestActiveNode8, _latestActiveNode9, _latestActiveNode10;
|
|
326
342
|
var _oldQuickInsertButton = findQuickInsertInsertButtonDecoration(decorations);
|
|
327
343
|
decorations = decorations.remove(_oldQuickInsertButton);
|
|
328
|
-
var quickInsertButton = quickInsertButtonDecoration(api, formatMessage, latestActiveNode === null ||
|
|
344
|
+
var quickInsertButton = quickInsertButtonDecoration(api, formatMessage, (_latestActiveNode6 = latestActiveNode) === null || _latestActiveNode6 === void 0 ? void 0 : _latestActiveNode6.rootPos, (_latestActiveNode7 = latestActiveNode) === null || _latestActiveNode7 === void 0 ? void 0 : _latestActiveNode7.anchorName, (_latestActiveNode8 = latestActiveNode) === null || _latestActiveNode8 === void 0 ? void 0 : _latestActiveNode8.nodeType, nodeViewPortalProviderAPI, (_latestActiveNode9 = latestActiveNode) === null || _latestActiveNode9 === void 0 ? void 0 : _latestActiveNode9.rootAnchorName, (_latestActiveNode10 = latestActiveNode) === null || _latestActiveNode10 === void 0 ? void 0 : _latestActiveNode10.rootNodeType);
|
|
329
345
|
decorations = decorations.add(newState.doc, [quickInsertButton]);
|
|
330
346
|
}
|
|
331
347
|
}
|
|
@@ -355,7 +371,7 @@ export var newApply = function newApply(api, formatMessage, tr, currentState, ne
|
|
|
355
371
|
decorations = decorations.add(newState.doc, [emptyParagraphNodeDecorations()]);
|
|
356
372
|
}
|
|
357
373
|
}
|
|
358
|
-
var newActiveNode = isEmptyDoc || !(meta !== null && meta !== void 0 && meta.activeNode) && findHandleDec(decorations, latestActiveNode === null ||
|
|
374
|
+
var newActiveNode = isEmptyDoc || !(meta !== null && meta !== void 0 && meta.activeNode) && findHandleDec(decorations, (_latestActiveNode11 = latestActiveNode) === null || _latestActiveNode11 === void 0 ? void 0 : _latestActiveNode11.pos, (_latestActiveNode12 = latestActiveNode) === null || _latestActiveNode12 === void 0 ? void 0 : _latestActiveNode12.pos).length === 0 ? null : latestActiveNode;
|
|
359
375
|
var isMenuOpenNew = isMenuOpen;
|
|
360
376
|
if (BLOCK_MENU_ENABLED && editorExperiment('platform_editor_controls', 'variant1')) {
|
|
361
377
|
if (meta !== null && meta !== void 0 && meta.closeMenu) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.11",
|
|
4
4
|
"description": "Block controls plugin for @atlaskit/editor-core",
|
|
5
5
|
"author": "Atlassian Pty Ltd",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@atlaskit/adf-schema": "^47.6.0",
|
|
36
|
-
"@atlaskit/editor-common": "^102.
|
|
36
|
+
"@atlaskit/editor-common": "^102.4.0",
|
|
37
37
|
"@atlaskit/editor-plugin-accessibility-utils": "^2.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^2.1.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
@@ -45,14 +45,14 @@
|
|
|
45
45
|
"@atlaskit/editor-prosemirror": "7.0.0",
|
|
46
46
|
"@atlaskit/editor-shared-styles": "^3.4.0",
|
|
47
47
|
"@atlaskit/editor-tables": "^2.9.0",
|
|
48
|
-
"@atlaskit/icon": "^
|
|
48
|
+
"@atlaskit/icon": "^25.0.0",
|
|
49
49
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
50
50
|
"@atlaskit/pragmatic-drag-and-drop": "^1.5.0",
|
|
51
51
|
"@atlaskit/pragmatic-drag-and-drop-auto-scroll": "^2.1.0",
|
|
52
52
|
"@atlaskit/pragmatic-drag-and-drop-react-drop-indicator": "^3.0.0",
|
|
53
53
|
"@atlaskit/primitives": "^14.1.0",
|
|
54
54
|
"@atlaskit/theme": "^18.0.0",
|
|
55
|
-
"@atlaskit/tmp-editor-statsig": "^3.
|
|
55
|
+
"@atlaskit/tmp-editor-statsig": "^3.6.0",
|
|
56
56
|
"@atlaskit/tokens": "^4.4.0",
|
|
57
57
|
"@atlaskit/tooltip": "^20.0.0",
|
|
58
58
|
"@babel/runtime": "^7.0.0",
|
|
@@ -169,6 +169,9 @@
|
|
|
169
169
|
},
|
|
170
170
|
"platform_editor_non_macros_copy_and_paste_fix": {
|
|
171
171
|
"type": "boolean"
|
|
172
|
+
},
|
|
173
|
+
"platform_editor_remove_drag_handle_fix": {
|
|
174
|
+
"type": "boolean"
|
|
172
175
|
}
|
|
173
176
|
}
|
|
174
177
|
}
|