@atlaskit/editor-plugin-block-controls 3.18.0 → 3.19.1
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 +17 -0
- package/dist/cjs/pm-plugins/decorations-drop-target-active.js +33 -4
- package/dist/cjs/pm-plugins/decorations-drop-target.js +16 -3
- package/dist/es2019/pm-plugins/decorations-drop-target-active.js +34 -5
- package/dist/es2019/pm-plugins/decorations-drop-target.js +16 -3
- package/dist/esm/pm-plugins/decorations-drop-target-active.js +34 -5
- package/dist/esm/pm-plugins/decorations-drop-target.js +16 -3
- package/package.json +6 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/editor-plugin-block-controls
|
|
2
2
|
|
|
3
|
+
## 3.19.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#171113](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/171113)
|
|
8
|
+
[`20200d3f20cfe`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/20200d3f20cfe) -
|
|
9
|
+
Fix memory leak when cleaning up drop targets
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 3.19.0
|
|
13
|
+
|
|
14
|
+
### Minor Changes
|
|
15
|
+
|
|
16
|
+
- [#170348](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/170348)
|
|
17
|
+
[`8f9510a71c843`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8f9510a71c843) -
|
|
18
|
+
ED-28158 implement active advanced layout drop targets
|
|
19
|
+
|
|
3
20
|
## 3.18.0
|
|
4
21
|
|
|
5
22
|
### Minor Changes
|
|
@@ -6,11 +6,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
exports.getActiveDropTargetDecorations = exports.canMoveNodeOrSliceToPos = void 0;
|
|
7
7
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
8
8
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
9
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
9
10
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
10
11
|
var _decorationsCommon = require("./decorations-common");
|
|
11
12
|
var _decorationsDropTarget = require("./decorations-drop-target");
|
|
12
13
|
var _decorationsFindSurroundingNodes = require("./decorations-find-surrounding-nodes");
|
|
13
14
|
var _activeAnchorTracker = require("./utils/active-anchor-tracker");
|
|
15
|
+
var _consts = require("./utils/consts");
|
|
14
16
|
var _validation = require("./utils/validation");
|
|
15
17
|
/**
|
|
16
18
|
* List of parent node types that can have child nodes
|
|
@@ -58,7 +60,9 @@ var canMoveNodeOrSliceToPos = exports.canMoveNodeOrSliceToPos = function canMove
|
|
|
58
60
|
return true;
|
|
59
61
|
};
|
|
60
62
|
var getActiveDropTargetDecorations = exports.getActiveDropTargetDecorations = function getActiveDropTargetDecorations(activeDropTargetNode, state, api, formatMessage, nodeViewPortalProviderAPI, activeNode) {
|
|
61
|
-
(0,
|
|
63
|
+
if (!(0, _platformFeatureFlags.fg)('platform_editor_block_controls_drop_target_mem_fix')) {
|
|
64
|
+
(0, _decorationsCommon.unmountDecorations)(nodeViewPortalProviderAPI, 'data-blocks-drop-target-container', 'data-blocks-drop-target-key');
|
|
65
|
+
}
|
|
62
66
|
var decs = [];
|
|
63
67
|
var activeNodePos = activeNode === null || activeNode === void 0 ? void 0 : activeNode.pos;
|
|
64
68
|
var $activeNodePos = typeof activeNodePos === 'number' && state.doc.resolve(activeNodePos);
|
|
@@ -134,6 +138,10 @@ var getActiveDropTargetDecorations = exports.getActiveDropTargetDecorations = fu
|
|
|
134
138
|
}, nodeViewPortalProviderAPI, -1, undefined, isSameLayout));
|
|
135
139
|
}
|
|
136
140
|
}
|
|
141
|
+
var rootNodeWithPos = {
|
|
142
|
+
node: node,
|
|
143
|
+
pos: pos
|
|
144
|
+
};
|
|
137
145
|
|
|
138
146
|
// if the current node is not a top level node, we create one for advanced layout drop targets
|
|
139
147
|
if (depth > 1) {
|
|
@@ -146,9 +154,30 @@ var getActiveDropTargetDecorations = exports.getActiveDropTargetDecorations = fu
|
|
|
146
154
|
formatMessage: formatMessage,
|
|
147
155
|
dropTargetStyle: 'default'
|
|
148
156
|
}, nodeViewPortalProviderAPI, 0, undefined, false));
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
157
|
+
rootNodeWithPos = {
|
|
158
|
+
node: root.node,
|
|
159
|
+
pos: root.pos
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
if ((0, _experiments.editorExperiment)('advanced_layouts', true)) {
|
|
163
|
+
var _isSameLayout = $activeNodePos && (0, _validation.isInSameLayout)($activeNodePos, state.doc.resolve(rootNodeWithPos.pos));
|
|
164
|
+
if (rootNodeWithPos.node.type.name === 'layoutSection') {
|
|
165
|
+
var layoutSectionNode = rootNodeWithPos.node;
|
|
166
|
+
if (layoutSectionNode.childCount < (0, _consts.maxLayoutColumnSupported)() || _isSameLayout) {
|
|
167
|
+
layoutSectionNode.descendants(function (childNode, childPos, parent, index) {
|
|
168
|
+
if (childNode.type.name === 'layoutColumn' && (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'layoutSection' && index !== 0 // Not the first node
|
|
169
|
+
) {
|
|
170
|
+
decs.push((0, _decorationsDropTarget.createLayoutDropTargetDecoration)(rootNodeWithPos.pos + childPos + 1, {
|
|
171
|
+
api: api,
|
|
172
|
+
parent: parent,
|
|
173
|
+
formatMessage: formatMessage
|
|
174
|
+
}, nodeViewPortalProviderAPI, undefined));
|
|
175
|
+
}
|
|
176
|
+
return false;
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
}
|
|
152
180
|
}
|
|
181
|
+
_activeAnchorTracker.defaultActiveAnchorTracker.emit((0, _decorationsCommon.getNodeAnchor)(rootNodeWithPos.node));
|
|
153
182
|
return decs;
|
|
154
183
|
};
|
|
@@ -11,6 +11,7 @@ var _uuid = _interopRequireDefault(require("uuid"));
|
|
|
11
11
|
var _selection = require("@atlaskit/editor-common/selection");
|
|
12
12
|
var _utils = require("@atlaskit/editor-common/utils");
|
|
13
13
|
var _view = require("@atlaskit/editor-prosemirror/view");
|
|
14
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
15
|
var _experiments = require("@atlaskit/tmp-editor-statsig/experiments");
|
|
15
16
|
var _consts = require("../ui/consts");
|
|
16
17
|
var _dropTarget = require("../ui/drop-target");
|
|
@@ -112,7 +113,12 @@ var createDropTargetDecoration = exports.createDropTargetDecoration = function c
|
|
|
112
113
|
return element;
|
|
113
114
|
}, {
|
|
114
115
|
type: _decorationsCommon.TYPE_DROP_TARGET_DEC,
|
|
115
|
-
side: side
|
|
116
|
+
side: side,
|
|
117
|
+
destroy: function destroy() {
|
|
118
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_block_controls_drop_target_mem_fix')) {
|
|
119
|
+
nodeViewPortalProviderAPI.remove(key);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
116
122
|
});
|
|
117
123
|
};
|
|
118
124
|
var createLayoutDropTargetDecoration = exports.createLayoutDropTargetDecoration = function createLayoutDropTargetDecoration(pos, props, nodeViewPortalProviderAPI, anchorRectCache) {
|
|
@@ -137,11 +143,18 @@ var createLayoutDropTargetDecoration = exports.createLayoutDropTargetDecoration
|
|
|
137
143
|
}, element, key);
|
|
138
144
|
return element;
|
|
139
145
|
}, {
|
|
140
|
-
type: _decorationsCommon.TYPE_DROP_TARGET_DEC
|
|
146
|
+
type: _decorationsCommon.TYPE_DROP_TARGET_DEC,
|
|
147
|
+
destroy: function destroy() {
|
|
148
|
+
if ((0, _platformFeatureFlags.fg)('platform_editor_block_controls_drop_target_mem_fix')) {
|
|
149
|
+
nodeViewPortalProviderAPI.remove(key);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
141
152
|
});
|
|
142
153
|
};
|
|
143
154
|
var dropTargetDecorations = exports.dropTargetDecorations = function dropTargetDecorations(newState, api, formatMessage, nodeViewPortalProviderAPI, activeNode, anchorRectCache, from, to) {
|
|
144
|
-
(0,
|
|
155
|
+
if (!(0, _platformFeatureFlags.fg)('platform_editor_block_controls_drop_target_mem_fix')) {
|
|
156
|
+
(0, _decorationsCommon.unmountDecorations)(nodeViewPortalProviderAPI, 'data-blocks-drop-target-container', 'data-blocks-drop-target-key');
|
|
157
|
+
}
|
|
145
158
|
var decs = [];
|
|
146
159
|
var POS_END_OF_DOC = newState.doc.nodeSize - 2;
|
|
147
160
|
var docFrom = from === undefined || from < 0 ? 0 : from;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { expandSelectionBounds } from '@atlaskit/editor-common/selection';
|
|
2
2
|
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
5
|
import { getNodeAnchor, unmountDecorations } from './decorations-common';
|
|
5
|
-
import { createDropTargetDecoration } from './decorations-drop-target';
|
|
6
|
+
import { createDropTargetDecoration, createLayoutDropTargetDecoration } from './decorations-drop-target';
|
|
6
7
|
import { findSurroundingNodes } from './decorations-find-surrounding-nodes';
|
|
7
8
|
import { defaultActiveAnchorTracker } from './utils/active-anchor-tracker';
|
|
9
|
+
import { maxLayoutColumnSupported } from './utils/consts';
|
|
8
10
|
import { canMoveNodeToIndex, canMoveSliceToIndex, isInSameLayout } from './utils/validation';
|
|
9
11
|
|
|
10
12
|
/**
|
|
@@ -54,7 +56,9 @@ export const canMoveNodeOrSliceToPos = (state, node, parent, index, $toPos, acti
|
|
|
54
56
|
return true;
|
|
55
57
|
};
|
|
56
58
|
export const getActiveDropTargetDecorations = (activeDropTargetNode, state, api, formatMessage, nodeViewPortalProviderAPI, activeNode) => {
|
|
57
|
-
|
|
59
|
+
if (!fg('platform_editor_block_controls_drop_target_mem_fix')) {
|
|
60
|
+
unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drop-target-container', 'data-blocks-drop-target-key');
|
|
61
|
+
}
|
|
58
62
|
const decs = [];
|
|
59
63
|
const activeNodePos = activeNode === null || activeNode === void 0 ? void 0 : activeNode.pos;
|
|
60
64
|
const $activeNodePos = typeof activeNodePos === 'number' && state.doc.resolve(activeNodePos);
|
|
@@ -131,6 +135,10 @@ export const getActiveDropTargetDecorations = (activeDropTargetNode, state, api,
|
|
|
131
135
|
}, nodeViewPortalProviderAPI, -1, undefined, isSameLayout));
|
|
132
136
|
}
|
|
133
137
|
}
|
|
138
|
+
let rootNodeWithPos = {
|
|
139
|
+
node,
|
|
140
|
+
pos
|
|
141
|
+
};
|
|
134
142
|
|
|
135
143
|
// if the current node is not a top level node, we create one for advanced layout drop targets
|
|
136
144
|
if (depth > 1) {
|
|
@@ -143,9 +151,30 @@ export const getActiveDropTargetDecorations = (activeDropTargetNode, state, api,
|
|
|
143
151
|
formatMessage,
|
|
144
152
|
dropTargetStyle: 'default'
|
|
145
153
|
}, nodeViewPortalProviderAPI, 0, undefined, false));
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
154
|
+
rootNodeWithPos = {
|
|
155
|
+
node: root.node,
|
|
156
|
+
pos: root.pos
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
if (editorExperiment('advanced_layouts', true)) {
|
|
160
|
+
const isSameLayout = $activeNodePos && isInSameLayout($activeNodePos, state.doc.resolve(rootNodeWithPos.pos));
|
|
161
|
+
if (rootNodeWithPos.node.type.name === 'layoutSection') {
|
|
162
|
+
const layoutSectionNode = rootNodeWithPos.node;
|
|
163
|
+
if (layoutSectionNode.childCount < maxLayoutColumnSupported() || isSameLayout) {
|
|
164
|
+
layoutSectionNode.descendants((childNode, childPos, parent, index) => {
|
|
165
|
+
if (childNode.type.name === 'layoutColumn' && (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'layoutSection' && index !== 0 // Not the first node
|
|
166
|
+
) {
|
|
167
|
+
decs.push(createLayoutDropTargetDecoration(rootNodeWithPos.pos + childPos + 1, {
|
|
168
|
+
api,
|
|
169
|
+
parent,
|
|
170
|
+
formatMessage
|
|
171
|
+
}, nodeViewPortalProviderAPI, undefined));
|
|
172
|
+
}
|
|
173
|
+
return false;
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
}
|
|
149
177
|
}
|
|
178
|
+
defaultActiveAnchorTracker.emit(getNodeAnchor(rootNodeWithPos.node));
|
|
150
179
|
return decs;
|
|
151
180
|
};
|
|
@@ -3,6 +3,7 @@ import uuid from 'uuid';
|
|
|
3
3
|
import { expandSelectionBounds } from '@atlaskit/editor-common/selection';
|
|
4
4
|
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
5
5
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
7
8
|
import { nodeMargins } from '../ui/consts';
|
|
8
9
|
import { DropTarget, EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_GAP, EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_OFFSET } from '../ui/drop-target';
|
|
@@ -100,7 +101,12 @@ export const createDropTargetDecoration = (pos, props, nodeViewPortalProviderAPI
|
|
|
100
101
|
return element;
|
|
101
102
|
}, {
|
|
102
103
|
type: TYPE_DROP_TARGET_DEC,
|
|
103
|
-
side
|
|
104
|
+
side,
|
|
105
|
+
destroy: () => {
|
|
106
|
+
if (fg('platform_editor_block_controls_drop_target_mem_fix')) {
|
|
107
|
+
nodeViewPortalProviderAPI.remove(key);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
104
110
|
});
|
|
105
111
|
};
|
|
106
112
|
export const createLayoutDropTargetDecoration = (pos, props, nodeViewPortalProviderAPI, anchorRectCache) => {
|
|
@@ -124,11 +130,18 @@ export const createLayoutDropTargetDecoration = (pos, props, nodeViewPortalProvi
|
|
|
124
130
|
}), element, key);
|
|
125
131
|
return element;
|
|
126
132
|
}, {
|
|
127
|
-
type: TYPE_DROP_TARGET_DEC
|
|
133
|
+
type: TYPE_DROP_TARGET_DEC,
|
|
134
|
+
destroy: () => {
|
|
135
|
+
if (fg('platform_editor_block_controls_drop_target_mem_fix')) {
|
|
136
|
+
nodeViewPortalProviderAPI.remove(key);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
128
139
|
});
|
|
129
140
|
};
|
|
130
141
|
export const dropTargetDecorations = (newState, api, formatMessage, nodeViewPortalProviderAPI, activeNode, anchorRectCache, from, to) => {
|
|
131
|
-
|
|
142
|
+
if (!fg('platform_editor_block_controls_drop_target_mem_fix')) {
|
|
143
|
+
unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drop-target-container', 'data-blocks-drop-target-key');
|
|
144
|
+
}
|
|
132
145
|
const decs = [];
|
|
133
146
|
const POS_END_OF_DOC = newState.doc.nodeSize - 2;
|
|
134
147
|
const docFrom = from === undefined || from < 0 ? 0 : from;
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { expandSelectionBounds } from '@atlaskit/editor-common/selection';
|
|
2
2
|
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
4
5
|
import { getNodeAnchor, unmountDecorations } from './decorations-common';
|
|
5
|
-
import { createDropTargetDecoration } from './decorations-drop-target';
|
|
6
|
+
import { createDropTargetDecoration, createLayoutDropTargetDecoration } from './decorations-drop-target';
|
|
6
7
|
import { findSurroundingNodes } from './decorations-find-surrounding-nodes';
|
|
7
8
|
import { defaultActiveAnchorTracker } from './utils/active-anchor-tracker';
|
|
9
|
+
import { maxLayoutColumnSupported } from './utils/consts';
|
|
8
10
|
import { canMoveNodeToIndex, canMoveSliceToIndex, isInSameLayout } from './utils/validation';
|
|
9
11
|
|
|
10
12
|
/**
|
|
@@ -53,7 +55,9 @@ export var canMoveNodeOrSliceToPos = function canMoveNodeOrSliceToPos(state, nod
|
|
|
53
55
|
return true;
|
|
54
56
|
};
|
|
55
57
|
export var getActiveDropTargetDecorations = function getActiveDropTargetDecorations(activeDropTargetNode, state, api, formatMessage, nodeViewPortalProviderAPI, activeNode) {
|
|
56
|
-
|
|
58
|
+
if (!fg('platform_editor_block_controls_drop_target_mem_fix')) {
|
|
59
|
+
unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drop-target-container', 'data-blocks-drop-target-key');
|
|
60
|
+
}
|
|
57
61
|
var decs = [];
|
|
58
62
|
var activeNodePos = activeNode === null || activeNode === void 0 ? void 0 : activeNode.pos;
|
|
59
63
|
var $activeNodePos = typeof activeNodePos === 'number' && state.doc.resolve(activeNodePos);
|
|
@@ -129,6 +133,10 @@ export var getActiveDropTargetDecorations = function getActiveDropTargetDecorati
|
|
|
129
133
|
}, nodeViewPortalProviderAPI, -1, undefined, isSameLayout));
|
|
130
134
|
}
|
|
131
135
|
}
|
|
136
|
+
var rootNodeWithPos = {
|
|
137
|
+
node: node,
|
|
138
|
+
pos: pos
|
|
139
|
+
};
|
|
132
140
|
|
|
133
141
|
// if the current node is not a top level node, we create one for advanced layout drop targets
|
|
134
142
|
if (depth > 1) {
|
|
@@ -141,9 +149,30 @@ export var getActiveDropTargetDecorations = function getActiveDropTargetDecorati
|
|
|
141
149
|
formatMessage: formatMessage,
|
|
142
150
|
dropTargetStyle: 'default'
|
|
143
151
|
}, nodeViewPortalProviderAPI, 0, undefined, false));
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
152
|
+
rootNodeWithPos = {
|
|
153
|
+
node: root.node,
|
|
154
|
+
pos: root.pos
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
if (editorExperiment('advanced_layouts', true)) {
|
|
158
|
+
var _isSameLayout = $activeNodePos && isInSameLayout($activeNodePos, state.doc.resolve(rootNodeWithPos.pos));
|
|
159
|
+
if (rootNodeWithPos.node.type.name === 'layoutSection') {
|
|
160
|
+
var layoutSectionNode = rootNodeWithPos.node;
|
|
161
|
+
if (layoutSectionNode.childCount < maxLayoutColumnSupported() || _isSameLayout) {
|
|
162
|
+
layoutSectionNode.descendants(function (childNode, childPos, parent, index) {
|
|
163
|
+
if (childNode.type.name === 'layoutColumn' && (parent === null || parent === void 0 ? void 0 : parent.type.name) === 'layoutSection' && index !== 0 // Not the first node
|
|
164
|
+
) {
|
|
165
|
+
decs.push(createLayoutDropTargetDecoration(rootNodeWithPos.pos + childPos + 1, {
|
|
166
|
+
api: api,
|
|
167
|
+
parent: parent,
|
|
168
|
+
formatMessage: formatMessage
|
|
169
|
+
}, nodeViewPortalProviderAPI, undefined));
|
|
170
|
+
}
|
|
171
|
+
return false;
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
}
|
|
147
175
|
}
|
|
176
|
+
defaultActiveAnchorTracker.emit(getNodeAnchor(rootNodeWithPos.node));
|
|
148
177
|
return decs;
|
|
149
178
|
};
|
|
@@ -6,6 +6,7 @@ import uuid from 'uuid';
|
|
|
6
6
|
import { expandSelectionBounds } from '@atlaskit/editor-common/selection';
|
|
7
7
|
import { isEmptyParagraph } from '@atlaskit/editor-common/utils';
|
|
8
8
|
import { Decoration } from '@atlaskit/editor-prosemirror/view';
|
|
9
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
10
|
import { editorExperiment } from '@atlaskit/tmp-editor-statsig/experiments';
|
|
10
11
|
import { nodeMargins } from '../ui/consts';
|
|
11
12
|
import { DropTarget, EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_GAP, EDITOR_BLOCK_CONTROLS_DROP_INDICATOR_OFFSET } from '../ui/drop-target';
|
|
@@ -105,7 +106,12 @@ export var createDropTargetDecoration = function createDropTargetDecoration(pos,
|
|
|
105
106
|
return element;
|
|
106
107
|
}, {
|
|
107
108
|
type: TYPE_DROP_TARGET_DEC,
|
|
108
|
-
side: side
|
|
109
|
+
side: side,
|
|
110
|
+
destroy: function destroy() {
|
|
111
|
+
if (fg('platform_editor_block_controls_drop_target_mem_fix')) {
|
|
112
|
+
nodeViewPortalProviderAPI.remove(key);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
109
115
|
});
|
|
110
116
|
};
|
|
111
117
|
export var createLayoutDropTargetDecoration = function createLayoutDropTargetDecoration(pos, props, nodeViewPortalProviderAPI, anchorRectCache) {
|
|
@@ -130,11 +136,18 @@ export var createLayoutDropTargetDecoration = function createLayoutDropTargetDec
|
|
|
130
136
|
}, element, key);
|
|
131
137
|
return element;
|
|
132
138
|
}, {
|
|
133
|
-
type: TYPE_DROP_TARGET_DEC
|
|
139
|
+
type: TYPE_DROP_TARGET_DEC,
|
|
140
|
+
destroy: function destroy() {
|
|
141
|
+
if (fg('platform_editor_block_controls_drop_target_mem_fix')) {
|
|
142
|
+
nodeViewPortalProviderAPI.remove(key);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
134
145
|
});
|
|
135
146
|
};
|
|
136
147
|
export var dropTargetDecorations = function dropTargetDecorations(newState, api, formatMessage, nodeViewPortalProviderAPI, activeNode, anchorRectCache, from, to) {
|
|
137
|
-
|
|
148
|
+
if (!fg('platform_editor_block_controls_drop_target_mem_fix')) {
|
|
149
|
+
unmountDecorations(nodeViewPortalProviderAPI, 'data-blocks-drop-target-container', 'data-blocks-drop-target-key');
|
|
150
|
+
}
|
|
138
151
|
var decs = [];
|
|
139
152
|
var POS_END_OF_DOC = newState.doc.nodeSize - 2;
|
|
140
153
|
var docFrom = from === undefined || from < 0 ? 0 : from;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/editor-plugin-block-controls",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.19.1",
|
|
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": "^106.
|
|
36
|
+
"@atlaskit/editor-common": "^106.7.0",
|
|
37
37
|
"@atlaskit/editor-plugin-accessibility-utils": "^2.0.0",
|
|
38
38
|
"@atlaskit/editor-plugin-analytics": "^2.3.0",
|
|
39
39
|
"@atlaskit/editor-plugin-editor-disabled": "^2.0.0",
|
|
@@ -57,7 +57,7 @@
|
|
|
57
57
|
"@atlaskit/primitives": "^14.8.0",
|
|
58
58
|
"@atlaskit/theme": "^18.0.0",
|
|
59
59
|
"@atlaskit/tmp-editor-statsig": "^7.0.0",
|
|
60
|
-
"@atlaskit/tokens": "^5.
|
|
60
|
+
"@atlaskit/tokens": "^5.2.0",
|
|
61
61
|
"@atlaskit/tooltip": "^20.3.0",
|
|
62
62
|
"@babel/runtime": "^7.0.0",
|
|
63
63
|
"@emotion/react": "^11.7.1",
|
|
@@ -206,6 +206,9 @@
|
|
|
206
206
|
},
|
|
207
207
|
"platform_editor_breakout_resizing_hello_release": {
|
|
208
208
|
"type": "boolean"
|
|
209
|
+
},
|
|
210
|
+
"platform_editor_block_controls_drop_target_mem_fix": {
|
|
211
|
+
"type": "boolean"
|
|
209
212
|
}
|
|
210
213
|
}
|
|
211
214
|
}
|